mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Migrate to bottom navigation
This commit is contained in:
		
							
								
								
									
										8
									
								
								app/src/main/res/drawable/bottom_nav_item_selector.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								app/src/main/res/drawable/bottom_nav_item_selector.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="?attr/tabBarIconColor" android:state_checked="true" /> | ||||
|     <item android:color="?attr/tabBarIconColor" android:state_enabled="true" android:state_pressed="true" /> | ||||
|     <item android:color="?attr/tabBarIconColor" android:state_focused="true" /> | ||||
|     <item android:color="?attr/tabBarIconInactive" android:state_focused="false" /> | ||||
|     <item android:color="?attr/tabBarIconColor" /> | ||||
| </selector> | ||||
| @@ -0,0 +1,9 @@ | ||||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:width="24dp" | ||||
|     android:height="24dp" | ||||
|     android:viewportWidth="24.0" | ||||
|     android:viewportHeight="24.0"> | ||||
|     <path | ||||
|         android:fillColor="#FF000000" | ||||
|         android:pathData="M9.01,14L2,14v2h7.01v3L13,15l-3.99,-4v3zM14.99,13v-3L22,10L22,8h-7.01L14.99,5L11,9l3.99,4z" /> | ||||
| </vector> | ||||
| @@ -4,6 +4,6 @@ | ||||
|     android:viewportWidth="24.0" | ||||
|     android:viewportHeight="24.0"> | ||||
|     <path | ||||
|         android:fillColor="#FFFFFFFF" | ||||
|         android:fillColor="#FF000000" | ||||
|         android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,19h-2v-2h2v2zM15.07,11.25l-0.9,0.92C13.45,12.9 13,13.5 13,15h-2v-0.5c0,-1.1 0.45,-2.1 1.17,-2.83l1.24,-1.26c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2L8,9c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,0.88 -0.36,1.68 -0.93,2.25z" /> | ||||
| </vector> | ||||
| @@ -7,7 +7,6 @@ | ||||
|     android:fitsSystemWindows="true"> | ||||
|  | ||||
|     <LinearLayout | ||||
|         android:id="@+id/main_content" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:orientation="vertical"> | ||||
| @@ -40,18 +39,19 @@ | ||||
|         <com.bluelinelabs.conductor.ChangeHandlerFrameLayout | ||||
|             android:id="@+id/controller_container" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" /> | ||||
|             android:layout_height="0dp" | ||||
|             android:layout_weight="1" /> | ||||
|  | ||||
|         <com.google.android.material.bottomnavigation.BottomNavigationView | ||||
|             android:id="@+id/bottom_nav" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_gravity="bottom" | ||||
|             android:background="?attr/colorPrimary" | ||||
|             app:itemIconTint="@drawable/bottom_nav_item_selector" | ||||
|             app:itemTextColor="@drawable/bottom_nav_item_selector" | ||||
|             app:menu="@menu/bottom_nav" /> | ||||
|  | ||||
|     </LinearLayout> | ||||
|  | ||||
|     <com.google.android.material.navigation.NavigationView | ||||
|         android:id="@+id/nav_view" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="match_parent" | ||||
|         android:layout_gravity="start" | ||||
|         android:fitsSystemWindows="true" | ||||
|         android:theme="?attr/navigation_view_theme" | ||||
|         app:headerLayout="@layout/navigation_header" | ||||
|         app:menu="@menu/menu_navigation" /> | ||||
|  | ||||
| </androidx.drawerlayout.widget.DrawerLayout> | ||||
|   | ||||
| @@ -1,21 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="@dimen/navigation_drawer_header_height" | ||||
|     android:gravity="bottom" | ||||
|     android:theme="@style/ThemeOverlay.AppCompat.Dark"> | ||||
|  | ||||
|     <FrameLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:background="@color/colorPrimary" /> | ||||
|  | ||||
|     <ImageView | ||||
|         android:layout_width="64dp" | ||||
|         android:layout_height="64dp" | ||||
|         android:layout_marginStart="16dp" | ||||
|         android:layout_marginTop="@dimen/navigation_drawer_header_margin" | ||||
|         android:scaleType="centerCrop" | ||||
|         android:src="@drawable/splash_icon" /> | ||||
|  | ||||
| </FrameLayout> | ||||
							
								
								
									
										23
									
								
								app/src/main/res/menu/bottom_nav.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								app/src/main/res/menu/bottom_nav.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item | ||||
