From 109f47f43f0133a65664c6d2db2f81558f3f8721 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 14 Aug 2022 17:35:17 +0200 Subject: [PATCH] improve dialog layout --- .../main/java/com/github/libretube/MyApp.kt | 7 ++--- .../github/libretube/api/ResettableLazy.kt | 2 +- .../libretube/fragments/PlayerFragment.kt | 2 +- .../main/res/layout/dialog_addtoplaylist.xml | 2 +- .../res/layout/dialog_create_playlist.xml | 12 ++++----- .../res/layout/dialog_custom_instance.xml | 27 +++++++++---------- .../main/res/layout/dialog_delete_account.xml | 12 ++++----- app/src/main/res/layout/dialog_login.xml | 21 +++++++-------- app/src/main/res/values/style.xml | 12 +++------ 9 files changed, 45 insertions(+), 52 deletions(-) diff --git a/app/src/main/java/com/github/libretube/MyApp.kt b/app/src/main/java/com/github/libretube/MyApp.kt index 45071f592..353a9ecff 100644 --- a/app/src/main/java/com/github/libretube/MyApp.kt +++ b/app/src/main/java/com/github/libretube/MyApp.kt @@ -19,7 +19,6 @@ import com.github.libretube.preferences.PreferenceHelper import com.github.libretube.preferences.PreferenceKeys import com.github.libretube.util.ExceptionHandler import com.github.libretube.util.NotificationHelper -import java.lang.Exception class MyApp : Application() { override fun onCreate() { @@ -170,7 +169,8 @@ class MyApp : Application() { DatabaseHolder.db.watchHistoryDao().insertAll( *watchHistoryItems.toTypedArray() ) - } catch (e: Exception) {} + } catch (e: Exception) { + } prefs.edit().putString("watch_history", "").commit() } val legacyWatchPositions = prefs.getString("watch_positions", "") @@ -181,7 +181,8 @@ class MyApp : Application() { DatabaseHolder.db.watchPositionDao().insertAll( *watchPositions.toTypedArray() ) - } catch (e: Exception) {} + } catch (e: Exception) { + } prefs.edit().remove("watch_positions").commit() } prefs.edit() diff --git a/app/src/main/java/com/github/libretube/api/ResettableLazy.kt b/app/src/main/java/com/github/libretube/api/ResettableLazy.kt index 129e27de6..432dff009 100644 --- a/app/src/main/java/com/github/libretube/api/ResettableLazy.kt +++ b/app/src/main/java/com/github/libretube/api/ResettableLazy.kt @@ -1,7 +1,7 @@ package com.github.libretube.util -import java.util.* import kotlin.reflect.KProperty +import java.util.* class ResettableLazyManager { // we synchronize to make sure the timing of a reset() call and new inits do not collide diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 3d7d64e4e..54e9363b9 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -92,6 +92,7 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource import com.google.android.exoplayer2.util.RepeatModeUtil import com.google.android.exoplayer2.video.VideoSize import com.google.android.material.dialog.MaterialAlertDialogBuilder +import kotlin.math.abs import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -99,7 +100,6 @@ import org.chromium.net.CronetEngine import retrofit2.HttpException import java.io.IOException import java.util.concurrent.Executors -import kotlin.math.abs class PlayerFragment : BaseFragment() { diff --git a/app/src/main/res/layout/dialog_addtoplaylist.xml b/app/src/main/res/layout/dialog_addtoplaylist.xml index 04e3bc172..31d353893 100644 --- a/app/src/main/res/layout/dialog_addtoplaylist.xml +++ b/app/src/main/res/layout/dialog_addtoplaylist.xml @@ -23,7 +23,7 @@