MaterialRecents一个仿安卓5.0任务管理器最近打开任务卡片效果的自定义布局

MaterialRecents

 

Lollipop's Recents container

介绍:

一个仿安卓5.0任务管理器最近打开任务卡片效果的自定义布局。

运行效果:

使用说明:

导入

1
2
3
4
5
6
7
8
9
repositories {
     maven {
         url  "https://jitpack.io"
     }
}
 
dependencies {
         compile  'com.github.ZieIony:MaterialRecents:d2aec46f48'
}

使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
     RecentsList recents = (RecentsList) 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.mipmap.ic_launcher);
     }
 
     @Override
     public int getHeaderColor(int position) {
         return  colors[random.nextInt(colors.length)];
     }
 
     @Override
     public int getCount() {
         return  10;
     }

 

猜你喜欢

转载自lishuaishuai.iteye.com/blog/2297036
今日推荐