summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2015-08-21 22:36:03 +0800
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:44:39 -0700
commit8e754707659e9c17c4c485ba17391887ffb0db7c (patch)
treea1c8ed831f874d062f0963fce7125f924fa61f4b
parent1ff17d7e28e09b5e352199d6736bca32af36b330 (diff)
downloadandroid_packages_apps_Snap-8e754707659e9c17c4c485ba17391887ffb0db7c.tar.gz
android_packages_apps_Snap-8e754707659e9c17c4c485ba17391887ffb0db7c.tar.bz2
android_packages_apps_Snap-8e754707659e9c17c4c485ba17391887ffb0db7c.zip
SnapdragonCamera: add button border
Add border for "All in Focus" button. Also some tweaks to meet UI spec. Change-Id: I56c458a420e503321cc9a3255a7dd4ae0a6d4637
-rw-r--r--res/drawable/refocus_button_disable.xml35
-rw-r--r--res/drawable/refocus_button_enable.xml35
-rw-r--r--res/layout/refocus_editor.xml9
-rw-r--r--src/com/android/camera/RefocusActivity.java8
4 files changed, 82 insertions, 5 deletions
diff --git a/res/drawable/refocus_button_disable.xml b/res/drawable/refocus_button_disable.xml
new file mode 100644
index 000000000..bae9d9ff7
--- /dev/null
+++ b/res/drawable/refocus_button_disable.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (c) 2015, 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <stroke
+ android:width="1dp"
+ android:color="#ffffff" />
+</shape>
diff --git a/res/drawable/refocus_button_enable.xml b/res/drawable/refocus_button_enable.xml
new file mode 100644
index 000000000..081dd898b
--- /dev/null
+++ b/res/drawable/refocus_button_enable.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (c) 2015, 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <stroke
+ android:width="1dp"
+ android:color="#29b6f6" />
+</shape>
diff --git a/res/layout/refocus_editor.xml b/res/layout/refocus_editor.xml
index c4b42bb4c..262d2d509 100644
--- a/res/layout/refocus_editor.xml
+++ b/res/layout/refocus_editor.xml
@@ -42,8 +42,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#80000000">
+ android:layout_height="50dp"
+ android:background="#b2191919">
<ImageView
android:id="@+id/refocus_cancel"
@@ -54,9 +54,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<TextView
android:id="@+id/refocus_all"
android:text="@string/all_in_focus"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="103dp"
+ android:layout_height="34dp"
android:layout_centerInParent="true"
+ android:gravity="center"
android:onClick="allInFocus" />
<ImageView
android:id="@+id/refocus_done"
diff --git a/src/com/android/camera/RefocusActivity.java b/src/com/android/camera/RefocusActivity.java
index 2102d1a78..060209b16 100644
--- a/src/com/android/camera/RefocusActivity.java
+++ b/src/com/android/camera/RefocusActivity.java
@@ -60,6 +60,8 @@ public class RefocusActivity extends Activity {
private int mWidth;
private int mHeight;
+ private View mAllInFocusView;
+
private DepthMap mDepthMap;
private int mCurrentImage = -1;
private int mRequestedImage = -1;
@@ -92,6 +94,8 @@ public class RefocusActivity extends Activity {
if (mDepthMap != null) {
int depth = mDepthMap.getDepth(x / (float) w, y / (float) h);
setCurrentImage(depth);
+ mAllInFocusView.setBackground(getDrawable(
+ R.drawable.refocus_button_disable));
}
break;
}
@@ -99,7 +103,8 @@ public class RefocusActivity extends Activity {
}
});
- findViewById(R.id.refocus_all).setOnClickListener(new View.OnClickListener() {
+ mAllInFocusView = findViewById(R.id.refocus_all);
+ mAllInFocusView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
allInFocus();
@@ -150,6 +155,7 @@ public class RefocusActivity extends Activity {
private void allInFocus() {
setCurrentImage(NAMES.length - 1);
+ mAllInFocusView.setBackground(getDrawable(R.drawable.refocus_button_enable));
}
private class SaveImageTask extends AsyncTask<String, Void, Void> {