summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKedi Xu <kedix@codeaurora.org>2017-01-17 20:20:32 +0800
committerKedi Xu <kedix@codeaurora.org>2017-01-17 20:20:32 +0800
commit554a896d0ff60d931e13f808eee35730007f5900 (patch)
tree5aa30587b7c0d2d0135ff308fe47396ff536f595
parentf4cfa24e62dc4278c5b0f168339c98ceb28b41fa (diff)
downloadandroid_packages_apps_Gallery2-554a896d0ff60d931e13f808eee35730007f5900.tar.gz
android_packages_apps_Gallery2-554a896d0ff60d931e13f808eee35730007f5900.tar.bz2
android_packages_apps_Gallery2-554a896d0ff60d931e13f808eee35730007f5900.zip
Gallery: Fix DDM UI issue
1.Fix dialog content doesn't diaplay completely 2.Fix when showing dialog then adjust display size, gallery crash 3.Add 3D button in 3Dviewer Change-Id: I3ee293a3dd9a242c1e927bc42f9ba71faa2b2b17 CRs-Fixed:1096494
-rwxr-xr-xres/layout/activity_three_dimensional.xml158
-rwxr-xr-x[-rw-r--r--]res/layout/do_not_show_again_dialog.xml26
-rwxr-xr-xres/values/filtershow_strings.xml2
-rwxr-xr-xsrc/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java6
-rwxr-xr-xsrc/com/android/gallery3d/app/dualcam3d/threed/Controller.java6
5 files changed, 109 insertions, 89 deletions
diff --git a/res/layout/activity_three_dimensional.xml b/res/layout/activity_three_dimensional.xml
index 316c9ad71..e5819bd1a 100755
--- a/res/layout/activity_three_dimensional.xml
+++ b/res/layout/activity_three_dimensional.xml
@@ -1,74 +1,84 @@
-<?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.
--->
-<merge xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- tools:context="com.android.gallery3d.app.dualcam3d.ThreeDimensionalActivity">
-
- <include layout="@layout/three_d_button" />
-
- <com.android.gallery3d.app.dualcam3d.GLView
- android:id="@+id/image"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
- <LinearLayout
- android:id="@+id/mode_3d"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|end"
- android:orientation="vertical"
- android:visibility="gone">
-
- <Button
- android:id="@+id/mode_gyro"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:text="@string/grad"
- android:textAlignment="center" />
-
- <Button
- android:id="@+id/mode_auto"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:text="@string/auto"
- android:textAlignment="center" />
-
- <Button
- android:id="@+id/mode_touch"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:text="@string/trueportrait_touch_up"
- android:textAlignment="center" />
- </LinearLayout>
-
-</merge>
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016-2017, 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.
+-->
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context="com.android.gallery3d.app.dualcam3d.ThreeDimensionalActivity">
+
+ <com.android.gallery3d.app.dualcam3d.GLView
+ android:id="@+id/image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <LinearLayout
+ android:id="@+id/mode_3d"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|end"
+ android:paddingTop="130dp"
+ android:paddingRight="50dp"
+ android:orientation="vertical">
+
+ <ImageButton
+ android:id="@+id/three_dimensional"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:background="?android:attr/actionBarItemBackground"
+ android:src="@drawable/three_d"/>
+
+ <ImageButton
+ android:id="@+id/mode_gyro"
+ android:layout_width="wrap_content"
+ android:layout_height="40dp"
+ android:text="@string/grad"
+ android:textAlignment="center"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/mode_auto"
+ android:layout_width="wrap_content"
+ android:layout_height="40dp"
+ android:text="@string/auto"
+ android:textAlignment="center"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/mode_touch"
+ android:layout_width="wrap_content"
+ android:layout_height="40dp"
+ android:text="@string/trueportrait_touch_up"
+ android:textAlignment="center"
+ android:visibility="gone" />
+ </LinearLayout>
+
+</merge>
diff --git a/res/layout/do_not_show_again_dialog.xml b/res/layout/do_not_show_again_dialog.xml
index d3d229740..cfd9fab2b 100644..100755
--- a/res/layout/do_not_show_again_dialog.xml
+++ b/res/layout/do_not_show_again_dialog.xml
@@ -29,27 +29,33 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:paddingEnd="?android:attr/dialogPreferredPadding"
android:paddingStart="?android:attr/dialogPreferredPadding"
android:orientation="vertical" >
- <TextView
- android:id="@+id/message"
+ <ScrollView
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="@android:style/TextAppearance.Material.Subhead" />
-
- <Space
- android:layout_width="0dp"
- android:layout_height="5dp"/>
+ android:layout_height="match_parent"
+ android:layout_weight="2">
+ <TextView
+ android:id="@+id/message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ style="@android:style/TextAppearance.Material.Subhead" />
+ </ScrollView>
<CheckBox
android:id="@+id/do_not_show_chk"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_vertical"
+ android:gravity="center"
+ android:layout_weight="1"
+ android:minHeight="20dp"
+ android:paddingEnd="6dp"
style="@android:style/TextAppearance.Material.Subhead"
android:text="@string/do_not_show_again" />
diff --git a/res/values/filtershow_strings.xml b/res/values/filtershow_strings.xml
index bdf5acebd..1f4c0b481 100755
--- a/res/values/filtershow_strings.xml
+++ b/res/values/filtershow_strings.xml
@@ -221,7 +221,7 @@
<!-- Label for the "posterize" dual camera effect [CHAR LIMIT=15] -->
<string name="posterize">Posterize</string>
<!-- Label for the "negative" dual camera effect [CHAR LIMIT=15] -->
- <string name="dc_negative">negative</string>
+ <string name="dc_negative">Negative</string>
<!-- Label for the "blur" true portrait effect [CHAR LIMIT=15] -->
<string name="blur">Blur</string>
<!-- Label for the "motion blur" true portrait effect [CHAR LIMIT=15] -->
diff --git a/src/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java b/src/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java
index c1212fac6..7a172116a 100755
--- a/src/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java
+++ b/src/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017, 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
@@ -46,7 +46,7 @@ import com.android.gallery3d.filtershow.tools.DualCameraNativeEngine;
import org.codeaurora.gallery.R;
public class ThreeDimensionalActivity extends Activity {
- private static final String TAG = "DualCamDemo";
+ private static final String TAG = ThreeDimensionalActivity.class.getSimpleName();
final static int MSG_UPDATE_IMAGE = 1;
final static int MSG_UPDATE_3D_DEPTH_MAP = 2;
@@ -180,4 +180,4 @@ public class ThreeDimensionalActivity extends Activity {
public Controller getController() {
return new Controller(mImageView, (LinearLayout) findViewById(R.id.mode_3d));
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/gallery3d/app/dualcam3d/threed/Controller.java b/src/com/android/gallery3d/app/dualcam3d/threed/Controller.java
index 72f6b1141..ff86d2bf5 100755
--- a/src/com/android/gallery3d/app/dualcam3d/threed/Controller.java
+++ b/src/com/android/gallery3d/app/dualcam3d/threed/Controller.java
@@ -31,6 +31,7 @@ package com.android.gallery3d.app.dualcam3d.threed;
import android.view.View;
import android.widget.Button;
+import android.widget.ImageButton;
import android.widget.LinearLayout;
import com.android.gallery3d.app.dualcam3d.GLView;
@@ -65,11 +66,14 @@ public class Controller implements Gyro.Listener {
case R.id.mode_touch:
stop(false);
break;
+ case R.id.three_dimensional:
+ start();
+ break;
}
}
};
for (int i = modeView.getChildCount() - 1; i >= 0; --i) {
- Button b = (Button) modeView.getChildAt(i);
+ ImageButton b = (ImageButton) modeView.getChildAt(i);
b.setOnClickListener(listener);
}
}