MaterialRecents
- 类别: 视图布局 (View Layout)
- 打分: ★★★★★
- 更新: 2015-09-15 09:16
- 大小: 2100 kb
- 开发环境: Android Studio
- 浏览: 1089 次
- 下载: 189 次
- 项目地址: https://github.com/ZieIony/MaterialRecents
Lollipop's Recents container
介绍:
一个仿安卓5.0任务管理器最近打开任务卡片效果的自定义布局。
运行效果:
使用说明:
导入
1
2
3
4
5
6
7
8
9
|
repositories {
maven {
}
}
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;
}
|