summaryrefslogtreecommitdiff
path: root/java/res
diff options
context:
space:
mode:
author Andrey Epin <ayepin@google.com> 2023-04-05 21:34:47 -0700
committer Andrey Epin <ayepin@google.com> 2023-04-07 08:23:02 -0700
commita36c4deb98e45aa0994b3f5fe2937fb112d03451 (patch)
treebfa6505e7911b50fe997844968d4010230b6d2bf /java/res
parent8a12f04a6116232ecd40a65ae6ba2f24234990ec (diff)
Replace view stubs with actual views
With the feature flags removed, there are no layout variations for action row and image preivew anymore thus ViewStubs can be replaced with the actual views. Bug: 267355521 Bug: 266983432 Test: manual testing Change-Id: I96a3a3560bfa5f1fbf064bd6080c618467c7aca1
Diffstat (limited to 'java/res')
-rw-r--r--java/res/layout/chooser_grid_preview_file.xml10
-rw-r--r--java/res/layout/chooser_grid_preview_image.xml24
-rw-r--r--java/res/layout/chooser_grid_preview_text.xml11
-rw-r--r--java/res/layout/scrollable_chooser_action_row.xml30
-rw-r--r--java/res/layout/scrollable_image_preview_view.xml35
5 files changed, 29 insertions, 81 deletions
diff --git a/java/res/layout/chooser_grid_preview_file.xml b/java/res/layout/chooser_grid_preview_file.xml
index 036c5318..bcc320d3 100644
--- a/java/res/layout/chooser_grid_preview_file.xml
+++ b/java/res/layout/chooser_grid_preview_file.xml
@@ -71,10 +71,12 @@
android:textAppearance="@style/TextAppearance.ChooserDefault" />
</LinearLayout>
- <ViewStub
- android:id="@+id/action_row_stub"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ <com.android.intentresolver.widget.ScrollableActionRow
+ android:id="@androidprv:id/chooser_action_row"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center" />
</LinearLayout>
diff --git a/java/res/layout/chooser_grid_preview_image.xml b/java/res/layout/chooser_grid_preview_image.xml
index 9ad594e8..43f6f4d1 100644
--- a/java/res/layout/chooser_grid_preview_image.xml
+++ b/java/res/layout/chooser_grid_preview_image.xml
@@ -19,6 +19,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@@ -33,11 +34,16 @@
android:gravity="center_horizontal"
android:layout_marginBottom="@dimen/chooser_view_spacing">
- <ViewStub
- android:id="@+id/image_preview_stub"
- android:inflatedId="@androidprv:id/content_preview_image_area"
+ <com.android.intentresolver.widget.ScrollableImagePreviewView
+ android:id="@+id/scrollable_image_preview"
android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_height="@dimen/chooser_preview_image_height_tall"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="@dimen/chooser_view_spacing"
+ android:background="?android:attr/colorBackground"
+ app:itemInnerSpacing="3dp"
+ app:itemOuterSpacing="@dimen/chooser_edge_margin_normal"
+ app:maxWidthHint="@dimen/chooser_width" />
<TextView
android:id="@androidprv:id/content_preview_text"
@@ -53,9 +59,11 @@
android:textAppearance="@style/TextAppearance.ChooserDefault" />
</LinearLayout>
- <ViewStub
- android:id="@+id/action_row_stub"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ <com.android.intentresolver.widget.ScrollableActionRow
+ android:id="@androidprv:id/chooser_action_row"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center" />
</LinearLayout>
diff --git a/java/res/layout/chooser_grid_preview_text.xml b/java/res/layout/chooser_grid_preview_text.xml
index 47beaa5a..5e7afa46 100644
--- a/java/res/layout/chooser_grid_preview_text.xml
+++ b/java/res/layout/chooser_grid_preview_text.xml
@@ -84,9 +84,12 @@
android:focusable="true"/>
</RelativeLayout>
- <ViewStub
- android:id="@+id/action_row_stub"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ <com.android.intentresolver.widget.ScrollableActionRow
+ android:id="@androidprv:id/chooser_action_row"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center" />
+
</LinearLayout>
diff --git a/java/res/layout/scrollable_chooser_action_row.xml b/java/res/layout/scrollable_chooser_action_row.xml
deleted file mode 100644
index cb5dabf0..00000000
--- a/java/res/layout/scrollable_chooser_action_row.xml
+++ /dev/null
@@ -1,30 +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
- -->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal">
-
- <com.android.intentresolver.widget.ScrollableActionRow
- android:id="@androidprv:id/chooser_action_row"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center" />
-</FrameLayout>
diff --git a/java/res/layout/scrollable_image_preview_view.xml b/java/res/layout/scrollable_image_preview_view.xml
deleted file mode 100644
index 0d41f1ae..00000000
--- a/java/res/layout/scrollable_image_preview_view.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-
-<!-- TODO: the unnecessary FrameLayout wrapping is a workaround for ViewStub (it ignores this view's
- width and height specs); remove when when the legacy image preview is removed -->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <com.android.intentresolver.widget.ScrollableImagePreviewView
- android:id="@+id/scrollable_image_preview"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/chooser_preview_image_height_tall"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="@dimen/chooser_view_spacing"
- android:background="?android:attr/colorBackground"
- app:itemInnerSpacing="3dp"
- app:itemOuterSpacing="@dimen/chooser_edge_margin_normal"
- app:maxWidthHint="@dimen/chooser_width" />
-</FrameLayout>