mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 14:02:44 +00:00
allow customizing more layouts (number, phone, numpad, ...)
This commit is contained in:
parent
71cfe3fbef
commit
2dfc824319
96 changed files with 128 additions and 185 deletions
|
@ -528,26 +528,16 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
};
|
||||
}
|
||||
|
||||
public static String readSymbolsLayoutName(final Context context, final Locale locale) {
|
||||
/** @return custom layout name if there is one for the given layout, else returns "layout" */
|
||||
public static String readLayoutName(final String layout, final Context context) {
|
||||
String[] layouts = getLayoutsDir(context).list();
|
||||
if (layouts != null) {
|
||||
for (String name : layouts) {
|
||||
if (name.startsWith(CustomLayoutUtilsKt.CUSTOM_LAYOUT_PREFIX + "symbols"))
|
||||
if (name.startsWith(CustomLayoutUtilsKt.CUSTOM_LAYOUT_PREFIX + layout + "."))
|
||||
return name;
|
||||
}
|
||||
}
|
||||
return ScriptUtils.script(locale).equals(ScriptUtils.SCRIPT_ARABIC) ? "symbols_arabic" : "symbols";
|
||||
}
|
||||
|
||||
public static String readShiftedSymbolsLayoutName(final Context context) {
|
||||
String[] layouts = getLayoutsDir(context).list();
|
||||
if (layouts != null) {
|
||||
for (String name : layouts) {
|
||||
if (name.startsWith(CustomLayoutUtilsKt.CUSTOM_LAYOUT_PREFIX + "shift_symbols"))
|
||||
return name;
|
||||
}
|
||||
}
|
||||
return "symbols_shifted";
|
||||
return layout;
|
||||
}
|
||||
|
||||
public static File getLayoutsDir(final Context context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue