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

Commit b087241b authored by Budi Kusmiantoro's avatar Budi Kusmiantoro Committed by Android Git Automerger
Browse files

am d0a9d268: Fix crash when Fragment is not yet attached to Actvity

* commit 'd0a9d268':
  Fix crash when Fragment is not yet attached to Actvity
parents 2c243022 d0a9d268
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1443,9 +1443,12 @@ public class AlarmClockFragment extends DeskClockFragment implements

    @Override
    public void setFabAppearance(ImageButton fab) {
        if (!isAdded()) {
            return;
        }
        fab.setVisibility(View.VISIBLE);
        fab.setImageResource(R.drawable.ic_fab_plus);
        fab.setContentDescription(fab.getContext().getString(R.string.button_alarms));
        fab.setContentDescription(getString(R.string.button_alarms));
    }

    @Override
+4 −1
Original line number Diff line number Diff line
@@ -278,9 +278,12 @@ public class ClockFragment extends DeskClockFragment implements OnSharedPreferen

    @Override
    public void setFabAppearance(ImageButton fab) {
        if (!isAdded()) {
            return;
        }
        fab.setVisibility(View.VISIBLE);
        fab.setImageResource(R.drawable.ic_globe);
        fab.setContentDescription(fab.getContext().getString(R.string.button_cities));
        fab.setContentDescription(getString(R.string.button_cities));
    }

    @Override
+8 −1
Original line number Diff line number Diff line
@@ -874,8 +874,11 @@ public class StopwatchFragment extends DeskClockFragment

    @Override
    public void setFabAppearance(ImageButton fab) {
        mFab = fab;
        if (!isAdded()) {
            return;
        }

        mFab = fab;
        if (mState == Stopwatches.STOPWATCH_RUNNING) {
            mFab.setImageResource(R.drawable.ic_fab_pause);
            mFab.setContentDescription(getString(R.string.sw_stop_button));
@@ -888,6 +891,10 @@ public class StopwatchFragment extends DeskClockFragment

    @Override
    public void setLeftRightButtonAppearance(ImageButton left, ImageButton right) {
        if (!isAdded()) {
            return;
        }

        mLeftButton = left;
        mRightButton = right;
        mLeftButton.setVisibility(mState == Stopwatches.STOPWATCH_RESET ? View.INVISIBLE :
+8 −0
Original line number Diff line number Diff line
@@ -513,6 +513,10 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen

    @Override
    public void setFabAppearance(ImageButton fab) {
        if (!isAdded()) {
            return;
        }

        mFab = fab;
        if (mFab != null) {
            if (atTimerTab()) {
@@ -540,6 +544,10 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen

    @Override
    public void setLeftRightButtonAppearance(ImageButton left, ImageButton right) {
        if (!isAdded()) {
            return;
        }

        mLeftButton = left;
        mRightButton = right;
        if (mLeftButton != null && mRightButton != null && atTimerTab()) {