diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt index fc6b53c3f..91a532e43 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/home/HomeViewModel.kt @@ -2,4 +2,8 @@ package com.topjohnwu.magisk.redesign.home import com.topjohnwu.magisk.redesign.compat.CompatViewModel -class HomeViewModel : CompatViewModel() \ No newline at end of file +class HomeViewModel : CompatViewModel() { + + fun onDeletePressed() {} + +} \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt index ad61131f8..7e2e93770 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -6,6 +6,7 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.Toolbar +import androidx.core.view.postDelayed import androidx.databinding.BindingAdapter import androidx.databinding.InverseBindingAdapter import androidx.databinding.InverseBindingListener @@ -220,4 +221,28 @@ fun getScrollPosition(view: RecyclerView) = (view.layoutManager as? LinearLayout @BindingAdapter("isEnabled") fun setEnabled(view: View, isEnabled: Boolean) { view.isEnabled = isEnabled +} + +// md2 + +@BindingAdapter("onSelectClick", "onSelectReset", requireAll = false) +fun View.setOnSelectClickListener(listener: View.OnClickListener, resetTime: Long) { + setOnClickListener { + when { + it.isSelected -> { + listener.onClick(it) + (it.tag as? Runnable)?.let { task -> + it.handler.removeCallbacks(task) + } + it.isSelected = false + } + else -> { + it.isSelected = true + it.tag = it.postDelayed(resetTime) { + it.tag = null + it.isSelected = false + } + } + } + } } \ No newline at end of file diff --git a/app/src/main/res/color/color_primary_delete_transient.xml b/app/src/main/res/color/color_primary_delete_transient.xml new file mode 100644 index 000000000..7be83a094 --- /dev/null +++ b/app/src/main/res/color/color_primary_delete_transient.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/avd_delete_magisk.xml b/app/src/main/res/drawable-v21/avd_delete_magisk.xml new file mode 100644 index 000000000..b01b1ce4a --- /dev/null +++ b/app/src/main/res/drawable-v21/avd_delete_magisk.xml @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v21/avd_magisk_delete.xml b/app/src/main/res/drawable-v21/avd_magisk_delete.xml new file mode 100644 index 000000000..0d0c585d9 --- /dev/null +++ b/app/src/main/res/drawable-v21/avd_magisk_delete.xml @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v21/ic_magisk_delete.xml b/app/src/main/res/drawable-v21/ic_magisk_delete.xml new file mode 100644 index 000000000..3feade979 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_magisk_delete.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_delete_md2.xml b/app/src/main/res/drawable/ic_delete_md2.xml index dd7f39908..e451bfa33 100644 --- a/app/src/main/res/drawable/ic_delete_md2.xml +++ b/app/src/main/res/drawable/ic_delete_md2.xml @@ -1,10 +1,12 @@ - - - \ No newline at end of file + + + diff --git a/app/src/main/res/drawable/ic_magisk_delete.xml b/app/src/main/res/drawable/ic_magisk_delete.xml new file mode 100644 index 000000000..5932b6150 --- /dev/null +++ b/app/src/main/res/drawable/ic_magisk_delete.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home_md2.xml b/app/src/main/res/layout/fragment_home_md2.xml index 548fd3fad..dd547cba6 100644 --- a/app/src/main/res/layout/fragment_home_md2.xml +++ b/app/src/main/res/layout/fragment_home_md2.xml @@ -39,20 +39,13 @@ - - - + app:srcCompat="@drawable/ic_magisk_delete" + app:tint="@color/color_primary_delete_transient" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" /> @@ -133,9 +129,11 @@ android:layout_marginStart="@dimen/l1" android:text="Manager" android:textAppearance="?appearanceTextTitleNormal" + app:layout_constraintBottom_toTopOf="@+id/status2" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/icon2" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" /> diff --git a/native/jni/external/mincrypt b/native/jni/external/mincrypt index ac33afa79..d443357d3 160000 --- a/native/jni/external/mincrypt +++ b/native/jni/external/mincrypt @@ -1 +1 @@ -Subproject commit ac33afa79e57e198b9eeec231140d64816a0bb1e +Subproject commit d443357d300f263179e04ef0893e6b8f040c9451