diff options
-rw-r--r-- | res/drawable/refocus_button_disable.xml | 35 | ||||
-rw-r--r-- | res/drawable/refocus_button_enable.xml | 35 | ||||
-rw-r--r-- | res/layout/refocus_editor.xml | 9 | ||||
-rw-r--r-- | src/com/android/camera/RefocusActivity.java | 8 |
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 454d44a46..aa4e8534b 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 8c18db977..7291f1fe0 100644 --- a/src/com/android/camera/RefocusActivity.java +++ b/src/com/android/camera/RefocusActivity.java @@ -71,6 +71,8 @@ public class RefocusActivity extends Activity { private int mHeight; private Indicator mIndicator; + private View mAllInFocusView; + private DepthMap mDepthMap; private int mCurrentImage = -1; private int mRequestedImage = -1; @@ -107,6 +109,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; } @@ -114,7 +118,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(); @@ -165,6 +170,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> { |