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

Commit 6ea2588a authored by Winson's avatar Winson
Browse files

Fixing issue with action button not showing/animating.

- The system flags need to be reread when the task stack is reset.
- Since we check for alpha before doing the animation, we need to
  initialize the action button alpha back to zero when we reset the
  task view.

Change-Id: I97530a7bdd5e934ab1d5831ef30cf7774418ed95
parent f3918002
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@
            android:translationZ="4dp"
            android:contentDescription="@string/recents_lock_to_app_button_label"
            android:background="@drawable/recents_lock_to_task_button_bg"
            android:visibility="invisible">
            android:visibility="invisible"
            android:alpha="0">
            <ImageView
                android:layout_width="@dimen/recents_lock_to_app_icon_size"
                android:layout_height="@dimen/recents_lock_to_app_icon_size"
+12 −4
Original line number Diff line number Diff line
@@ -228,11 +228,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal

    @Override
    protected void onAttachedToWindow() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        mTouchExplorationEnabled = ssp.isTouchExplorationEnabled();
        mScreenPinningEnabled = ssp.getSystemSetting(getContext(),
                Settings.System.LOCK_TO_APP_ENABLED) != 0;
        EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
        readSystemFlags();
        super.onAttachedToWindow();
    }

@@ -338,6 +335,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        mUIDozeTrigger.resetTrigger();
        mStackScroller.reset();
        mLayoutAlgorithm.reset();
        readSystemFlags();
        requestLayout();
    }

@@ -1666,4 +1664,14 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
    private boolean shouldShowHistoryButton() {
        return !mStack.getHistoricalTasks().isEmpty();
    }

    /**
     * Reads current system flags related to accessibility and screen pinning.
     */
    private void readSystemFlags() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        mTouchExplorationEnabled = ssp.isTouchExplorationEnabled();
        mScreenPinningEnabled = ssp.getSystemSetting(getContext(),
                Settings.System.LOCK_TO_APP_ENABLED) != 0;
    }
}
+1 −3
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,

        mActionButtonView.setScaleX(1f);
        mActionButtonView.setScaleY(1f);
        mActionButtonView.setAlpha(1f);
        mActionButtonView.setAlpha(0f);
        mActionButtonView.setTranslationZ(mActionButtonTranslationZ);
    }

@@ -461,7 +461,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
                        .scaleY(1f)
                        .setDuration(fadeInDuration)
                        .setInterpolator(PhoneStatusBar.ALPHA_IN)
                        .withLayer()
                        .start();
            }
        } else {
@@ -500,7 +499,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
                                mActionButtonView.setVisibility(View.INVISIBLE);
                            }
                        })
                        .withLayer()
                        .start();
            }
        } else {