mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Merge "Add max height logic and avoidance of taskbar into task menu" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
18694cc977
@@ -23,11 +23,17 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu_option_layout"
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu_option_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</com.android.quickstep.views.TaskMenuViewWithArrow>
|
||||
@@ -213,7 +213,8 @@ public class PortraitPagedViewHandler extends DefaultPagedViewHandler implements
|
||||
@Override
|
||||
public int getTaskMenuHeight(float taskInsetMargin, DeviceProfile deviceProfile,
|
||||
float taskMenuX, float taskMenuY) {
|
||||
return (int) (deviceProfile.availableHeightPx - taskInsetMargin - taskMenuY);
|
||||
return (int) (deviceProfile.heightPx - deviceProfile.getInsets().top - taskMenuY
|
||||
- deviceProfile.getOverviewActionsClaimedSpaceBelow());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -124,6 +124,25 @@ class TaskMenuViewWithArrow<T : BaseDraggingActivity> : ArrowPopup<T> {
|
||||
optionLayout = requireViewById(R.id.menu_option_layout)
|
||||
}
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
val maxMenuHeight: Int = calculateMaxHeight()
|
||||
val newHeightMeasureSpec =
|
||||
if (MeasureSpec.getSize(heightMeasureSpec) > maxMenuHeight) {
|
||||
MeasureSpec.makeMeasureSpec(maxMenuHeight, MeasureSpec.AT_MOST)
|
||||
} else heightMeasureSpec
|
||||
super.onMeasure(widthMeasureSpec, newHeightMeasureSpec)
|
||||
}
|
||||
|
||||
private fun calculateMaxHeight(): Int {
|
||||
val taskInsetMargin = resources.getDimension(R.dimen.task_card_margin)
|
||||
return taskView.pagedOrientationHandler.getTaskMenuHeight(
|
||||
taskInsetMargin,
|
||||
mActivityContext.deviceProfile,
|
||||
translationX,
|
||||
translationY
|
||||
)
|
||||
}
|
||||
|
||||
private fun populateAndShowForTask(
|
||||
taskContainer: TaskIdAttributeContainer,
|
||||
alignedOptionIndex: Int
|
||||
|
||||
Reference in New Issue
Block a user