Skip to content

Commit

Permalink
更新ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
chaychan committed Mar 20, 2018
1 parent 36c59df commit 9f6fc4b
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
46 changes: 46 additions & 0 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

![](./intro_img/4.png)

### V1.1.2 update instructions(2018-03-20)

- Add attributes to modify unread font colors and background

- Add attributes to modify prompt text font colors and background

- Add attributes to modify prompt point background


### V1.1.1 update instructions(2018-02-27)

- Repair must be set up ViewPager problems, can be modified to set or not set;
Expand Down Expand Up @@ -76,9 +85,20 @@

<!--Set unread font size-->
<attr name="unreadTextSize" format="dimension"/>
<!--Set unread font color-->
<attr name="unreadTextColor" format="reference"/>
<!--Set unread font background-->
<attr name="unreadTextBg" format="reference"/>

<!--Set the message font size-->
<attr name="msgTextSize" format="dimension"/>
<!--Set the message font color-->
<attr name="msgTextColor" format="reference"/>
<!--Set the message font background-->
<attr name="msgTextBg" format="reference"/>

<!--Set the message prompt point background-->
<attr name="notifyPointBg" format="reference"/>

<!--Set the number of unread array thresholds greater than the threshold to be displayed as n + n as the set threshold-->
<attr name="unreadThreshold" format="integer"/>
Expand Down Expand Up @@ -220,6 +240,32 @@ When unread more than 99, it shows 99+;
mBottomBarLayout.hideNotify(2);//Hide the third page shows the tips of the little red dot
mBottomBarLayout.hideMsg(3);//Hide the text displayed on the fourth tab

#### Set unread font color

app:unreadTextColor="@color/unreadTextColor"

#### Set the unread background

app:unreadTextBg="@drawable/shape_unread"

Drawable is written as follows:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<solid android:color="@color/red" />
<padding android:left="4dp" android:right="4dp" android:top="1dp" android:bottom="1dp"/>
</shape>

#### Set prompt text font color, background

app:msgTextColor="@color/msgTextColor"
app:msgTextBg="@drawable/shape_msg"

#### Set prompt point background

app:notifyPointBg="@drawable/shape_notify_point"


#### **How to import**

Expand Down
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

![](./intro_img/4.png)

### V1.1.2版本更新说明(2018-03-20)

- 添加修改未读数字体颜色和背景的属性

- 添加修改提示文字字体颜色和背景的属性

- 添加修改提示点背景的属性

### V1.1.1版本更新说明(2018-02-27)

- 修复一定要设置ViewPager的问题,修改成可设置或不设置;
Expand Down Expand Up @@ -40,6 +48,7 @@
<attr name="iconNormal" format="reference"/>
<!--选中状态下的图标-->
<attr name="iconSelected" format="reference"/>

<!--底部文字-->
<attr name="itemText" format="string"/>
<!--文字大小-->
Expand All @@ -48,22 +57,40 @@
<attr name="textColorNormal" format="color"/>
<!--选中状态下的文字颜色-->
<attr name="textColorSelected" format="color"/>

<!--文字和图标的顶部距离-->
<attr name="itemMarginTop" format="dimension"/>

<!--是否开启触摸背景效果-->
<attr name="openTouchBg" format="boolean"/>
<!--设置触摸背景-->
<attr name="touchDrawable" format="reference"/>

<!--设置图标的宽度-->
<attr name="iconWidth" format="dimension"/>
<!--设置图标的高度-->
<attr name="iconHeight" format="dimension"/>

<!--设置BottomBarItem的padding-->
<attr name="itemPadding" format="dimension"/>

<!--设置未读数字体大小-->
<attr name="unreadTextSize" format="dimension"/>
<!--设置未读数字体颜色-->
<attr name="unreadTextColor" format="reference"/>
<!--设置未读数背景色-->
<attr name="unreadTextBg" format="reference"/>

<!--设置提示消息字体大小-->
<attr name="msgTextSize" format="dimension"/>
<!--设置提示消息字体颜色-->
<attr name="msgTextColor" format="reference"/>
<!--设置提示消息背景-->
<attr name="msgTextBg" format="reference"/>

<!--设置提示点背景-->
<attr name="notifyPointBg" format="reference"/>

<!--设置未读数组阈值 大于阈值的数字将显示为 n+ n为设置的阈值-->
<attr name="unreadThreshold" format="integer"/>

Expand Down Expand Up @@ -204,6 +231,33 @@
mBottomBarLayout.hideNotify(2);//隐藏第三个页签显示提示的小红点
mBottomBarLayout.hideMsg(3);//隐藏第四个页签显示的提示文字


#### 设置未读数字体颜色

app:unreadTextColor="@color/unreadTextColor"

#### 设置未读数背景

app:unreadTextBg="@drawable/shape_unread"

drawable的编写如下:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<solid android:color="@color/red" />
<padding android:left="4dp" android:right="4dp" android:top="1dp" android:bottom="1dp"/>
</shape>

#### 设置提示文字字体颜色、背景

app:msgTextColor="@color/msgTextColor"
app:msgTextBg="@drawable/shape_msg"

####设置提示点背景

app:notifyPointBg="@drawable/shape_notify_point"

#### BottomBarItem的介绍
&emsp;&emsp;BottomBarItem继承于LinearLayout,其子View有显示图标的ImageView和展示文字的TextView,分别可以通过getImageView()和getTextView()方法获取到对应的子控件。github上不少底部导航栏的控件都没能获取到对应的子控件,所以在需要对子控件进行操作的时候极不方便,有一些的思路并不是用ImageView和TextView,而是用绘制的,所以也不能获取到对应的显示图标的控件或展示文字的控件,造成无法获取到该控件,无法进行一些业务上的操作,比如类似今日头条的底部的首页,点击首页的页签,会更换成加载中的图标,执行旋转动画,BottomBarLayout可以轻松地做到这个需求。

Expand Down Expand Up @@ -288,7 +342,7 @@
打开app的module中的build.gradle,在dependencies{}中,添加依赖,如下:

dependencies {
compile 'com.github.chaychan:BottomBarLayout:1.1.1' //建议使用最新版本
compile 'com.github.chaychan:BottomBarLayout:1.1.2' //建议使用最新版本
}


Expand Down
1 change: 1 addition & 0 deletions demo/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<color name="tab_selected_color">#D33D3C</color>

<color name="unreadTextColor">#00ff00</color>
<color name="msgTextColor">#00ff00</color>
</resources>

0 comments on commit 9f6fc4b

Please sign in to comment.