feat: button to swap sponsorblock segment start and end time

This commit is contained in:
Bnyro 2024-07-15 13:58:18 +02:00
parent fadd2d31af
commit 801f97353c
3 changed files with 30 additions and 1 deletions

View File

@ -57,6 +57,12 @@ class SubmitSegmentDialog : DialogFragment() {
binding.segmentCategory.items = resources.getStringArray(R.array.sponsorBlockSegmentNames).toList()
binding.swapTimestamps.setOnClickListener {
val temp = binding.startTime.text
binding.startTime.text = binding.endTime.text
binding.endTime.text = temp
}
lifecycleScope.launch(Dispatchers.IO) {
fetchSegments()
}

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="?colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M9.01,14H2v2h7.01v3L13,15l-3.99,-4V14zM14.99,13v-3H22V8h-7.01V5L11,9L14.99,13z" />
</vector>

View File

@ -39,10 +39,20 @@
android:inputType="time" />
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:id="@+id/swap_timestamps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="2dp"
android:background="?selectableItemBackgroundBorderless"
android:padding="4dp"
android:src="@drawable/ic_arrow_left_right" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:hint="@string/end_time">