2019-10-17 18:57:00 +02:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2019-10-30 17:54:43 +01:00
|
|
|
<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">
|
2019-10-17 18:57:00 +02:00
|
|
|
|
|
|
|
<data>
|
|
|
|
|
2020-01-13 22:01:46 +08:00
|
|
|
<import type="com.topjohnwu.magisk.core.Config" />
|
2019-10-30 17:54:43 +01:00
|
|
|
|
2019-10-17 18:57:00 +02:00
|
|
|
<variable
|
|
|
|
name="viewModel"
|
2020-01-13 00:43:09 +08:00
|
|
|
type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
|
2019-10-17 18:57:00 +02:00
|
|
|
|
|
|
|
</data>
|
|
|
|
|
2019-11-14 18:56:03 +01:00
|
|
|
<FrameLayout
|
2019-10-17 18:57:00 +02:00
|
|
|
android:layout_width="match_parent"
|
2019-11-14 18:56:03 +01:00
|
|
|
android:layout_height="match_parent">
|
|
|
|
|
2020-04-11 17:58:10 +02:00
|
|
|
<!--
|
|
|
|
The list is reverted to use LinearLayoutManager only. The issue of random crashes lies in
|
|
|
|
the way StaggeredGridLayoutManager invalidates view in LazySpanLookup. Since we're adding
|
|
|
|
items in between full-span items the array is not yet invalidated and consecutively crashes
|
|
|
|
due to index of -end- being out of bounds of the current array.
|
|
|
|
|
|
|
|
If you'd like to use StaggeredGridLayoutManager, do so without adding single span items in
|
|
|
|
between of full-span items.
|
|
|
|
https://issuetracker.google.com/issues/37034096
|
|
|
|
-->
|
|
|
|
|
2019-11-14 18:56:03 +01:00
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
2020-01-04 16:07:53 +01:00
|
|
|
android:id="@+id/module_list"
|
2019-11-14 18:56:03 +01:00
|
|
|
adapter="@{viewModel.adapter}"
|
2020-01-23 02:23:42 +08:00
|
|
|
dividerHorizontal="@{@drawable/divider_l1}"
|
2020-08-09 21:41:23 -07:00
|
|
|
dividerVertical="@{@drawable/divider_l_50}"
|
2019-11-16 19:20:44 +01:00
|
|
|
gone="@{viewModel.loading && viewModel.items.empty}"
|
2019-11-14 18:56:03 +01:00
|
|
|
itemBinding="@{viewModel.itemBinding}"
|
|
|
|
items="@{viewModel.items}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
android:clipToPadding="false"
|
|
|
|
android:orientation="vertical"
|
|
|
|
android:paddingStart="@dimen/l1"
|
|
|
|
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l1}"
|
|
|
|
android:paddingEnd="0dp"
|
2019-11-17 13:48:52 +01:00
|
|
|
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/internal_action_bar_size + (int) @dimen/l1}"
|
2020-04-11 17:58:10 +02:00
|
|
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
2019-11-14 18:56:03 +01:00
|
|
|
tools:listitem="@layout/item_module_md2" />
|
|
|
|
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
|
|
android:id="@+id/module_filter_toggle"
|
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_gravity="bottom|end"
|
|
|
|
android:layout_marginStart="@dimen/l1"
|
|
|
|
android:layout_marginEnd="@dimen/l1"
|
|
|
|
android:layout_marginBottom="@{viewModel.insets.bottom + (int) @dimen/l1}"
|
2019-11-14 19:10:49 +01:00
|
|
|
app:backgroundTint="?colorSurfaceSurfaceVariant"
|
2020-08-27 03:10:25 -07:00
|
|
|
app:srcCompat="@drawable/ic_search_md2"
|
2019-11-14 18:56:03 +01:00
|
|
|
app:tint="?colorPrimary"
|
|
|
|
tools:layout_marginBottom="64dp" />
|
|
|
|
|
|
|
|
<com.google.android.material.circularreveal.cardview.CircularRevealCardView
|
|
|
|
android:id="@+id/module_filter"
|
2020-09-17 02:27:43 -07:00
|
|
|
style="@style/WidgetFoundation.Card"
|
2020-08-29 22:55:18 -07:00
|
|
|
app:cardBackgroundColor="?colorSurface"
|
2019-11-14 18:56:03 +01:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
android:layout_gravity="bottom"
|
|
|
|
android:visibility="invisible"
|
|
|
|
app:cardCornerRadius="0dp">
|
|
|
|
|
|
|
|
<include
|
|
|
|
android:id="@+id/module_filter_include"
|
|
|
|
layout="@layout/include_module_filter"
|
|
|
|
viewModel="@{viewModel}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent" />
|
|
|
|
|
|
|
|
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>
|
|
|
|
|
2019-11-15 22:16:59 +01:00
|
|
|
<LinearLayout
|
2019-11-16 19:20:44 +01:00
|
|
|
goneUnless="@{viewModel.loading && viewModel.items.empty}"
|
2019-11-15 22:16:59 +01:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_gravity="center"
|
|
|
|
android:gravity="center"
|
|
|
|
android:orientation="vertical">
|
|
|
|
|
2020-08-19 02:45:14 -07:00
|
|
|
<TextView
|
2019-11-15 22:16:59 +01:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2020-09-24 04:44:44 +08:00
|
|
|
android:text="@string/loading"
|
2019-11-22 19:29:53 +01:00
|
|
|
android:textAppearance="@style/AppearanceFoundation.Title"
|
2019-11-15 22:16:59 +01:00
|
|
|
android:textStyle="bold" />
|
|
|
|
|
|
|
|
<ProgressBar
|
2019-11-22 19:29:53 +01:00
|
|
|
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
|
2019-11-15 22:16:59 +01:00
|
|
|
android:layout_marginTop="@dimen/l1" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
2020-03-29 12:38:41 +02:00
|
|
|
<FrameLayout
|
|
|
|
goneUnless="@{viewModel.remoteLoading}"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="4dp"
|
|
|
|
android:layout_gravity="bottom">
|
|
|
|
|
|
|
|
<FrameLayout
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="16dp"
|
|
|
|
android:layout_gravity="center"
|
|
|
|
tools:ignore="UselessParent">
|
|
|
|
|
|
|
|
<ProgressBar
|
|
|
|
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
android:layout_gravity="center" />
|
|
|
|
|
|
|
|
</FrameLayout>
|
|
|
|
|
|
|
|
</FrameLayout>
|
|
|
|
|
2019-11-14 18:56:03 +01:00
|
|
|
</FrameLayout>
|
|
|
|
|
2019-10-17 18:57:00 +02:00
|
|
|
|
2020-01-13 00:43:09 +08:00
|
|
|
</layout>
|