Merge "Add a click listener to QQS drag handler" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
33138749a5
@@ -208,9 +208,17 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
|
|
||||||
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() {
|
||||||
@@ -226,6 +234,7 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import android.widget.ImageView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
|
|
||||||
import com.android.systemui.Dumpable;
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.animation.Interpolators;
|
import com.android.systemui.animation.Interpolators;
|
||||||
import com.android.systemui.dump.DumpManager;
|
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);
|
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