Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ChayChan
BottomBarLayout
提交
883ed4d9
B
BottomBarLayout
项目概览
ChayChan
/
BottomBarLayout
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
12
列表
看板
标记
里程碑
合并请求
1
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
BottomBarLayout
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
12
Issue
12
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
883ed4d9
编写于
1月 21, 2019
作者:
C
ccw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新README
上级
b771cd1e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
10 deletion
+15
-10
README.md
README.md
+15
-10
未找到文件。
README.md
浏览文件 @
883ed4d9
...
...
@@ -341,13 +341,18 @@ drawable的编写如下:
mBottomBarLayout.setOnItemSelectedListener(new BottomBarLayout.OnItemSelectedListener() {
@Override
public void onItemSelected(final BottomBarItem bottomBarItem, int position) {
if (position == 0){
public void onItemSelected(final BottomBarItem bottomBarItem, int previousPosition, final int currentPosition) {
Log.i("MainActivity", "position: " + currentPosition);
if (currentPosition == 0) {
//如果是第一个,即首页
if (
mBottomBarLayout.getCurrentItem() == position)
{
if (
previousPosition == currentPosition)
{
//如果是在原来位置上点击,更换首页图标并播放旋转动画
bottomBarItem.setIconSelectedResourceId(R.mipmap.tab_loading);//更换成加载图标
bottomBarItem.setStatus(true);
if (mRotateAnimation != null && !mRotateAnimation.hasEnded()){
//如果当前动画正在执行
return;
}
bottomBarItem.setSelectedIcon(R.mipmap.tab_loading);//更换成加载图标
//播放旋转动画
if (mRotateAnimation == null) {
...
...
@@ -365,18 +370,18 @@ drawable的编写如下:
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
bo
ttomBarItem.setIconSelectedResourceId(R.mipmap.tab_home_selected);//更换成首页原来图标
bottomBarItem.setS
tatus(true);//刷新
图标
bo
olean tabNotChanged = mBottomBarLayout.getCurrentItem() == currentPosition; //是否还停留在当前页签
bottomBarItem.setS
electedIcon(R.mipmap.tab_home_selected);//更换成首页原来选中
图标
cancelTabLoading(bottomBarItem);
}
},3000);
},
3000);
return;
}
}
//如果点击了其他条目
BottomBarItem bottomItem = mBottomBarLayout.getBottomItem(0);
bottomItem.set
IconSelectedResourceId
(R.mipmap.tab_home_selected);//更换为原来的图标
bottomItem.set
SelectedIcon
(R.mipmap.tab_home_selected);//更换为原来的图标
cancelTabLoading(bottomItem);//停止旋转动画
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录