mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
reformat
This commit is contained in:
parent
ff16e14b33
commit
9f777b2493
@ -979,7 +979,8 @@ class PlayerFragment : BaseFragment() {
|
|||||||
try {
|
try {
|
||||||
position = DatabaseHolder.db.watchPositionDao().findById(videoId!!).position
|
position = DatabaseHolder.db.watchPositionDao().findById(videoId!!).position
|
||||||
if (position!! < streams.duration!! * 0.9) position = null
|
if (position!! < streams.duration!! * 0.9) position = null
|
||||||
} catch (e: Exception) {}
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
}.await()
|
}.await()
|
||||||
if (position != null) exoPlayer.seekTo(position!!)
|
if (position != null) exoPlayer.seekTo(position!!)
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,10 @@ class AppearanceSettings : MaterialPreferenceFragment() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
val legacySubscriptionView = findPreference<SwitchPreferenceCompat>(PreferenceKeys.LEGACY_SUBSCRIPTIONS)
|
val legacySubscriptionView =
|
||||||
val legacySubscriptionColumns = findPreference<ListPreference>(PreferenceKeys.LEGACY_SUBSCRIPTIONS_COLUMNS)
|
findPreference<SwitchPreferenceCompat>(PreferenceKeys.LEGACY_SUBSCRIPTIONS)
|
||||||
|
val legacySubscriptionColumns =
|
||||||
|
findPreference<ListPreference>(PreferenceKeys.LEGACY_SUBSCRIPTIONS_COLUMNS)
|
||||||
legacySubscriptionColumns?.isVisible = legacySubscriptionView?.isChecked!!
|
legacySubscriptionColumns?.isVisible = legacySubscriptionView?.isChecked!!
|
||||||
legacySubscriptionView.setOnPreferenceChangeListener { _, newValue ->
|
legacySubscriptionView.setOnPreferenceChangeListener { _, newValue ->
|
||||||
legacySubscriptionColumns?.isVisible = newValue as Boolean
|
legacySubscriptionColumns?.isVisible = newValue as Boolean
|
||||||
|
@ -38,7 +38,8 @@ class GeneralSettings : MaterialPreferenceFragment() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
val breakReminder = findPreference<SwitchPreferenceCompat>(PreferenceKeys.BREAK_REMINDER_TOGGLE)
|
val breakReminder =
|
||||||
|
findPreference<SwitchPreferenceCompat>(PreferenceKeys.BREAK_REMINDER_TOGGLE)
|
||||||
val breakReminderTime = findPreference<EditTextPreference>(PreferenceKeys.BREAK_REMINDER)
|
val breakReminderTime = findPreference<EditTextPreference>(PreferenceKeys.BREAK_REMINDER)
|
||||||
breakReminderTime?.isEnabled = PreferenceHelper.getBoolean(
|
breakReminderTime?.isEnabled = PreferenceHelper.getBoolean(
|
||||||
PreferenceKeys.BREAK_REMINDER_TOGGLE,
|
PreferenceKeys.BREAK_REMINDER_TOGGLE,
|
||||||
|
@ -90,14 +90,16 @@ class MainSettings : MaterialPreferenceFragment() {
|
|||||||
update?.setOnPreferenceClickListener {
|
update?.setOnPreferenceClickListener {
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
if (!NetworkHelper.isNetworkAvailable(requireContext())) {
|
if (!NetworkHelper.isNetworkAvailable(requireContext())) {
|
||||||
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.unknown_error)?.show()
|
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.unknown_error)
|
||||||
|
?.show()
|
||||||
return@launch
|
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
|
||||||
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.unknown_error)?.show()
|
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.unknown_error)
|
||||||
|
?.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)
|
||||||
@ -107,7 +109,8 @@ class MainSettings : MaterialPreferenceFragment() {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// otherwise show the no update available snackBar
|
// otherwise show the no update available snackBar
|
||||||
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.app_uptodate)?.show()
|
(activity as? SettingsActivity)?.binding?.root?.getStyledSnackBar(R.string.app_uptodate)
|
||||||
|
?.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
android:viewportHeight="512">
|
android:viewportHeight="512">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M256,428C203.65,428 144.61,416.39 98.07,397 81,389.81 66.38,378.18 54.43,369A4,4 0,0 0,48 372.18v12.58c0,28.07 23.49,53.22 66.14,70.82C152.29,471.33 202.67,480 256,480s103.7,-8.67 141.86,-24.42C440.51,438 464,412.83 464,384.76V372.18a4,4 0,0 0,-6.43 -3.18C445.62,378.17 431,389.81 413.92,397 367.38,416.39 308.35,428 256,428Z"/>
|
android:pathData="M256,428C203.65,428 144.61,416.39 98.07,397 81,389.81 66.38,378.18 54.43,369A4,4 0,0 0,48 372.18v12.58c0,28.07 23.49,53.22 66.14,70.82C152.29,471.33 202.67,480 256,480s103.7,-8.67 141.86,-24.42C440.51,438 464,412.83 464,384.76V372.18a4,4 0,0 0,-6.43 -3.18C445.62,378.17 431,389.81 413.92,397 367.38,416.39 308.35,428 256,428Z" />
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M464,126.51c-0.81,-27.65 -24.18,-52.4 -66,-69.85C359.74,40.76 309.34,32 256,32S152.26,40.76 114.09,56.66c-41.78,17.41 -65.15,42.11 -66,69.69L48,144c0,6.41 5.2,16.48 14.63,24.73 11.13,9.73 27.65,19.33 47.78,27.73C153.24,214.36 207.67,225 256,225s102.76,-10.68 145.59,-28.58c20.13,-8.4 36.65,-18 47.78,-27.73C458.8,160.49 464,150.42 464,144Z"/>
|
android:pathData="M464,126.51c-0.81,-27.65 -24.18,-52.4 -66,-69.85C359.74,40.76 309.34,32 256,32S152.26,40.76 114.09,56.66c-41.78,17.41 -65.15,42.11 -66,69.69L48,144c0,6.41 5.2,16.48 14.63,24.73 11.13,9.73 27.65,19.33 47.78,27.73C153.24,214.36 207.67,225 256,225s102.76,-10.68 145.59,-28.58c20.13,-8.4 36.65,-18 47.78,-27.73C458.8,160.49 464,150.42 464,144Z" />
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M413.92,226C367.39,245.43 308.35,257 256,257S144.61,245.43 98.07,226C81,218.85 66.38,207.21 54.43,198A4,4 0,0 0,48 201.22V232c0,6.41 5.2,14.48 14.63,22.73 11.13,9.74 27.65,19.33 47.78,27.74C153.24,300.34 207.67,311 256,311s102.76,-10.68 145.59,-28.57c20.13,-8.41 36.65,-18 47.78,-27.74C458.8,246.47 464,238.41 464,232V201.22a4,4 0,0 0,-6.43 -3.18C445.62,207.21 431,218.85 413.92,226Z"/>
|
android:pathData="M413.92,226C367.39,245.43 308.35,257 256,257S144.61,245.43 98.07,226C81,218.85 66.38,207.21 54.43,198A4,4 0,0 0,48 201.22V232c0,6.41 5.2,14.48 14.63,22.73 11.13,9.74 27.65,19.33 47.78,27.74C153.24,300.34 207.67,311 256,311s102.76,-10.68 145.59,-28.57c20.13,-8.41 36.65,-18 47.78,-27.74C458.8,246.47 464,238.41 464,232V201.22a4,4 0,0 0,-6.43 -3.18C445.62,207.21 431,218.85 413.92,226Z" />
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M413.92,312C367.38,331.41 308.35,343 256,343S144.61,331.41 98.07,312C81,304.83 66.38,293.19 54.43,284A4,4 0,0 0,48 287.2V317c0,6.41 5.2,14.47 14.62,22.71 11.13,9.74 27.66,19.33 47.79,27.74C153.24,385.32 207.66,396 256,396s102.76,-10.68 145.59,-28.57c20.13,-8.41 36.65,-18 47.78,-27.74C458.8,331.44 464,323.37 464,317V287.2a4,4 0,0 0,-6.43 -3.18C445.62,293.19 431,304.83 413.92,312Z"/>
|
android:pathData="M413.92,312C367.38,331.41 308.35,343 256,343S144.61,331.41 98.07,312C81,304.83 66.38,293.19 54.43,284A4,4 0,0 0,48 287.2V317c0,6.41 5.2,14.47 14.62,22.71 11.13,9.74 27.66,19.33 47.79,27.74C153.24,385.32 207.66,396 256,396s102.76,-10.68 145.59,-28.57c20.13,-8.41 36.65,-18 47.78,-27.74C458.8,331.44 464,323.37 464,317V287.2a4,4 0,0 0,-6.43 -3.18C445.62,293.19 431,304.83 413.92,312Z" />
|
||||||
</vector>
|
</vector>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search"
|
android:id="@+id/action_search"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user