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

Commit e67e3903 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I0e699465,If2bc354f

* changes:
  Remove mSupportsLongpress from KeyButtonView
  Remove keyRepeat from KeyButtonView
parents b587d291 d41b41f3
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@
    <declare-styleable name="KeyButtonView">
        <!-- key code to send when pressed; if absent or 0, no key is sent -->
        <attr name="keyCode" format="integer" />
        <!-- does this button generate longpress / repeat events? -->
        <attr name="keyRepeat" format="boolean" />
        <!-- Should this button play sound effects, default true -->
        <attr name="playSound" format="boolean" />
        <attr name="android:contentDescription" />
+2 −4
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
    private int mTouchDownX;
    private int mTouchDownY;
    private boolean mIsVertical;
    private boolean mSupportsLongpress = true;
    private AudioManager mAudioManager;
    private boolean mGestureAborted;
    private boolean mLongClicked;
@@ -83,7 +82,7 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
                    // Just an old-fashioned ImageView
                    performLongClick();
                    mLongClicked = true;
                } else if (mSupportsLongpress) {
                } else {
                    sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS);
                    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
                    mLongClicked = true;
@@ -104,7 +103,6 @@ public class KeyButtonView extends ImageView implements ButtonInterface {

        mCode = a.getInteger(R.styleable.KeyButtonView_keyCode, KEYCODE_UNKNOWN);

        mSupportsLongpress = a.getBoolean(R.styleable.KeyButtonView_keyRepeat, true);
        mPlaySounds = a.getBoolean(R.styleable.KeyButtonView_playSound, true);

        TypedValue value = new TypedValue();
@@ -166,7 +164,7 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
        super.onInitializeAccessibilityNodeInfo(info);
        if (mCode != KEYCODE_UNKNOWN) {
            info.addAction(new AccessibilityNodeInfo.AccessibilityAction(ACTION_CLICK, null));
            if (mSupportsLongpress || isLongClickable()) {
            if (isLongClickable()) {
                info.addAction(
                        new AccessibilityNodeInfo.AccessibilityAction(ACTION_LONG_CLICK, null));
            }