diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-31 10:18:49 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2017-01-31 10:18:49 -0700 |
commit | b61b7311cbc1f31237e93497feb67235007132fc (patch) | |
tree | 40ff04fd3fac7abf34782bf255fa89a63fb7cc91 | |
parent | 5f81791904da3b9003ea5a8e0b5c33719eab01aa (diff) | |
parent | c0baec89af90113274f5190c21a61a11349cfb67 (diff) | |
download | android_packages_apps_Gallery2-b61b7311cbc1f31237e93497feb67235007132fc.tar.gz android_packages_apps_Gallery2-b61b7311cbc1f31237e93497feb67235007132fc.tar.bz2 android_packages_apps_Gallery2-b61b7311cbc1f31237e93497feb67235007132fc.zip |
Merge c0baec89af90113274f5190c21a61a11349cfb67 on remote branch
Change-Id: Ief14b2b9b6af0a220460e54e4c9e54ca521d2f2a
-rwxr-xr-x | res/layout/activity_three_dimensional.xml | 158 | ||||
-rwxr-xr-x[-rw-r--r--] | res/layout/do_not_show_again_dialog.xml | 26 | ||||
-rwxr-xr-x | res/values/filtershow_strings.xml | 2 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/PhotoPage.java | 11 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/dualcam3d/ThreeDimensionalActivity.java | 6 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/dualcam3d/threed/Controller.java | 6 | ||||
-rwxr-xr-x | src/com/android/gallery3d/filtershow/category/MainPanel.java | 6 | ||||
-rwxr-xr-x | src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java | 7 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/ui/DoNotShowAgainDialog.java | 7 |
9 files changed, 130 insertions, 99 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/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 8cea64ea5..dff96bf7a 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -68,6 +68,7 @@ import com.android.gallery3d.data.SnailItem; import com.android.gallery3d.data.SnailSource; import com.android.gallery3d.filtershow.FilterShowActivity; import com.android.gallery3d.filtershow.imageshow.MasterImage; +import com.android.gallery3d.filtershow.tools.DualCameraNativeEngine; import com.android.gallery3d.mpo.MpoParser; import com.android.gallery3d.ui.DetailsHelper; import com.android.gallery3d.ui.DetailsHelper.CloseListener; @@ -1505,11 +1506,13 @@ public abstract class PhotoPage extends ActivityState implements private void parseMpoData() { bShow3DButton = false; - if (mParseMpoDateTask.getStatus() != AsyncTask.Status.FINISHED) { - boolean r = mParseMpoDateTask.cancel(true); + if (DualCameraNativeEngine.getInstance().isLibLoaded()) { + if (mParseMpoDateTask.getStatus() != AsyncTask.Status.FINISHED) { + boolean r = mParseMpoDateTask.cancel(true); + } + mParseMpoDateTask = new ParseMpoDataTask(); + mParseMpoDateTask.execute(); } - mParseMpoDateTask = new ParseMpoDataTask(); - mParseMpoDateTask.execute(); } @Override 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); } } diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java index 055d7a430..25788d790 100755 --- a/src/com/android/gallery3d/filtershow/category/MainPanel.java +++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java @@ -255,13 +255,13 @@ public class MainPanel extends Fragment implements BottomPanel.BottomPanelDelega } else { DoNotShowAgainDialog dialog = new DoNotShowAgainDialog( R.string.dual_camera_effects, R.string.dual_camera_effects_intro, - R.string.pref_dualcam_intro_show_key) { + R.string.pref_dualcam_intro_show_key); + dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { - super.onDismiss(dialog); showPanel(DUALCAM); } - }; + }); dialog.show(getFragmentManager(), "dualcam_intro"); } } diff --git a/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java b/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java index f4490b330..b9e1e2930 100755 --- a/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java +++ b/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java @@ -173,15 +173,16 @@ public class EditorDualCamFusion extends Editor { if (dialog == null) { dialog = new DoNotShowAgainDialog( R.string.fusion_pick_background, R.string.dualcam_fusion_intro, - R.string.pref_dualcam_fusion_intro_show_key) { + R.string.pref_dualcam_fusion_intro_show_key); + dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { - super.onCancel(dialog); FilterShowActivity activity = (FilterShowActivity) mContext; activity.cancelCurrentFilter(); activity.leaveSeekBarPanel(); } - }; + }); + dialog.setOnOkButtonClickListener(new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { diff --git a/src/com/android/gallery3d/filtershow/ui/DoNotShowAgainDialog.java b/src/com/android/gallery3d/filtershow/ui/DoNotShowAgainDialog.java index bea6d5be0..a4e0968a9 100644 --- a/src/com/android/gallery3d/filtershow/ui/DoNotShowAgainDialog.java +++ b/src/com/android/gallery3d/filtershow/ui/DoNotShowAgainDialog.java @@ -101,6 +101,7 @@ public class DoNotShowAgainDialog extends DialogFragment { public void setOnCancelListener(DialogInterface.OnCancelListener listener) { mCancelListener = listener; } + @Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); @@ -108,4 +109,10 @@ public class DoNotShowAgainDialog extends DialogFragment { mCancelListener.onCancel(dialog); } } + + @Override + public void onPause() { + this.dismiss(); + super.onPause(); + } } |