summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-04-26 13:34:17 -0700
committerKevin <kevhan@google.com>2019-04-29 14:52:56 -0700
commitfc3a79e45e17ee5f5bb9ef12d102f1d5467854e5 (patch)
tree7fd579a93d1bef22053d5a682dbec5fc55934323 /go
parentad8ca82e61206ee3c0e064e39f57272aebf3cf66 (diff)
downloadandroid_packages_apps_Trebuchet-fc3a79e45e17ee5f5bb9ef12d102f1d5467854e5.tar.gz
android_packages_apps_Trebuchet-fc3a79e45e17ee5f5bb9ef12d102f1d5467854e5.tar.bz2
android_packages_apps_Trebuchet-fc3a79e45e17ee5f5bb9ef12d102f1d5467854e5.zip
Layout aligned to dp grid for portrait (3/3)
Remove old custom view functionality to size based off device height since we now specify dimensions exactly. Bug: 131610834 Test: Builds, layout meets spec in portrait mode Change-Id: Id401f27360f6bb2450d3ffb77888a1f709dc62f8
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/res/layout/clear_all_button.xml4
-rw-r--r--go/quickstep/src/com/android/quickstep/views/ClearAllItemView.java41
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java1
-rw-r--r--go/quickstep/src/com/android/quickstep/views/TaskItemView.java9
-rw-r--r--go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java59
5 files changed, 2 insertions, 112 deletions
diff --git a/go/quickstep/res/layout/clear_all_button.xml b/go/quickstep/res/layout/clear_all_button.xml
index 85ccb88ca..2f7c8ae20 100644
--- a/go/quickstep/res/layout/clear_all_button.xml
+++ b/go/quickstep/res/layout/clear_all_button.xml
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.quickstep.views.ClearAllItemView
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clear_all_item_view"
android:layout_width="match_parent"
@@ -30,4 +30,4 @@
android:textAllCaps="false"
android:textColor="@color/clear_all_button_text"
android:textSize="14sp"/>
-</com.android.quickstep.views.ClearAllItemView>
+</FrameLayout>
diff --git a/go/quickstep/src/com/android/quickstep/views/ClearAllItemView.java b/go/quickstep/src/com/android/quickstep/views/ClearAllItemView.java
deleted file mode 100644
index 378dbf4e4..000000000
--- a/go/quickstep/src/com/android/quickstep/views/ClearAllItemView.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.views;
-
-import static com.android.quickstep.views.TaskLayoutUtils.getClearAllItemHeight;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.FrameLayout;
-
-/**
- * Recycler view item that lays out the clear all button and measures the space it takes based on
- * the device height.
- */
-public final class ClearAllItemView extends FrameLayout {
-
- public ClearAllItemView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int buttonHeight = getClearAllItemHeight(getContext());
- int newHeightSpec = MeasureSpec.makeMeasureSpec(buttonHeight, MeasureSpec.EXACTLY);
- super.onMeasure(widthMeasureSpec, newHeightSpec);
- }
-}
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index f0795150c..145495330 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -215,7 +215,6 @@ public final class IconRecentsView extends FrameLayout {
updateContentViewVisibility();
}
});
- // TODO: Move layout param logic into onMeasure
}
}
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
index 90192057b..1b61a10ef 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
@@ -15,8 +15,6 @@
*/
package com.android.quickstep.views;
-import static com.android.quickstep.views.TaskLayoutUtils.getTaskHeight;
-
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -91,13 +89,6 @@ public final class TaskItemView extends LinearLayout {
CONTENT_TRANSITION_PROGRESS.setValue(this, 1.0f);
}
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int taskHeight = getTaskHeight(getContext());
- int newHeightSpec = MeasureSpec.makeMeasureSpec(taskHeight,MeasureSpec.EXACTLY);
- super.onMeasure(widthMeasureSpec, newHeightSpec);
- }
-
/**
* Resets task item view to empty, loading UI.
*/
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java b/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java
deleted file mode 100644
index e28a9e04f..000000000
--- a/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.views;
-
-import static com.android.quickstep.TaskAdapter.MAX_TASKS_TO_DISPLAY;
-
-import android.content.Context;
-
-import com.android.launcher3.InvariantDeviceProfile;
-
-/**
- * Utils to determine dynamically task and view sizes based off the device height and width.
- */
-public final class TaskLayoutUtils {
-
- private static final float CLEAR_ALL_ITEM_TO_HEIGHT_RATIO = 7.0f / 64;
-
- private TaskLayoutUtils() {}
-
- /**
- * Calculate task height based off the available height in portrait mode such that when the
- * recents list is full, the total height fills in the available device height perfectly. In
- * landscape mode, we keep the same task height so that tasks scroll off the top.
- *
- * @param context current context
- * @return task height
- */
- public static int getTaskHeight(Context context) {
- final int availableHeight =
- InvariantDeviceProfile.INSTANCE.get(context).portraitProfile.availableHeightPx;
- final int availableTaskSpace = availableHeight - getClearAllItemHeight(context);
- return (int) (availableTaskSpace * 1.0f / MAX_TASKS_TO_DISPLAY);
- }
-
- /**
- * Calculate clear all item height scaled to available height in portrait mode.
- *
- * @param context current context
- * @return clear all item height
- */
- public static int getClearAllItemHeight(Context context) {
- final int availableHeight =
- InvariantDeviceProfile.INSTANCE.get(context).portraitProfile.availableHeightPx;
- return (int) (CLEAR_ALL_ITEM_TO_HEIGHT_RATIO * availableHeight);
- }
-}