Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ class KeyboardLayoutSet internal constructor(private val mContext: Context, priv
}
InputType.TYPE_CLASS_PHONE -> KeyboardMode.PHONE
InputType.TYPE_CLASS_TEXT ->
if (InputTypeUtils.isEmailVariation(variation)) KeyboardMode.EMAIL
if (!Settings.getValues().mUrlEmailLayout) KeyboardMode.TEXT
else if (InputTypeUtils.isEmailVariation(variation)) KeyboardMode.EMAIL
else if (variation == InputType.TYPE_TEXT_VARIATION_URI) KeyboardMode.URL
else KeyboardMode.TEXT
else -> KeyboardMode.TEXT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ object Defaults {
const val PREF_POPUP_KEYS_HINT_ORDER = POPUP_KEYS_LABEL_DEFAULT
const val PREF_SHOW_POPUP_HINTS = false
const val PREF_SHOW_TLD_POPUP_KEYS = true
const val PREF_URL_EMAIL_LAYOUT = true
const val PREF_MORE_POPUP_KEYS = "main"
const val PREF_SPACE_TO_CHANGE_LANG = true
const val PREF_LANGUAGE_SWIPE_DISTANCE = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static final String PREF_SHOW_POPUP_HINTS = "show_popup_hints";
public static final String PREF_MORE_POPUP_KEYS = "more_popup_keys";
public static final String PREF_SHOW_TLD_POPUP_KEYS = "show_tld_popup_keys";
public static final String PREF_URL_EMAIL_LAYOUT = "url_email_layout";

public static final String PREF_SPACE_TO_CHANGE_LANG = "prefs_long_press_keyboard_to_change_lang";
public static final String PREF_LANGUAGE_SWIPE_DISTANCE = "language_swipe_distance";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class SettingsValues {
public final boolean mShowsHints;
public final boolean mShowsPopupHints;
public final boolean mShowTldPopupKeys;
public final boolean mUrlEmailLayout;
public final boolean mSpaceForLangChange;
public final boolean mShowsEmojiKey;
public final boolean mVarToolbarDirection;
Expand Down Expand Up @@ -211,6 +212,7 @@ public SettingsValues(final Context context, final SharedPreferences prefs, fina
mShowsHints = prefs.getBoolean(Settings.PREF_SHOW_HINTS, Defaults.PREF_SHOW_HINTS);
mShowsPopupHints = prefs.getBoolean(Settings.PREF_SHOW_POPUP_HINTS, Defaults.PREF_SHOW_POPUP_HINTS);
mShowTldPopupKeys = prefs.getBoolean(Settings.PREF_SHOW_TLD_POPUP_KEYS, Defaults.PREF_SHOW_TLD_POPUP_KEYS);
mUrlEmailLayout = prefs.getBoolean(Settings.PREF_URL_EMAIL_LAYOUT, Defaults.PREF_URL_EMAIL_LAYOUT);
mSpaceForLangChange = prefs.getBoolean(Settings.PREF_SPACE_TO_CHANGE_LANG, Defaults.PREF_SPACE_TO_CHANGE_LANG);
mShowsEmojiKey = prefs.getBoolean(Settings.PREF_SHOW_EMOJI_KEY, Defaults.PREF_SHOW_EMOJI_KEY);
mVarToolbarDirection = mToolbarMode != ToolbarMode.HIDDEN && prefs.getBoolean(Settings.PREF_VARIABLE_TOOLBAR_DIRECTION, Defaults.PREF_VARIABLE_TOOLBAR_DIRECTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fun PreferencesScreen(
Settings.PREF_POPUP_KEYS_ORDER,
Settings.PREF_SHOW_POPUP_HINTS,
Settings.PREF_SHOW_TLD_POPUP_KEYS,
Settings.PREF_URL_EMAIL_LAYOUT,
Settings.PREF_POPUP_ON,
if (AudioAndHapticFeedbackManager.getInstance().hasVibrator())
Settings.PREF_VIBRATE_ON else null,
Expand Down Expand Up @@ -109,6 +110,12 @@ fun createPreferencesSettings(context: Context) = listOf(
) {
SwitchPreference(it, Defaults.PREF_SHOW_TLD_POPUP_KEYS) { KeyboardSwitcher.getInstance().setThemeNeedsReload() }
},
Setting(
context, Settings.PREF_URL_EMAIL_LAYOUT, R.string.url_email_layout,
R.string.url_email_layout_summary
) {
SwitchPreference(it, Defaults.PREF_URL_EMAIL_LAYOUT) { KeyboardSwitcher.getInstance().setThemeNeedsReload() }
},
Setting(context, Settings.PREF_SHOW_POPUP_HINTS, R.string.show_popup_hints, R.string.show_popup_hints_summary) {
SwitchPreference(it, Defaults.PREF_SHOW_POPUP_HINTS) { KeyboardSwitcher.getInstance().setThemeNeedsReload() }
},
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@
<string name="subtype_baishakhi_bn_IN">%s (Baisakhi)</string>
<string name="show_tld_popup_keys">Zeige TLD-Popup-Tasten</string>
<string name="show_tld_popup_keys_summary">Ersetze Punkt-Tastenpopups mit Top-Level-Domains wenn URLs und Mailadressen eingegeben werden</string>
<string name="url_email_layout">Layout für URL- und E-Mail-Felder anpassen</string>
<string name="url_email_layout_summary">Zeige in URL-Feldern eine Schrägstrich-Taste und in E-Mail-Feldern eine @-Taste (anstelle des Kommas) samt passender Popup-Tasten. Deaktivieren, um immer das normale Layout zu behalten.</string>
<string name="prefs_always_show_suggestions_except_web_text">Nicht immer Vorschläge für Web-Editierfelder anzeigen</string>
<string name="layout_number_row_basic" tools:keep="@string/layout_number_row_basic">Zahlenreihe (Basis)</string>
<string name="prefs_always_show_suggestions_except_web_text_summary">Web-Eingabefelder (meist in Browsern) sind eine häufige Ursache für Probleme mit der Einstellung \"Immer Vorschläge anzeigen\"</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@
<string name="show_tld_popup_keys">Show TLD popup keys</string>
<!-- Description of the setting to show TLD popup keys -->
<string name="show_tld_popup_keys_summary">Replace period key popups with top level domains when typing URLs and email addresses</string>
<!-- Title of the setting to adapt the keyboard layout in URL and email input fields -->
<string name="url_email_layout">Adapt layout for URL and email fields</string>
<!-- Description of the setting to adapt the keyboard layout in URL and email input fields -->
<string name="url_email_layout_summary">Show a slash key in URL fields and an @ key in email fields (in place of the comma), and matching popup keys. Disable to always keep the normal layout.</string>
<!-- Names of the popup key classes -->
<string name="popup_keys_number" tools:keep="@string/popup_keys_number">Number row</string>
<string name="popup_keys_language" translatable="false" tools:keep="@string/popup_keys_language">@string/subtype_locale</string>
Expand Down