IME config fixups.
This commit is contained in:
parent
73cb566620
commit
ae5221947a
|
@ -29,6 +29,7 @@
|
||||||
<activity android:name=".browser.LazyPopupMenu"></activity>
|
<activity android:name=".browser.LazyPopupMenu"></activity>
|
||||||
<activity android:name=".browser.PopupMenuAbstract"></activity>
|
<activity android:name=".browser.PopupMenuAbstract"></activity>
|
||||||
<activity android:name=".browser.ReportIME"></activity>
|
<activity android:name=".browser.ReportIME"></activity>
|
||||||
|
<activity android:name=".browser.IMEActivity"></activity>
|
||||||
<activity android:name=".browser.HelpActivity"></activity>
|
<activity android:name=".browser.HelpActivity"></activity>
|
||||||
<activity android:name=".browser.FileWrapper"></activity>
|
<activity android:name=".browser.FileWrapper"></activity>
|
||||||
<activity android:name=".browser.DirectoryActivity"></activity>
|
<activity android:name=".browser.DirectoryActivity"></activity>
|
||||||
|
|
|
@ -123,10 +123,6 @@
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
<PreferenceScreen android:title="Input Options" >
|
<PreferenceScreen android:title="Input Options" >
|
||||||
<PreferenceCategory android:title="General" >
|
<PreferenceCategory android:title="General" >
|
||||||
<CheckBoxPreference android:title="Enable global configuration"
|
|
||||||
android:summary="Enable global settings for all cores. Leave disabled if you want per-core settings."
|
|
||||||
android:key="global_config_enable"
|
|
||||||
android:defaultValue="true"/>
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:entries="@array/back_options"
|
android:entries="@array/back_options"
|
||||||
android:entryValues="@array/back_options_values"
|
android:entryValues="@array/back_options_values"
|
||||||
|
@ -134,6 +130,17 @@
|
||||||
android:summary="Select how you want the Back button to behave."
|
android:summary="Select how you want the Back button to behave."
|
||||||
android:title="Back behavior" />
|
android:title="Back behavior" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="IME" >
|
||||||
|
<Preference
|
||||||
|
android:summary="Sets IME to be used in-game."
|
||||||
|
android:title="Set Input Method" >
|
||||||
|
<intent
|
||||||
|
android:targetClass="org.retroarch.browser.IMEActivity"
|
||||||
|
android:targetPackage="org.retroarch" />
|
||||||
|
</Preference>
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="Configuration Autodetect" >
|
<PreferenceCategory android:title="Configuration Autodetect" >
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
|
@ -468,6 +475,14 @@
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
<PreferenceScreen android:title="Settings" >
|
<PreferenceScreen android:title="Settings" >
|
||||||
|
<PreferenceCategory android:title="Configuration style" >
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="global_config_enable"
|
||||||
|
android:summary="Enable global settings for all cores. Leave disabled if you want per-core settings."
|
||||||
|
android:title="Enable global configuration" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="General" >
|
<PreferenceCategory android:title="General" >
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.retroarch.browser;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
|
public class IMEActivity extends Activity {
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.showInputMethodPicker();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
|
@ -83,7 +83,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
setCoreTitle(libretro_name);
|
setCoreTitle(libretro_name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
libretro_path = MainMenuActivity.getInstance().getApplicationInfo().nativeLibraryDir;
|
libretro_path = getInstance().getApplicationInfo().nativeLibraryDir;
|
||||||
libretro_name = "No core";
|
libretro_name = "No core";
|
||||||
setCoreTitle("No core");
|
setCoreTitle("No core");
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
public static final double getRefreshRate() {
|
public static final double getRefreshRate() {
|
||||||
double rate = 0;
|
double rate = 0;
|
||||||
SharedPreferences prefs = PreferenceManager
|
SharedPreferences prefs = PreferenceManager
|
||||||
.getDefaultSharedPreferences(MainMenuActivity.getInstance()
|
.getDefaultSharedPreferences(getInstance()
|
||||||
.getBaseContext());
|
.getBaseContext());
|
||||||
String refresh_rate = prefs.getString("video_refresh_rate", "");
|
String refresh_rate = prefs.getString("video_refresh_rate", "");
|
||||||
if (!refresh_rate.isEmpty()) {
|
if (!refresh_rate.isEmpty()) {
|
||||||
|
@ -129,10 +129,10 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
rate = Double.parseDouble(refresh_rate);
|
rate = Double.parseDouble(refresh_rate);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
Log.e(TAG, "Cannot parse: " + refresh_rate + " as a double!");
|
Log.e(TAG, "Cannot parse: " + refresh_rate + " as a double!");
|
||||||
rate = MainMenuActivity.getInstance().getDisplayRefreshRate();
|
rate = getInstance().getDisplayRefreshRate();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rate = MainMenuActivity.getInstance().getDisplayRefreshRate();
|
rate = getInstance().getDisplayRefreshRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "Using refresh rate: " + rate + " Hz.");
|
Log.i(TAG, "Using refresh rate: " + rate + " Hz.");
|
||||||
|
@ -199,13 +199,13 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
String external = System.getenv("EXTERNAL_STORAGE");
|
String external = System.getenv("EXTERNAL_STORAGE");
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
SharedPreferences prefs = PreferenceManager
|
||||||
.getDefaultSharedPreferences(MainMenuActivity.getInstance()
|
.getDefaultSharedPreferences(getInstance()
|
||||||
.getBaseContext());
|
.getBaseContext());
|
||||||
|
|
||||||
boolean global_config_enable = prefs.getBoolean("global_config_enable",
|
boolean global_config_enable = prefs.getBoolean("global_config_enable",
|
||||||
true);
|
true);
|
||||||
boolean config_same_as_native_lib_dir = libretro_path
|
boolean config_same_as_native_lib_dir = libretro_path
|
||||||
.equals(MainMenuActivity.getInstance().getApplicationInfo().nativeLibraryDir);
|
.equals(getInstance().getApplicationInfo().nativeLibraryDir);
|
||||||
String append_path;
|
String append_path;
|
||||||
if (!global_config_enable && (config_same_as_native_lib_dir == false)) {
|
if (!global_config_enable && (config_same_as_native_lib_dir == false)) {
|
||||||
String sanitized_name = libretro_path.substring(
|
String sanitized_name = libretro_path.substring(
|
||||||
|
@ -237,8 +237,8 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
else if (external != null
|
else if (external != null
|
||||||
&& new File(internal + append_path).canWrite())
|
&& new File(internal + append_path).canWrite())
|
||||||
return external + append_path;
|
return external + append_path;
|
||||||
else if ((MainMenuActivity.getInstance().getApplicationInfo().dataDir) != null)
|
else if ((getInstance().getApplicationInfo().dataDir) != null)
|
||||||
return (MainMenuActivity.getInstance().getApplicationInfo().dataDir)
|
return (getInstance().getApplicationInfo().dataDir)
|
||||||
+ append_path;
|
+ append_path;
|
||||||
else
|
else
|
||||||
// emergency fallback, all else failed
|
// emergency fallback, all else failed
|
||||||
|
@ -254,7 +254,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager
|
SharedPreferences prefs = PreferenceManager
|
||||||
.getDefaultSharedPreferences(MainMenuActivity.getInstance()
|
.getDefaultSharedPreferences(getInstance()
|
||||||
.getBaseContext());
|
.getBaseContext());
|
||||||
|
|
||||||
config.setString("libretro_path", libretro_path);
|
config.setString("libretro_path", libretro_path);
|
||||||
|
@ -323,7 +323,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
"0")));
|
"0")));
|
||||||
|
|
||||||
config.setDouble("video_refresh_rate",
|
config.setDouble("video_refresh_rate",
|
||||||
MainMenuActivity.getRefreshRate());
|
getRefreshRate());
|
||||||
config.setBoolean("video_threaded",
|
config.setBoolean("video_threaded",
|
||||||
prefs.getBoolean("video_threaded", true));
|
prefs.getBoolean("video_threaded", true));
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
boolean useOverlay = prefs.getBoolean("input_overlay_enable", true);
|
boolean useOverlay = prefs.getBoolean("input_overlay_enable", true);
|
||||||
if (useOverlay) {
|
if (useOverlay) {
|
||||||
String overlayPath = prefs
|
String overlayPath = prefs
|
||||||
.getString("input_overlay", (MainMenuActivity.getInstance()
|
.getString("input_overlay", (getInstance()
|
||||||
.getApplicationInfo().dataDir)
|
.getApplicationInfo().dataDir)
|
||||||
+ "/overlays/snes-landscape.cfg");
|
+ "/overlays/snes-landscape.cfg");
|
||||||
config.setString("input_overlay", overlayPath);
|
config.setString("input_overlay", overlayPath);
|
||||||
|
@ -382,7 +382,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
config.setBoolean("video_font_enable",
|
config.setBoolean("video_font_enable",
|
||||||
prefs.getBoolean("video_font_enable", true));
|
prefs.getBoolean("video_font_enable", true));
|
||||||
|
|
||||||
config.setString("game_history_path", MainMenuActivity.getInstance()
|
config.setString("game_history_path", getInstance()
|
||||||
.getApplicationInfo().dataDir + "/retroarch-history.txt");
|
.getApplicationInfo().dataDir + "/retroarch-history.txt");
|
||||||
|
|
||||||
for (int i = 1; i <= 4; i++) {
|
for (int i = 1; i <= 4; i++) {
|
||||||
|
@ -705,7 +705,7 @@ public class MainMenuActivity extends PreferenceActivity {
|
||||||
myIntent.putExtra("ROM", data.getStringExtra("PATH"));
|
myIntent.putExtra("ROM", data.getStringExtra("PATH"));
|
||||||
myIntent.putExtra("LIBRETRO", libretro_path);
|
myIntent.putExtra("LIBRETRO", libretro_path);
|
||||||
myIntent.putExtra("CONFIGFILE",
|
myIntent.putExtra("CONFIGFILE",
|
||||||
MainMenuActivity.getDefaultConfigPath());
|
getDefaultConfigPath());
|
||||||
myIntent.putExtra("IME", current_ime);
|
myIntent.putExtra("IME", current_ime);
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.retroarch.browser;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
@ -9,7 +10,27 @@ public class ReportIME extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
String current_ime = Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
|
String current_ime = Settings.Secure.getString(getContentResolver(),
|
||||||
new AlertDialog.Builder(this).setMessage(current_ime).setNeutralButton("Close", null).show();
|
Settings.Secure.DEFAULT_INPUT_METHOD);
|
||||||
|
|
||||||
|
final Activity ctx = this;
|
||||||
|
AlertDialog.Builder dialog = new AlertDialog.Builder(this)
|
||||||
|
.setMessage(current_ime)
|
||||||
|
.setNeutralButton("Close",
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int which) {
|
||||||
|
ctx.finish();
|
||||||
|
}
|
||||||
|
}).setCancelable(true)
|
||||||
|
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialog) {
|
||||||
|
ctx.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue