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

Commit f450327b authored by Budi Kusmiantoro's avatar Budi Kusmiantoro
Browse files

Hide unused buttons, which will also disable talk back

Bug: 18013804
Change-Id: Ia38cca72ca08220b6e78b73e8ea4a6da9ffd9f9d
parent fdc03907
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.deskclock;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Bundle;
import android.util.AttributeSet;
@@ -109,7 +108,9 @@ public class TimerSetupView extends LinearLayout implements Button.OnClickListen
        mLeft = (Button)v4.findViewById(R.id.key_left);
        mNumbers[0] = (Button)v4.findViewById(R.id.key_middle);
        mRight = (Button)v4.findViewById(R.id.key_right);
        setLeftRightEnabled(false);

        mLeft.setVisibility(INVISIBLE);
        mRight.setVisibility(INVISIBLE);

        for (int i = 0; i < 10; i++) {
            mNumbers[i].setOnClickListener(this);
@@ -246,13 +247,4 @@ public class TimerSetupView extends LinearLayout implements Button.OnClickListen
        }
        initializeStartButtonVisibility();
    }

    protected void setLeftRightEnabled(boolean enabled) {
        mLeft.setEnabled(enabled);
        mRight.setEnabled(enabled);
        if (!enabled) {
            mLeft.setContentDescription(null);
            mRight.setContentDescription(null);
        }
    }
}