Update dialogs' drag handle to use BottomSheetDragHandleView

This commit is contained in:
lynxnb 2023-03-07 12:29:28 +01:00 committed by Niccolò Betto
parent 2bcf0e2abd
commit ee2716403e
6 changed files with 11 additions and 21 deletions

View File

@ -11,14 +11,16 @@ import android.view.View
import android.view.ViewGroup
import androidx.transition.TransitionManager
import com.google.android.material.bottomsheet.BottomSheetBehavior
import emu.skyline.R
import com.google.android.material.bottomsheet.BottomSheetDragHandleView
class DragIndicatorView : androidx.appcompat.widget.AppCompatImageView {
/**
* A [BottomSheetDragHandleView] that hides itself when the bottom sheet is expanded full-screen
*/
class DragHandleView : BottomSheetDragHandleView {
private val visibilityCallback = DragIndicatorCallback()
private var callbackAttached = false
init {
setImageResource(R.drawable.drag_indicator)
isFocusable = false
isClickable = false
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="42dp"
android:height="4dp" />
<solid android:color="@color/onBackgroundLight" />
<corners android:radius="4dp" />
</shape>

View File

@ -6,11 +6,12 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<emu.skyline.views.DragIndicatorView
<emu.skyline.views.DragHandleView
android:id="@+id/drag_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp" />
android:minHeight="40dp"
android:paddingBottom="12dp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

@ -10,10 +10,11 @@
android:orientation="vertical"
android:paddingHorizontal="2.5dp">
<emu.skyline.views.DragIndicatorView
<emu.skyline.views.DragHandleView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="8dp" />
android:minHeight="40dp"
android:paddingBottom="12dp" />
<TextView
android:id="@+id/library_title"

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="onBackgroundLight">#1AFFFFFF</color>
</resources>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="logoBackground">#121212</color>
<color name="onBackgroundLight">#1E000000</color>
<color name="colorPerfStatsPrimary">#9FFFFF00</color>
<color name="colorPerfStatsSecondary">#9F00FFFF</color>