Initial adding bottom navigation
parent
1d2584001f
commit
0e7960fced
@ -0,0 +1,27 @@
|
|||||||
|
package org.koitharu.kotatsu.utils
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.Resources
|
||||||
|
|
||||||
|
object InternalResourceHelper {
|
||||||
|
|
||||||
|
fun getBoolean(context: Context, resName: String, defaultValue: Boolean): Boolean {
|
||||||
|
val id = getResourceId(resName, "bool")
|
||||||
|
return if (id != 0) {
|
||||||
|
context.createPackageContext("android", 0).resources.getBoolean(id)
|
||||||
|
} else {
|
||||||
|
defaultValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get resource id from system resources
|
||||||
|
* @param resName resource name to get
|
||||||
|
* @param type resource type of [resName] to get
|
||||||
|
* @return 0 if not available
|
||||||
|
*/
|
||||||
|
private fun getResourceId(resName: String, type: String): Int {
|
||||||
|
return Resources.getSystem().getIdentifier(resName, type, "android")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,96 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
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"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<com.google.android.material.navigation.NavigationView
|
|
||||||
android:id="@+id/navigationView"
|
|
||||||
android:layout_width="260dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:fitsSystemWindows="false"
|
|
||||||
app:drawerLayoutCornerSize="0dp"
|
|
||||||
app:elevation="0dp"
|
|
||||||
app:menu="@menu/nav_drawer" />
|
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
|
||||||
android:id="@id/container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
|
||||||
tools:layout="@layout/fragment_list" />
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@null"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
app:elevation="0dp"
|
|
||||||
app:liftOnScroll="false">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/toolbar_card"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="54dp"
|
|
||||||
android:layout_marginVertical="8dp"
|
|
||||||
android:background="@drawable/toolbar_background"
|
|
||||||
android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlways">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
|
||||||
android:id="@id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@null"
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true">
|
|
||||||
|
|
||||||
<org.koitharu.kotatsu.search.ui.widget.SearchEditText
|
|
||||||
android:id="@+id/searchView"
|
|
||||||
style="@style/Widget.Kotatsu.SearchView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:background="@null"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:hint="@string/search_manga"
|
|
||||||
android:imeOptions="actionSearch"
|
|
||||||
android:importantForAutofill="no"
|
|
||||||
android:singleLine="true"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
|
||||||
android:id="@+id/fab"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:text="@string/_continue"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:backgroundTint="?attr/colorContainer"
|
|
||||||
app:icon="@drawable/ic_read"
|
|
||||||
app:layout_anchor="@id/container"
|
|
||||||
app:layout_anchorGravity="bottom|end"
|
|
||||||
app:layout_behavior="org.koitharu.kotatsu.base.ui.util.ShrinkOnScrollBehavior"
|
|
||||||
app:layout_dodgeInsetEdges="bottom"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Loading…
Reference in New Issue