mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
feat: allow timestamp inputs in dearrow submit dialog
This commit is contained in:
parent
801f97353c
commit
0a00d9c0b1
@ -15,6 +15,7 @@ import com.github.libretube.databinding.DialogSubmitDearrowBinding
|
|||||||
import com.github.libretube.extensions.toastFromMainDispatcher
|
import com.github.libretube.extensions.toastFromMainDispatcher
|
||||||
import com.github.libretube.helpers.PreferenceHelper
|
import com.github.libretube.helpers.PreferenceHelper
|
||||||
import com.github.libretube.util.TextUtils
|
import com.github.libretube.util.TextUtils
|
||||||
|
import com.github.libretube.util.TextUtils.parseDurationString
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -88,7 +89,7 @@ class SubmitDeArrowDialog: DialogFragment() {
|
|||||||
val title = binding.dearrowTitle.text
|
val title = binding.dearrowTitle.text
|
||||||
.takeIf { it.isNotEmpty() && binding.titleCheckbox.isChecked }
|
.takeIf { it.isNotEmpty() && binding.titleCheckbox.isChecked }
|
||||||
?.let { DeArrowSubmitTitle(it) }
|
?.let { DeArrowSubmitTitle(it) }
|
||||||
val thumbnail = binding.thumbnailTime.text.toString().toFloatOrNull()
|
val thumbnail = binding.thumbnailTime.text.toString().parseDurationString()
|
||||||
?.takeIf { binding.thumbnailTimeCheckbox.isChecked }
|
?.takeIf { binding.thumbnailTimeCheckbox.isChecked }
|
||||||
?.let { DeArrowSubmitThumbnail(it) }
|
?.let { DeArrowSubmitThumbnail(it) }
|
||||||
val requestBody = DeArrowBody(videoId, userID, userAgent, title, thumbnail)
|
val requestBody = DeArrowBody(videoId, userID, userAgent, title, thumbnail)
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
android:id="@+id/thumbnail_time"
|
android:id="@+id/thumbnail_time"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="numberDecimal" />
|
android:inputType="time" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user