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

Commit a8467296 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Make gesture nav tutorial skip button always visible.

Bug: 198285152
Test: started, completed and tried failing gesture nav tutorial.
Change-Id: Ic30a54e6592783abafcf1efe61ecedb9514d094d
parent 3fca6717
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -258,7 +258,6 @@ abstract class TutorialController implements BackGestureAttemptCallback,
                mFeedbackView.findViewById(R.id.gesture_tutorial_fragment_feedback_subtitle);
        subtitle.setText(subtitleResId);
        if (isGestureSuccessful) {
            hideCloseButton();
            if (mTutorialFragment.isAtFinalStep()) {
                showActionButton();
            }
@@ -382,6 +381,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
    void transitToController() {
        hideFeedback();
        hideActionButton();
        updateCloseButton();
        updateSubtext();
        updateDrawables();

@@ -391,26 +391,21 @@ abstract class TutorialController implements BackGestureAttemptCallback,
        }
    }

    void hideCloseButton() {
        mCloseButton.setVisibility(GONE);
    }

    void showCloseButton() {
        mCloseButton.setVisibility(View.VISIBLE);
    void updateCloseButton() {
        mCloseButton.setTextAppearance(Utilities.isDarkTheme(mContext)
                ? R.style.TextAppearance_GestureTutorial_Feedback_Subtext
                : R.style.TextAppearance_GestureTutorial_Feedback_Subtext_Dark);
    }

    void hideActionButton() {
        showCloseButton();
        mCloseButton.setVisibility(View.VISIBLE);
        // Invisible to maintain the layout.
        mActionButton.setVisibility(View.INVISIBLE);
        mActionButton.setOnClickListener(null);
    }

    void showActionButton() {
        hideCloseButton();
        mCloseButton.setVisibility(GONE);
        mActionButton.setVisibility(View.VISIBLE);
        mActionButton.setOnClickListener(this::onActionButtonClicked);
    }