Commit a4387131 authored by fallenstardust's avatar fallenstardust

只使用textbadge

parent 66cb179c
...@@ -98,14 +98,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat ...@@ -98,14 +98,6 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
private void initBottomNavigationBar() { private void initBottomNavigationBar() {
frameLayout = (FrameLayout) findViewById(R.id.fragment_content); frameLayout = (FrameLayout) findViewById(R.id.fragment_content);
mTextBadgeItem = new TextBadgeItem()
.setBorderWidth(4)//文本大小
.setGravity(Gravity.LEFT )//位置 默认右上
.setBackgroundColorResource(R.color.holo_orange_bright)//背景颜色
.setAnimationDuration(200)//动画时间
.setText("3")
.setHideOnSelect(false)//true当选中状态时消失,非选中状态再次显示
.show();
// 获取页面上的底部导航栏控件 // 获取页面上的底部导航栏控件
bottomNavigationBar = (BottomNavigationBar) findViewById(R.id.bottom_navigation_bar); bottomNavigationBar = (BottomNavigationBar) findViewById(R.id.bottom_navigation_bar);
bottomNavigationBar bottomNavigationBar
...@@ -134,6 +126,17 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat ...@@ -134,6 +126,17 @@ public abstract class HomeActivity extends BaseActivity implements BottomNavigat
getSupportActionBar().hide(); getSupportActionBar().hide();
} }
private void showNewsCounts() {
mTextBadgeItem = new TextBadgeItem()
.setBorderWidth(4)//文本大小
.setGravity(Gravity.LEFT )//位置 默认右上
.setBackgroundColorResource(R.color.holo_orange_bright)//背景颜色
.setAnimationDuration(200)//动画时间
.setText("3")
.setHideOnSelect(false)//true当选中状态时消失,非选中状态再次显示
.show();
}
@Override @Override
public void onTabSelected(int position) { public void onTabSelected(int position) {
switch (position) { switch (position) {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_logout" android:id="@+id/img_logout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="match_parent"
android:src="@drawable/ic_guide_right" /> android:src="@drawable/ic_guide_right" />
</LinearLayout> </LinearLayout>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<style name="AppTheme" parent="AppBaseTheme"> <style name="AppTheme" parent="AppBaseTheme">
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorNavy</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowActionBar">false</item> <item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment