Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21700935 authored by Winson's avatar Winson
Browse files

Don’t scale task thumbnails.

- Changing task view thumbnail layout.  In portrait, scale the thumbnail
  to width for portrait screenshots, and apply the same scale to 
  landscape screenshots.  In landscape, scale screenshots up to 1:1, and
  tweak the app transition to clip the sides instead of scaling.
  In both orientations, fill with the background color in the remaining
  space.
- Moving some resources related to the title bar to be calculated 
  programmatically so that we can have different header bar sizes which 
  completely overlap the action bar in the screenshot in each 
  orientation.
- Constraining the task stack width in landscape to portrait

Bug: 27504677
Change-Id: Ic9b6fdde6dd728d9f2d20a8b89c05b3a350edfbf
parent d8f7431d
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Point;
@@ -1790,7 +1791,7 @@ public class ActivityManager {

        public int taskWidth;
        public int taskHeight;
        public int screenOrientation;
        public int screenOrientation = Configuration.ORIENTATION_UNDEFINED;

        public TaskThumbnailInfo() {
            // Do nothing
@@ -1807,7 +1808,16 @@ public class ActivityManager {
        public void reset() {
            taskWidth = 0;
            taskHeight = 0;
            screenOrientation = 0;
            screenOrientation = Configuration.ORIENTATION_UNDEFINED;
        }

        /**
         * Copies from another ThumbnailInfo.
         */
        public void copyFrom(TaskThumbnailInfo o) {
            taskWidth = o.taskWidth;
            taskHeight = o.taskHeight;
            screenOrientation = o.screenOrientation;
        }

        /** @hide */
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
    <dimen name="thumbnail_width">192dp</dimen>
    <!-- The height that is used when creating thumbnails of applications. -->
    <dimen name="thumbnail_height">192dp</dimen>
    <!-- The amount to scale a fullscreen screenshot thumbnail. -->
    <item name="thumbnail_fullscreen_scale" type="fraction">60%</item>
    <!-- The standard size (both width and height) of an application icon that
         will be displayed in the app launcher and elsewhere. -->
    <dimen name="app_icon_size">48dip</dimen>
+1 −0
Original line number Diff line number Diff line
@@ -1513,6 +1513,7 @@
  <java-symbol type="dimen" name="docked_stack_minimize_thickness" />
  <java-symbol type="integer" name="config_dockedStackDividerSnapMode" />
  <java-symbol type="fraction" name="docked_stack_divider_fixed_ratio" />
  <java-symbol type="fraction" name="thumbnail_fullscreen_scale" />
  <java-symbol type="dimen" name="navigation_bar_height" />
  <java-symbol type="dimen" name="navigation_bar_height_landscape" />
  <java-symbol type="dimen" name="navigation_bar_width" />
+11 −12
Original line number Diff line number Diff line
@@ -14,28 +14,28 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- The layouts params are calculated in TaskViewHeader.java -->
<com.android.systemui.recents.views.TaskViewHeader
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/task_view_bar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/recents_task_view_header_height"
    android:layout_height="wrap_content"
    android:layout_gravity="top|center_horizontal">
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/icon"
        android:contentDescription="@string/recents_app_info_button_label"
        android:layout_width="@dimen/recents_task_view_header_icon_width"
        android:layout_height="@dimen/recents_task_view_header_icon_height"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|start"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:paddingStart="16dp"
        android:paddingEnd="12dp" />
    <LinearLayout
        android:id="@+id/title_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="56dp"
        android:layout_marginEnd="56dp"
        android:orientation="vertical">
        <TextView
            android:id="@+id/title"
@@ -67,21 +67,20 @@
    </LinearLayout>
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/move_task"
        android:layout_width="@dimen/recents_task_view_header_button_width"
        android:layout_height="@dimen/recents_task_view_header_button_height"
        android:layout_marginEnd="@dimen/recents_task_view_header_button_width"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|end"
        android:padding="16dp"
        android:padding="@dimen/recents_task_view_header_button_padding"
        android:src="@drawable/star"
        android:background="?android:selectableItemBackground"
        android:alpha="0"
        android:visibility="gone" />
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/dismiss_task"
        android:layout_width="@dimen/recents_task_view_header_button_width"
        android:layout_height="@dimen/recents_task_view_header_button_height"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|end"
        android:padding="16dp"
        android:padding="@dimen/recents_task_view_header_button_padding"
        android:src="@drawable/recents_dismiss_light"
        android:background="?android:selectableItemBackground"
        android:alpha="0"
+6 −7
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- The layouts params are calculated in TaskViewHeader.java -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
@@ -20,8 +21,8 @@
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/app_icon"
        android:contentDescription="@string/recents_app_info_button_label"
        android:layout_width="@dimen/recents_task_view_header_icon_width"
        android:layout_height="@dimen/recents_task_view_header_icon_height"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|start"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
@@ -32,8 +33,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="56dp"
        android:layout_marginEnd="112dp"
        android:textSize="16sp"
        android:textColor="#ffffffff"
        android:text="@string/recents_empty_message"
@@ -44,10 +43,10 @@
        android:fadingEdge="horizontal" />
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/app_info"
        android:layout_width="@dimen/recents_task_view_header_button_width"
        android:layout_height="@dimen/recents_task_view_header_button_height"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|end"
        android:padding="16dp"
        android:padding="@dimen/recents_task_view_header_button_padding"
        android:background="?android:selectableItemBackground"
        android:src="@drawable/recents_info_light" />
</FrameLayout>
 No newline at end of file
Loading