commit 8023d16ce8ca9ca53858cc860c80437720b1cf76 Author: n8fr8 nathan@freitas.net Date: Thu Feb 7 15:24:01 2013 +0700
updated locale handling to stop flashing --- AndroidManifest.xml | 9 +++++---- src/org/torproject/android/OrbotApp.java | 15 +++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0fa75da..2df28d5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,22 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.torproject.android" - android:versionName="0.2.3.23-rc-1.0.11-RC6" - android:versionCode="52" + android:versionName="0.2.3.25-1.0.12-alpha-1" + android:versionCode="53" android:installLocation="auto" > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> - <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="15"/> + <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="17"/> + <application android:name=".OrbotApp" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:configChanges="locale|orientation|screenSize" android:theme="@style/Theme.Sherlock" >
- <activity android:name=".Orbot" android:configChanges="locale|orientation|screenSize"> + <activity android:name=".Orbot" android:configChanges="orientation|screenSize"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/src/org/torproject/android/OrbotApp.java b/src/org/torproject/android/OrbotApp.java index 66a1e9a..d470afb 100644 --- a/src/org/torproject/android/OrbotApp.java +++ b/src/org/torproject/android/OrbotApp.java @@ -35,10 +35,14 @@ public class OrbotApp extends Application implements TorConstants locale = new Locale(lang); Locale.setDefault(locale); - config.locale = locale; - getResources().updateConfiguration(config, getResources().getDisplayMetrics()); + + Configuration myConfig = new Configuration(config); + myConfig.locale = locale; + + getResources().updateConfiguration(myConfig, getResources().getDisplayMetrics()); }
+ } @Override @@ -51,9 +55,12 @@ public class OrbotApp extends Application implements TorConstants if (! "".equals(lang) && ! newConfig.locale.getLanguage().equals(lang)) { locale = new Locale(lang); - newConfig.locale = locale; Locale.setDefault(locale); - getResources().updateConfiguration(newConfig, getResources().getDisplayMetrics()); + + Configuration myConfig = new Configuration(newConfig); + myConfig.locale = locale; + + getResources().updateConfiguration(myConfig, getResources().getDisplayMetrics()); } } }
tor-commits@lists.torproject.org