hanjing 7 anni fa
parent
commit
43dd7cccc3
35 ha cambiato i file con 192 aggiunte e 142 eliminazioni
  1. 18 0
      app/src/main/AndroidManifest.xml
  2. 0 2
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  3. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActCreditCardTaskList.java
  4. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActExchangeCMCC.java
  5. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java
  6. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java
  7. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMiDong.java
  8. 56 79
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchAppOrTask.java
  9. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java
  10. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActXianWanWeb.java
  11. 1 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActXiaomiGame.java
  12. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java
  13. 3 1
      app/src/main/java/com/sheep/gamegroup/view/activity/GamemakeMoneyAct.java
  14. 5 6
      app/src/main/java/com/sheep/gamegroup/view/activity/RechargeQAct.java
  15. 1 0
      app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java
  16. 1 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment.java
  17. 1 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment2.java
  18. 4 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtEveryDayShare.java
  19. 3 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFootprint.java
  20. 4 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserNoviceGuidance.java
  21. 50 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  22. 1 2
      app/src/main/res/layout/act_credit_card_task_list.xml
  23. 1 3
      app/src/main/res/layout/act_game_agency_recharge_layout.xml
  24. 1 2
      app/src/main/res/layout/act_game_center.xml
  25. 1 3
      app/src/main/res/layout/act_game_make_money.xml
  26. 1 4
      app/src/main/res/layout/act_search_app_or_task.xml
  27. 1 2
      app/src/main/res/layout/act_search_game.xml
  28. 1 2
      app/src/main/res/layout/activity_guide_on_hook.xml
  29. 1 2
      app/src/main/res/layout/common_tab_vp.xml
  30. 1 6
      app/src/main/res/layout/fgt_foot_print.xml
  31. 1 4
      app/src/main/res/layout/net_empty_fresh_list_more.xml
  32. 1 4
      app/src/main/res/layout/net_empty_xrecycler.xml
  33. 1 2
      app/src/main/res/layout/rechargeq_layout.xml
  34. 24 2
      app/src/main/res/layout/title.xml
  35. 1 2
      app/src/main/res/layout/try_makemoney_act_layout.xml

+ 18 - 0
app/src/main/AndroidManifest.xml

@@ -228,9 +228,11 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.TryMakeMoneyact"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.GamemakeMoneyAct"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.LieMakeMoneyAct"
@@ -296,9 +298,11 @@
         </activity>
         <activity
             android:name="com.sheep.gamegroup.view.activity.AskGetMoneyAct"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActExchangeCMCC"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActDownloadMgr"
@@ -384,12 +388,14 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActCreditCardTaskList"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActCreditCardWeb"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActXianWanWeb"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.TaskDetailCreditCardAct"
@@ -435,9 +441,11 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActUserNoviceGuidance"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActXiaomiGame"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActTestExpression"
@@ -681,6 +689,7 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSearchGame"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSetting"
@@ -688,6 +697,7 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActGameCenter"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActDownloadWelfareList"
@@ -707,6 +717,7 @@
 
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActMiDong"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
 
         <service
@@ -730,6 +741,7 @@
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSearchAppOrTask"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSearchApp"
@@ -833,26 +845,32 @@
         <!-- 小绵羊3.4.5 足迹 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActFootprint"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 收徒红包 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActApprenticeRedPacket"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 兑换商城 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActExchangeMall"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 每日分享 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActEveryDayShare"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 娱乐抽奖 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActEntertainmentLuckDraw"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 金币中心 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActCoinCenter"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <!-- 小绵羊3.4.5 发布发现内容 -->
         <activity

