diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/ModuleInstallDialog.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/ModuleInstallDialog.kt index 4a91de88f..592e8d089 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/ModuleInstallDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/ModuleInstallDialog.kt @@ -22,10 +22,12 @@ class ModuleInstallDialog(private val item: Repo) : DialogEvent() { .cancellable(true) .applyButton(MagiskDialog.ButtonType.POSITIVE) { titleRes = R.string.install + icon = R.drawable.ic_install onClick { download(true) } } .applyButton(MagiskDialog.ButtonType.NEGATIVE) { titleRes = R.string.download + icon = R.drawable.ic_download_md2 onClick { download(false) } } .reveal() diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt index 3d812a93e..2202166ba 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/hide/HideFragment.kt @@ -17,6 +17,7 @@ import androidx.core.view.marginBottom import androidx.core.view.marginEnd import androidx.interpolator.view.animation.FastOutSlowInInterpolator import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.google.android.material.circularreveal.CircularRevealCompat import com.google.android.material.circularreveal.CircularRevealWidget import com.google.android.material.floatingactionbutton.FloatingActionButton @@ -50,6 +51,11 @@ class HideFragment : CompatFragment() { hideKeyboard() MotionRevealHelper.withViews(binding.hideFilter, binding.hideFilterToggle, false) } + binding.hideContent.addOnScrollListener(object : RecyclerView.OnScrollListener() { + override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { + if (newState != RecyclerView.SCROLL_STATE_IDLE) hideKeyboard() + } + }) val lama = binding.hideContent.layoutManager ?: return lama.isAutoMeasureEnabled = false diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt index c3cf5b993..3667cdc0a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleFragment.kt @@ -8,6 +8,7 @@ import android.view.MenuInflater import android.view.MenuItem import android.view.View import androidx.core.view.isVisible +import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.StaggeredGridLayoutManager import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding @@ -55,6 +56,12 @@ class ModuleFragment : CompatFragment hideKeyboard() MotionRevealHelper.withViews(binding.moduleFilter, binding.moduleFilterToggle, false) } + binding.moduleFilterInclude.moduleFilterList.addOnScrollListener(object : + RecyclerView.OnScrollListener() { + override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { + if (newState != RecyclerView.SCROLL_STATE_IDLE) hideKeyboard() + } + }) } override fun onDestroyView() { diff --git a/app/src/main/res/drawable/fast_scroll_thumb.xml b/app/src/main/res/drawable/fast_scroll_thumb.xml new file mode 100644 index 000000000..19c3590fa --- /dev/null +++ b/app/src/main/res/drawable/fast_scroll_thumb.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/fast_scroll_track.xml b/app/src/main/res/drawable/fast_scroll_track.xml new file mode 100644 index 000000000..c8b91c814 --- /dev/null +++ b/app/src/main/res/drawable/fast_scroll_track.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/include_module_filter.xml b/app/src/main/res/layout/include_module_filter.xml index c1c3d2b57..3d5e93c4e 100644 --- a/app/src/main/res/layout/include_module_filter.xml +++ b/app/src/main/res/layout/include_module_filter.xml @@ -30,6 +30,11 @@ items="@{viewModel.itemsSearch}" android:layout_width="match_parent" android:layout_height="0dp" + app:fastScrollEnabled="true" + app:fastScrollHorizontalThumbDrawable="@drawable/fast_scroll_thumb" + app:fastScrollHorizontalTrackDrawable="@drawable/fast_scroll_track" + app:fastScrollVerticalThumbDrawable="@drawable/fast_scroll_thumb" + app:fastScrollVerticalTrackDrawable="@drawable/fast_scroll_track" android:layout_marginBottom="@dimen/l1" android:clipToPadding="false" android:orientation="vertical"