安卓5.1.1点击最近任务的时候隐藏搜索栏

@@ -253,11 +253,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
                        //ActionsCode(author:fanguoyong,add clear all task button)
                        findViewById(R.id.clear_recents).setVisibility(View.VISIBLE);
                        
-            if (mRecentsView.hasSearchBar()) {
-                mRecentsView.setSearchBarVisibility(View.VISIBLE);
-            } else {
-                addSearchBarAppWidgetView();
-            }
+//            if (mRecentsView.hasSearchBar()) {
+//                mRecentsView.setSearchBarVisibility(View.VISIBLE);
+//            } else {
+//                addSearchBarAppWidgetView();
+//            }
         }
 
         // Animate the SystemUI scrims into view
@@ -394,7 +394,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
         inflateDebugOverlay();
 
         // Bind the search app widget when we first start up
-        bindSearchBarAppWidget();
+//        bindSearchBarAppWidget();
 
         // Register the broadcast receiver to handle messages when the screen is turned off
         IntentFilter filter = new IntentFilter();
@@ -633,8 +633,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
 
     @Override
     public void refreshSearchWidget() {
-        bindSearchBarAppWidget();
-        addSearchBarAppWidgetView();
+        //bindSearchBarAppWidget();
+        //addSearchBarAppWidgetView();
     }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一个仿安卓5.0任务管理器最近打开任务卡片效果的自定义布局。项目地址:https://github.com/ZieIony/MaterialRecents 效果图:如何使用:创建实例2. 设置adapterRecentsList recents = (RecentsList) this.findViewById(R.id.recents); recents.setAdapter(new RecentsAdapter() {             @Override             public String getTitle(int position) {//标题名称                 return "Item "   position;             }             @Override             public View getView(int position) {//内容                 ImageView iv = new ImageView(RecentsActivity.this);                 iv.setImageResource(R.drawable.mazda);                 iv.setBackgroundColor(0xffffffff);                 return iv;             }             @Override             public Drawable getIcon(int position) {//图标                 return getResources().getDrawable(R.drawable.ic_launcher);             }             @Override             public int getHeaderColor(int position) {//header颜色                 return colors[random.nextInt(colors.length)];             }             @Override             public int getCount() {//卡片个数                 return 10;             }         });另外,实例中用到了support v7中的cardview。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值