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
15
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
596cfd08
Commit
596cfd08
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Set app locale in background
parent
8b0f5dc1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/VLCApplication.java
+17
-11
17 additions, 11 deletions
vlc-android/src/org/videolan/vlc/VLCApplication.java
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+0
-2
0 additions, 2 deletions
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
with
17 additions
and
13 deletions
vlc-android/src/org/videolan/vlc/VLCApplication.java
+
17
−
11
View file @
596cfd08
...
...
@@ -21,14 +21,10 @@ package org.videolan.vlc;
import
android.annotation.SuppressLint
;
import
android.app.Application
;
import
androidx.lifecycle.Lifecycle
;
import
androidx.lifecycle.ProcessLifecycleOwner
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
androidx.fragment.app.DialogFragment
;
import
androidx.collection.SimpleArrayMap
;
import
android.util.Log
;
import
org.videolan.libvlc.Dialog
;
...
...
@@ -49,6 +45,11 @@ import java.lang.ref.WeakReference;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Calendar
;
import
androidx.collection.SimpleArrayMap
;
import
androidx.fragment.app.DialogFragment
;
import
androidx.lifecycle.Lifecycle
;
import
androidx.lifecycle.ProcessLifecycleOwner
;
import
static
org
.
videolan
.
vlc
.
gui
.
helpers
.
UiTools
.
setLocale
;
public
class
VLCApplication
extends
Application
{
...
...
@@ -76,10 +77,15 @@ public class VLCApplication extends Application {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
locale
=
Settings
.
INSTANCE
.
getInstance
(
this
).
getString
(
"set_locale"
,
""
);
WorkersKt
.
runIO
(
new
Runnable
()
{
@Override
public
void
run
()
{
locale
=
Settings
.
INSTANCE
.
getInstance
(
instance
).
getString
(
"set_locale"
,
""
);
// Set the locale for API < 24 and set application resources and direction for API >=24
setLocale
(
getAppContext
());
// Set the locale for API < 24 and set application resources and direction for API >=24
setLocale
(
getAppContext
());
}
});
WorkersKt
.
runIO
(
new
Runnable
()
{
@Override
...
...
@@ -129,10 +135,10 @@ public class VLCApplication extends Application {
else
{
try
{
instance
=
(
VLCApplication
)
Class
.
forName
(
"android.app.ActivityThread"
).
getDeclaredMethod
(
"currentApplication"
).
invoke
(
null
);
}
catch
(
IllegalAccessException
e
)
{}
catch
(
InvocationTargetException
e
)
{}
catch
(
NoSuchMethodException
e
)
{}
catch
(
ClassNotFoundException
e
)
{}
}
catch
(
IllegalAccessException
ignored
)
{}
catch
(
InvocationTargetException
ignored
)
{}
catch
(
NoSuchMethodException
ignored
)
{}
catch
(
ClassNotFoundException
ignored
)
{}
return
instance
;
}
}
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+
0
−
2
View file @
596cfd08
...
...
@@ -25,13 +25,11 @@ import android.content.ComponentName;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.database.Cursor
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.IBinder
;
import
android.view.KeyEvent
;
import
android.view.MenuItem
;
import
android.widget.FilterQueryProvider
;
import
com.google.android.material.navigation.NavigationView
;
...
...
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