Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12d80ebe authored by Dan Zivkovic's avatar Dan Zivkovic
Browse files

Remove shortcut support from LatinIME.

Note this change does not affect the native decoder interface.

Change-Id: I73b7dc008a5acaf75a31a36a2d332b5afabd82d0
parent 2979fad2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -16,11 +16,20 @@

package com.android.inputmethod.latin.common;

import android.os.Build;

import com.android.inputmethod.annotations.UsedForTesting;

import javax.annotation.Nonnull;

public final class Constants {

    public static final boolean JELLY_BEAN_OR_HIGHER =
            Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;

    public static final boolean JELLY_BEAN_MR1_OR_HIGHER =
            Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;

    public static final class Color {
        /**
         * The alpha value for fully opaque.
+0 −20
Original line number Diff line number Diff line
@@ -43,26 +43,6 @@
        android:layout_marginStart="8dip"
        android:columnCount="2" >

        <TextView
            android:id="@+id/user_dictionary_add_shortcut_label"
            style="?android:attr/textAppearanceSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start|center_vertical"
            android:text="@string/user_dict_settings_add_shortcut_option_name" />

        <EditText
            android:id="@+id/user_dictionary_add_shortcut"
            android:layout_width="wrap_content"
            android:layout_gravity="fill_horizontal|center_vertical"
            android:layout_marginBottom="8dip"
            android:layout_marginStart="8dip"
            android:layout_marginTop="8dip"
            android:hint="@string/user_dict_settings_add_shortcut_hint"
            android:imeOptions="flagNoFullscreen"
            android:inputType="textNoSuggestions"
            android:maxLength="@integer/config_user_dictionary_max_word_length" />

        <TextView
            android:id="@+id/user_dictionary_add_locale_label"
            style="?android:attr/textAppearanceSmall"
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.compat.SettingsSecureCompatUtils;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.common.Constants;
import com.android.inputmethod.latin.utils.InputTypeUtils;

public final class AccessibilityUtils {
@@ -221,7 +222,7 @@ public final class AccessibilityUtils {

        // Platforms starting at SDK version 16 (Build.VERSION_CODES.JELLY_BEAN) should use
        // announce events.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        if (Constants.JELLY_BEAN_OR_HIGHER) {
            event.setEventType(AccessibilityEventCompat.TYPE_ANNOUNCEMENT);
        } else {
            event.setEventType(AccessibilityEvent.TYPE_VIEW_FOCUSED);
+2 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public final class InputMethodSubtypeCompatUtils {
                    int.class, int.class, String.class, String.class, String.class, boolean.class,
                    boolean.class, int.class);
    static {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        if (Constants.JELLY_BEAN_MR1_OR_HIGHER) {
            if (CONSTRUCTOR_INPUT_METHOD_SUBTYPE == null) {
                android.util.Log.w(TAG, "Warning!!! Constructor is not defined.");
            }
@@ -59,8 +59,7 @@ public final class InputMethodSubtypeCompatUtils {
    public static InputMethodSubtype newInputMethodSubtype(int nameId, int iconId, String locale,
            String mode, String extraValue, boolean isAuxiliary,
            boolean overridesImplicitlyEnabledSubtype, int id) {
        if (CONSTRUCTOR_INPUT_METHOD_SUBTYPE == null
                || Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
        if (CONSTRUCTOR_INPUT_METHOD_SUBTYPE == null || !Constants.JELLY_BEAN_MR1_OR_HIGHER) {
            return new InputMethodSubtype(nameId, iconId, locale, mode, extraValue, isAuxiliary,
                    overridesImplicitlyEnabledSubtype);
        }
+3 −2
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@
package com.android.inputmethod.compat;

import android.app.Notification;
import android.os.Build;

import com.android.inputmethod.latin.common.Constants;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -73,7 +74,7 @@ public class NotificationCompatUtils {

    @SuppressWarnings("deprecation")
    public static Notification build(final Notification.Builder builder) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        if (Constants.JELLY_BEAN_OR_HIGHER) {
            // #build was added in API level 16, JELLY_BEAN
            return (Notification) CompatUtils.invoke(builder, null, METHOD_build);
        }
Loading