mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 10:31:07 +00:00
Language chooser: use constants
This commit is contained in:
Binary file not shown.
@@ -13,6 +13,7 @@ import com.limelight.grid.AppGridAdapter;
|
||||
import com.limelight.nvstream.http.GfeHttpResponseException;
|
||||
import com.limelight.nvstream.http.NvApp;
|
||||
import com.limelight.nvstream.http.NvHTTP;
|
||||
import com.limelight.preferences.PreferenceConfiguration;
|
||||
import com.limelight.utils.Dialog;
|
||||
import com.limelight.utils.SpinnerDialog;
|
||||
import com.limelight.utils.UiHelper;
|
||||
@@ -53,8 +54,9 @@ public class AppView extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString("list_languages", "default");
|
||||
if (!locale.equals("default")) {
|
||||
String locale = prefs.getString(PreferenceConfiguration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
|
||||
@@ -88,8 +88,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString("list_languages", "default");
|
||||
if (!locale.equals("default")) {
|
||||
String locale = prefs.getString(PreferenceConfiguration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.limelight.nvstream.http.PairingManager;
|
||||
import com.limelight.nvstream.http.PairingManager.PairState;
|
||||
import com.limelight.nvstream.wol.WakeOnLanSender;
|
||||
import com.limelight.preferences.AddComputerManually;
|
||||
import com.limelight.preferences.PreferenceConfiguration;
|
||||
import com.limelight.preferences.StreamSettings;
|
||||
import com.limelight.utils.Dialog;
|
||||
import com.limelight.utils.UiHelper;
|
||||
@@ -152,8 +153,9 @@ public class PcView extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString("list_languages", "default");
|
||||
if (!locale.equals("default")) {
|
||||
String locale = prefs.getString(PreferenceConfiguration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ControllerHandler {
|
||||
private static final int EMULATED_SELECT_UP_DELAY_MS = 30;
|
||||
|
||||
private Vector2d inputVector = new Vector2d();
|
||||
private Vector2d normalizedInputVector = new Vector2d();
|
||||
//private Vector2d normalizedInputVector = new Vector2d();
|
||||
|
||||
private HashMap<String, ControllerMapping> mappings = new HashMap<String, ControllerMapping>();
|
||||
|
||||
@@ -236,6 +236,11 @@ public class ControllerHandler {
|
||||
mapping.isRemote = true;
|
||||
}
|
||||
}
|
||||
// NYKO Playpad has a fake hat that mimics the left stick for some reason
|
||||
else if (devName.contains("NYKO PLAYPAD")) {
|
||||
mapping.hatXAxis = -1;
|
||||
mapping.hatYAxis = -1;
|
||||
}
|
||||
}
|
||||
|
||||
LimeLog.info("Analog stick deadzone: "+mapping.leftStickDeadzoneRadius+" "+mapping.rightStickDeadzoneRadius);
|
||||
|
||||
@@ -133,8 +133,9 @@ public class AddComputerManually extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString("list_languages", "default");
|
||||
if (!locale.equals("default")) {
|
||||
String locale = prefs.getString(PreferenceConfiguration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PreferenceConfiguration {
|
||||
private static final String DISABLE_TOASTS_PREF_STRING = "checkbox_disable_warnings";
|
||||
private static final String HOST_AUDIO_PREF_STRING = "checkbox_host_audio";
|
||||
private static final String DEADZONE_PREF_STRING = "seekbar_deadzone";
|
||||
private static final String LANGUAGE_PREF_STRING = "list_languages";
|
||||
public static final String LANGUAGE_PREF_STRING = "list_languages";
|
||||
|
||||
private static final int BITRATE_DEFAULT_720_30 = 5;
|
||||
private static final int BITRATE_DEFAULT_720_60 = 10;
|
||||
@@ -28,7 +28,7 @@ public class PreferenceConfiguration {
|
||||
private static final boolean DEFAULT_DISABLE_TOASTS = false;
|
||||
private static final boolean DEFAULT_HOST_AUDIO = false;
|
||||
private static final int DEFAULT_DEADZONE = 15;
|
||||
private static final String DEFAULT_LANGUAGE = "default";
|
||||
public static final String DEFAULT_LANGUAGE = "default";
|
||||
|
||||
public static final int FORCE_HARDWARE_DECODER = -1;
|
||||
public static final int AUTOSELECT_DECODER = 0;
|
||||
|
||||
@@ -16,8 +16,9 @@ public class StreamSettings extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String locale = prefs.getString("list_languages", "default");
|
||||
if (!locale.equals("default")) {
|
||||
String locale = prefs.getString(PreferenceConfigration.LANGUAGE_PREF_STRING,
|
||||
PreferenceConfiguration.DEFAULT_LANGUAGE);
|
||||
if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
|
||||
Configuration config = new Configuration(getResources().getConfiguration());
|
||||
config.locale = new Locale(locale);
|
||||
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
|
||||
|
||||
Reference in New Issue
Block a user