summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Zhang <chaoz@codeaurora.org>2016-05-12 17:34:31 +0800
committerLikai Ding <likaid@codeaurora.org>2016-07-08 09:51:18 +0800
commit8724b7e9dd3f64403f9469d20f797d7df379b9e8 (patch)
tree0cdce80efe042ef42a042c56e3abdc5bff883414
parent8788884b50a0bdaeac563f5b34f56abe79704fe0 (diff)
downloadandroid_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.tar.gz
android_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.tar.bz2
android_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.zip
Gallery: Modify the layout according to UX design document.
1. Modify toolbar layout according to UX design document. 2. Add touch effect to all buttons if need. 3. Modify video gesture indicator text color. 4. Don't use createChooser if only one app resolve Intent. 5. Modify export dialog layout in Photo Editor. 6. Modify truescanner icon. 7. Modify filter's label color. Change-Id: I987966ce76e5cab7bc50e5d2e52d1f7b5bdf2113 CRs-Fixed: 1017208
-rw-r--r--res/drawable/truescanner_background.xml34
-rw-r--r--res/drawable/truescanner_select.xml63
-rw-r--r--res/layout/filtershow_actionbar.xml8
-rw-r--r--res/layout/filtershow_actionbar_effects.xml4
-rw-r--r--res/layout/filtershow_bottom_panel.xml21
-rw-r--r--res/layout/filtershow_category_geometry_panel.xml7
-rw-r--r--res/layout/filtershow_export_dialog.xml51
-rw-r--r--res/layout/filtershow_seekbar.xml5
-rw-r--r--res/layout/photopage_bottom_controls.xml13
-rw-r--r--res/layout/toolbar.xml4
-rw-r--r--res/layout/trim_menu.xml6
-rw-r--r--res/values/dimens.xml3
-rw-r--r--res/values/filtershow_color.xml20
-rw-r--r--res/values/filtershow_styles.xml1
-rw-r--r--res/values/styles.xml12
-rw-r--r--src/com/android/gallery3d/app/CommonControllerOverlay.java9
-rw-r--r--src/com/android/gallery3d/app/GestureControllerOverlay.java2
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java2
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java17
-rw-r--r--src/com/android/gallery3d/filtershow/ui/ExportDialog.java66
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java15
-rw-r--r--src/com/android/gallery3d/ui/PopupList.java2
22 files changed, 235 insertions, 130 deletions
diff --git a/res/drawable/truescanner_background.xml b/res/drawable/truescanner_background.xml
new file mode 100644
index 000000000..381bd7fd2
--- /dev/null
+++ b/res/drawable/truescanner_background.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/truescanner" android:state_selected="false"/>
+ <item android:drawable="@drawable/truescanner_select" android:state_selected="true"/>
+</selector> \ No newline at end of file
diff --git a/res/drawable/truescanner_select.xml b/res/drawable/truescanner_select.xml
new file mode 100644
index 000000000..382c14e55
--- /dev/null
+++ b/res/drawable/truescanner_select.xml
@@ -0,0 +1,63 @@
+<!--
+ Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="32dp"
+ android:viewportWidth="32"
+ android:viewportHeight="32">
+
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M15.1,23.4c0,0.8,0,1.6,0,2.3c-4,0-7.9,0-11.9,0c0-6.7,0-13.4,0-20c4,0,7.9,0,11.9,0c0,0.8,0,1.5,0,2.3
+c-3.2,0-6.4,0-9.6,0c0,5.1,0,10.2,0,15.4C8.7,23.4,11.9,23.4,15.1,23.4z" />
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M15.1,10c0,0,0,0.1,0,0.1c0,1.9,0,3.7,0,5.6c0,0.1,0,0.2-0.1,0.3c-0.1,0.2-0.2,0.4-0.3,0.6c0,0,0,0.1,0,0.1
+c0.1,0,0.3,0,0.4,0c0,0.8,0,1.5,0,2.2c-0.1,0-0.2,0-0.3,0c-0.3,0-0.7,0-1,0c-0.1,0-0.1,0-0.2,0.1c-0.4,0.8-0.7,1.6-1.1,2.4
+c0,0.1-0.1,0.1-0.1,0.1c-0.9,0-1.8,0-2.8,0c0,0,0,0-0.1,0C11.4,17.7,13.2,13.9,15.1,10C15.1,10,15.1,10,15.1,10z" />
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M17,16.4c0,4.2,0,8.4,0,12.5c0,0.3-0.2,0.5-0.4,0.5c-0.3,0-0.5-0.2-0.5-0.4c0,0,0-0.1,0-0.1
+c0-8.3,0-16.7,0-25c0-0.1,0-0.2,0-0.2c0.1-0.2,0.3-0.4,0.5-0.3c0.2,0,0.4,0.2,0.4,0.5c0,0,0,0.1,0,0.1C17,8.1,17,12.3,17,16.4z" />
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M28.7,6.5c0,6.1,0,12.2,0,18.3c-3.4,0-6.9,0-10.3,0c0-0.1,0-0.2,0-0.3c3.3,0,6.7,0,10,0
+c0-5.9,0-11.8,0-17.7c-3.3,0-6.6,0-9.9,0c0-0.1,0-0.2,0-0.3C21.9,6.5,25.3,6.5,28.7,6.5z" />
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M18,9.6c1.9,4,3.8,8,5.7,12.1c-0.1,0-0.1,0-0.1,0c-1,0-2,0-3,0c-0.1,0-0.1,0-0.2-0.1
+c-0.4-0.8-0.7-1.6-1.1-2.4c0-0.1-0.1-0.1-0.2-0.1c-0.3,0-0.7,0-1,0c0,0-0.1,0-0.1,0c0-0.1,0-0.2,0-0.3c0,0,0.1,0,0.1,0
+c0.4,0,0.9,0,1.3,0c0.1,0,0.1,0,0.2,0.1c0.4,0.8,0.7,1.6,1.1,2.4c0,0.1,0.1,0.1,0.2,0.1c0.8,0,1.5,0,2.3,0c0,0,0.1,0,0.1,0
+c-0.1-0.2-0.2-0.5-0.3-0.7c-1.6-3.3-3.1-6.6-4.7-9.9c0,0,0-0.1,0-0.1C17.9,10.4,17.9,10,18,9.6C18,9.7,18,9.6,18,9.6
+C18,9.6,18,9.6,18,9.6z" />
+ <path
+ android:fillColor="#FF4F92E9"
+ android:pathData="M18.6,16.8c-0.2,0-0.4,0-0.6,0c0-0.1,0-0.2,0-0.3c0,0,0.1,0,0.1,0c-0.2-0.3-0.1-0.7-0.1-1
+C18.2,15.9,18.4,16.4,18.6,16.8z" />
+</vector>
diff --git a/res/layout/filtershow_actionbar.xml b/res/layout/filtershow_actionbar.xml
index a23ca80b7..60088e0a1 100644
--- a/res/layout/filtershow_actionbar.xml
+++ b/res/layout/filtershow_actionbar.xml
@@ -15,6 +15,7 @@
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@android:style/Theme.DeviceDefault"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:orientation="horizontal">
@@ -23,17 +24,18 @@
android:id="@+id/filtershow_exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:scaleType="fitCenter"
android:src="@drawable/cancel"
android:layout_gravity="left|center_vertical"
- android:paddingStart="6dp" />
+ android:layout_marginStart="@dimen/toolbar_exit_padding_left" />
<TextView
android:id="@+id/filtershow_done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingRight="13dp"
+ android:background="?android:attr/selectableItemBackgroundBorderless"
+ android:layout_marginEnd="13dp"
android:textSize="17sp"
android:text="@string/save"
android:textAllCaps="true"
diff --git a/res/layout/filtershow_actionbar_effects.xml b/res/layout/filtershow_actionbar_effects.xml
index c2b05ebe0..b14a0a766 100644
--- a/res/layout/filtershow_actionbar_effects.xml
+++ b/res/layout/filtershow_actionbar_effects.xml
@@ -29,7 +29,7 @@
android:layout_height="fill_parent"
android:layout_gravity="left|center_vertical"
android:layout_weight=".1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:gravity="center"
android:src="@drawable/cancel"
android:paddingStart="16dp"
@@ -63,7 +63,7 @@
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:layout_weight=".1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:gravity="center"
android:src="@drawable/done"
android:paddingEnd="16dp"
diff --git a/res/layout/filtershow_bottom_panel.xml b/res/layout/filtershow_bottom_panel.xml
index 80efe1a08..81a9d967b 100644
--- a/res/layout/filtershow_bottom_panel.xml
+++ b/res/layout/filtershow_bottom_panel.xml
@@ -29,6 +29,7 @@
-->
<com.android.gallery3d.filtershow.CenteredLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@android:style/Theme.DeviceDefault"
android:id="@+id/bottom_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -47,7 +48,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:scaleType="centerInside"
android:src="@drawable/color_background" />
@@ -56,7 +57,7 @@
android:layout_width="@dimen/thumbnail_size"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/frames_background"
@@ -67,7 +68,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/crop_background" />
@@ -77,7 +78,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/exposure_background" />
@@ -87,7 +88,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/beautify_background"
@@ -98,7 +99,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/dualcamera_background"
@@ -109,17 +110,17 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
- android:src="@drawable/truescanner" />
+ android:src="@drawable/truescanner_background" />
<ImageButton
android:id="@+id/hazeBusterButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/hazebuster" />
@@ -129,7 +130,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:padding="2dip"
android:scaleType="centerInside"
android:src="@drawable/seestraight" />
diff --git a/res/layout/filtershow_category_geometry_panel.xml b/res/layout/filtershow_category_geometry_panel.xml
index e66aa12a4..50515d6ac 100644
--- a/res/layout/filtershow_category_geometry_panel.xml
+++ b/res/layout/filtershow_category_geometry_panel.xml
@@ -29,6 +29,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@android:style/Theme.DeviceDefault"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
@@ -54,7 +55,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/crop_icon_size"
android:scaleType="centerInside"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:layout_marginTop="@dimen/crop_icon_margin_padding" />
<TextView
@@ -83,7 +84,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/crop_icon_size"
android:scaleType="centerInside"
- android:background="@android:color/transparent"
+ android:background="?android:attr/actionBarItemBackground"
android:layout_marginTop="@dimen/crop_icon_margin_padding" />
<TextView
@@ -113,7 +114,7 @@
android:layout_height="@dimen/crop_icon_size"
android:scaleType="centerInside"
android:layout_marginTop="@dimen/crop_icon_margin_padding"
- android:background="@android:color/transparent" />
+ android:background="?android:attr/actionBarItemBackground" />
<TextView
android:id="@+id/rightText"
diff --git a/res/layout/filtershow_export_dialog.xml b/res/layout/filtershow_export_dialog.xml
index 3b41ddaa4..394a89f2e 100644
--- a/res/layout/filtershow_export_dialog.xml
+++ b/res/layout/filtershow_export_dialog.xml
@@ -19,15 +19,12 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:divider="?android:dividerVertical"
- android:showDividers="middle">
+ android:padding="?android:attr/dialogPreferredPadding" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
- android:layout_margin="7dp"
- android:paddingStart="8dp"
android:textSize="16sp"
android:textColor="@color/albumset_label_background"
android:text="@string/select_output_settings"/>
@@ -37,16 +34,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alignmentMode="alignBounds"
- android:useDefaultMargins="true"
- android:layout_marginTop="24dp"
+ android:layout_marginTop="8dp"
android:columnOrderPreserved="false"
android:columnCount="5">
<TextView
android:text="@string/size"
- android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
android:layout_gravity="start|center_vertical"
- android:paddingStart="8dp"
android:textSize="16sp"
android:textColor="@color/albumlist_label_title"/>
@@ -71,13 +66,13 @@
<TextView
android:id="@+id/estimadedSize"
- android:layout_marginEnd="8dp"
android:layout_gravity="end|center_vertical"
android:textSize="16sp"
android:textColor="@color/albumlist_label_title"/>
<LinearLayout
android:layout_columnSpan="5"
+ android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -85,13 +80,11 @@
android:text="@string/quality"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
- android:layout_margin="8dp"
android:textSize="16sp"
android:textColor="@color/albumlist_label_title" />
<SeekBar
android:id="@+id/qualitySeekBar"
- android:layout_margin="8dp"
android:layout_gravity="center"
android:max="100"
android:progress="100"
@@ -105,43 +98,9 @@
android:id="@+id/qualityTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_margin="8dp"
android:textSize="16sp"
android:textColor="@color/albumlist_label_title"
- android:layout_gravity="end|center_vertical"
- />
-
+ android:layout_gravity="end|center_vertical" />
</LinearLayout>
-
-
</GridLayout>
-
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="48dp"
- style="?android:attr/buttonBarStyle"
- android:gravity="right">
-
- <Button
- android:id="@+id/cancel"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:text="@string/cancel"
- android:textSize="14sp"
- android:layout_marginRight="8dp"
- style="?android:attr/buttonBarButtonStyle"
- android:textColor="#009688"/>
-
- <Button
- android:id="@+id/done"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:textSize="14sp"
- android:text="@string/done"
- style="?android:attr/buttonBarButtonStyle"
- android:textColor="#009688"/>
-
- </LinearLayout>
-
</LinearLayout>
diff --git a/res/layout/filtershow_seekbar.xml b/res/layout/filtershow_seekbar.xml
index 216b72a9c..8cb5cd979 100644
--- a/res/layout/filtershow_seekbar.xml
+++ b/res/layout/filtershow_seekbar.xml
@@ -16,6 +16,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:theme="@android:style/Theme.DeviceDefault"
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -28,7 +29,7 @@
android:layout_height="60dp"
android:src="@drawable/cancel"
android:layout_gravity="center_vertical"
- android:background="@android:color/transparent" />
+ android:background="?android:attr/actionBarItemBackground" />
<SeekBar
android:id="@+id/primarySeekBar"
@@ -47,6 +48,6 @@
android:layout_height="60dp"
android:src="@drawable/done"
android:layout_gravity="center_vertical"
- android:background="@android:color/transparent" />
+ android:background="?android:attr/actionBarItemBackground" />
</LinearLayout>
diff --git a/res/layout/photopage_bottom_controls.xml b/res/layout/photopage_bottom_controls.xml
index f52a704a7..cd8e8a7d2 100644
--- a/res/layout/photopage_bottom_controls.xml
+++ b/res/layout/photopage_bottom_controls.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/photopage_bottom_controls"
+ android:theme="@android:style/Theme.DeviceDefault"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
@@ -13,30 +14,30 @@
<ImageButton
android:id="@+id/photopage_bottom_control_edit"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:background="@null"
+ android:background="?android:attr/actionBarItemBackground"
android:src="@drawable/edit"
android:visibility="gone" />
<ImageButton
android:id="@+id/photopage_bottom_control_share"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:background="@null"
+ android:background="?android:attr/actionBarItemBackground"
android:src="@drawable/share"
android:visibility="gone" />
<ImageButton
android:id="@+id/photopage_bottom_control_delete"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:background="@null"
+ android:background="?android:attr/actionBarItemBackground"
android:src="@drawable/delete"
android:visibility="gone" />
diff --git a/res/layout/toolbar.xml b/res/layout/toolbar.xml
index 5616f1fcb..054d97c84 100644
--- a/res/layout/toolbar.xml
+++ b/res/layout/toolbar.xml
@@ -31,8 +31,8 @@
<Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
- android:paddingTop="30dp"
- android:background="#e53935"
+ android:paddingTop="26dp"
+ android:background="@color/toolbar_theme"
android:elevation="4dp"
android:theme="@style/ToolbarTheme"
android:titleTextAppearance="@style/ToolbarTitleStyle"
diff --git a/res/layout/trim_menu.xml b/res/layout/trim_menu.xml
index 164264546..79a0f8808 100644
--- a/res/layout/trim_menu.xml
+++ b/res/layout/trim_menu.xml
@@ -20,17 +20,19 @@
android:layout_centerVertical="true">
<ImageView
android:id="@+id/exit_trim"
+ android:background="?android:attr/actionBarItemBackground"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/cancel"/>
<TextView
android:id="@+id/start_trim"
+ android:background="?android:attr/selectableItemBackgroundBorderless"
android:layout_marginStart="8dp"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:text="@string/save"
android:textAllCaps="true"
- android:layout_gravity="right"
+ android:layout_gravity="end|center_vertical"
android:textSize="16sp"
android:textColor="@color/primary_text"
android:gravity="left|center_vertical"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 845c53dd3..aa7da66eb 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -184,7 +184,7 @@
<dimen name="timeline_grid_vertical_space">3dp</dimen>
<dimen name="slot_width">174dp</dimen>
<dimen name="slot_height">174dp</dimen>
- <dimen name="toolbar_height">84dp</dimen>
+ <dimen name="toolbar_height">80dp</dimen>
<dimen name="slot_width_album">116dp</dimen>
<dimen name="slot_height_album">116dp</dimen>
<dimen name="crop_icon_size">30dp</dimen>
@@ -231,4 +231,5 @@
<dimen name="controller_indicator_text_size">16sp</dimen>
<dimen name="toolbar_title_text_size">20dp</dimen>
+ <dimen name="toolbar_exit_padding_left">16dp</dimen>
</resources>
diff --git a/res/values/filtershow_color.xml b/res/values/filtershow_color.xml
index 70a1e7336..b1d4111c2 100644
--- a/res/values/filtershow_color.xml
+++ b/res/values/filtershow_color.xml
@@ -52,16 +52,16 @@
<color name="filtershow_image_mask">#4d000000</color>
<color name="filtershow_info_text">#DE000000</color>
- <color name="filtershow_color_none">#5c5c5c</color>
- <color name="filtershow_color_punch">#c6bcc6</color>
- <color name="filtershow_color_vintage">#bb9e61</color>
- <color name="filtershow_color_bw">#000000</color>
- <color name="filtershow_color_bleach">#676f82</color>
- <color name="filtershow_color_instant">#e1d08b</color>
- <color name="filtershow_color_latte">#b18f7c</color>
- <color name="filtershow_color_blue">#5d6299</color>
- <color name="filtershow_color_litho">#c7c4b7</color>
- <color name="filtershow_color_xprocess">#409797</color>
+ <color name="filtershow_color_none">#80000000</color>
+ <color name="filtershow_color_punch">#80000000</color>
+ <color name="filtershow_color_vintage">#80000000</color>
+ <color name="filtershow_color_bw">#80000000</color>
+ <color name="filtershow_color_bleach">#80000000</color>
+ <color name="filtershow_color_instant">#80000000</color>
+ <color name="filtershow_color_latte">#80000000</color>
+ <color name="filtershow_color_blue">#80000000</color>
+ <color name="filtershow_color_litho">#80000000</color>
+ <color name="filtershow_color_xprocess">#80000000</color>
<color name="iconview_bottom_color">#80000000</color>
<color name="bottom_panel_background_color">#A5000000</color>
diff --git a/res/values/filtershow_styles.xml b/res/values/filtershow_styles.xml
index 974b81318..e8dd11040 100644
--- a/res/values/filtershow_styles.xml
+++ b/res/values/filtershow_styles.xml
@@ -61,6 +61,7 @@
<item name="android:thumb">@drawable/adjust</item>
<item name="android:thumbOffset">0dip</item>
<item name="android:focusable">true</item>
+ <item name="android:background">@null</item>
</style>
</resources> \ No newline at end of file
diff --git a/res/values/styles.xml b/res/values/styles.xml
index c3db0f362..02a79df5f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -30,12 +30,16 @@
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowActionModeOverlay">true</item>
- <item name="android:actionOverflowButtonStyle">@style/EditOverflow</item>
+ <item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
<item name="android:logo">@android:color/transparent</item>
</style>
<style name="Theme.FilterShow" parent="Theme.Gallery">
<item name="android:windowBackground">@null</item>
<item name="android:actionBarStyle">@style/FilterShowActionBar</item>
+ <item name="android:toolbarStyle">@style/FilterShowToolbar</item>
+ </style>
+ <style name="FilterShowToolbar" parent="@android:style/Widget.Toolbar">
+ <item name="android:contentInsetStart">0dp</item>
</style>
<style name="Theme.Crop" parent="Theme.GalleryBase">
<item name="android:displayOptions"></item>
@@ -324,7 +328,9 @@
<item name="android:statusBarColor">#ab5810</item>
</style>
- <style name="ToolbarTheme" parent="android:Theme.Material"/>
+ <style name="ToolbarTheme" parent="android:Theme.Material" >
+ <item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
+ </style>
<style name="ToolbarTitleStyle" parent="android:TextAppearance.Material.Widget.Toolbar.Title">
<item name="android:textSize">@dimen/toolbar_title_text_size</item>
@@ -336,7 +342,7 @@
<style name="MyOverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">@drawable/multiselect_more</item>
</style>
- <style name="EditOverflow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
+ <style name="WhiteOverflow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">@drawable/more</item>
</style>
<style name="FilterShowActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
diff --git a/src/com/android/gallery3d/app/CommonControllerOverlay.java b/src/com/android/gallery3d/app/CommonControllerOverlay.java
index 1c8287414..f4fbeb868 100644
--- a/src/com/android/gallery3d/app/CommonControllerOverlay.java
+++ b/src/com/android/gallery3d/app/CommonControllerOverlay.java
@@ -18,7 +18,9 @@ package com.android.gallery3d.app;
import android.content.Context;
import android.content.res.Resources;
+import android.content.res.TypedArray;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -108,6 +110,13 @@ public abstract class CommonControllerOverlay extends FrameLayout implements
mPlayPauseReplayView.setFocusable(true);
mPlayPauseReplayView.setClickable(true);
mPlayPauseReplayView.setOnClickListener(this);
+ TypedArray array = context.getTheme().obtainStyledAttributes(new int[] {
+ android.R.attr.actionBarItemBackground
+ });
+ Drawable drawable = array.getDrawable(array.getIndex(0));
+ if (drawable != null) {
+ mPlayPauseReplayView.setBackground(drawable);
+ }
addView(mPlayPauseReplayView, wrapContent);
mErrorView = createOverlayTextView(context);
diff --git a/src/com/android/gallery3d/app/GestureControllerOverlay.java b/src/com/android/gallery3d/app/GestureControllerOverlay.java
index 38b7f0d65..fee9b3ab5 100644
--- a/src/com/android/gallery3d/app/GestureControllerOverlay.java
+++ b/src/com/android/gallery3d/app/GestureControllerOverlay.java
@@ -51,7 +51,6 @@ public class GestureControllerOverlay extends FrameLayout implements
private static final int MAX_VIDEO_STEP_TIME = 2 * 60 * 1000;
private static final int MAX_BRIGHTNESS = 100;
- private static final int INDICATOR_FADE_OUT_TIME = 200; // millisecond
private float mStartBrightness = -1.0f;
private double mStartVolumePercent = -1.0f;
@@ -130,6 +129,7 @@ public class GestureControllerOverlay extends FrameLayout implements
mCurrentIndicator.setPadding(paddingH, paddingV, paddingH, paddingV);
mCurrentIndicator.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM);
mCurrentIndicator.setTextSize(TypedValue.COMPLEX_UNIT_PX, mIndicatorTextSize);
+ mCurrentIndicator.setTextColor(Color.WHITE);
mCurrentIndicator.setMinWidth(mIndicatorWidth);
addView(mCurrentIndicator, layoutParams);
mCurrentIndicator.setVisibility(INVISIBLE);
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index 80a7fc6aa..c1e36487d 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -664,7 +664,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
LayoutParams wrapContent =
new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
// add screenView
- mScreenView = new ImageView(context);
+ mScreenView = new ImageView(context, null, android.R.attr.actionButtonStyle);
// default next screen mode
mScreenView.setImageResource(R.drawable.ic_media_fullscreen);
mScreenView.setScaleType(ScaleType.CENTER);
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index cdbe3e7e4..df3229f95 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -23,6 +23,7 @@ import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.net.Uri;
@@ -75,6 +76,7 @@ import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.util.GalleryUtils;
import com.android.gallery3d.util.UsageStatistics;
+import java.util.List;
import java.util.Locale;
//import android.drm.DrmHelper;
@@ -775,9 +777,18 @@ public abstract class PhotoPage extends ActivityState implements
}
intent.putExtra(FilterShowActivity.LAUNCH_FULLSCREEN,
mActivity.isFullscreen());
- ((Activity) mActivity).startActivityForResult(Intent.createChooser(intent, null),
- REQUEST_EDIT);
- overrideTransitionToEditor();
+
+ List<ResolveInfo> resolveInfoList = mActivity.getPackageManager()
+ .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
+ if (resolveInfoList != null && resolveInfoList.size() > 0) {
+ if (resolveInfoList.size() == 1) {
+ // only one app can resolve intent, don't use createChooser.
+ mActivity.startActivityForResult(intent, REQUEST_EDIT);
+ } else {
+ mActivity.startActivityForResult(Intent.createChooser(intent, null), REQUEST_EDIT);
+ }
+ overrideTransitionToEditor();
+ }
}
private void launchSimpleEditor() {
diff --git a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
index d9e695cfb..6ec3cfed5 100644
--- a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
+++ b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
@@ -16,6 +16,9 @@
package com.android.gallery3d.filtershow.ui;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -27,7 +30,6 @@ import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
@@ -42,8 +44,7 @@ import com.android.gallery3d.filtershow.tools.SaveImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
-public class ExportDialog extends DialogFragment implements View.OnClickListener,
- SeekBar.OnSeekBarChangeListener {
+public class ExportDialog extends DialogFragment implements SeekBar.OnSeekBarChangeListener {
SeekBar mSeekBar;
TextView mSeekVal;
EditText mWidthText;
@@ -90,11 +91,37 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
mHandler = new Handler(getActivity().getMainLooper());
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ View view = initCustomLayout();
+ builder.setView(view);
+ builder.setTitle(R.string.export_flattened);
+ builder.setPositiveButton(R.string.done,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ FilterShowActivity activity = (FilterShowActivity) getActivity();
+ Uri sourceUri = MasterImage.getImage().getUri();
+ File dest = SaveImage.getNewFile(activity, activity.getSelectedImageUri());
+ float scaleFactor = mExportWidth / (float) mOriginalBounds.width();
+ Intent processIntent = ProcessingService.getSaveIntent(activity,
+ MasterImage.getImage().getPreset(), dest,
+ activity.getSelectedImageUri(), sourceUri, true,
+ mSeekBar.getProgress(), scaleFactor, false, -1);
+ activity.startService(processIntent);
+ }
+ });
+ builder.setNegativeButton(R.string.cancel, null);
- View view = inflater.inflate(R.layout.filtershow_export_dialog, container);
+ updateCompressionFactor();
+ updateSize();
+ return builder.create();
+ }
+
+ private View initCustomLayout() {
+ LayoutInflater inflater = getActivity().getLayoutInflater();
+ View view = inflater.inflate(R.layout.filtershow_export_dialog, null);
mSeekBar = (SeekBar) view.findViewById(R.id.qualitySeekBar);
mSeekVal = (TextView) view.findViewById(R.id.qualityTextView);
mSliderLabel = getString(R.string.quality) + ": ";
@@ -124,13 +151,6 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener
mExportHeight = mOriginalBounds.height();
mWidthText.addTextChangedListener(new Watcher(mWidthText));
mHeightText.addTextChangedListener(new Watcher(mHeightText));
-
- view.findViewById(R.id.cancel).setOnClickListener(this);
- view.findViewById(R.id.done).setOnClickListener(this);
- getDialog().setTitle(R.string.export_flattened);
-
- updateCompressionFactor();
- updateSize();
return view;
}
@@ -156,26 +176,6 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener
mHandler.postDelayed(mUpdateRunnable, mUpdateDelay);
}
- @Override
- public void onClick(View v) {
- switch (v.getId()) {
- case R.id.cancel:
- dismiss();
- break;
- case R.id.done:
- FilterShowActivity activity = (FilterShowActivity) getActivity();
- Uri sourceUri = MasterImage.getImage().getUri();
- File dest = SaveImage.getNewFile(activity, activity.getSelectedImageUri());
- float scaleFactor = mExportWidth / (float) mOriginalBounds.width();
- Intent processIntent = ProcessingService.getSaveIntent(activity, MasterImage
- .getImage().getPreset(), dest, activity.getSelectedImageUri(), sourceUri,
- true, mSeekBar.getProgress(), scaleFactor, false, -1);
- activity.startService(processIntent);
- dismiss();
- break;
- }
- }
-
public void updateCompressionFactor() {
Bitmap bitmap = MasterImage.getImage().getFilteredImage();
if (bitmap == null) {
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index c28fd097b..c57e848e3 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -25,6 +25,8 @@ import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
//import android.drm.DrmHelper;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
@@ -46,6 +48,7 @@ import com.android.gallery3d.util.ThreadPool.Job;
import com.android.gallery3d.util.ThreadPool.JobContext;
import java.util.ArrayList;
+import java.util.List;
public class MenuExecutor {
private static final String TAG = "MenuExecutor";
@@ -254,7 +257,17 @@ public class MenuExecutor {
Intent intent = getIntentBySingleSelectedPath(Intent.ACTION_EDIT);
if (intent != null) {
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- ((Activity) mActivity).startActivity(Intent.createChooser(intent, null));
+
+ List<ResolveInfo> resolveInfoList = mActivity.getPackageManager()
+ .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
+ if (resolveInfoList != null && resolveInfoList.size() > 0) {
+ if (resolveInfoList.size() == 1) {
+ // only one app can resolve intent, don't use createChooser.
+ mActivity.startActivity(intent);
+ } else {
+ mActivity.startActivity(Intent.createChooser(intent, null));
+ }
+ }
}
return;
}
diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java
index efbddd3ea..a9aa2570f 100644
--- a/src/com/android/gallery3d/ui/PopupList.java
+++ b/src/com/android/gallery3d/ui/PopupList.java
@@ -154,7 +154,7 @@ public class PopupList {
}
private PopupWindow createPopupWindow() {
- PopupWindow popup = new PopupWindow(mContext);
+ PopupWindow popup = new PopupWindow(mContext, null, android.R.attr.popupMenuStyle);
popup.setOnDismissListener(mOnDismissListener);
popup.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffffff")));