Add a click listener to QQS drag handler
That way, QS can be expanded by clicking on it Test: manual Fixes: 198453772 Change-Id: I766d0236452ddf6271a97d065e35414d6a6d428b
This commit is contained in:
@@ -208,9 +208,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() {
|
||||
@@ -226,6 +234,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();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import android.widget.ImageView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.animation.Interpolators;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
@@ -238,6 +237,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
|
||||
|
||||
Reference in New Issue
Block a user