Merge "Add a click listener to QQS drag handler" into sc-v2-dev am: 33138749a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15854670 Change-Id: I4a1643d096e25e9c60e534aa0fc4e843dc1fc16e
This commit is contained in:
@@ -205,9 +205,17 @@ public class QSContainerImpl extends FrameLayout {
|
|||||||
|
|
||||||
protected int calculateContainerHeight() {
|
protected int calculateContainerHeight() {
|
||||||
int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
|
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()
|
return mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
|
||||||
: Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
|
: Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
|
||||||
+ mHeader.getHeight();
|
+ mHeader.getHeight()
|
||||||
|
+ dragHandleHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
int calculateContainerBottom() {
|
int calculateContainerBottom() {
|
||||||
@@ -223,6 +231,7 @@ public class QSContainerImpl extends FrameLayout {
|
|||||||
mQsExpansion = expansion;
|
mQsExpansion = expansion;
|
||||||
mQSPanelContainer.setScrollingEnabled(expansion > 0f);
|
mQSPanelContainer.setScrollingEnabled(expansion > 0f);
|
||||||
mDragHandle.setAlpha(1.0f - expansion);
|
mDragHandle.setAlpha(1.0f - expansion);
|
||||||
|
mDragHandle.setClickable(expansion == 0f); // Only clickable when fully collapsed
|
||||||
updateExpansion();
|
updateExpansion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,11 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
|||||||
mQSPanelController.getMediaHost().getHostView().setAlpha(1.0f);
|
mQSPanelController.getMediaHost().getHostView().setAlpha(1.0f);
|
||||||
mQSAnimator.requestAnimatorUpdate();
|
mQSAnimator.requestAnimatorUpdate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mQsDragHandler.setOnClickListener(v -> {
|
||||||
|
Log.d(TAG, "drag handler clicked");
|
||||||
|
mCommandQueue.animateExpandSettingsPanel(null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user