mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-26 20:51:33 +02:00
Always show the keyboard switching key
Android's shouldOfferSwitchingToNextInputMethod() method might return false when an other IME is installed, perhaps when the other IME doesn't specify android:supportsSwitchingToNextInputMethod="true".
This commit is contained in:
parent
70d777253c
commit
0a86f9ab01
@ -61,7 +61,6 @@ public final class Config
|
|||||||
public boolean pin_entry_enabled;
|
public boolean pin_entry_enabled;
|
||||||
|
|
||||||
// Dynamically set
|
// Dynamically set
|
||||||
public boolean shouldOfferSwitchingToNextInputMethod;
|
|
||||||
public boolean shouldOfferVoiceTyping;
|
public boolean shouldOfferVoiceTyping;
|
||||||
public String actionLabel; // Might be 'null'
|
public String actionLabel; // Might be 'null'
|
||||||
public int actionId; // Meaningful only when 'actionLabel' isn't 'null'
|
public int actionId; // Meaningful only when 'actionLabel' isn't 'null'
|
||||||
@ -88,7 +87,6 @@ public final class Config
|
|||||||
// from prefs
|
// from prefs
|
||||||
refresh(res);
|
refresh(res);
|
||||||
// initialized later
|
// initialized later
|
||||||
shouldOfferSwitchingToNextInputMethod = false;
|
|
||||||
shouldOfferVoiceTyping = false;
|
shouldOfferVoiceTyping = false;
|
||||||
actionLabel = null;
|
actionLabel = null;
|
||||||
actionId = 0;
|
actionId = 0;
|
||||||
@ -238,8 +236,6 @@ public final class Config
|
|||||||
switch (key.getEvent())
|
switch (key.getEvent())
|
||||||
{
|
{
|
||||||
case CHANGE_METHOD_PICKER:
|
case CHANGE_METHOD_PICKER:
|
||||||
if (!shouldOfferSwitchingToNextInputMethod)
|
|
||||||
return null;
|
|
||||||
if (switch_input_immediate)
|
if (switch_input_immediate)
|
||||||
return KeyValue.getKeyByName("change_method_prev");
|
return KeyValue.getKeyByName("change_method_prev");
|
||||||
return key;
|
return key;
|
||||||
|
@ -136,8 +136,6 @@ public class Keyboard2 extends InputMethodService
|
|||||||
for (InputMethodSubtype s : enabled_subtypes)
|
for (InputMethodSubtype s : enabled_subtypes)
|
||||||
extra_keys.add(extra_keys_of_subtype(s));
|
extra_keys.add(extra_keys_of_subtype(s));
|
||||||
_config.extra_keys_subtype = ExtraKeys.merge(extra_keys);
|
_config.extra_keys_subtype = ExtraKeys.merge(extra_keys);
|
||||||
if (enabled_subtypes.size() > 1)
|
|
||||||
_config.shouldOfferSwitchingToNextInputMethod = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InputMethodManager get_imm()
|
InputMethodManager get_imm()
|
||||||
@ -148,10 +146,6 @@ public class Keyboard2 extends InputMethodService
|
|||||||
private void refreshSubtypeImm()
|
private void refreshSubtypeImm()
|
||||||
{
|
{
|
||||||
InputMethodManager imm = get_imm();
|
InputMethodManager imm = get_imm();
|
||||||
if (VERSION.SDK_INT < 28)
|
|
||||||
_config.shouldOfferSwitchingToNextInputMethod = true;
|
|
||||||
else
|
|
||||||
_config.shouldOfferSwitchingToNextInputMethod = shouldOfferSwitchingToNextInputMethod();
|
|
||||||
_config.shouldOfferVoiceTyping = true;
|
_config.shouldOfferVoiceTyping = true;
|
||||||
KeyboardData default_layout = null;
|
KeyboardData default_layout = null;
|
||||||
_config.extra_keys_subtype = null;
|
_config.extra_keys_subtype = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user