|         android:id="@+id/nav_library" | ||||
|         android:icon="@drawable/ic_book_black_24dp" | ||||
|         android:title="@string/label_library" /> | ||||
|     <item | ||||
|         android:id="@+id/nav_updates" | ||||
|         android:icon="@drawable/ic_new_releases_black_24dp" | ||||
|         android:title="@string/label_recent_updates" /> | ||||
|     <item | ||||
|         android:id="@+id/nav_history" | ||||
|         android:icon="@drawable/ic_history_black_24dp" | ||||
|         android:title="@string/label_recent_manga" /> | ||||
|     <item | ||||
|         android:id="@+id/nav_catalogues" | ||||
|         android:icon="@drawable/ic_explore_black_24dp" | ||||
|         android:title="@string/label_catalogues" /> | ||||
|     <item | ||||
|         android:id="@+id/nav_more" | ||||
|         android:icon="@drawable/ic_more_horiz_black_24dp" | ||||
|         android:title="@string/label_more" /> | ||||
| </menu> | ||||
| @@ -42,9 +42,4 @@ | ||||
|         </menu> | ||||
|     </item> | ||||
|  | ||||
|     <item | ||||
|         android:id="@+id/action_source_migration" | ||||
|         android:title="@string/label_migration" | ||||
|         app:showAsAction="never" /> | ||||
|  | ||||
| </menu> | ||||
|   | ||||
| @@ -1,42 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <group | ||||
|         android:id="@+id/group_feature" | ||||
|         android:checkableBehavior="single"> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_library" | ||||
|             android:checked="true" | ||||
|             android:icon="@drawable/ic_book_black_24dp" | ||||
|             android:title="@string/label_library" /> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_recent_updates" | ||||
|             android:icon="@drawable/ic_new_releases_black_24dp" | ||||
|             android:title="@string/label_recent_updates" /> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_recently_read" | ||||
|             android:icon="@drawable/ic_history_black_24dp" | ||||
|             android:title="@string/label_recent_manga" /> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_catalogues" | ||||
|             android:icon="@drawable/ic_explore_black_24dp" | ||||
|             android:title="@string/label_catalogues" /> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_extensions" | ||||
|             android:icon="@drawable/ic_extension_black_24dp" | ||||
|             android:title="@string/label_extensions" /> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_downloads" | ||||
|             android:checkable="false" | ||||
|             android:icon="@drawable/ic_file_download_black_24dp" | ||||
|             android:title="@string/label_download_queue" /> | ||||
|     </group> | ||||
|     <group | ||||
|         android:id="@+id/group_settings" | ||||
|         android:checkableBehavior="single"> | ||||
|         <item | ||||
|             android:id="@+id/nav_drawer_settings" | ||||
|             android:checkable="false" | ||||
|             android:icon="@drawable/ic_settings_black_24dp" | ||||
|             android:title="@string/label_settings" /> | ||||
|     </group> | ||||
| </menu> | ||||
| @@ -1,11 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <menu xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto"> | ||||
|  | ||||
|     <item | ||||
|         android:id="@+id/action_help" | ||||
|         android:icon="@drawable/ic_help_white_24dp" | ||||
|         android:title="@string/label_help" | ||||
|         app:showAsAction="ifRoom" /> | ||||
|  | ||||
| </menu> | ||||
| @@ -20,12 +20,13 @@ | ||||
|         <attr name="max_seek" format="integer"/> | ||||
|     </declare-styleable> | ||||
|  | ||||
|     <attr name="navigation_view_theme" format="reference"/> | ||||
|     <attr name="selectable_list_drawable" format="reference|integer" /> | ||||
|     <attr name="selectable_library_drawable" format="reference|integer"/> | ||||
|     <attr name="text_color_primary" format="reference|integer"/> | ||||
|     <attr name="background_card" format="reference|integer"/> | ||||
|     <attr name="colorBackgroundSplash" format="reference|integer"/> | ||||
|     <attr name="icon_color" format="reference|integer"/> | ||||
|     <attr name="tabBarIconColor" format="reference|integer"/> | ||||
|     <attr name="tabBarIconInactive" format="reference|integer"/> | ||||
|  | ||||
| </resources> | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
|     <string name="history">History</string> | ||||
|  | ||||
|     <!-- Activities and fragments labels (toolbar title) --> | ||||
|     <string name="label_more">More</string> | ||||
|     <string name="label_settings">Settings</string> | ||||
|     <string name="label_download_queue">Download queue</string> | ||||
|     <string name="label_library">Library</string> | ||||
|   | ||||
| @@ -36,15 +36,6 @@ | ||||
|         <item name="android:background">@color/colorAmoledPrimary</item> | ||||
|     </style> | ||||
|  | ||||
|     <!--==============--> | ||||
|     <!--NavigationView--> | ||||
|     <!--==============--> | ||||
|     <style name="Theme.Widget.NavigationView" /> | ||||
|  | ||||
|     <style name="Theme.Widget.NavigationView.Dark"> | ||||
|         <item name="colorControlHighlight">@color/md_grey_900</item> | ||||
|         <item name="colorPrimary">?colorAccent</item> | ||||
|     </style> | ||||
|  | ||||
|     <!--===============--> | ||||
|     <!--Text Appearance--> | ||||
|   | ||||
| @@ -40,6 +40,8 @@ | ||||
|         <item name="text_color_primary">@color/textColorPrimaryLight</item> | ||||
|         <item name="background_card">@color/dialogLight</item> | ||||
|         <item name="icon_color">@color/iconColorLight</item> | ||||
|         <item name="tabBarIconColor">@android:color/white</item> | ||||
|         <item name="tabBarIconInactive">@color/textColorHintDark</item> | ||||
|     </style> | ||||
|  | ||||
|     <!--===========--> | ||||
| @@ -81,14 +83,14 @@ | ||||
|         <item name="md_background_color">@color/dialogDark</item> | ||||
|         <item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item> | ||||
|  | ||||
|  | ||||
|         <!-- Custom Attributes--> | ||||
|         <item name="navigation_view_theme">@style/Theme.Widget.NavigationView.Dark</item> | ||||
|         <item name="selectable_list_drawable">@drawable/list_item_selector_dark</item> | ||||
|         <item name="selectable_library_drawable">@drawable/library_item_selector_dark</item> | ||||
|         <item name="text_color_primary">@color/textColorPrimaryDark</item> | ||||
|         <item name="background_card">@color/dialogDark</item> | ||||
|         <item name="icon_color">@color/iconColorDark</item> | ||||
|         <item name="tabBarIconColor">@android:color/white</item> | ||||
|         <item name="tabBarIconInactive">@color/textColorHintDark</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user