mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
improve dialog layout
This commit is contained in:
parent
03b2e8e937
commit
109f47f43f
@ -19,7 +19,6 @@ import com.github.libretube.preferences.PreferenceHelper
|
|||||||
import com.github.libretube.preferences.PreferenceKeys
|
import com.github.libretube.preferences.PreferenceKeys
|
||||||
import com.github.libretube.util.ExceptionHandler
|
import com.github.libretube.util.ExceptionHandler
|
||||||
import com.github.libretube.util.NotificationHelper
|
import com.github.libretube.util.NotificationHelper
|
||||||
import java.lang.Exception
|
|
||||||
|
|
||||||
class MyApp : Application() {
|
class MyApp : Application() {
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
@ -170,7 +169,8 @@ class MyApp : Application() {
|
|||||||
DatabaseHolder.db.watchHistoryDao().insertAll(
|
DatabaseHolder.db.watchHistoryDao().insertAll(
|
||||||
*watchHistoryItems.toTypedArray()
|
*watchHistoryItems.toTypedArray()
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {}
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
prefs.edit().putString("watch_history", "").commit()
|
prefs.edit().putString("watch_history", "").commit()
|
||||||
}
|
}
|
||||||
val legacyWatchPositions = prefs.getString("watch_positions", "")
|
val legacyWatchPositions = prefs.getString("watch_positions", "")
|
||||||
@ -181,7 +181,8 @@ class MyApp : Application() {
|
|||||||
DatabaseHolder.db.watchPositionDao().insertAll(
|
DatabaseHolder.db.watchPositionDao().insertAll(
|
||||||
*watchPositions.toTypedArray()
|
*watchPositions.toTypedArray()
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {}
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
prefs.edit().remove("watch_positions").commit()
|
prefs.edit().remove("watch_positions").commit()
|
||||||
}
|
}
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.github.libretube.util
|
package com.github.libretube.util
|
||||||
|
|
||||||
import java.util.*
|
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
class ResettableLazyManager {
|
class ResettableLazyManager {
|
||||||
// we synchronize to make sure the timing of a reset() call and new inits do not collide
|
// we synchronize to make sure the timing of a reset() call and new inits do not collide
|
||||||
|
@ -92,6 +92,7 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
|
|||||||
import com.google.android.exoplayer2.util.RepeatModeUtil
|
import com.google.android.exoplayer2.util.RepeatModeUtil
|
||||||
import com.google.android.exoplayer2.video.VideoSize
|
import com.google.android.exoplayer2.video.VideoSize
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
|
import kotlin.math.abs
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -99,7 +100,6 @@ import org.chromium.net.CronetEngine
|
|||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
class PlayerFragment : BaseFragment() {
|
class PlayerFragment : BaseFragment() {
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/addToPlaylist"
|
android:id="@+id/addToPlaylist"
|
||||||
style="@style/CustomDialogButton"
|
style="@style/CustomDialogButton"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/addToPlaylist" />
|
android:text="@string/addToPlaylist" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -14,22 +14,22 @@
|
|||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/playlistName">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/playlist_name"
|
android:id="@+id/playlist_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/playlistName"
|
android:inputType="text" />
|
||||||
android:inputType="text"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="end"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/create_new_playlist"
|
android:id="@+id/create_new_playlist"
|
||||||
style="@style/CustomDialogButton"
|
style="@style/CustomDialogButton"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/createPlaylist" />
|
android:text="@string/createPlaylist" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -14,37 +13,37 @@
|
|||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/instance_name">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/instanceName"
|
android:id="@+id/instanceName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/instance_name"
|
android:inputType="text" />
|
||||||
android:inputType="text"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/instance_frontend_url">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/instanceFrontendUrl"
|
android:id="@+id/instanceFrontendUrl"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/instance_frontend_url"
|
android:inputType="text" />
|
||||||
android:inputType="text"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/instance_api_url">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/instanceApiUrl"
|
android:id="@+id/instanceApiUrl"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/instance_api_url"
|
android:inputType="text" />
|
||||||
android:inputType="text"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -61,7 +60,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/addInstance"
|
android:id="@+id/addInstance"
|
||||||
style="@style/CustomDialogButton"
|
style="@style/CustomDialogButton"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/addInstance" />
|
android:text="@string/addInstance" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -13,22 +13,22 @@
|
|||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/password">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/delete_password"
|
android:id="@+id/delete_password"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/password"
|
android:inputType="textPassword" />
|
||||||
android:inputType="textPassword"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="end"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/delete_account_confirm"
|
android:id="@+id/delete_account_confirm"
|
||||||
style="@style/CustomDialogButton"
|
style="@style/CustomDialogButton"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/deleteAccount" />
|
android:text="@string/deleteAccount" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -14,33 +13,33 @@
|
|||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/username">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/username"
|
android:id="@+id/username"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/username"
|
android:inputType="text" />
|
||||||
android:inputType="text"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout style="@style/CustomDialogTextInputLayout">
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/CustomDialogTextInputLayout"
|
||||||
|
android:hint="@string/password">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/password"
|
android:id="@+id/password"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/password"
|
android:inputType="textPassword" />
|
||||||
android:inputType="textPassword"
|
|
||||||
android:padding="12dp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right"
|
android:gravity="end"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@ -51,7 +50,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/login"
|
android:id="@+id/login"
|
||||||
style="@style/CustomDialogButton"
|
style="@style/CustomDialogButton"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:text="@string/login" />
|
android:text="@string/login" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_gravity">right</item>
|
<item name="android:layout_gravity">end</item>
|
||||||
<item name="android:layout_marginBottom">8dp</item>
|
<item name="android:layout_marginBottom">8dp</item>
|
||||||
<item name="android:padding">8dp</item>
|
<item name="android:padding">8dp</item>
|
||||||
|
|
||||||
@ -73,16 +73,10 @@
|
|||||||
|
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="hintEnabled">false</item>
|
|
||||||
<item name="android:layout_marginLeft">15dp</item>
|
<item name="android:layout_marginLeft">15dp</item>
|
||||||
<item name="android:layout_marginRight">15dp</item>
|
<item name="android:layout_marginRight">15dp</item>
|
||||||
<item name="android:layout_marginTop">10dp</item>
|
<item name="android:layout_marginTop">5dp</item>
|
||||||
<item name="android:layout_marginBottom">5dp</item>
|
<item name="android:layout_marginBottom">10dp</item>
|
||||||
|
|
||||||
<item name="boxCornerRadiusBottomStart">15dp</item>
|
|
||||||
<item name="boxCornerRadiusBottomEnd">15dp</item>
|
|
||||||
<item name="boxCornerRadiusTopEnd">15dp</item>
|
|
||||||
<item name="boxCornerRadiusTopStart">15dp</item>
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user