mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-19 09:02:19 +00:00
Added one-click scroll to the bottom
This commit is contained in:
10
app/src/main/res/drawable/ic_arrow_down.xml
Normal file
10
app/src/main/res/drawable/ic_arrow_down.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M16.59,5.59L18,7L12,13L6,7L7.41,5.59L12,10.17L16.59,5.59M16.59,11.59L18,13L12,19L6,13L7.41,11.59L12,16.17L16.59,11.59Z" />
|
||||
</vector>
|
@@ -15,20 +15,39 @@
|
||||
|
||||
</data>
|
||||
|
||||
<HorizontalScrollView
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
adapter="@{viewModel.itemsAdapter}"
|
||||
itemBinding="@{viewModel.itemBinding}"
|
||||
items="@{item.items}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_console" />
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
adapter="@{viewModel.itemsAdapter}"
|
||||
itemBinding="@{viewModel.itemBinding}"
|
||||
items="@{item.items}"
|
||||
scrollPosition="@={viewModel.scrollPosition}"
|
||||
scrollPositionSmooth="@{true}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_console" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
hide="@{viewModel.scrollPosition == item.items.size - 1}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/margin_generic"
|
||||
android:onClick="@{() -> viewModel.scrollDownPressed()}"
|
||||
app:srcCompat="@drawable/ic_arrow_down"
|
||||
app:tint="@color/colorTextInverse" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</layout>
|
Reference in New Issue
Block a user