【开源】fab-toolbar
fab-toolbar
- https://github.com/AlexKolpa/fab-toolbar
介绍:
像Material设计指南中所描述那样,一个悬浮操作按钮的Toolbar库。运行效果:
![]()
使用说明:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<com.github.alexkolpa.fabtoolbar.FabToolbar android:id="@+id/fab_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" tb:tb_animation_duration="500" tb:tb_button_gravity="end" tb:tb_container_gravity="center" > <ImageView android:id="@+id/attach" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_attachment_white_48dp" android:layout_marginLeft="@dimen/icon_margin" android:layout_marginRight="@dimen/icon_margin" /> <!-- More buttons can be added here --></com.github.alexkolpa.fabtoolbar.FabToolbar> |
调用hide()和show()方法显示和隐藏Toolbar
|
1
2
3
4
5
6
7
|
FabToolbar fabToolbar = ((FabToolbar) findViewById(R.id.fab_toolbar));findViewById(R.id.attach).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { fabToolbar.hide(); }}); |
依赖
Gradle:
|
1
2
3
|
dependencies { compile 'com.github.alexkolpa:floating-action-button-toolbar:0.5.1'} |
Maven:
|
1
2
3
4
5
|
<dependency> <groupId>com.github.alexkolpa</groupId> <artifactId>floating-action-button-toolbar</artifactId> <version>0.5.1</version></dependency> |
posted on 2015-05-08 12:13 wasdchenhao 阅读(170) 评论(0) 收藏 举报

浙公网安备 33010602011771号