[Android] Remove the need for IMEActivity. We can also do this within InputPreferenceFragment.

This commit is contained in:
Lioncash 2013-10-15 10:40:15 -04:00
parent 9121aea91e
commit b1a48dea51
4 changed files with 18 additions and 22 deletions

View File

@ -26,7 +26,6 @@
<category android:name="tv.ouya.intent.category.GAME" />
</intent-filter>
</activity>
<activity android:name=".browser.IMEActivity"/>
<activity android:name=".browser.HelpActivity"/>
<activity android:name=".browser.FileWrapper"/>
<activity android:name=".browser.RetroTVMode"/>

View File

@ -12,12 +12,9 @@
<PreferenceCategory android:title="@string/ime" >
<Preference
android:key="set_ime_pref"
android:summary="@string/ime_method_desc"
android:title="@string/ime_method" >
<intent
android:targetClass="org.retroarch.browser.IMEActivity"
android:targetPackage="org.retroarch" />
</Preference>
android:title="@string/ime_method" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/config_autodetect" >

View File

@ -1,16 +0,0 @@
package org.retroarch.browser;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.inputmethod.InputMethodManager;
public final class IMEActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
finish();
}
}

View File

@ -4,10 +4,12 @@ import org.retroarch.R;
import org.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.provider.Settings;
import android.view.inputmethod.InputMethodManager;
/**
* A {@link PreferenceListFragment} responsible for handling the input preferences.
@ -22,6 +24,20 @@ public final class InputPreferenceFragment extends PreferenceListFragment
// Add input preferences from the XML.
addPreferencesFromResource(R.xml.input_preferences);
// Set Input Method preference
final Preference setImePref = findPreference("set_ime_pref");
setImePref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
// Show an IME picker so the user can change their set IME.
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
return true;
}
});
// Report IME preference
final Preference reportImePref = findPreference("report_ime_pref");
reportImePref.setOnPreferenceClickListener(new OnPreferenceClickListener()