You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Use RV to show Magisk logs
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
gone="@{viewModel.loading}"
|
||||
android:id="@+id/log_filter_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -15,46 +15,63 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
gone="@{viewModel.consoleText.empty}"
|
||||
<HorizontalScrollView
|
||||
gone="@{viewModel.loading}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/log_magisk"
|
||||
app:items="@{viewModel.logs}"
|
||||
app:extraBindings="@{viewModel.extraBindings}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/internal_action_bar_size"
|
||||
android:paddingBottom="@dimen/internal_action_bar_size"
|
||||
app:fitsSystemWindowsInsets="top|bottom"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_log_textview"
|
||||
tools:paddingTop="24dp" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="monospace"
|
||||
android:paddingTop="@dimen/internal_action_bar_size"
|
||||
android:paddingBottom="128dp"
|
||||
android:text="@{viewModel.consoleText}"
|
||||
android:textAppearance="@style/AppearanceFoundation.Caption"
|
||||
app:layout_fitsSystemWindowsInsets="top|bottom"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<FrameLayout
|
||||
gone="@{!viewModel.consoleText.empty}"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
item="@{viewModel.itemMagiskEmpty}"
|
||||
layout="@layout/item_text"
|
||||
<TextView
|
||||
goneUnless="@{viewModel.loading}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/loading"
|
||||
android:textAppearance="@style/AppearanceFoundation.Title"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ProgressBar
|
||||
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
|
||||
goneUnless="@{viewModel.loading}"
|
||||
android:layout_marginTop="@dimen/l1" />
|
||||
|
||||
<FrameLayout
|
||||
gone="@{viewModel.loading || !viewModel.magiskLogRaw.empty}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
</FrameLayout>
|
||||
<include
|
||||
item="@{viewModel.itemMagiskEmpty}"
|
||||
layout="@layout/item_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</layout>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="com.topjohnwu.magisk.ui.log.LogRvItem" />
|
||||
type="com.topjohnwu.magisk.ui.log.SuLogRvItem" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="com.topjohnwu.magisk.ui.log.LogRvItem" />
|
||||
|
||||
</data>
|
||||
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="monospace"
|
||||
android:textAppearance="@style/AppearanceFoundation.Caption"
|
||||
android:text="@{item.item}" />
|
||||
|
||||
</layout>
|
||||
Reference in New Issue
Block a user