Merge "Add a click listener to QQS drag handler" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-09-21 12:37:50 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -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