Dola TENG 1 rok pred
rodič
commit
11fa5d3d0b

+ 1 - 0
app/src/main/java/com/sambath/sbc/app/MainActivity.kt

@@ -3,6 +3,7 @@ package com.sambath.sbc.app
 import androidx.appcompat.app.AppCompatActivity
 import android.os.Bundle
 import android.widget.TextView
+import androidx.core.content.ContextCompat
 import androidx.navigation.findNavController
 import androidx.navigation.ui.AppBarConfiguration
 import androidx.navigation.ui.setupWithNavController

+ 5 - 0
app/src/main/res/drawable/selector_bottom_nav_item.xml

@@ -0,0 +1,5 @@
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_checked="true" android:color="@color/color_blue_600" />
+    <item android:state_pressed="true" android:state_enabled="true" android:color="@color/color_blue_600" />
+    <item android:color="@color/color_white" />
+</selector>

+ 2 - 0
app/src/main/res/layout/activity_main2.xml

@@ -18,6 +18,8 @@
         android:layout_marginStart="0dp"
         android:layout_marginEnd="0dp"
         android:background="@color/color_black"
+        app:itemIconTint="@drawable/selector_bottom_nav_item"
+        app:itemTextColor="@drawable/selector_bottom_nav_item"
         app:labelVisibilityMode="labeled"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"

+ 0 - 1
app/src/main/res/menu/bottom_nav_menu.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
-
     <item
         android:id="@+id/navigation_home"
         android:icon="@drawable/ic_help"

+ 0 - 20
app/src/main/res/values/styles.xml

@@ -11,27 +11,7 @@
     <style name="AppBarOverlay" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar" />
 
     <style name="PopupOverlay" parent="ThemeOverlay.MaterialComponents.Dark" />
-    <!--    <style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">-->
-    <!--        &lt;!&ndash; Primary brand color. &ndash;&gt;-->
-    <!--        <item name="colorPrimary">@color/purple_500</item>-->
-    <!--        <item name="colorPrimaryVariant">@color/purple_700</item>-->
-    <!--        <item name="colorOnPrimary">@color/white</item>-->
-    <!--        &lt;!&ndash; Secondary brand color. &ndash;&gt;-->
-    <!--        <item name="colorSecondary">@color/teal_200</item>-->
-    <!--        <item name="colorSecondaryVariant">@color/teal_700</item>-->
-    <!--        <item name="colorOnSecondary">@color/black</item>-->
-    <!--        &lt;!&ndash; Status bar color. &ndash;&gt;-->
-    <!--        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>-->
-    <!--        &lt;!&ndash; Customize your theme here. &ndash;&gt;-->
-    <!--    </style>-->
-    <!--    <style name="Theme.MyApplication.NoActionBar">-->
-    <!--        <item name="windowActionBar">false</item>-->
-    <!--        <item name="windowNoTitle">true</item>-->
-    <!--    </style>-->
 
-    <!--    <style name="Theme.MyApplication.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />-->
-
-    <!--    <style name="Theme.MyApplication.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />-->
     <style name="GDTTextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
         <item name="boxStrokeColor">@color/color_highlight</item>
         <item name="endIconTint">@color/color_white</item>