Merge "Add a click listener to QQS drag handler" into sc-v2-dev am: 33138749a5 am: c99988cdfc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15854670

Change-Id: Ibc7fc76d6d3a258346a741a3b59ad2d3f5b0c0de
This commit is contained in:
TreeHugger Robot
2021-09-21 13:12:31 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 1 deletions

View File

@@ -209,9 +209,17 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
protected int calculateContainerHeight() {
int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
// Need to add the dragHandle height so touches will be intercepted by it.
int dragHandleHeight;
if (mDragHandle.getVisibility() == VISIBLE) {
dragHandleHeight = Math.round((1 - mQsExpansion) * mDragHandle.getHeight());
} else {
dragHandleHeight = 0;
}
return mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
: Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
+ mHeader.getHeight();
+ mHeader.getHeight()
+ dragHandleHeight;
}
int calculateContainerBottom() {
@@ -227,6 +235,7 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
mQsExpansion = expansion;
mQSPanelContainer.setScrollingEnabled(expansion > 0f);
mDragHandle.setAlpha(1.0f - expansion);
mDragHandle.setClickable(expansion == 0f); // Only clickable when fully collapsed
updateExpansion();
}

View File

@@ -238,6 +238,11 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
mQSPanelController.getMediaHost().getHostView().setAlpha(1.0f);
mQSAnimator.requestAnimatorUpdate();
});
mQsDragHandler.setOnClickListener(v -> {
Log.d(TAG, "drag handler clicked");
mCommandQueue.animateExpandSettingsPanel(null);
});
}
@Override