Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
096ae5bb
Commit
096ae5bb
authored
5 years ago
by
Nicolas Pomepuy
Committed by
Geoffrey Métais
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Migrate app theme settings
parent
3539249c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!254
Allow skipping resuming video playback + settings migration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
+1
-8
1 addition, 8 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
vlc-android/src/org/videolan/vlc/util/SettingsMigration.kt
+11
-0
11 additions, 0 deletions
vlc-android/src/org/videolan/vlc/util/SettingsMigration.kt
with
12 additions
and
8 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
+
1
−
8
View file @
096ae5bb
...
...
@@ -674,12 +674,5 @@ fun BaseActivity.applyTheme() {
setTheme
(
R
.
style
.
Theme_VLC_Black
)
return
}
if
(
settings
.
contains
(
KEY_APP_THEME
))
{
AppCompatDelegate
.
setDefaultNightMode
(
Integer
.
valueOf
(
settings
.
getString
(
KEY_APP_THEME
,
"-1"
)
!!
))
}
else
if
(
settings
.
contains
(
KEY_DAYNIGHT
)
||
settings
.
contains
(
KEY_BLACK_THEME
))
{
// legacy support
val
daynight
=
settings
.
getBoolean
(
KEY_DAYNIGHT
,
false
)
val
dark
=
settings
.
getBoolean
(
KEY_BLACK_THEME
,
false
)
val
mode
=
if
(
dark
)
AppCompatDelegate
.
MODE_NIGHT_YES
else
if
(
daynight
)
AppCompatDelegate
.
MODE_NIGHT_AUTO
else
AppCompatDelegate
.
MODE_NIGHT_NO
AppCompatDelegate
.
setDefaultNightMode
(
mode
)
}
AppCompatDelegate
.
setDefaultNightMode
(
Integer
.
valueOf
(
settings
.
getString
(
KEY_APP_THEME
,
"-1"
)
!!
))
}
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/util/SettingsMigration.kt
+
11
−
0
View file @
096ae5bb
...
...
@@ -27,6 +27,7 @@ package org.videolan.vlc.util
import
android.content.Context
import
android.content.SharedPreferences
import
android.util.Log
import
androidx.appcompat.app.AppCompatDelegate
import
org.videolan.vlc.BuildConfig
object
SettingsMigration
{
...
...
@@ -43,11 +44,21 @@ object SettingsMigration {
private
fun
migrateToVersion3030000
(
settings
:
SharedPreferences
)
{
Log
.
i
(
this
::
class
.
java
.
simpleName
,
"Migrating preferences to 3030000"
)
val
editor
=
settings
.
edit
()
//Migrate video Resume confirmation
val
dialogConfirmResume
=
settings
.
getBoolean
(
"dialog_confirm_resume"
,
false
)
if
(
dialogConfirmResume
)
{
editor
.
putString
(
KEY_VIDEO_CONFIRM_RESUME
,
"2"
)
}
editor
.
remove
(
"dialog_confirm_resume"
)
//Migrate apptheme
if
(!
settings
.
contains
(
KEY_APP_THEME
))
{
val
daynight
=
settings
.
getBoolean
(
"daynight"
,
false
)
val
dark
=
settings
.
getBoolean
(
"enable_black_theme"
,
false
)
val
mode
=
if
(
dark
)
AppCompatDelegate
.
MODE_NIGHT_YES
else
if
(
daynight
)
AppCompatDelegate
.
MODE_NIGHT_AUTO
else
AppCompatDelegate
.
MODE_NIGHT_NO
editor
.
putString
(
KEY_APP_THEME
,
mode
.
toString
())
}
editor
.
remove
(
"daynight"
).
remove
(
"enable_black_theme"
)
editor
.
apply
()
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment