summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-12-19 10:47:49 -0800
committerRuben Brunk <rubenbrunk@google.com>2013-01-11 17:52:36 -0800
commit405feeac6565e52882f05dca46097db57b9b1133 (patch)
treec487c3f0eb46e28bdcdf4a85b1b70e8e126c90cf
parentdbe227cc4aa7ca09f098f371102096e71519c24a (diff)
downloadandroid_packages_apps_Snap-405feeac6565e52882f05dca46097db57b9b1133.tar.gz
android_packages_apps_Snap-405feeac6565e52882f05dca46097db57b9b1133.tar.bz2
android_packages_apps_Snap-405feeac6565e52882f05dca46097db57b9b1133.zip
Refactoring button class. Minor bug fixes.
Bug: 7875246 Bug: 7459118 Change-Id: Ic1099a7ae0feeeb16c8be3035f9726805149666e
-rw-r--r--res/layout/filtericonbutton.xml18
-rw-r--r--res/layout/filtershow_activity.xml58
-rw-r--r--res/values/iconbutton_styles.xml49
3 files changed, 92 insertions, 33 deletions
diff --git a/res/layout/filtericonbutton.xml b/res/layout/filtericonbutton.xml
new file mode 100644
index 000000000..8fc98e38c
--- /dev/null
+++ b/res/layout/filtericonbutton.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<com.android.gallery3d.filtershow.ui.FilterIconButton
+ style="@style/FilterIconButton" />
diff --git a/res/layout/filtershow_activity.xml b/res/layout/filtershow_activity.xml
index dfd669f98..35e83bc97 100644
--- a/res/layout/filtershow_activity.xml
+++ b/res/layout/filtershow_activity.xml
@@ -16,6 +16,7 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:iconbutton="http://schemas.android.com/apk/res/com.android.gallery3d"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainView">
@@ -95,12 +96,6 @@
android:layerType="software"
android:visibility="gone" />
- <com.android.gallery3d.filtershow.imageshow.ImageBorder
- android:id="@+id/imageBorder"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
-
<com.android.gallery3d.filtershow.imageshow.ImageZoom
android:id="@+id/imageZoom"
android:layout_width="match_parent"
@@ -123,15 +118,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
- <!--
- <ImageButton
- android:id="@+id/showOriginalButton"
- android:layout_width="64dip"
- android:layout_height="64dip"
- android:layout_gravity="bottom"
- android:scaleType="centerInside"
- android:src="@drawable/filtershow_button_show_original" />
- -->
<com.android.gallery3d.filtershow.CenteredLinearLayout
xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
@@ -255,37 +241,42 @@
android:id="@+id/listGeometry"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
- android:layout_gravity="center"
+ android:layout_gravity="left"
android:orientation="horizontal">
- <com.android.gallery3d.filtershow.ui.ImageButtonTitle
+ <com.android.gallery3d.filtershow.ui.IconButton
android:id="@+id/straightenButton"
- style="@style/FilterShowBottomButton"
- android:src="@drawable/filtershow_button_geometry_straighten"
+ android:layout_height="match_parent"
+ style="@style/IconButton"
+ android:drawableTop="@drawable/filtershow_button_geometry_straighten"
android:text="@string/straighten" />
- <com.android.gallery3d.filtershow.ui.ImageButtonTitle
+ <com.android.gallery3d.filtershow.ui.IconButton
android:id="@+id/cropButton"
- style="@style/FilterShowBottomButton"
- android:src="@drawable/filtershow_button_geometry_crop"
+ android:layout_height="match_parent"
+ style="@style/IconButton"
+ android:drawableTop="@drawable/filtershow_button_geometry_crop"
android:text="@string/crop" />
- <com.android.gallery3d.filtershow.ui.ImageButtonTitle
+ <com.android.gallery3d.filtershow.ui.IconButton
android:id="@+id/rotateButton"
- style="@style/FilterShowBottomButton"
- android:src="@drawable/filtershow_button_geometry_rotate"
+ android:layout_height="match_parent"
+ style="@style/IconButton"
+ android:drawableTop="@drawable/filtershow_button_geometry_rotate"
android:text="@string/rotate" />
- <com.android.gallery3d.filtershow.ui.ImageButtonTitle
+ <com.android.gallery3d.filtershow.ui.IconButton
android:id="@+id/flipButton"
- style="@style/FilterShowBottomButton"
- android:src="@drawable/filtershow_button_geometry_flip"
+ android:layout_height="match_parent"
+ style="@style/IconButton"
+ android:drawableTop="@drawable/filtershow_button_geometry_flip"
android:text="@string/mirror" />
- <com.android.gallery3d.filtershow.ui.ImageButtonTitle
+ <com.android.gallery3d.filtershow.ui.IconButton
android:id="@+id/redEyeButton"
- style="@style/FilterShowBottomButton"
- android:src="@drawable/photoeditor_effect_redeye"
+ android:layout_height="match_parent"
+ style="@style/IconButton"
+ android:drawableTop="@drawable/photoeditor_effect_redeye"
android:text="@string/redeye" />
</LinearLayout>
@@ -294,7 +285,7 @@
<HorizontalScrollView
android:id="@+id/colorsFxList"
android:layout_width="fill_parent"
- android:layout_height="@dimen/thumbnail_size"
+ android:layout_height="wrap_content"
android:background="@color/background_main_toolbar"
android:visibility="gone"
android:scrollbars="none" >
@@ -302,7 +293,8 @@
<LinearLayout
android:id="@+id/listColorsFx"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="@dimen/thumbnail_size"
+ android:background="@color/background_main_toolbar"
android:layout_marginLeft="@dimen/thumbnail_margin"
android:orientation="horizontal" >
diff --git a/res/values/iconbutton_styles.xml b/res/values/iconbutton_styles.xml
new file mode 100644
index 000000000..e33460af2
--- /dev/null
+++ b/res/values/iconbutton_styles.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <style name="IconButton">
+ <item name="android:layout_width">96dp</item>
+ <item name="android:layout_height">match_parent</item>
+ <item name="android:background">@drawable/filtershow_button_background</item>
+ <item name="android:textColor">@android:color/white</item>
+ <item name="android:textSize">14dp</item>
+ <item name="android:scaleType">centerInside</item>
+ <item name="android:gravity">center</item>
+ <item name="android:padding">6dp</item>
+ <item name="android:drawablePadding">6dp</item>
+ <item name="android:ellipsize">marquee</item>
+ <item name="android:marqueeRepeatLimit">marquee_forever</item>
+ <item name="android:singleLine">true</item>
+ </style>
+
+ <style name="FilterIconButton">
+ <item name="android:layout_width">70dp</item>
+ <item name="android:layout_height">match_parent</item>
+ <item name="android:background">@drawable/filtershow_button_background</item>
+ <item name="android:textColor">@android:color/white</item>
+ <item name="android:textSize">13dp</item>
+ <item name="android:scaleType">centerInside</item>
+ <item name="android:gravity">center</item>
+ <item name="android:paddingLeft">3dp</item>
+ <item name="android:paddingRight">3dp</item>
+ <item name="android:paddingTop">6dp</item>
+ <item name="android:paddingBottom">6dp</item>
+ <item name="android:ellipsize">marquee</item>
+ <item name="android:marqueeRepeatLimit">marquee_forever</item>
+ <item name="android:singleLine">true</item>
+ </style>
+</resources>