+ 0 - 2
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -241,8 +241,6 @@ public class DataUtil {
     public <T> List<T> getCacheList(String key, Class<T> classT) {
         String cacheData = aCache.getAsString(SheepApp.getInstance().getConnectAddress().getAppUrl() + "v1/" + key);
         if (cacheData == null) {
-            return null;
-        } else if (cacheData.isEmpty()) {
             return ListUtil.emptyList();
         }
         if (BuildConfig.XXTEA_ENCRYPT) {

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActCreditCardTaskList.java

@@ -50,6 +50,7 @@ public class ActCreditCardTaskList extends AbsChooseImageActivity {
         final Activity activity = this;
         TitleBarUtils.getInstance()
                 .setTitle(this,"办卡赚钱")
+                .setShowOrHide(this, true)
                 .setTitleFinish(this)
                 .setRightImgBotton(activity, R.mipmap.question_black_img, new View.OnClickListener() {
                     @Override

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActExchangeCMCC.java

@@ -29,6 +29,7 @@ public class ActExchangeCMCC extends BaseUMActivity{
     public void initView() {
         activity = this;
         TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(this, "兑换绵羊币")
                 .setTitleFinish(activity);
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java

@@ -59,6 +59,7 @@ public class ActGameAgencyRecharge extends BaseActivity {
         TitleBarUtils.getInstance()
                 .setTitleFinish(activity)
                 .setTitle(activity, "游戏充值")
+                .setShowOrHide(this, true)
                 .setRightSecondBtn(activity, R.mipmap.search_black_img, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameCenter.java

@@ -34,6 +34,7 @@ public class ActGameCenter extends BaseActivity {
     public void initView() {
         activity = this;
         final TitleBarUtils titleBarUtils = TitleBarUtils.getInstance().setTitleFinish(activity);
+        titleBarUtils.setShowOrHide(this, true);
         titleBarUtils.addTabs(activity, act_game_center_vp, "玩转游戏", new FgtPlayGame(), "福利中心", new FgtWelfareCenter(),
                         new ViewPager.OnPageChangeListener() {
                             @Override

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActMiDong.java

@@ -59,6 +59,7 @@ public class ActMiDong extends BaseActivity {
     public void initView() {
         activity = this;
         TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(activity, "简单奖励")
                 .setTitleFinish(activity)
                 .setRightImgBotton(activity, R.mipmap.question_black_img, new View.OnClickListener() {

+ 56 - 79
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchAppOrTask.java

@@ -33,6 +33,8 @@ import com.sheep.gamegroup.view.adapter.AdpTitleInfoList;
 import com.sheep.gamegroup.view.fragment.FgtSearchAppOrTask;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+import com.umeng.socialize.utils.Log;
 
 import org.afinal.simplecache.ApiKey;
 
@@ -50,14 +52,10 @@ import io.reactivex.schedulers.Schedulers;
  * realicing@sina.com
  */
 public class ActSearchAppOrTask extends BaseContainerActivity {
-    @BindView(R.id.title_search_input)
-    AppCompatAutoCompleteTextView title_search_input;
     @BindView(R.id.search_app_list)
     RecyclerView recyclerView;
     @BindView(R.id.frame_container)
     View frame_container;
-    @BindView(R.id.title_search_commit)
-    TextView title_search_commit;
 
     @Override
     protected int getLayoutId() {
@@ -74,49 +72,39 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
 
     @Override
     public void initListener() {
+        TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
+                .setSearchBox(this, "搜索任务名称/游戏名称",
+                        (v, actionId, event) -> {
+                            if (actionId == EditorInfo.IME_ACTION_SEARCH) {
+                                toSearchApp();
+                            }
+                            return false;
+                        },
+                        (text) -> {
+                            frame_container.removeCallbacks(autoSearchRunnable);
+                            if (text.isEmpty() && !isTitleInfoListEmpty()) {//输入框内容为空且有搜索记录时显示搜索记录
+                                recyclerView.setVisibility(View.VISIBLE);
+                                frame_container.setVisibility(View.INVISIBLE);
+                            } else {
+                                frame_container.postDelayed(autoSearchRunnable, 1000L);//1秒后自动搜索
+                            }
+                        })
+                .setRightBtn(this, "搜索", 0,
+                        v -> toSearchApp())
+                .setShowOrHide(this, true);
+
         recyclerView.setHasFixedSize(true);
         recyclerView.setNestedScrollingEnabled(false);
         recyclerView.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         AdpTitleInfoList adpTitleInfoList = new AdpTitleInfoList(titleInfoListList);
         adpTitleInfoList.bindToRecyclerView(recyclerView);
-        title_search_input.setHint("搜索任务名称/游戏名称");
-        title_search_input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
-            @Override
-            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-                if (actionId == EditorInfo.IME_ACTION_SEARCH) {
-                    title_search_commit.performClick();
-                }
-                return false;
-            }
-        });
-        title_search_input.addTextChangedListener(new TextWatcher() {
-            @Override
-            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
-            }
-
-            @Override
-            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-            }
-
-            @Override
-            public void afterTextChanged(Editable editable) {
-                title_search_input.removeCallbacks(autoSearchRunnable);
-                if (editable.toString().isEmpty() && !isTitleInfoListEmpty()) {//输入框内容为空且有搜索记录时显示搜索记录
-                    recyclerView.setVisibility(View.VISIBLE);
-                    frame_container.setVisibility(View.INVISIBLE);
-                } else {
-                    title_search_input.postDelayed(autoSearchRunnable, 1000L);//1秒后自动搜索
-                }
-            }
-        });
     }
 
     private Runnable autoSearchRunnable = new Runnable() {
         @Override
         public void run() {
-            if (title_search_commit != null)
-                title_search_commit.performClick();
+            toSearchApp();
         }
     };
 
@@ -124,6 +112,7 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
     public static final int SORT_TOP_SEARCH = 1;//热门推荐 的排序
     public static final int SORT_SEARCH_RECORD = 2;//搜索历史 的排序
     List<ISearchRecord> topSearchStatisticsList = new ArrayList<>();
+
     @Override
     public void initData() {
         //尝试获取缓存数据
@@ -141,34 +130,35 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
         }
         notifyDataSetChangedTitleInfoList();
         SheepApp.getInstance().getNetComponent().getApiService().getTopSearchStatistics()
-                        .subscribeOn(Schedulers.io())
-                        .observeOn(AndroidSchedulers.mainThread())
-                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                            @Override
-                            public void onNext(BaseMessage baseMessage) {
-                                boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.top_search_statistics);
-                                if (isNewData) {
-                                    List<TopSearchStatistics> newList = baseMessage.getDatas(TopSearchStatistics.class);
-                                    topSearchStatisticsList.clear();
-                                    topSearchStatisticsList.addAll(newList);
-                                    if(ListUtil.getItem(titleInfoListList, new ListUtil.CallBack<TitleInfoList, Boolean>() {
-                                        @Override
-                                        public Boolean call(TitleInfoList titleInfoList) {
-                                            return titleInfoList.getSort() == SORT_TOP_SEARCH;
-                                        }
-                                    }) == null){
-                                        addListData("热门推荐", topSearchStatisticsList, SORT_TOP_SEARCH);
-                                    }
-                                    notifyDataSetChangedTitleInfoList();
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        boolean isNewData = DataUtil.getInstance().isNewData(ApiKey.top_search_statistics);
+                        if (isNewData) {
+                            List<TopSearchStatistics> newList = baseMessage.getDatas(TopSearchStatistics.class);
+                            topSearchStatisticsList.clear();
+                            topSearchStatisticsList.addAll(newList);
+                            if (ListUtil.getItem(titleInfoListList, new ListUtil.CallBack<TitleInfoList, Boolean>() {
+                                @Override
+                                public Boolean call(TitleInfoList titleInfoList) {
+                                    return titleInfoList.getSort() == SORT_TOP_SEARCH;
                                 }
+                            }) == null) {
+                                addListData("热门推荐", topSearchStatisticsList, SORT_TOP_SEARCH);
                             }
+                            notifyDataSetChangedTitleInfoList();
+                        }
+                    }
 
-                            @Override
-                            public void onError(BaseMessage baseMessage) {
-                            }
-                        });
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                    }
+                });
 
     }
+
     //排序与刷新
     private void notifyDataSetChangedTitleInfoList() {
         //排序
@@ -193,7 +183,7 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
                 TextView item_search_record_name = view.findViewById(R.id.item_search_record_name);
                 ImageView item_search_record_x = view.findViewById(R.id.item_search_record_x);
                 ViewUtil.setText(item_search_record_name, item.getInput());
-                if(item instanceof SearchRecord) {
+                if (item instanceof SearchRecord) {
                     //点击一条搜索历史后面的xx
                     item_search_record_x.setOnClickListener(new View.OnClickListener() {
                         @Override
@@ -214,9 +204,8 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
                 view.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
-                        title_search_input.setText(item.getInput());
-                        title_search_input.setSelection(item.getInput().length());
-                        if(item instanceof IHomePageSearch)
+                        TitleBarUtils.getInstance().setSearchText(ActSearchAppOrTask.this, item.getInput());
+                        if (item instanceof IHomePageSearch)
                             ApiUtil.postTopSearchStatisticsClickTopSearch((IHomePageSearch) item);
                     }
                 });
@@ -226,19 +215,7 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
 
     //搜索历史中没有数据且没有获取到服务器的热门搜索列表
     private boolean isTitleInfoListEmpty() {
-        return searchRecordList.isEmpty() && topSearchStatisticsList.isEmpty() ;
-    }
-
-    @OnClick({R.id.title_search_commit, R.id.title_img_back})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.title_search_commit:
-                toSearchApp();
-                break;
-            case R.id.title_img_back:
-                finish();
-                break;
-        }
+        return searchRecordList.isEmpty() && topSearchStatisticsList.isEmpty();
     }
 
     List<ISearchRecord> searchRecordList = new ArrayList<>();
@@ -247,10 +224,10 @@ public class ActSearchAppOrTask extends BaseContainerActivity {
     private void toSearchApp() {
         recyclerView.setVisibility(View.INVISIBLE);
         frame_container.setVisibility(View.VISIBLE);
-        String inputText = title_search_input.getText().toString();
+        String inputText = TitleBarUtils.getInstance().getSearchText(this);
         if (!TextUtils.isEmpty(inputText)) {
             //保存搜索到数据库
-            SearchRecord searchRecord  = new SearchRecord();
+            SearchRecord searchRecord = new SearchRecord();
             searchRecord.setInput(inputText);
             searchRecord.setLast_time(System.currentTimeMillis());
             searchRecord.setCount(1);

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -90,6 +90,7 @@ public class ActSearchGame extends BaseActivity {
         EventBus.getDefault().register(this);
         activity = this;
         TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(this, "搜索游戏")
                 .setTitleFinish(this);
         empty_view.setVisibility(View.GONE);

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActXianWanWeb.java

@@ -57,6 +57,7 @@ public class ActXianWanWeb extends BaseActivity {
         xianWanEntity = (XianWanEntity) getIntent().getSerializableExtra("xianwan_enty");
         TitleBarUtils
                 .getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(this, "闲玩")
                 .setTitleFinish(this, new View.OnClickListener() {
                     @Override

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActXiaomiGame.java

@@ -44,8 +44,6 @@ import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX
 
 public class ActXiaomiGame extends BaseActivity {
 
-    @BindView(R.id.title)
-    View title;
     @BindView(R.id.refresh)
     SwipeRefreshLayout refresh;
     @BindView(R.id.empty_view)
@@ -72,6 +70,7 @@ public class ActXiaomiGame extends BaseActivity {
         EventBus.getDefault().register(this);
         TitleBarUtils.getInstance()
                 .setTitleFinish(activity)
+                .setShowOrHide(this, true)
                 .setTitle(activity, "小米游戏中心")
                 .setRightImgBotton(activity,
                         R.mipmap.search_black_img,

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -28,6 +28,7 @@ public class AskGetMoneyAct extends BaseUMActivity{
     public void initView() {
         activity = this;
         TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(this, "邀请赚钱")
                 .setTitleFinish(activity);
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/GamemakeMoneyAct.java

@@ -67,7 +67,9 @@ public class GamemakeMoneyAct extends BaseActivity {
                 .getIntExtra("current_item", 0);
         TitleBarUtils
                 .getInstance()
-                .setTitle(activity, title).setTitleFinish(activity)
+                .setShowOrHide(this, true)
+                .setTitle(activity, title)
+                .setTitleFinish(activity)
                 .setRightSecondBtn(activity, R.mipmap.question_black_img, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {

+ 5 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/RechargeQAct.java

@@ -49,7 +49,6 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ_PAY;
 
 public class RechargeQAct extends BaseActivity implements RechargeQContract.View {
 
-    Activity activity;
     @Inject
     RechargeQPresenter presenter;
     @BindView(R.id.tv_zk)
@@ -82,18 +81,18 @@ public class RechargeQAct extends BaseActivity implements RechargeQContract.View
 
     @Override
     public void initView() {
-        activity = this;
         TitleBarUtils
                 .getInstance()
-                .setTitle(activity, "Q币充值")
-                .setTitleFinish(activity);
+                .setShowOrHide(this, true)
+                .setTitle(this, "Q币充值")
+                .setTitleFinish(this);
         DaggerRechargeQComponent.builder()
                 .netComponent(SheepApp.getInstance().getNetComponent())
                 .rechargeQModule(new RechargeQModule(this))
                 .build()
                 .inject(this);
         initRechargeDatas();
-        adapter = new RechargeQAdapter(activity, wlLists);
+        adapter = new RechargeQAdapter(this, wlLists);
         rechargeqGreidview.setVerticalSpacing(20);
         rechargeqGreidview.setAdapter(adapter);
         adapter.notifyDataSetChanged();
@@ -188,7 +187,7 @@ public class RechargeQAct extends BaseActivity implements RechargeQContract.View
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.tv_myb_recharge:
-                Jump2View.getInstance().goRechargeAct(activity, "充值Q币");
+                Jump2View.getInstance().goRechargeAct(this, "充值Q币");
                 break;
             case R.id.rechargeq_sure:
                 RECHARGE_QQ_PAY.onEvent();

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java

@@ -59,6 +59,7 @@ public class TryMakeMoneyact extends BaseActivity {
         TitleBarUtils
                 .getInstance()
                 .setTitle(activity, title).setTitleFinish(activity)
+                .setShowOrHide(this, true)
                 .setRightSecondBtn(activity, R.mipmap.question_black_img, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {

+ 1 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment.java

@@ -58,8 +58,6 @@ public abstract class BaseListFragment<T> extends BaseFragment implements IRefre
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_RESUME = 1;
     public static final int REFRESH_ON_YOURSELF = -1;
-    @BindView(R.id.title)
-    protected View title;
     @BindView(R.id.empty_view)
     protected View empty_view;
     @BindView(R.id.check_net_ll)
@@ -73,7 +71,7 @@ public abstract class BaseListFragment<T> extends BaseFragment implements IRefre
     private boolean loadMore;
 
     public void initView() {
-        title.setVisibility(View.GONE);
+
     }
 
     protected View bottomLine;

+ 1 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment2.java

@@ -64,8 +64,6 @@ public abstract class BaseListFragment2<T> extends BaseFragment implements IRefr
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_RESUME = 1;
     public static final int REFRESH_ON_YOURSELF = -1;
-    @BindView(R.id.title)
-    protected View title;
     @BindView(R.id.empty_view)
     protected View empty_view;
     @BindView(R.id.check_net_ll)
@@ -79,7 +77,7 @@ public abstract class BaseListFragment2<T> extends BaseFragment implements IRefr
     private boolean loadMore;
 
     public void initView() {
-        title.setVisibility(View.GONE);
+
     }
 
     protected View bottomLine;

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtEveryDayShare.java

@@ -24,8 +24,10 @@ public class FgtEveryDayShare extends BaseListFragment2<EveryDayShare>{
 
     @Override
     public void initView() {
-        TitleBarUtils.getInstance().setTitle(title, "每日分享")
-                .setTitleFinish(title, activity);
+        TitleBarUtils.getInstance()
+                .setShowOrHide(getActivity(), true)
+                .setTitle(getActivity(), "每日分享")
+                .setTitleFinish(getActivity());
         view_list.setLoadingMoreEnabled(false);
     }
 

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFootprint.java

@@ -79,8 +79,9 @@ public class FgtFootprint extends BaseListFragment4<UserFootprint> {
         CustomWeekView.class.getSimpleName();
         TitleBarUtils
                 .getInstance()
-                .setTitleFinish(getView(), activity)
-                .setTitle(getView(), "足迹")
+                .setShowOrHide(getActivity(), true)
+                .setTitleFinish(activity)
+                .setTitle(activity, "足迹")
                 .setRightImgBotton(activity, R.mipmap.share, new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserNoviceGuidance.java

@@ -21,8 +21,10 @@ import io.reactivex.Observable;
 public class FgtUserNoviceGuidance extends BaseListFragment2<NoviceGuidance> {
     @Override
     public void initView() {
-        TitleBarUtils.getInstance().setTitle(title, "新手引导")
-                .setTitleFinish(title, activity);
+        TitleBarUtils.getInstance()
+                .setShowOrHide(getActivity(), true)
+                .setTitle(getActivity(), "新手引导")
+                .setTitleFinish(getActivity());
         view_list.setLoadingMoreEnabled(false);
     }
 

+ 50 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -10,6 +10,9 @@ import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
 import android.support.v7.app.ActionBar;
 import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatAutoCompleteTextView;
+import android.text.Editable;
+import android.text.TextWatcher;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageButton;
@@ -218,6 +221,49 @@ public class TitleBarUtils {
         return mTitleBarUtils;
     }
 
+    public TitleBarUtils setSearchBox(Activity activity, String hint
+            , TextView.OnEditorActionListener editorActionListener
+            , TextChangedListener textChangedListener) {
+        AppCompatAutoCompleteTextView box = activity.getWindow().getDecorView().findViewById(R.id.box_baseactivity_search);
+        box.setHint(hint);
+        box.setVisibility(View.VISIBLE);
+        activity.getWindow().getDecorView().findViewById(R.id.txt_baseactivity_title).setVisibility(View.GONE);
+        box.setOnEditorActionListener(editorActionListener);
+        box.addTextChangedListener(new TextWatcher() {
+
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                textChangedListener.onTextChanged(s.toString());
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
+        return this;
+    }
+
+    public void setSearchText(Activity activity, String text) {
+        AppCompatAutoCompleteTextView box = activity.getWindow().getDecorView().findViewById(R.id.box_baseactivity_search);
+        if (box != null) {
+            box.setText(text);
+            box.setSelection(text.length());
+        }
+    }
+
+    public String getSearchText(Activity activity) {
+        AppCompatAutoCompleteTextView box = activity.getWindow().getDecorView().findViewById(R.id.box_baseactivity_search);
+        if (box != null) {
+            return box.getText().toString();
+        }
+        return "";
+    }
 
     /**
      * 设置最右边的普通按钮状态
@@ -594,4 +640,8 @@ public class TitleBarUtils {
         }
         return this;
     }
+
+    public interface TextChangedListener {
+        void onTextChanged(String text);
+    }
 }

+ 1 - 2
app/src/main/res/layout/act_credit_card_task_list.xml

@@ -3,11 +3,10 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:fitsSystemWindows="true"
     android:orientation="vertical"
     android:background="@color/white_light">
 
-    <include layout="@layout/title"/>
-
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"
         android:layout_width="match_parent"

+ 1 - 3
app/src/main/res/layout/act_game_agency_recharge_layout.xml

@@ -4,11 +4,9 @@
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical"
+    android:fitsSystemWindows="true"
     android:background="@color/gray_F5F5F5">
 
-    <include
-        layout="@layout/title"/>
-
     <HorizontalScrollView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"

+ 1 - 2
app/src/main/res/layout/act_game_center.xml

@@ -4,10 +4,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
+    android:fitsSystemWindows="true"
     tools:context="com.sheep.gamegroup.view.activity.ActGameCenter">
 
-    <include layout="@layout/title" />
-
     <android.support.v4.view.ViewPager
         android:id="@+id/act_game_center_vp"
         android:layout_width="match_parent"

+ 1 - 3
app/src/main/res/layout/act_game_make_money.xml

@@ -3,11 +3,9 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
+    android:fitsSystemWindows="true"
     android:background="@color/white">
 
-    <include
-        layout="@layout/title"/>
-
     <LinearLayout
         android:id="@+id/show_flow_layout"
         android:layout_width="match_parent"

+ 1 - 4
app/src/main/res/layout/act_search_app_or_task.xml

@@ -3,12 +3,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/white"
+    android:fitsSystemWindows="true"
     android:orientation="vertical">
 
-    <include
-        android:id="@+id/include_title"
-        layout="@layout/title_search" />
-
     <android.support.v7.widget.RecyclerView
         android:id="@+id/search_app_list"
         android:layout_width="match_parent"

+ 1 - 2
app/src/main/res/layout/act_search_game.xml

@@ -4,10 +4,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/bg_gray"
+    android:fitsSystemWindows="true"
     android:orientation="vertical">
 
-    <include layout="@layout/title" />
-
     <android.support.v4.widget.NestedScrollView
         android:layout_width="match_parent"
         android:layout_height="wrap_content">

+ 1 - 2
app/src/main/res/layout/activity_guide_on_hook.xml

@@ -3,10 +3,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
+    android:fitsSystemWindows="true"
     android:background="@color/white_F9F9F9">
 
-    <include
-        layout="@layout/title"/>
     <com.tencent.smtt.sdk.WebView
         android:id="@+id/webview"
         android:layout_width="match_parent"

+ 1 - 2
app/src/main/res/layout/common_tab_vp.xml

@@ -3,10 +3,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/white"
+    android:fitsSystemWindows="true"
     android:orientation="vertical">
 
-    <include layout="@layout/title" />
-
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"
         style="@style/style_tab"

+ 1 - 6
app/src/main/res/layout/fgt_foot_print.xml

@@ -3,14 +3,9 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
     android:background="@color/white">
 
-    <include
-        android:id="@+id/title"
-        layout="@layout/title"
-        android:layout_width="match_parent"
-        android:layout_height="?attr/actionBarSize" />
-
     <TextView
         android:id="@+id/header_foot_print_date_tv"
         android:layout_width="wrap_content"

+ 1 - 4
app/src/main/res/layout/net_empty_fresh_list_more.xml

@@ -2,13 +2,10 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
     android:background="@color/white">
 
     <include
-        android:id="@+id/title"
-        layout="@layout/title"/>
-
-    <include
         android:id="@+id/check_net_ll"
         layout="@layout/check_net_view"
         android:layout_width="match_parent"

+ 1 - 4
app/src/main/res/layout/net_empty_xrecycler.xml

@@ -2,13 +2,10 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
     android:background="@color/white">
 
     <include
-        android:id="@+id/title"
-        layout="@layout/title" />
-
-    <include
         android:id="@+id/check_net_ll"
         layout="@layout/check_net_view"
         android:layout_width="match_parent"

+ 1 - 2
app/src/main/res/layout/rechargeq_layout.xml

@@ -3,10 +3,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/bg_gray"
+    android:fitsSystemWindows="true"
     android:orientation="vertical">
 
-    <include layout="@layout/title" />
-
     <ScrollView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"

+ 24 - 2
app/src/main/res/layout/title.xml

@@ -39,13 +39,35 @@
         android:textColor="@color/black_text_deep"
         android:textSize="18sp" />
 
+    <android.support.v7.widget.AppCompatAutoCompleteTextView
+        android:id="@+id/box_baseactivity_search"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:layout_centerVertical="true"
+        android:layout_toEndOf="@+id/img_baseactivity_title"
+        android:layout_marginRight="@dimen/view_size_60"
+        android:background="@drawable/shape_f5_solid_rectangle_15"
+        android:drawablePadding="4dp"
+        android:drawableStart="@drawable/index_search"
+        android:gravity="center|start"
+        android:visibility="gone"
+        android:imeOptions="actionSearch"
+        android:maxLength="40"
+        android:singleLine="true"
+        android:paddingEnd="6dp"
+        android:paddingStart="6dp"
+        android:textColorHint="@color/G"
+        android:textColor="@color/black_6_3"
+        android:textSize="14sp" />
+
     <!--右边按钮-->
 
     <RelativeLayout
+        android:id="@+id/right_btn_container"
         android:layout_width="wrap_content"
         android:layout_height="@dimen/app_nav_toolbar_height"
-        android:layout_alignParentEnd="true"
-        android:layout_centerInParent="true"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
         android:visibility="visible">
 
         <Button

+ 1 - 2
app/src/main/res/layout/try_makemoney_act_layout.xml

@@ -3,11 +3,10 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:fitsSystemWindows="true"
     android:background="@color/white"
     android:orientation="vertical">
 
-    <include layout="@layout/title" />
-
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent">