底部导航管理
底部导航分类
功能描述:
①管理对象的创建
②初始化各个导航容器及相关控件设置监听
③控制各个导航容器的显示和隐藏
④控制玩法导航内容显示
功能实现:
在MainActivity中调用BottomNavigatorManager创建实例,并进行初始化。
|
1、布局文件:
<?xml version="1.0" encoding="utf-8"?>
<!-- 底部导航 -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rl_main_buttom_navigator"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<!-- 1、通用导航 -->
<LinearLayout
android:id="@+id/ll_common_buttom_navigator_zl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible" >
<ImageButton
android:id="@+id/ib_bottom_home_zl"
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@drawable/id_buttom_bg"
android:clickable="true"
android:focusable="true"
android:src="@drawable/id_lottery_home"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/ib_bottom_lottery_hall_zl"
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@drawable/id_buttom_bg"
android:clickable="true"
android:focusable="true"
android:src="@drawable/id_lottery_hall"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/ib_bottom_recharge_zl"
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@drawable/id_buttom_bg"
android:clickable="true"
android:focusable="true"
android:src="@drawable/id_lottery_recharge"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/ib_bottom_lottery_myself_zl"
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@drawable/id_buttom_bg"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:src="@drawable/id_lottery_myself"
tools:ignore="ContentDescription" />
</LinearLayout>
<!-- 购彩 -->
<LinearLayout
android:id="@+id/ll_game_bottom_zl"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/id_buttom_menu_bg"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="invisible" >
<ImageButton
android:id="@+id/ib_game_choose_clean_zl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:background="@drawable/id_clear_choose"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_game_choose_notice_zl"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:gravity="center_vertical|center_horizontal"
android:text="@string/is_ssq_default_notice"
android:textColor="@android:color/white"
android:textSize="15sp" />
<ImageButton
android:id="@+id/ib_game_choose_ok_zl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dip"
android:background="@drawable/id_choose_ok"
tools:ignore="ContentDescription" />
</LinearLayout>
</RelativeLayout>
|
2、管理类工具BottomNavigatorManager.java
|