add navigation bar tab labels - with option to hide them
This commit is contained in:
@@ -12,111 +12,183 @@
|
||||
<org.joinmastodon.android.ui.views.TabBar
|
||||
android:id="@+id/tabbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingHorizontal="8dp">
|
||||
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_home"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/home_timeline">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_home_24_selector"/>
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/home_timeline">
|
||||
|
||||
</FrameLayout>
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_home_24_selector"/>
|
||||
|
||||
<FrameLayout
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_home_label"
|
||||
style="@style/m3_label_medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="@color/m3_on_surface_selector"
|
||||
android:text="@string/sk_tab_home" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_search"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/search_hint">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_search_24_selector"/>
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/search_hint">
|
||||
|
||||
</FrameLayout>
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_search_24_selector"/>
|
||||
|
||||
<RelativeLayout
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_search_label"
|
||||
style="@style/m3_label_medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/m3_on_surface_selector"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/sk_tab_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_notifications"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/notifications">
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/notifications">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notifications_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_alert_24_selector"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notifications_badge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_alignTop="@id/notifications_icon"
|
||||
android:layout_toEndOf="@id/notifications_icon"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:background="@drawable/bg_tabbar_badge"
|
||||
android:textColor="?colorM3OnPrimary"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textAppearance="@style/m3_label_small"
|
||||
android:minWidth="16dp"
|
||||
tools:text="222"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/notifications_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="center"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_alert_24_selector"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notifications_badge"
|
||||
android:id="@+id/tab_notifications_label"
|
||||
style="@style/m3_label_medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_alignTop="@id/notifications_icon"
|
||||
android:layout_toEndOf="@id/notifications_icon"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:background="@drawable/bg_tabbar_badge"
|
||||
android:textColor="?colorM3OnPrimary"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textAppearance="@style/m3_label_small"
|
||||
android:minWidth="16dp"
|
||||
tools:text="222"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="@color/m3_on_surface_selector"
|
||||
android:text="@string/sk_tab_notifications" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/tab_profile"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/my_profile">
|
||||
<ImageView
|
||||
android:id="@+id/tab_profile_ava"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@null"/>
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="22dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_chevron_up_down_16_regular"/>
|
||||
</FrameLayout>
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_tabbar_tab"
|
||||
android:contentDescription="@string/my_profile">
|
||||
<ImageView
|
||||
android:id="@+id/tab_profile_ava"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@null"/>
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="22dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/tab_bar_icon"
|
||||
android:src="@drawable/ic_fluent_chevron_up_down_16_regular"/>
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_profile_label"
|
||||
style="@style/m3_label_medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="@color/m3_on_surface_selector"
|
||||
android:text="@string/sk_tab_profile" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</org.joinmastodon.android.ui.views.TabBar>
|
||||
|
||||
</FrameLayout>
|
||||
Reference in New Issue
Block a user