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

Commit 89b86937 authored by Budi Kusmiantoro's avatar Budi Kusmiantoro
Browse files

Add talkback to Stopwatch tab

Bug: 17829919

The 3 buttons at the bottom are shared across the 4 tabs. Missing
talkback on Stopwatch tab would cause contentdescription from any
last visited tab to be used instead.

Change-Id: I62aedc71276d3520c42d196819377e703eb39138
parent 273e5dfd
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -875,8 +875,14 @@ public class StopwatchFragment extends DeskClockFragment
    @Override
    public void setFabAppearance(ImageButton fab) {
        mFab = fab;
        mFab.setImageResource(mState == Stopwatches.STOPWATCH_RUNNING ? R.drawable.ic_fab_pause :
                R.drawable.ic_fab_play);

        if (mState == Stopwatches.STOPWATCH_RUNNING) {
            mFab.setImageResource(R.drawable.ic_fab_pause);
            mFab.setContentDescription(getString(R.string.sw_stop_button));
        } else {
            mFab.setImageResource(R.drawable.ic_fab_play);
            mFab.setContentDescription(getString(R.string.sw_start_button));
        }
        mFab.setVisibility(View.VISIBLE);
    }

@@ -888,8 +894,16 @@ public class StopwatchFragment extends DeskClockFragment
                View.VISIBLE);
        mRightButton.setVisibility(mState == Stopwatches.STOPWATCH_RESET ||
                mState == Stopwatches.STOPWATCH_RUNNING ? View.INVISIBLE : View.VISIBLE);
        mLeftButton.setImageResource(mState == Stopwatches.STOPWATCH_RUNNING ? R.drawable.ic_lap :
                R.drawable.ic_reset);

        if (mState == Stopwatches.STOPWATCH_RUNNING) {
            mLeftButton.setImageResource(R.drawable.ic_lap);
            mLeftButton.setContentDescription(getString(R.string.sw_lap_button));
        } else {
            mLeftButton.setImageResource(R.drawable.ic_reset);
            mLeftButton.setContentDescription(getString(R.string.sw_reset_button));
        }

        mRightButton.setImageResource(R.drawable.ic_share);
        mRightButton.setContentDescription(getString(R.string.sw_share_button));
    }
}