mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Merge pull request #1065 from Bnyro/master
Resize Mode Pref & Better Dialogs & SnackBars
This commit is contained in:
commit
cb14f0a161
@ -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()
|
||||||
|
@ -13,8 +13,8 @@ import com.github.libretube.WEBLATE_URL
|
|||||||
import com.github.libretube.WEBSITE_URL
|
import com.github.libretube.WEBSITE_URL
|
||||||
import com.github.libretube.databinding.ActivityAboutBinding
|
import com.github.libretube.databinding.ActivityAboutBinding
|
||||||
import com.github.libretube.extensions.BaseActivity
|
import com.github.libretube.extensions.BaseActivity
|
||||||
|
import com.github.libretube.extensions.showSnackBar
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import com.google.android.material.snackbar.Snackbar
|
|
||||||
|
|
||||||
class AboutActivity : BaseActivity() {
|
class AboutActivity : BaseActivity() {
|
||||||
private lateinit var binding: ActivityAboutBinding
|
private lateinit var binding: ActivityAboutBinding
|
||||||
@ -29,8 +29,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
openLinkFromHref(WEBSITE_URL)
|
openLinkFromHref(WEBSITE_URL)
|
||||||
}
|
}
|
||||||
binding.website.setOnLongClickListener {
|
binding.website.setOnLongClickListener {
|
||||||
val text = getString(R.string.website_summary)
|
binding.root.showSnackBar(R.string.website_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +37,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
openLinkFromHref(PIPED_GITHUB_URL)
|
openLinkFromHref(PIPED_GITHUB_URL)
|
||||||
}
|
}
|
||||||
binding.piped.setOnLongClickListener {
|
binding.piped.setOnLongClickListener {
|
||||||
val text = getString(R.string.piped_summary)
|
binding.root.showSnackBar(R.string.piped_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,8 +45,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
openLinkFromHref(WEBLATE_URL)
|
openLinkFromHref(WEBLATE_URL)
|
||||||
}
|
}
|
||||||
binding.translate.setOnLongClickListener {
|
binding.translate.setOnLongClickListener {
|
||||||
val text = getString(R.string.translate_summary)
|
binding.root.showSnackBar(R.string.translate_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,8 +53,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
openLinkFromHref(DONATE_URL)
|
openLinkFromHref(DONATE_URL)
|
||||||
}
|
}
|
||||||
binding.donate.setOnLongClickListener {
|
binding.donate.setOnLongClickListener {
|
||||||
val text = getString(R.string.donate_summary)
|
binding.root.showSnackBar(R.string.donate_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,8 +61,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
openLinkFromHref(GITHUB_URL)
|
openLinkFromHref(GITHUB_URL)
|
||||||
}
|
}
|
||||||
binding.github.setOnLongClickListener {
|
binding.github.setOnLongClickListener {
|
||||||
val text = getString(R.string.contributing_summary)
|
binding.root.showSnackBar(R.string.contributing_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,8 +69,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
showLicense()
|
showLicense()
|
||||||
}
|
}
|
||||||
binding.license.setOnLongClickListener {
|
binding.license.setOnLongClickListener {
|
||||||
val text = getString(R.string.license_summary)
|
binding.root.showSnackBar(R.string.license_summary)
|
||||||
showSnackBar(text)
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,16 +80,6 @@ class AboutActivity : BaseActivity() {
|
|||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showSnackBar(text: String) {
|
|
||||||
val snackBar = Snackbar
|
|
||||||
.make(binding.root, text, Snackbar.LENGTH_LONG)
|
|
||||||
|
|
||||||
// prevent the text from being partially hidden
|
|
||||||
snackBar.setTextMaxLines(3)
|
|
||||||
|
|
||||||
snackBar.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showLicense() {
|
private fun showLicense() {
|
||||||
val licenseString = assets
|
val licenseString = assets
|
||||||
?.open("gpl3.html")
|
?.open("gpl3.html")
|
||||||
|
@ -5,9 +5,9 @@ import android.os.Bundle
|
|||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.databinding.ActivityNointernetBinding
|
import com.github.libretube.databinding.ActivityNointernetBinding
|
||||||
import com.github.libretube.extensions.BaseActivity
|
import com.github.libretube.extensions.BaseActivity
|
||||||
|
import com.github.libretube.extensions.showSnackBar
|
||||||
import com.github.libretube.util.ConnectionHelper
|
import com.github.libretube.util.ConnectionHelper
|
||||||
import com.github.libretube.util.ThemeHelper
|
import com.github.libretube.util.ThemeHelper
|
||||||
import com.google.android.material.snackbar.Snackbar
|
|
||||||
|
|
||||||
class NoInternetActivity : BaseActivity() {
|
class NoInternetActivity : BaseActivity() {
|
||||||
private lateinit var binding: ActivityNointernetBinding
|
private lateinit var binding: ActivityNointernetBinding
|
||||||
@ -21,9 +21,7 @@ class NoInternetActivity : BaseActivity() {
|
|||||||
if (ConnectionHelper.isNetworkAvailable(this)) {
|
if (ConnectionHelper.isNetworkAvailable(this)) {
|
||||||
ThemeHelper.restartMainActivity(this)
|
ThemeHelper.restartMainActivity(this)
|
||||||
} else {
|
} else {
|
||||||
val snackBar = Snackbar
|
binding.root.showSnackBar(R.string.turnInternetOn)
|
||||||
.make(binding.root, R.string.turnInternetOn, Snackbar.LENGTH_LONG)
|
|
||||||
snackBar.show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.noInternetSettingsImageView.setOnClickListener {
|
binding.noInternetSettingsImageView.setOnClickListener {
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.github.libretube.extensions
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import com.github.libretube.R
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
|
||||||
|
fun View.showSnackBar(text: Int) {
|
||||||
|
val snackBar = Snackbar.make(this, text, Snackbar.LENGTH_SHORT)
|
||||||
|
snackBar.setTextMaxLines(3)
|
||||||
|
snackBar.animationMode = Snackbar.ANIMATION_MODE_SLIDE
|
||||||
|
|
||||||
|
val params = snackBar.view.layoutParams as FrameLayout.LayoutParams
|
||||||
|
val sideMargin = 70
|
||||||
|
|
||||||
|
params.setMargins(
|
||||||
|
sideMargin,
|
||||||
|
params.topMargin,
|
||||||
|
sideMargin,
|
||||||
|
sideMargin + 50
|
||||||
|
)
|
||||||
|
snackBar.view.layoutParams = params
|
||||||
|
|
||||||
|
snackBar.view.background = resources.getDrawable(R.drawable.snackbar_shape, null)
|
||||||
|
snackBar.show()
|
||||||
|
}
|
@ -168,6 +168,7 @@ class PlayerFragment : BaseFragment() {
|
|||||||
private var sponsorBlockNotifications = true
|
private var sponsorBlockNotifications = true
|
||||||
private var skipButtonsEnabled = false
|
private var skipButtonsEnabled = false
|
||||||
private var pipEnabled = true
|
private var pipEnabled = true
|
||||||
|
private var resizeModePref = "fit"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* for autoplay
|
* for autoplay
|
||||||
@ -336,6 +337,11 @@ class PlayerFragment : BaseFragment() {
|
|||||||
PreferenceKeys.PICTURE_IN_PICTURE,
|
PreferenceKeys.PICTURE_IN_PICTURE,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
resizeModePref = PreferenceHelper.getString(
|
||||||
|
PreferenceKeys.PLAYER_RESIZE_MODE,
|
||||||
|
"fit"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initializeTransitionLayout() {
|
private fun initializeTransitionLayout() {
|
||||||
@ -513,13 +519,9 @@ class PlayerFragment : BaseFragment() {
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAspectRatioClicked() {
|
override fun onResizeModeClicked() {
|
||||||
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
||||||
val aspectRatioModeNames = arrayOf(
|
val aspectRatioModeNames = context?.resources?.getStringArray(R.array.resizeMode)
|
||||||
context?.getString(R.string.resize_mode_fit),
|
|
||||||
context?.getString(R.string.resize_mode_zoom),
|
|
||||||
context?.getString(R.string.resize_mode_fill)
|
|
||||||
)
|
|
||||||
|
|
||||||
val aspectRatioModes = arrayOf(
|
val aspectRatioModes = arrayOf(
|
||||||
AspectRatioFrameLayout.RESIZE_MODE_FIT,
|
AspectRatioFrameLayout.RESIZE_MODE_FIT,
|
||||||
@ -605,7 +607,7 @@ class PlayerFragment : BaseFragment() {
|
|||||||
context.getString(R.string.repeat_mode_none)
|
context.getString(R.string.repeat_mode_none)
|
||||||
} else context.getString(R.string.repeat_mode_current)
|
} else context.getString(R.string.repeat_mode_current)
|
||||||
// set the aspect ratio mode
|
// set the aspect ratio mode
|
||||||
currentAspectRatio = when (exoPlayerView.resizeMode) {
|
currentResizeMode = when (exoPlayerView.resizeMode) {
|
||||||
AspectRatioFrameLayout.RESIZE_MODE_FIT -> context.getString(R.string.resize_mode_fit)
|
AspectRatioFrameLayout.RESIZE_MODE_FIT -> context.getString(R.string.resize_mode_fit)
|
||||||
AspectRatioFrameLayout.RESIZE_MODE_FILL -> context.getString(R.string.resize_mode_fill)
|
AspectRatioFrameLayout.RESIZE_MODE_FILL -> context.getString(R.string.resize_mode_fill)
|
||||||
else -> context.getString(R.string.resize_mode_zoom)
|
else -> context.getString(R.string.resize_mode_zoom)
|
||||||
@ -979,6 +981,11 @@ class PlayerFragment : BaseFragment() {
|
|||||||
controllerHideOnTouch = true
|
controllerHideOnTouch = true
|
||||||
useController = false
|
useController = false
|
||||||
player = exoPlayer
|
player = exoPlayer
|
||||||
|
resizeMode = when (resizeModePref) {
|
||||||
|
"fill" -> AspectRatioFrameLayout.RESIZE_MODE_FILL
|
||||||
|
"zoom" -> AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
||||||
|
else -> AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useSystemCaptionStyle) {
|
if (useSystemCaptionStyle) {
|
||||||
|
@ -10,7 +10,7 @@ interface PlayerOptionsInterface {
|
|||||||
|
|
||||||
fun onPlaybackSpeedClicked()
|
fun onPlaybackSpeedClicked()
|
||||||
|
|
||||||
fun onAspectRatioClicked()
|
fun onResizeModeClicked()
|
||||||
|
|
||||||
fun onRepeatModeClicked()
|
fun onRepeatModeClicked()
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,10 @@ import com.github.libretube.BuildConfig
|
|||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.activities.SettingsActivity
|
import com.github.libretube.activities.SettingsActivity
|
||||||
import com.github.libretube.dialogs.UpdateDialog
|
import com.github.libretube.dialogs.UpdateDialog
|
||||||
|
import com.github.libretube.extensions.showSnackBar
|
||||||
import com.github.libretube.update.UpdateChecker
|
import com.github.libretube.update.UpdateChecker
|
||||||
|
import com.github.libretube.util.ConnectionHelper
|
||||||
import com.github.libretube.views.MaterialPreferenceFragment
|
import com.github.libretube.views.MaterialPreferenceFragment
|
||||||
import com.google.android.material.snackbar.Snackbar
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -85,32 +86,25 @@ class MainSettings : MaterialPreferenceFragment() {
|
|||||||
// checking for update: yes -> dialog, no -> snackBar
|
// checking for update: yes -> dialog, no -> snackBar
|
||||||
update?.setOnPreferenceClickListener {
|
update?.setOnPreferenceClickListener {
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
if (!ConnectionHelper.isNetworkAvailable(requireContext())) {
|
||||||
|
(activity as SettingsActivity).binding.root.showSnackBar(R.string.unknown_error)
|
||||||
|
return@launch
|
||||||
|
}
|
||||||
// check for update
|
// check for update
|
||||||
val updateInfo = UpdateChecker.getLatestReleaseInfo()
|
val updateInfo = UpdateChecker.getLatestReleaseInfo()
|
||||||
if (updateInfo?.name == null) {
|
if (updateInfo?.name == null) {
|
||||||
// request failed
|
// request failed
|
||||||
val settingsActivity = activity as SettingsActivity
|
(activity as SettingsActivity).binding.root.showSnackBar(R.string.unknown_error)
|
||||||
val snackBar = Snackbar
|
|
||||||
.make(
|
|
||||||
settingsActivity.binding.root,
|
|
||||||
R.string.unknown_error,
|
|
||||||
Snackbar.LENGTH_SHORT
|
|
||||||
)
|
|
||||||
snackBar.show()
|
|
||||||
} else if (BuildConfig.VERSION_NAME != updateInfo.name) {
|
} else if (BuildConfig.VERSION_NAME != updateInfo.name) {
|
||||||
// show the UpdateAvailableDialog if there's an update available
|
// show the UpdateAvailableDialog if there's an update available
|
||||||
val updateAvailableDialog = UpdateDialog(updateInfo)
|
val updateAvailableDialog = UpdateDialog(updateInfo)
|
||||||
updateAvailableDialog.show(childFragmentManager, UpdateDialog::class.java.name)
|
updateAvailableDialog.show(
|
||||||
|
childFragmentManager,
|
||||||
|
UpdateDialog::class.java.name
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
// otherwise show the no update available snackBar
|
// otherwise show the no update available snackBar
|
||||||
val settingsActivity = activity as SettingsActivity
|
(activity as SettingsActivity).binding.root.showSnackBar(R.string.app_uptodate)
|
||||||
val snackBar = Snackbar
|
|
||||||
.make(
|
|
||||||
settingsActivity.binding.root,
|
|
||||||
R.string.app_uptodate,
|
|
||||||
Snackbar.LENGTH_SHORT
|
|
||||||
)
|
|
||||||
snackBar.show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
@ -67,6 +67,7 @@ object PreferenceKeys {
|
|||||||
const val DEFAULT_SUBTITLE = "default_subtitle"
|
const val DEFAULT_SUBTITLE = "default_subtitle"
|
||||||
const val SKIP_BUTTONS = "skip_buttons"
|
const val SKIP_BUTTONS = "skip_buttons"
|
||||||
const val PICTURE_IN_PICTURE = "picture_in_picture"
|
const val PICTURE_IN_PICTURE = "picture_in_picture"
|
||||||
|
const val PLAYER_RESIZE_MODE = "player_resize_mode"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Background mode
|
* Background mode
|
||||||
|
@ -25,7 +25,7 @@ class PlayerOptionsBottomSheet : BottomSheetDialogFragment() {
|
|||||||
var currentAutoplayMode: String? = null
|
var currentAutoplayMode: String? = null
|
||||||
var currentRepeatMode: String? = null
|
var currentRepeatMode: String? = null
|
||||||
var currentQuality: String? = null
|
var currentQuality: String? = null
|
||||||
var currentAspectRatio: String? = null
|
var currentResizeMode: String? = null
|
||||||
var currentCaptions: String? = null
|
var currentCaptions: String? = null
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
@ -67,10 +67,10 @@ class PlayerOptionsBottomSheet : BottomSheetDialogFragment() {
|
|||||||
|
|
||||||
binding.repeatMode.updateText(currentRepeatMode)
|
binding.repeatMode.updateText(currentRepeatMode)
|
||||||
|
|
||||||
binding.aspectRatio.updateText(currentAspectRatio)
|
binding.resizeMode.updateText(currentResizeMode)
|
||||||
|
|
||||||
binding.aspectRatio.setOnClickListener {
|
binding.resizeMode.setOnClickListener {
|
||||||
playerOptionsInterface.onAspectRatioClicked()
|
playerOptionsInterface.onResizeModeClicked()
|
||||||
this.dismiss()
|
this.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
app/src/main/res/drawable/ic_zoom.xml
Normal file
10
app/src/main/res/drawable/ic_zoom.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:tint="?attr/colorControlNormal"
|
||||||
|
android:viewportWidth="48"
|
||||||
|
android:viewportHeight="48">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M6,42L6,30.5h3v6.35l7.4,-7.4 2.15,2.15 -7.4,7.4h6.35v3ZM30.5,42v-3h6.35l-7.35,-7.35 2.15,-2.15L39,36.85L39,30.5h3L42,42ZM16.35,18.5 L9,11.15v6.35L6,17.5L6,6h11.5v3h-6.35l7.35,7.35ZM31.65,18.5 L29.5,16.35L36.85,9L30.5,9L30.5,6L42,6v11.5h-3v-6.35Z" />
|
||||||
|
</vector>
|
6
app/src/main/res/drawable/snackbar_shape.xml
Normal file
6
app/src/main/res/drawable/snackbar_shape.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="?attr/colorSurface" />
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
</shape>
|
@ -39,8 +39,8 @@
|
|||||||
app:drawableStartCompat="@drawable/ic_repeat" />
|
app:drawableStartCompat="@drawable/ic_repeat" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/aspectRatio"
|
android:id="@+id/resizeMode"
|
||||||
style="@style/BottomSheetItem"
|
style="@style/BottomSheetItem"
|
||||||
android:text="@string/aspect_ratio"
|
android:text="@string/player_resize_mode"
|
||||||
app:drawableStartCompat="@drawable/ic_aspect_ratio" />
|
app:drawableStartCompat="@drawable/ic_aspect_ratio" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -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>
|
||||||
|
@ -846,4 +846,16 @@
|
|||||||
<item>120</item>
|
<item>120</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="resizeMode">
|
||||||
|
<item>@string/resize_mode_fit</item>
|
||||||
|
<item>@string/resize_mode_zoom</item>
|
||||||
|
<item>@string/resize_mode_fill</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="resizeModeValues">
|
||||||
|
<item>fit</item>
|
||||||
|
<item>zoom</item>
|
||||||
|
<item>fill</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -313,4 +313,5 @@
|
|||||||
<string name="backup_restore">Backup & restore</string>
|
<string name="backup_restore">Backup & restore</string>
|
||||||
<string name="backup">Backup</string>
|
<string name="backup">Backup</string>
|
||||||
<string name="picture_in_picture">Picture in Picture</string>
|
<string name="picture_in_picture">Picture in Picture</string>
|
||||||
|
<string name="player_resize_mode">Resize mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
@ -77,6 +77,15 @@
|
|||||||
app:key="default_subtitle"
|
app:key="default_subtitle"
|
||||||
app:title="@string/default_subtitle_language" />
|
app:title="@string/default_subtitle_language" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="fit"
|
||||||
|
android:entries="@array/resizeMode"
|
||||||
|
android:entryValues="@array/resizeModeValues"
|
||||||
|
android:icon="@drawable/ic_zoom"
|
||||||
|
app:key="player_resize_mode"
|
||||||
|
app:title="@string/player_resize_mode"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:icon="@drawable/ic_next"
|
android:icon="@drawable/ic_next"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user