更改底部Tab

This commit is contained in:
oujunhui
2020-04-02 19:33:08 +08:00
parent 783bb08358
commit ea1a07b314
12 changed files with 40 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ public class MainRedPointTab extends RelativeLayout {
private int mTabIcon, mTabIconSelect; private int mTabIcon, mTabIconSelect;
private MainTab mMainTab; private MainTab mMainTab;
private TextView mTvNum; private TextView mTvNum;
private String mTabText;
private RedPointDismissListener mListener; private RedPointDismissListener mListener;
@@ -42,11 +43,12 @@ public class MainRedPointTab extends RelativeLayout {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MainTab); TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MainTab);
mTabIcon = typedArray.getResourceId(R.styleable.MainTab_tab_icon, R.mipmap.ic_main_tab_game_home); mTabIcon = typedArray.getResourceId(R.styleable.MainTab_tab_icon, R.mipmap.ic_main_tab_game_home);
mTabIconSelect = typedArray.getResourceId(R.styleable.MainTab_tab_icon_select, R.mipmap.ic_main_tab_game_pressed); mTabIconSelect = typedArray.getResourceId(R.styleable.MainTab_tab_icon_select, R.mipmap.ic_main_tab_game_pressed);
mTabText = typedArray.getString(R.styleable.MainTab_tab_text);
boolean draggable = typedArray.getBoolean(R.styleable.MainTab_tab_draggable, false); boolean draggable = typedArray.getBoolean(R.styleable.MainTab_tab_draggable, false);
mMainTab = findViewById(R.id.main_tab_msg); mMainTab = findViewById(R.id.main_tab_msg);
mMainTab.setmTabIcon(mTabIcon); mMainTab.setmTabIcon(mTabIcon);
mMainTab.setmTabIconSelect(mTabIconSelect); mMainTab.setmTabIconSelect(mTabIconSelect);
mMainTab.setText(mTabText);
mTvNum = findViewById(R.id.msg_number); mTvNum = findViewById(R.id.msg_number);
if (draggable) { if (draggable) {

View File

@@ -16,9 +16,9 @@
android:textSize="10sp" android:textSize="10sp"
app:tab_icon="@mipmap/ic_main_tab_game_home" app:tab_icon="@mipmap/ic_main_tab_game_home"
app:tab_icon_select="@mipmap/ic_main_tab_game_pressed" app:tab_icon_select="@mipmap/ic_main_tab_game_pressed"
app:tab_text="" app:tab_text="首页"
app:tab_text_color_select="@color/color_1A1A1A" app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_CCCCCC" /> app:tab_text_color="@color/color_999999" />
<com.yizhuan.erban.ui.widget.MainTab <com.yizhuan.erban.ui.widget.MainTab
android:id="@+id/main_home_tab" android:id="@+id/main_home_tab"
@@ -26,24 +26,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:textSize="10sp" android:textSize="@dimen/sp_10"
android:visibility="gone" android:visibility="gone"
app:tab_icon="@mipmap/ic_main_tab_home" app:tab_icon="@mipmap/ic_main_tab_home"
app:tab_icon_select="@mipmap/ic_main_tab_home_pressed" app:tab_icon_select="@mipmap/ic_main_tab_home_pressed"
app:tab_text="" app:tab_text=""
app:tab_text_color_select="@color/color_1A1A1A" app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_CCCCCC" /> app:tab_text_color="@color/color_999999" />
<com.yizhuan.erban.ui.widget.MainRedPointTab
android:id="@+id/main_msg_tab"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
app:tab_icon="@mipmap/ic_main_tab_msg"
app:tab_icon_select="@mipmap/ic_main_tab_msg_pressed"
app:tab_draggable="true"
/>
<com.yizhuan.erban.ui.widget.MainRedPointTab <com.yizhuan.erban.ui.widget.MainRedPointTab
android:id="@+id/main_attention_tab" android:id="@+id/main_attention_tab"
@@ -51,13 +40,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:textSize="10sp" android:textSize="@dimen/sp_10"
app:tab_icon="@mipmap/ic_main_tab_find" app:tab_icon="@mipmap/ic_main_tab_find"
app:tab_icon_select="@mipmap/ic_main_tab_find_pressed" app:tab_icon_select="@mipmap/ic_main_tab_find_pressed"
app:tab_text="" app:tab_text="广场"
app:tab_text_color_select="@color/color_1A1A1A" app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_CCCCCC" app:tab_text_color="@color/color_999999"
app:tab_draggable="false"/> />
<com.yizhuan.erban.ui.widget.MainRedPointTab
android:id="@+id/main_msg_tab"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:textSize="@dimen/sp_10"
app:tab_icon="@mipmap/ic_main_tab_msg"
app:tab_icon_select="@mipmap/ic_main_tab_msg_pressed"
app:tab_text="消息"
app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_999999"
/>
<com.yizhuan.erban.ui.widget.MainTab <com.yizhuan.erban.ui.widget.MainTab
android:id="@+id/main_me_tab" android:id="@+id/main_me_tab"
@@ -65,11 +68,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:textSize="10sp" android:textSize="@dimen/sp_10"
app:tab_icon="@mipmap/ic_main_tab_me" app:tab_icon="@mipmap/ic_main_tab_me"
app:tab_icon_select="@mipmap/ic_main_tab_me_pressed" app:tab_icon_select="@mipmap/ic_main_tab_me_pressed"
app:tab_text="" app:tab_text="我的"
app:tab_text_color_select="@color/color_1A1A1A" app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_CCCCCC" /> app:tab_text_color="@color/color_999999" />
</merge> </merge>

View File

@@ -10,11 +10,13 @@
android:id="@+id/main_tab_msg" android:id="@+id/main_tab_msg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="0sp"
app:tab_text=""
android:layout_centerInParent="true" android:layout_centerInParent="true"
app:tab_text_color_select="@color/color_1A1A1A" android:textSize="10sp"
app:tab_text_color="@color/color_CCCCCC" /> app:tab_icon="@mipmap/ic_main_tab_game_home"
app:tab_icon_select="@mipmap/ic_main_tab_game_pressed"
app:tab_text="首页"
app:tab_text_color_select="@color/appColor"
app:tab_text_color="@color/color_999999" />
<com.netease.nim.uikit.common.ui.draggablebubbles.BubbleView <com.netease.nim.uikit.common.ui.draggablebubbles.BubbleView
android:id="@+id/msg_number" android:id="@+id/msg_number"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -51,7 +51,7 @@
<color name="white_transparent_12">#1EFFFFFF</color> <color name="white_transparent_12">#1EFFFFFF</color>
<color name="white_transparent_14">#23FFFFFF</color> <color name="white_transparent_14">#23FFFFFF</color>
<color name="appColor">@color/color_34EBDE</color> <color name="appColor">@color/color_7154EE</color>
<color name="color_common_text_content">#2C2C2E</color> <color name="color_common_text_content">#2C2C2E</color>
<!-- 灰色 对应以前的 666666 --> <!-- 灰色 对应以前的 666666 -->
<color name="color_common_text_gray">#626166</color> <color name="color_common_text_gray">#626166</color>
@@ -256,6 +256,7 @@
<color name="bubbleView_dark_press_background">#E6000000</color> <color name="bubbleView_dark_press_background">#E6000000</color>
<color name="color_7154EE">#7154EE</color>
<color name="color_333333">#333333</color> <color name="color_333333">#333333</color>
<color name="color_666666">#666666</color> <color name="color_666666">#666666</color>
<color name="color_ffc160">#ffc160</color> <color name="color_ffc160">#ffc160</color>