2019-10-02 19:42:38 +02:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<layout 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">
|
|
|
|
|
|
|
|
<data>
|
|
|
|
|
|
|
|
<variable
|
|
|
|
name="viewModel"
|
2020-01-12 17:43:09 +01:00
|
|
|
type="com.topjohnwu.magisk.ui.MainViewModel" />
|
2019-10-02 19:42:38 +02:00
|
|
|
|
|
|
|
</data>
|
|
|
|
|
|
|
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
2019-10-03 17:31:45 +02:00
|
|
|
android:orientation="vertical"
|
|
|
|
android:paddingLeft="@{viewModel.insets.left}"
|
|
|
|
android:paddingRight="@{viewModel.insets.right}"
|
|
|
|
tools:ignore="RtlHardcoded">
|
2019-10-02 19:42:38 +02:00
|
|
|
|
2020-03-17 17:28:09 +01:00
|
|
|
<fragment
|
2019-10-05 22:51:21 +02:00
|
|
|
android:id="@+id/main_nav_host"
|
2020-03-17 17:28:09 +01:00
|
|
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
2019-10-05 22:51:21 +02:00
|
|
|
android:layout_width="match_parent"
|
2020-03-17 17:28:09 +01:00
|
|
|
android:layout_height="match_parent"
|
|
|
|
app:defaultNavHost="true"
|
|
|
|
app:navGraph="@navigation/main" />
|
2019-10-05 22:51:21 +02:00
|
|
|
|
2019-10-22 18:08:57 +02:00
|
|
|
<com.google.android.material.appbar.AppBarLayout
|
|
|
|
android:id="@+id/main_toolbar_wrapper"
|
2019-11-22 19:29:53 +01:00
|
|
|
style="@style/WidgetFoundation.Appbar"
|
2019-10-02 19:42:38 +02:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2019-10-22 18:08:57 +02:00
|
|
|
android:paddingTop="@{viewModel.insets.top}">
|
2019-10-02 19:42:38 +02:00
|
|
|
|
|
|
|
<com.google.android.material.appbar.MaterialToolbar
|
2019-10-03 17:31:45 +02:00
|
|
|
android:id="@+id/main_toolbar"
|
2019-11-22 19:29:53 +01:00
|
|
|
style="@style/WidgetFoundation.Toolbar"
|
2019-10-02 19:42:38 +02:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
2019-10-05 22:20:57 +02:00
|
|
|
app:layout_scrollFlags="noScroll"
|
2019-10-22 18:08:57 +02:00
|
|
|
tools:layout_marginTop="24dp"
|
2019-10-03 18:41:04 +02:00
|
|
|
tools:title="Home" />
|
2019-10-02 19:42:38 +02:00
|
|
|
|
2019-10-22 18:08:57 +02:00
|
|
|
</com.google.android.material.appbar.AppBarLayout>
|
|
|
|
|
2020-03-17 16:15:30 +01:00
|
|
|
<!--
|
|
|
|
todo(diareuse) this stupid-ass bottom menu doesn't fit with the fab-s, so either of those
|
|
|
|
things need to be removed, probably the fab-s.
|
|
|
|
|
|
|
|
Using the BottomAppBar is not viable as it looks terrible with the blank space in the
|
|
|
|
middle and / or with the "animation" which BottomNavigationView performs when it's
|
|
|
|
reinflating its menu items. This bullshit cockblocks the entire feature. Terrific.
|
|
|
|
|
|
|
|
Possibility is then to keep the middle fab and assign it some other functionality on all
|
|
|
|
screens. Which -ha-ha- good luck finding something on superuser and homepage...
|
|
|
|
-->
|
2019-10-10 17:34:06 +02:00
|
|
|
<com.google.android.material.card.MaterialCardView
|
2019-10-03 17:31:45 +02:00
|
|
|
android:id="@+id/main_bottom_bar"
|
2019-11-22 19:29:53 +01:00
|
|
|
style="@style/WidgetFoundation.Card.Elevated"
|
2020-03-17 16:15:30 +01:00
|
|
|
android:layout_width="224dp"
|
2019-10-02 19:42:38 +02:00
|
|
|
android:layout_height="wrap_content"
|
2019-10-30 17:11:42 +01:00
|
|
|
android:layout_gravity="bottom|center_horizontal"
|
2019-10-10 17:34:06 +02:00
|
|
|
android:layout_marginStart="@dimen/l1"
|
|
|
|
android:layout_marginEnd="@dimen/l1"
|
|
|
|
android:layout_marginBottom="@{(int) @dimen/l1 + viewModel.insets.bottom}"
|
|
|
|
tools:layout_marginBottom="64dp">
|
2019-10-02 19:42:38 +02:00
|
|
|
|
2019-10-06 12:06:09 +02:00
|
|
|
<LinearLayout
|
2019-10-02 19:42:38 +02:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2019-10-06 12:06:09 +02:00
|
|
|
android:animateLayoutChanges="true"
|
|
|
|
android:orientation="vertical">
|
|
|
|
|
|
|
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
|
|
|
android:id="@+id/main_navigation"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:background="@android:color/transparent"
|
2020-03-17 16:15:30 +01:00
|
|
|
android:textStyle="bold"
|
2019-10-06 12:06:09 +02:00
|
|
|
app:elevation="0dp"
|
2020-03-17 16:15:30 +01:00
|
|
|
app:itemHorizontalTranslationEnabled="false"
|
2019-10-06 12:06:09 +02:00
|
|
|
app:itemIconTint="@color/color_menu_tint"
|
2020-03-17 16:15:30 +01:00
|
|
|
app:itemRippleColor="?colorPrimary"
|
2019-10-06 12:06:09 +02:00
|
|
|
app:itemTextAppearanceActive="@style/AppearanceFoundation.Tiny.Bold"
|
|
|
|
app:itemTextAppearanceInactive="@style/AppearanceFoundation.Tiny.Bold"
|
|
|
|
app:itemTextColor="@color/color_menu_tint"
|
|
|
|
app:labelVisibilityMode="unlabeled"
|
|
|
|
app:menu="@menu/menu_bottom_nav" />
|
|
|
|
|
|
|
|
<androidx.appcompat.widget.AppCompatTextView
|
|
|
|
gone="@{viewModel.isConnected}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:gravity="center"
|
|
|
|
android:paddingBottom="@dimen/l_50"
|
|
|
|
android:text="@string/no_connection"
|
2019-11-22 19:29:53 +01:00
|
|
|
android:textAppearance="@style/AppearanceFoundation.Caption"
|
2019-10-06 12:06:09 +02:00
|
|
|
android:textColor="?colorError"
|
|
|
|
android:visibility="gone"
|
|
|
|
tools:visibility="visible" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
2019-10-02 19:42:38 +02:00
|
|
|
|
2019-10-10 17:34:06 +02:00
|
|
|
</com.google.android.material.card.MaterialCardView>
|
2019-10-02 19:42:38 +02:00
|
|
|
|
|
|
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
|
|
|
|
|
|
</layout>
|