Android: Close keyboard when editing complete
This commit is contained in:
parent
72f11223f7
commit
f51f04ba9a
|
@ -149,8 +149,8 @@ public class OptionsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE
|
if (actionId == EditorInfo.IME_ACTION_DONE
|
||||||
|| (event.getAction() == KeyEvent.ACTION_DOWN
|
|| (event.getKeyCode() == KeyEvent.KEYCODE_ENTER
|
||||||
&& event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
&& event.getAction() == KeyEvent.ACTION_DOWN)) {
|
||||||
if (event == null || !event.isShiftPressed()) {
|
if (event == null || !event.isShiftPressed()) {
|
||||||
if (v.getText() != null) {
|
if (v.getText() != null) {
|
||||||
home_directory = v.getText().toString();
|
home_directory = v.getText().toString();
|
||||||
|
@ -163,10 +163,11 @@ public class OptionsFragment extends Fragment {
|
||||||
JNIdc.config(home_directory);
|
JNIdc.config(home_directory);
|
||||||
new LocateThemes(OptionsFragment.this).execute(home_directory + "/themes");
|
new LocateThemes(OptionsFragment.this).execute(home_directory + "/themes");
|
||||||
}
|
}
|
||||||
return true; // consume.
|
hideSoftKeyBoard();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // pass on to other listeners.
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -220,17 +221,18 @@ public class OptionsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE
|
if (actionId == EditorInfo.IME_ACTION_DONE
|
||||||
|| (event.getAction() == KeyEvent.ACTION_DOWN
|
|| (event.getKeyCode() == KeyEvent.KEYCODE_ENTER
|
||||||
&& event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
&& event.getAction() == KeyEvent.ACTION_DOWN)) {
|
||||||
if (event == null || !event.isShiftPressed()) {
|
if (event == null || !event.isShiftPressed()) {
|
||||||
if (v.getText() != null) {
|
if (v.getText() != null) {
|
||||||
game_directory = v.getText().toString();
|
game_directory = v.getText().toString();
|
||||||
mPrefs.edit().putString(Config.pref_games, game_directory).apply();
|
mPrefs.edit().putString(Config.pref_games, game_directory).apply();
|
||||||
}
|
}
|
||||||
return true; // consume.
|
hideSoftKeyBoard();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // pass on to other listeners.
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -414,18 +416,19 @@ public class OptionsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE
|
if (actionId == EditorInfo.IME_ACTION_DONE
|
||||||
|| (event.getAction() == KeyEvent.ACTION_DOWN
|
|| (event.getKeyCode() == KeyEvent.KEYCODE_ENTER
|
||||||
&& event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
&& event.getAction() == KeyEvent.ACTION_DOWN)) {
|
||||||
if (event == null || !event.isShiftPressed()) {
|
if (event == null || !event.isShiftPressed()) {
|
||||||
if (v.getText() != null) {
|
if (v.getText() != null) {
|
||||||
int frames = Integer.parseInt(v.getText().toString());
|
int frames = Integer.parseInt(v.getText().toString());
|
||||||
frameSeek.setProgress(frames);
|
frameSeek.setProgress(frames);
|
||||||
mPrefs.edit().putInt(Emulator.pref_frameskip, frames).apply();
|
mPrefs.edit().putInt(Emulator.pref_frameskip, frames).apply();
|
||||||
}
|
}
|
||||||
return true; // consume.
|
hideSoftKeyBoard();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // pass on to other listeners.
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -455,8 +458,8 @@ public class OptionsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE
|
if (actionId == EditorInfo.IME_ACTION_DONE
|
||||||
|| (event.getAction() == KeyEvent.ACTION_DOWN
|
|| (event.getKeyCode() == KeyEvent.KEYCODE_ENTER
|
||||||
&& event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
&& event.getAction() == KeyEvent.ACTION_DOWN)) {
|
||||||
if (event == null || !event.isShiftPressed()) {
|
if (event == null || !event.isShiftPressed()) {
|
||||||
if (v.getText() != "null") {
|
if (v.getText() != "null") {
|
||||||
String disk = v.getText().toString();
|
String disk = v.getText().toString();
|
||||||
|
@ -476,10 +479,11 @@ public class OptionsFragment extends Fragment {
|
||||||
v.setText(disk);
|
v.setText(disk);
|
||||||
Emulator.bootdisk = disk;
|
Emulator.bootdisk = disk;
|
||||||
}
|
}
|
||||||
return true; // consume.
|
hideSoftKeyBoard();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // pass on to other listeners.
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -447,16 +447,16 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_destroy(JNIEnv *env,j
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_diskSwap(JNIEnv *env,jobject obj)
|
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_diskSwap(JNIEnv *env,jobject obj)
|
||||||
{
|
{
|
||||||
|
if (settings.imgread.LoadDefaultImage == 1) {
|
||||||
if (!gamedisk) settings.imgread.DefaultImage[0] = '\0';
|
if (!gamedisk) settings.imgread.DefaultImage[0] = '\0';
|
||||||
else {
|
else {
|
||||||
printf("Got URI: '%s'\n", gamedisk);
|
printf("Got URI: '%s'\n", gamedisk);
|
||||||
strncpy(settings.imgread.DefaultImage, gamedisk, sizeof(settings.imgread.DefaultImage));
|
strncpy(settings.imgread.DefaultImage, gamedisk, sizeof(settings.imgread.DefaultImage));
|
||||||
settings.imgread.DefaultImage[sizeof(settings.imgread.DefaultImage) - 1] = '\0';
|
settings.imgread.DefaultImage[sizeof(settings.imgread.DefaultImage) - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.imgread.LoadDefaultImage = 1;
|
|
||||||
DiscSwap();
|
DiscSwap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vmuSwap(JNIEnv *env,jobject obj)
|
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vmuSwap(JNIEnv *env,jobject obj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue