diff options
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/ic_home_black_24dp.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 32 | ||||
-rw-r--r-- | app/src/main/res/layout/content_main.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/top_manga_page.xml | 16 | ||||
-rw-r--r-- | app/src/main/res/menu/bottom_nav_menu.xml | 19 | ||||
-rw-r--r-- | app/src/main/res/navigation/mobile_navigation.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 8 |
7 files changed, 94 insertions, 17 deletions
diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml new file mode 100644 index 0000000..f8bb0b5 --- /dev/null +++ b/app/src/main/res/drawable/ic_home_black_24dp.xml @@ -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="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" /> +</vector> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index dc71220..9c34ba0 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" @@ -9,6 +9,8 @@ <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" android:theme="@style/Theme.Aniki.AppBarOverlay"> <androidx.appcompat.widget.Toolbar @@ -20,6 +22,30 @@ </com.google.android.material.appbar.AppBarLayout> - <include layout="@layout/content_main" /> + <com.google.android.material.bottomnavigation.BottomNavigationView + android:id="@+id/nav_view" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="0dp" + android:layout_marginEnd="0dp" + android:background="?android:attr/windowBackground" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:menu="@menu/bottom_nav_menu" /> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/nav_host_fragment_activity_main" + android:name="androidx.navigation.fragment.NavHostFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:defaultNavHost="true" + app:layout_constraintBottom_toTopOf="@id/nav_view" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:navGraph="@navigation/mobile_navigation" /> + + <!--include layout="@layout/content_main" /--> -</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index c4e7db6..f4c4e46 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - <fragment + <androidx.fragment.app.FragmentContainerView android:id="@+id/nav_host_fragment" android:name="androidx.navigation.fragment.NavHostFragment" android:layout_width="0dp" diff --git a/app/src/main/res/layout/top_manga_page.xml b/app/src/main/res/layout/top_manga_page.xml index b9b3182..cde56c7 100644 --- a/app/src/main/res/layout/top_manga_page.xml +++ b/app/src/main/res/layout/top_manga_page.xml @@ -8,6 +8,7 @@ tools:context=".presentation.view.fragment.TopMangaFragment"> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout + android:paddingVertical="50dp" android:id="@+id/swiperefresh" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -30,16 +31,8 @@ android:layout_height="wrap_content" android:text="@string/prev" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@id/button_home" /> - - <Button - android:id="@+id/button_home" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/home" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/button_next" @@ -47,6 +40,7 @@ android:layout_height="wrap_content" android:text="@string/next" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/button_home" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml new file mode 100644 index 0000000..0ea00a0 --- /dev/null +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + + <item + android:id="@+id/navigation_manga" + android:icon="@drawable/ic_home_black_24dp" + android:title="@string/title_manga" /> + + <item + android:id="@+id/navigation_home" + android:icon="@drawable/ic_home_black_24dp" + android:title="@string/title_home" /> + + <item + android:id="@+id/navigation_anime" + android:icon="@drawable/ic_home_black_24dp" + android:title="@string/title_anime" /> + +</menu>
\ No newline at end of file diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml new file mode 100644 index 0000000..8d197c0 --- /dev/null +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<navigation xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/mobile_navigation" + app:startDestination="@+id/navigation_home"> + + <fragment + android:id="@+id/navigation_manga" + android:name="xyz.adjutor.aniki.presentation.view.fragment.TopMangaFragment" + android:label="@string/title_manga" + tools:layout="@layout/top_manga_page" /> + + <fragment + android:id="@+id/navigation_home" + android:name="xyz.adjutor.aniki.presentation.view.fragment.HomePage" + android:label="@string/title_home" + tools:layout="@layout/home_page" /> + + <fragment + android:id="@+id/navigation_anime" + android:name="xyz.adjutor.aniki.presentation.view.fragment.TopAnimeFragment" + android:label="@string/title_anime" + tools:layout="@layout/top_anime_page" /> +</navigation>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 861a440..c998872 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,7 +42,11 @@ <string name="search_anime">Search Anime</string> <string name="search_anime_page_label">Search Anime Page</string> <string name="hint_query">Your query …</string> - <string name="prev">PREV</string> - <string name="next">NEXT</string> + <string name="prev"><</string> + <string name="next">></string> + + <string name="title_home">Home</string> + <string name="title_manga">Manga</string> + <string name="title_anime">Anime</string> </resources>
\ No newline at end of file |