mirror of
https://github.com/yuliskov/LeanKeyboard.git
synced 2026-06-12 01:24:16 -04:00
string upd
This commit is contained in:
@@ -278,7 +278,7 @@ public class LeanbackImeService extends InputMethodService {
|
||||
// FireTV fix
|
||||
@Override
|
||||
public boolean onShowInputRequested(int flags, boolean configChange) {
|
||||
return true;
|
||||
return mForceShowKbd || super.onShowInputRequested(flags, configChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,14 +26,22 @@ public class BaseSettingsFragment extends GuidedStepSupportFragment {
|
||||
void onClick();
|
||||
}
|
||||
|
||||
protected void addCheckedAction(int resId, GetChecked getChecked, OnChecked onChecked) {
|
||||
addCheckedAction(getString(resId), getChecked, onChecked);
|
||||
protected void addCheckedAction(int titleResId, int descResId, GetChecked getChecked, OnChecked onChecked) {
|
||||
addCheckedAction(getString(titleResId), getString(descResId), getChecked, onChecked);
|
||||
}
|
||||
|
||||
protected void addCheckedAction(int titleRedId, GetChecked getChecked, OnChecked onChecked) {
|
||||
addCheckedAction(getString(titleRedId), getChecked, onChecked);
|
||||
}
|
||||
|
||||
protected void addCheckedAction(String title, GetChecked getChecked, OnChecked onChecked) {
|
||||
mCheckedActions.put(mId++, new CheckedAction(title, getChecked, onChecked));
|
||||
}
|
||||
|
||||
protected void addCheckedAction(String title, String desc, GetChecked getChecked, OnChecked onChecked) {
|
||||
mCheckedActions.put(mId++, new CheckedAction(title, desc, getChecked, onChecked));
|
||||
}
|
||||
|
||||
protected void addNextAction(int resId, OnClick onClick) {
|
||||
mNextActions.put(mId++, new NextAction(resId, onClick));
|
||||
}
|
||||
@@ -49,14 +57,6 @@ public class BaseSettingsFragment extends GuidedStepSupportFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void addNextItem(long id, NextAction nextAction, List<GuidedAction> actions) {
|
||||
GuidedAction action = new GuidedAction.Builder(getActivity())
|
||||
.id(id)
|
||||
.hasNext(true)
|
||||
.title(nextAction.getResId()).build();
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuidedActionClicked(GuidedAction action) {
|
||||
CheckedAction checkedAction = mCheckedActions.get(action.getId());
|
||||
@@ -72,6 +72,14 @@ public class BaseSettingsFragment extends GuidedStepSupportFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void addNextItem(long id, NextAction nextAction, List<GuidedAction> actions) {
|
||||
GuidedAction action = new GuidedAction.Builder(getActivity())
|
||||
.id(id)
|
||||
.hasNext(true)
|
||||
.title(nextAction.getResId()).build();
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
private void addCheckedItem(long id, CheckedAction checkedAction, List<GuidedAction> actions) {
|
||||
GuidedAction action = new GuidedAction.Builder(getActivity())
|
||||
.checked(checkedAction.isChecked())
|
||||
@@ -79,16 +87,27 @@ public class BaseSettingsFragment extends GuidedStepSupportFragment {
|
||||
.id(id)
|
||||
.title(checkedAction.getTitle())
|
||||
.build();
|
||||
|
||||
if (checkedAction.getDesc() != null) {
|
||||
action.setDescription(checkedAction.getDesc());
|
||||
}
|
||||
|
||||
actions.add(action);
|
||||
}
|
||||
|
||||
private static class CheckedAction {
|
||||
private final String mDesc;
|
||||
private final GetChecked mGetChecked;
|
||||
private final OnChecked mOnChecked;
|
||||
private final String mTitle;
|
||||
|
||||
public CheckedAction(String title, GetChecked getChecked, OnChecked onChecked) {
|
||||
this(title, null, getChecked, onChecked);
|
||||
}
|
||||
|
||||
public CheckedAction(String title, String desc, GetChecked getChecked, OnChecked onChecked) {
|
||||
mTitle = title;
|
||||
mDesc = desc;
|
||||
mGetChecked = getChecked;
|
||||
mOnChecked = onChecked;
|
||||
}
|
||||
@@ -97,6 +116,10 @@ public class BaseSettingsFragment extends GuidedStepSupportFragment {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return mDesc;
|
||||
}
|
||||
|
||||
public boolean isChecked() {
|
||||
return mGetChecked.getChecked();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class MiscFragment extends BaseSettingsFragment {
|
||||
super.onAttach(context);
|
||||
|
||||
mPrefs = LeanKeySettings.instance(getActivity());
|
||||
addCheckedAction(R.string.keep_on_screen, mPrefs::getForceShowKeyboard, mPrefs::setForceShowKeyboard);
|
||||
addCheckedAction(R.string.keep_on_screen, R.string.keep_on_screen_desc, mPrefs::getForceShowKeyboard, mPrefs::setForceShowKeyboard);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
<string name="about_desc">Über die Applikation</string>
|
||||
<string name="about">Über</string>
|
||||
<string name="enable_kb_in_system_prefs">Sie müssen %s in den Systemeinstellungen aktivieren</string>
|
||||
<string name="keep_on_screen">Auf dem Display einblenden, wenn die physische Tastatur aktiv ist</string>
|
||||
<string name="keep_on_screen_desc">Auf dem Display einblenden, wenn die physische Tastatur aktiv ist</string>
|
||||
<string name="keep_on_screen">Auf dem Display einblenden</string>
|
||||
<string name="misc">Andere</string>
|
||||
<string name="misc_desc">Andere Einstellungen</string>
|
||||
</resources>
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
<string name="enable_kb_in_system_prefs">Вам нужно включить %s в Системных настройках</string>
|
||||
<string name="about">О приложении</string>
|
||||
<string name="about_desc">О приложении</string>
|
||||
<string name="keep_on_screen">Показывать на экране вместе физической</string>
|
||||
<string name="keep_on_screen">Показывать на экране</string>
|
||||
<string name="keep_on_screen_desc">Показывать на экране вместе физической</string>
|
||||
<string name="misc">Разное</string>
|
||||
<string name="misc_desc">Разные настройки</string>
|
||||
</resources>
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
<string name="enable_kb_in_system_prefs">You need to enable %s in System Preferences</string>
|
||||
<string name="about">About</string>
|
||||
<string name="about_desc">About Application</string>
|
||||
<string name="keep_on_screen">Keep it on screen while physical keyboard is active</string>
|
||||
<string name="keep_on_screen_desc">Keep it on screen while physical keyboard is active</string>
|
||||
<string name="misc">Misc</string>
|
||||
<string name="misc_desc">Misc Settings</string>
|
||||
<string name="keep_on_screen">Keep on Screen</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user