Added empty states for all remaining screens

Fixed some issues in the process as the MergeObservableList doesn't support additions or deletions, duh...
This commit is contained in:
Viktor De Pasquale
2020-01-06 19:03:36 +01:00
parent 7342509b2e
commit 904948dc7d
7 changed files with 107 additions and 32 deletions
@@ -61,6 +61,20 @@
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>
<FrameLayout
gone="@{!viewModel.items.empty}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<include
item="@{viewModel.itemEmpty}"
layout="@layout/item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
</FrameLayout>
</layout>
@@ -18,6 +18,8 @@
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/superuser_list"
adapter="@{viewModel.adapter}"
dividerHorizontal="@{R.drawable.divider_l1}"
dividerVertical="@{R.drawable.divider_l1}"
goneUnless="@{viewModel.loaded || !viewModel.items.empty}"
@@ -25,7 +27,6 @@
items="@{viewModel.items}"
nestedScrollingEnabled="@{false}"
android:layout_width="match_parent"
android:id="@+id/superuser_list"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
+35 -15
View File
@@ -11,24 +11,44 @@
</data>
<HorizontalScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
adapter="@{viewModel.consoleAdapter}"
itemBinding="@{viewModel.itemConsoleBinding}"
items="@{viewModel.itemsConsole}"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingBottom="@{viewModel.insets.bottom}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_console"
tools:paddingTop="24dp" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
</HorizontalScrollView>
<androidx.recyclerview.widget.RecyclerView
adapter="@{viewModel.consoleAdapter}"
itemBinding="@{viewModel.itemConsoleBinding}"
items="@{viewModel.itemsConsole}"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingBottom="@{viewModel.insets.bottom}"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_console"
tools:paddingTop="24dp" />
</HorizontalScrollView>
<FrameLayout
gone="@{!viewModel.itemsConsole.empty}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<include
item="@{viewModel.itemMagiskEmpty}"
layout="@layout/item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
</FrameLayout>
</layout>
+4
View File
@@ -91,10 +91,14 @@
<string name="superuser_toggle_log">Logs</string>
<string name="superuser_toggle_notification">Notifications</string>
<string name="superuser_toggle_revoke">Revoke</string>
<string name="superuser_policy_none">No app has asked for superuser permission yet.</string>
<string name="hide_filter_hint">Filter by name</string>
<string name="hide_scroll_up">Scroll up</string>
<string name="hide_filters">Filters</string>
<string name="hide_search">Search</string>
<string name="log_data_none">You\'re log-free, try using your SU enabled apps more.</string>
<string name="log_data_magisk_none">Magisk logs are empty, that\'s weird.</string>
</resources>