summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwqi <wqi@codeaurora.org>2016-04-14 11:25:23 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-22 02:51:33 -0700
commit6c5a2dd884a861e8d279fb7cd50c11b4c7d68004 (patch)
tree8fcb5cfbfc6f6fdc8f1845767add280e59422ee9
parent317616930e7273b40e8b7a367fee225b1c9e6bea (diff)
downloadandroid_packages_apps_Gallery2-6c5a2dd884a861e8d279fb7cd50c11b4c7d68004.tar.gz
android_packages_apps_Gallery2-6c5a2dd884a861e8d279fb7cd50c11b4c7d68004.tar.bz2
android_packages_apps_Gallery2-6c5a2dd884a861e8d279fb7cd50c11b4c7d68004.zip
Gallery2: Modified layout of crop and exposure model in photo editor.
1. Modified layout in crop model. 2. Remove mirror and draw only keep crop, straighten, rotate in crop model. 3. Adjust style of seekbar in exposure model. 4. Modified layout in exposure model. 5. Remove '4:3', '3:4', '5:7' and '7:5' functions from crop. According to UX specification document. Change-Id: Ib536b3f57a83053bac8fc6ec778675a82b6327e6 CRs-Fixed: 988082 988090
-rw-r--r--res/drawable/adjust.xml2
-rw-r--r--res/drawable/crop_1_1.xml34
-rw-r--r--res/drawable/crop_1_1_select.xml34
-rw-r--r--res/drawable/crop_crop.xml34
-rw-r--r--res/drawable/crop_free.xml34
-rw-r--r--res/drawable/crop_free_background.xml34
-rw-r--r--res/drawable/crop_free_select.xml34
-rw-r--r--res/drawable/crop_one_background.xml34
-rw-r--r--res/drawable/crop_original.xml34
-rw-r--r--res/drawable/crop_original_background.xml34
-rw-r--r--res/drawable/crop_original_select.xml34
-rw-r--r--res/drawable/crop_rotate.xml34
-rw-r--r--res/drawable/crop_straighten.xml34
-rw-r--r--res/drawable/sliderbg.xml2
-rw-r--r--res/drawable/sliderprogress.xml2
-rw-r--r--res/layout-land/filtershow_category_panel_new.xml63
-rw-r--r--res/layout-land/filtershow_editor_panel.xml112
-rw-r--r--res/layout/filtershow_actionbar.xml3
-rw-r--r--res/layout/filtershow_category_geometry_panel.xml163
-rw-r--r--res/layout/filtershow_editor_panel.xml9
-rw-r--r--res/layout/filtershow_seekbar.xml56
-rw-r--r--res/values/dimens.xml6
-rw-r--r--res/values/filtershow_color.xml1
-rw-r--r--res/values/filtershow_strings.xml2
-rw-r--r--res/values/filtershow_styles.xml8
-rw-r--r--res/values/filtershow_values.xml2
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java36
-rw-r--r--src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java94
-rw-r--r--src/com/android/gallery3d/filtershow/category/EditorCropPanel.java169
-rw-r--r--src/com/android/gallery3d/filtershow/category/GeometryPanel.java99
-rw-r--r--src/com/android/gallery3d/filtershow/category/MainPanel.java5
-rw-r--r--src/com/android/gallery3d/filtershow/category/StraightenPanel.java94
-rw-r--r--src/com/android/gallery3d/filtershow/controller/BasicSlider.java34
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java42
-rw-r--r--src/com/android/gallery3d/filtershow/crop/CropView.java7
-rw-r--r--src/com/android/gallery3d/filtershow/editors/EditorCrop.java2
-rw-r--r--src/com/android/gallery3d/filtershow/editors/ParametricEditor.java2
-rw-r--r--src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java6
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java19
39 files changed, 1194 insertions, 254 deletions
diff --git a/res/drawable/adjust.xml b/res/drawable/adjust.xml
index 3ce4ed243..ac0cff0a6 100644
--- a/res/drawable/adjust.xml
+++ b/res/drawable/adjust.xml
@@ -34,5 +34,5 @@
android:viewportHeight="12.0">
<path
android:pathData="M5.984,6.016m-5.859,0a5.859,5.859 0,1 1,11.718 0a5.859,5.859 0,1 1,-11.718 0"
- android:fillColor="#00E3FF"/>
+ android:fillColor="#4f92e9"/>
</vector>
diff --git a/res/drawable/crop_1_1.xml b/res/drawable/crop_1_1.xml
new file mode 100644
index 000000000..332eff7e7
--- /dev/null
+++ b/res/drawable/crop_1_1.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M3,3L3,87L87,87L87,3L3,3ZM78.99,78.99L11.01,78.99L11.01,11.01L78.99,11.01L78.99,78.99Z"/>
+</vector>
diff --git a/res/drawable/crop_1_1_select.xml b/res/drawable/crop_1_1_select.xml
new file mode 100644
index 000000000..892870714
--- /dev/null
+++ b/res/drawable/crop_1_1_select.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FF4F92E9" android:pathData="M3,3L3,87L87,87L87,3L3,3ZM78.99,78.99L11.01,78.99L11.01,11.01L78.99,11.01L78.99,78.99Z"/>
+</vector>
diff --git a/res/drawable/crop_crop.xml b/res/drawable/crop_crop.xml
new file mode 100644
index 000000000..0272da20d
--- /dev/null
+++ b/res/drawable/crop_crop.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M15,67C15,71.42 18.58,75 23,75L23,75L67,75L67,87L75,87L75,75L87,75L87,67L23,67L23,3L15,3L15,15L3,15L3,23L15,23L15,67ZM67,59L75,59L75,23C75,18.58 71.42,15 67,15L31,15L31,23L67,23L67,59Z"/>
+</vector>
diff --git a/res/drawable/crop_free.xml b/res/drawable/crop_free.xml
new file mode 100644
index 000000000..eac62fb24
--- /dev/null
+++ b/res/drawable/crop_free.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M11,62L3,62L3,87L28,87L28,79L11,79L11,62ZM79,79L62,79L62,87L87,87L87,62L79,62L79,79ZM3,28L11,28L11,11L28,11L28,3L3,3L3,28ZM62,3L62,11L79,11L79,28L87,28L87,3L62,3Z"/>
+</vector>
diff --git a/res/drawable/crop_free_background.xml b/res/drawable/crop_free_background.xml
new file mode 100644
index 000000000..4404d4e7b
--- /dev/null
+++ b/res/drawable/crop_free_background.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/crop_free" android:state_selected="false"></item>
+ <item android:drawable="@drawable/crop_free_select" android:state_selected="true"></item>
+</selector> \ No newline at end of file
diff --git a/res/drawable/crop_free_select.xml b/res/drawable/crop_free_select.xml
new file mode 100644
index 000000000..f24699731
--- /dev/null
+++ b/res/drawable/crop_free_select.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FF4F92E9" android:pathData="M11,62L3,62L3,87L28,87L28,79L11,79L11,62ZM79,79L62,79L62,87L87,87L87,62L79,62L79,79ZM3,28L11,28L11,11L28,11L28,3L3,3L3,28ZM62,3L62,11L79,11L79,28L87,28L87,3L62,3Z"/>
+</vector>
diff --git a/res/drawable/crop_one_background.xml b/res/drawable/crop_one_background.xml
new file mode 100644
index 000000000..aa035eda8
--- /dev/null
+++ b/res/drawable/crop_one_background.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/crop_1_1" android:state_selected="false"></item>
+ <item android:drawable="@drawable/crop_1_1_select" android:state_selected="true"></item>
+</selector> \ No newline at end of file
diff --git a/res/drawable/crop_original.xml b/res/drawable/crop_original.xml
new file mode 100644
index 000000000..91eef6c0c
--- /dev/null
+++ b/res/drawable/crop_original.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M9,1L9,89L81,89L81,1L9,1ZM17,46L44,46L44,81L17,81L17,46ZM73,81L48,81L48,42L17,42L17,9L73,9L73,81Z"/>
+</vector>
diff --git a/res/drawable/crop_original_background.xml b/res/drawable/crop_original_background.xml
new file mode 100644
index 000000000..eafe86131
--- /dev/null
+++ b/res/drawable/crop_original_background.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/crop_original" android:state_selected="false"></item>
+ <item android:drawable="@drawable/crop_original_select" android:state_selected="true"></item>
+</selector> \ No newline at end of file
diff --git a/res/drawable/crop_original_select.xml b/res/drawable/crop_original_select.xml
new file mode 100644
index 000000000..3bb0f7694
--- /dev/null
+++ b/res/drawable/crop_original_select.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FF4F92E9" android:pathData="M9,1L9,89L81,89L81,1L9,1ZM17,46L44,46L44,81L17,81L17,46ZM73,81L48,81L48,42L17,42L17,9L73,9L73,81Z"/>
+</vector>
diff --git a/res/drawable/crop_rotate.xml b/res/drawable/crop_rotate.xml
new file mode 100644
index 000000000..8caf459e4
--- /dev/null
+++ b/res/drawable/crop_rotate.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="90.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M45,5C32.42,5 21.21,10.81 13.88,19.88L5,11L5.01,33.99L6.55,33.99C6.55,33.99 6.55,34 6.54,34L14.94,34C14.94,34 14.94,33.99 14.95,33.99L27.99,33.99L19.57,25.57C25.42,17.93 34.63,13 45,13C62.67,13 77,27.33 77,45C77,62.67 62.67,77 45,77C27.33,77 13,62.67 13,45L5,45C5,67.09 22.91,85 45,85C67.09,85 85,67.09 85,45C85,22.91 67.09,5 45,5Z"/>
+</vector>
diff --git a/res/drawable/crop_straighten.xml b/res/drawable/crop_straighten.xml
new file mode 100644
index 000000000..9fda1f484
--- /dev/null
+++ b/res/drawable/crop_straighten.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+
+<vector android:height="24dp" android:viewportHeight="90.0"
+ android:viewportWidth="89.844" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M87.85,22.54L73.87,22.54L73.87,29.53L82.86,29.53L82.86,75.44L48.91,75.44L48.91,82.43L87.85,82.43C88.95,82.43 89.84,81.53 89.84,80.43L89.84,24.54C89.84,23.44 88.95,22.54 87.85,22.54ZM74.82,64.32L65.09,9.23C64.9,8.15 63.86,7.42 62.77,7.61L1.66,18.37C0.57,18.56 -0.16,19.6 0.03,20.68L9.77,75.77C9.96,76.86 11,77.59 12.09,77.39L73.2,66.64C74.29,66.45 75.01,65.41 74.82,64.32ZM44.55,36.57L31.7,61L21.53,51.79L14.88,64.43L7.8,24.39L59.06,15.37L66.28,56.22L44.55,36.57Z"/>
+</vector>
diff --git a/res/drawable/sliderbg.xml b/res/drawable/sliderbg.xml
index 974ab918e..efc809f4b 100644
--- a/res/drawable/sliderbg.xml
+++ b/res/drawable/sliderbg.xml
@@ -35,5 +35,5 @@
<path
android:pathData="M0,1h216v2h-216z"
android:fillAlpha="0.2"
- android:fillColor="#FFFFFF"/>
+ android:fillColor="#99FFFFFF"/>
</vector>
diff --git a/res/drawable/sliderprogress.xml b/res/drawable/sliderprogress.xml
index 9ca10b6e2..5c2b541ab 100644
--- a/res/drawable/sliderprogress.xml
+++ b/res/drawable/sliderprogress.xml
@@ -34,5 +34,5 @@
android:viewportHeight="4.0">
<path
android:pathData="M0,1h216v2h-216z"
- android:fillColor="#00E3FF"/>
+ android:fillColor="#4f92e9"/>
</vector>
diff --git a/res/layout-land/filtershow_category_panel_new.xml b/res/layout-land/filtershow_category_panel_new.xml
deleted file mode 100644
index 26b92e769..000000000
--- a/res/layout-land/filtershow_category_panel_new.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2013 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/edit_actionbar_background"
- android:orientation="horizontal" >
-
- <!-- <com.android.gallery3d.filtershow.category.IconView -->
- <!-- android:id="@+id/addButton" -->
- <!-- android:layout_width="match_parent" -->
- <!-- android:layout_height="@dimen/category_panel_height" -->
- <!-- android:src="@drawable/filtershow_add"/> -->
-
-
- <!-- <ListView -->
- <!-- android:id="@+id/listItems" -->
- <!-- android:orientation="vertical" -->
- <!-- android:layout_width="match_parent" -->
- <!-- android:layout_height="@dimen/category_panel_height" -->
- <!-- android:layout_margin="8dip" -->
- <!-- android:divider="@android:color/transparent" -->
- <!-- android:dividerHeight="8dip" -->
- <!-- android:layout_weight="1"/> -->
-
- <HorizontalScrollView
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:scrollbars="none" >
-
- <com.android.gallery3d.filtershow.category.CategoryTrack
- android:id="@+id/listItems"
- android:layout_width="match_parent"
- android:layout_height="@dimen/category_panel_height"
- android:divider="@android:color/transparent"
- android:dividerPadding="8dip"
- custom:iconSize="@dimen/category_panel_icon_size" />
- </HorizontalScrollView>
-
- <com.android.gallery3d.filtershow.category.IconView
- android:id="@+id/addButton"
- android:layout_width="@dimen/category_panel_height"
- android:layout_height="@dimen/category_panel_height"
- android:src="@drawable/filtershow_add" />
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout-land/filtershow_editor_panel.xml b/res/layout-land/filtershow_editor_panel.xml
deleted file mode 100644
index 59885e0f0..000000000
--- a/res/layout-land/filtershow_editor_panel.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2013 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/top"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:visibility="visible" >
-
- <!-- <RelativeLayout -->
- <!-- android:layout_width="match_parent" -->
- <!-- android:layout_height="match_parent" > -->
-
- <Button
- android:id="@+id/toggle_state"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:background="@color/background_main_toolbar"
- android:text="@string/imageState"
- android:visibility="gone" />
-
- <!-- <LinearLayout -->
- <!-- android:id="@+id/applyBar" -->
- <!-- android:layout_width="match_parent" -->
- <!-- android:layout_height="48dip" -->
- <!-- android:layout_above="@id/bottomControlLineBottom" -->
- <!-- android:background="@color/background_main_toolbar" -->
- <!-- android:baselineAligned="false" -->
- <!-- android:orientation="horizontal" -->
- <!-- android:visibility="visible" > -->
-
-
- <!-- <ImageButton -->
- <!-- android:id="@+id/cancelFilter" -->
- <!-- android:layout_width="wrap_content" -->
- <!-- android:layout_height="fill_parent" -->
- <!-- android:layout_gravity="left|center_vertical" -->
- <!-- android:layout_weight=".1" -->
- <!-- android:background="@android:color/transparent" -->
- <!-- android:gravity="center" -->
- <!-- android:src="@drawable/ic_menu_cancel_holo_light" -->
- <!-- android:textSize="18dip" /> -->
-
-
- <!-- <LinearLayout -->
- <!-- android:id="@+id/panelAccessoryViewList" -->
- <!-- android:layout_width="wrap_content" -->
- <!-- android:layout_height="match_parent" -->
- <!-- android:layout_weight="1" -->
- <!-- android:orientation="horizontal" -->
- <!-- android:visibility="visible" > -->
-
-
- <!-- <com.android.gallery3d.filtershow.editors.SwapButton -->
- <!-- android:id="@+id/applyEffect" -->
- <!-- android:layout_width="fill_parent" -->
- <!-- android:layout_height="fill_parent" -->
- <!-- android:layout_gravity="center" -->
- <!-- android:background="@android:color/transparent" -->
- <!-- android:drawableEnd="@drawable/filtershow_menu_marker_rtl" -->
- <!-- android:text="@string/apply_effect" -->
- <!-- android:textSize="18dip" /> -->
- <!-- </LinearLayout> -->
-
-
- <!-- <ImageButton -->
- <!-- android:id="@+id/applyFilter" -->
- <!-- android:layout_width="wrap_content" -->
- <!-- android:layout_height="fill_parent" -->
- <!-- android:layout_gravity="right|center_vertical" -->
- <!-- android:layout_weight=".1" -->
- <!-- android:background="@android:color/transparent" -->
- <!-- android:gravity="center" -->
- <!-- android:src="@drawable/ic_menu_done_holo_light" -->
- <!-- android:textSize="18dip" /> -->
- <!-- </LinearLayout> -->
-
- <LinearLayout
- android:id="@+id/controlArea"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="bottom"
- android:orientation="horizontal"
- android:visibility="visible" >
-
- <SeekBar
- android:id="@+id/primarySeekBar"
- style="@style/FilterShowSlider"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:visibility="gone" />
- </LinearLayout>
- <!-- </RelativeLayout> -->
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/filtershow_actionbar.xml b/res/layout/filtershow_actionbar.xml
index 7e6d62504..a23ca80b7 100644
--- a/res/layout/filtershow_actionbar.xml
+++ b/res/layout/filtershow_actionbar.xml
@@ -27,7 +27,7 @@
android:scaleType="fitCenter"
android:src="@drawable/cancel"
android:layout_gravity="left|center_vertical"
- android:paddingStart="16dp" />
+ android:paddingStart="6dp" />
<TextView
android:id="@+id/filtershow_done"
@@ -36,6 +36,7 @@
android:paddingRight="13dp"
android:textSize="17sp"
android:text="@string/save"
+ android:textAllCaps="true"
android:layout_gravity="center_vertical|right"
android:textColor="#ffffff" />
diff --git a/res/layout/filtershow_category_geometry_panel.xml b/res/layout/filtershow_category_geometry_panel.xml
new file mode 100644
index 000000000..92dc359d6
--- /dev/null
+++ b/res/layout/filtershow_category_geometry_panel.xml
@@ -0,0 +1,163 @@
+<?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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/category_panel_height"
+ android:background="@android:color/transparent"
+ android:clickable="true"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:id="@+id/leftPanel"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@android:color/transparent"
+ android:orientation="vertical" >
+
+ <ImageButton
+ android:id="@+id/leftButton"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/crop_icon_size"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:layout_marginTop="@dimen/crop_icon_margin_padding" />
+
+ <TextView
+ android:id="@+id/leftText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:clickable="true"
+ android:background="@android:color/transparent"
+ android:layout_marginTop="@dimen/crop_text_margin_padding"
+ android:textColor="#ffffff"
+ android:textSize="12sp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/centerPanel"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:background="@android:color/transparent"
+ android:orientation="vertical">
+
+ <ImageButton
+ android:id="@+id/centerButton"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/crop_icon_size"
+ android:scaleType="centerInside"
+ android:background="@android:color/transparent"
+ android:layout_marginTop="@dimen/crop_icon_margin_padding" />
+
+ <TextView
+ android:id="@+id/centerText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:clickable="true"
+ android:background="@android:color/transparent"
+ android:layout_marginTop="@dimen/crop_text_margin_padding"
+ android:textColor="#ffffff"
+ android:textSize="12sp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/rightPanel"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:background="@android:color/transparent"
+ android:orientation="vertical">
+
+ <ImageButton
+ android:id="@+id/rightButton"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/crop_icon_size"
+ android:scaleType="centerInside"
+ android:layout_marginTop="@dimen/crop_icon_margin_padding"
+ android:background="@android:color/transparent" />
+
+ <TextView
+ android:id="@+id/rightText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:clickable="true"
+ android:background="@android:color/transparent"
+ android:layout_marginTop="@dimen/crop_text_margin_padding"
+ android:textColor="#ffffff"
+ android:textSize="12sp" />
+ </LinearLayout>
+
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/bottom_panel"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/category_actionbar_panel_height"
+ android:background="@color/edit_actionbar_background"
+ android:visibility="gone">
+
+ <ImageButton
+ android:id="@+id/cancel"
+ android:layout_width="@dimen/category_actionbar_panel_height"
+ android:layout_height="@dimen/category_actionbar_panel_height"
+ android:background="@color/edit_actionbar_background"
+ android:src="@drawable/cancel" />
+
+ <TextView
+ android:id="@+id/editor_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="16sp"
+ android:textColor="#fff"
+ android:layout_gravity="center"/>
+
+ <ImageButton
+ android:id="@+id/done"
+ android:layout_width="@dimen/category_actionbar_panel_height"
+ android:layout_height="@dimen/category_actionbar_panel_height"
+ android:background="@color/edit_actionbar_background"
+ android:layout_gravity="right"
+ android:src="@drawable/done" />
+ </FrameLayout>
+
+</LinearLayout>
diff --git a/res/layout/filtershow_editor_panel.xml b/res/layout/filtershow_editor_panel.xml
index 8fc01ecae..b7ec266f2 100644
--- a/res/layout/filtershow_editor_panel.xml
+++ b/res/layout/filtershow_editor_panel.xml
@@ -22,6 +22,15 @@
android:orientation="vertical"
android:visibility="visible" >
+ <Button
+ android:id="@+id/toggle_state"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:background="@color/background_main_toolbar"
+ android:text="@string/imageState"
+ android:visibility="gone"/>
+
<!-- <View -->
<!-- android:layout_width="match_parent" -->
<!-- android:layout_height="1dip" -->
diff --git a/res/layout/filtershow_seekbar.xml b/res/layout/filtershow_seekbar.xml
index f4d5577d2..5b884ae49 100644
--- a/res/layout/filtershow_seekbar.xml
+++ b/res/layout/filtershow_seekbar.xml
@@ -22,49 +22,31 @@
android:orientation="horizontal"
android:visibility="visible" >
- <LinearLayout
- android:id="@+id/basicFilterContainer"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/tvFilterValue"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_gravity="left|center_vertical"
- android:paddingLeft="23dp"
- android:paddingTop="20dp"
- android:textColor="#ffffff"
- android:textSize="20sp"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/tvFilterName"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/tvFilterValue"
- android:layout_gravity="center_vertical"
- android:paddingLeft="12dp"
- android:paddingTop="14dp"
- android:text="@string/apply_effect"
- android:textColor="#ffffff"
- android:textSize="14sp"
- android:visibility="gone" />
- </LinearLayout>
+ <ImageButton
+ android:id="@+id/slider_cancel"
+ android:layout_width="60dp"
+ android:layout_height="60dp"
+ android:src="@drawable/cancel"
+ android:layout_gravity="center_vertical"
+ android:background="#000000" />
<SeekBar
android:id="@+id/primarySeekBar"
style="@style/FilterShowSlider"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_gravity="center_vertical|center_horizontal"
- android:layout_marginRight="34dp"
android:layout_toRightOf="@+id/tvFilterName"
- android:layout_weight="1"
- android:paddingTop="20dp"
- android:visibility="gone" />
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_weight="1" />
+
+ <ImageButton
+ android:id="@+id/slider_save"
+ android:layout_width="60dp"
+ android:layout_height="60dp"
+ android:src="@drawable/done"
+ android:layout_gravity="center_vertical"
+ android:background="#000000" />
</LinearLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index ea0ced68e..6b5a51584 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -185,6 +185,12 @@
<dimen name="toolbar_height">84dp</dimen>
<dimen name="slot_width_album">116dp</dimen>
<dimen name="slot_height_album">116dp</dimen>
+ <dimen name="crop_icon_size">30dp</dimen>
+ <dimen name="crop_icon_margin_padding">20dp</dimen>
+ <dimen name="crop_text_margin_padding">6dp</dimen>
+ <dimen name="crop_rect_stroke">2dp</dimen>
+ <dimen name="crop_line_stroke">1dp</dimen>
+ <dimen name="crop_corner_length">14dp</dimen>
<!-- configuration for album page in listview -->
<integer name="albumlist_cols_land">1</integer>
diff --git a/res/values/filtershow_color.xml b/res/values/filtershow_color.xml
index 8d6bf0404..a768e690e 100644
--- a/res/values/filtershow_color.xml
+++ b/res/values/filtershow_color.xml
@@ -65,4 +65,5 @@
<color name="iconview_bottom_color">#80000000</color>
<color name="crop_panel_background_color">#A5000000</color>
+ <color name="crop_text_color">#4f92e9</color>
</resources> \ No newline at end of file
diff --git a/res/values/filtershow_strings.xml b/res/values/filtershow_strings.xml
index d3a4e7cee..1a4d2cde5 100644
--- a/res/values/filtershow_strings.xml
+++ b/res/values/filtershow_strings.xml
@@ -124,7 +124,7 @@
<!-- Label for the aspect 1:1 effect [CHAR LIMIT=15] -->
<string name="aspect9to16_effect">16:9</string>
<!-- Label for the aspect None effect [CHAR LIMIT=15] -->
- <string name="aspectNone_effect">None</string>
+ <string name="aspectNone_effect">Free</string>
<!-- Label for the aspect None effect [CHAR LIMIT=15] -->
<string name="aspectOriginal_effect">@string/original</string>
<!-- Label for when the aspect ratio is fixed to a value [CHAR LIMIT=15] -->
diff --git a/res/values/filtershow_styles.xml b/res/values/filtershow_styles.xml
index 1e97acced..974b81318 100644
--- a/res/values/filtershow_styles.xml
+++ b/res/values/filtershow_styles.xml
@@ -56,13 +56,11 @@
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/filtershow_slider</item>
<item name="android:indeterminateDrawable">@drawable/filtershow_slider</item>
- <item name="android:minHeight">13dip</item>
- <item name="android:maxHeight">13dip</item>
+ <item name="android:minHeight">4dip</item>
+ <item name="android:maxHeight">4dip</item>
<item name="android:thumb">@drawable/adjust</item>
- <item name="android:thumbOffset">16dip</item>
+ <item name="android:thumbOffset">0dip</item>
<item name="android:focusable">true</item>
- <item name="android:paddingStart">16dip</item>
- <item name="android:paddingEnd">16dip</item>
</style>
</resources> \ No newline at end of file
diff --git a/res/values/filtershow_values.xml b/res/values/filtershow_values.xml
index 1af341ea9..c15df9465 100644
--- a/res/values/filtershow_values.xml
+++ b/res/values/filtershow_values.xml
@@ -27,6 +27,8 @@
<!-- Category Panel Icon Size -->
<dimen name="category_panel_icon_size">80dip</dimen>
+ <dimen name="category_actionbar_panel_height">60dip</dimen>
+
<!-- Category Panel Text Size -->
<dimen name="category_panel_text_size">11dip</dimen>
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index a5b58f2b1..7c2768f8b 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -86,13 +86,17 @@ import com.android.gallery3d.filtershow.category.Action;
import com.android.gallery3d.filtershow.category.CategoryAdapter;
import com.android.gallery3d.filtershow.category.CategorySelected;
import com.android.gallery3d.filtershow.category.CategoryView;
+import com.android.gallery3d.filtershow.category.EditorCropPanel;
import com.android.gallery3d.filtershow.category.MainPanel;
+import com.android.gallery3d.filtershow.category.StraightenPanel;
import com.android.gallery3d.filtershow.category.SwipableView;
import com.android.gallery3d.filtershow.data.UserPresetsManager;
import com.android.gallery3d.filtershow.editors.Editor;
+import com.android.gallery3d.filtershow.editors.EditorCrop;
import com.android.gallery3d.filtershow.editors.EditorDualCamFusion;
import com.android.gallery3d.filtershow.editors.EditorManager;
import com.android.gallery3d.filtershow.editors.EditorPanel;
+import com.android.gallery3d.filtershow.editors.EditorStraighten;
import com.android.gallery3d.filtershow.editors.ImageOnlyEditor;
import com.android.gallery3d.filtershow.editors.TrueScannerEditor;
import com.android.gallery3d.filtershow.filters.FilterDrawRepresentation;
@@ -332,6 +336,38 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
return;
}
final int currentId = currentEditor.getID();
+ if (currentId == EditorCrop.ID) {
+ new Runnable() {
+ @Override
+ public void run() {
+ EditorCropPanel panel = new EditorCropPanel();
+ FragmentTransaction transaction =
+ getSupportFragmentManager().beginTransaction();
+ transaction.remove(getSupportFragmentManager().findFragmentByTag(
+ MainPanel.FRAGMENT_TAG));
+ transaction.replace(R.id.main_panel_container, panel,
+ MainPanel.FRAGMENT_TAG);
+ transaction.commit();
+ }
+ }.run();
+ return;
+ }
+ if (currentId == EditorStraighten.ID) {
+ new Runnable() {
+ @Override
+ public void run() {
+ StraightenPanel panel = new StraightenPanel();
+ FragmentTransaction transaction =
+ getSupportFragmentManager().beginTransaction();
+ transaction.remove(getSupportFragmentManager().findFragmentByTag(
+ MainPanel.FRAGMENT_TAG));
+ transaction.replace(R.id.main_panel_container, panel,
+ MainPanel.FRAGMENT_TAG);
+ transaction.commit();
+ }
+ }.run();
+ return;
+ }
Runnable showEditor = new Runnable() {
@Override
public void run() {
diff --git a/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java b/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java
new file mode 100644
index 000000000..30d874040
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+package com.android.gallery3d.filtershow.category;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.android.gallery3d.R;
+
+public class BasicGeometryPanel extends Fragment {
+ protected View mMainView;
+ protected ImageButton mExitButton;
+ protected ImageButton mApplyButton;
+ protected View mBottomPanel;
+ protected TextView mEditorName;
+
+ protected ImageButton[] mButtons;
+ protected TextView[] mTextViews;
+ protected View[] mPanels;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ mMainView = inflater.inflate(R.layout.filtershow_category_geometry_panel, container, false);
+ mEditorName = (TextView) mMainView.findViewById(R.id.editor_name);
+
+ initButtons();
+ initTexts();
+ initPanels();
+
+ mBottomPanel = mMainView.findViewById(R.id.bottom_panel);
+
+ mExitButton = (ImageButton) mMainView.findViewById(R.id.cancel);
+ mApplyButton = (ImageButton) mMainView.findViewById(R.id.done);
+ return mMainView;
+ }
+
+ protected void initButtons() {
+ mButtons = new ImageButton[] {
+ (ImageButton) mMainView.findViewById(R.id.leftButton),
+ (ImageButton) mMainView.findViewById(R.id.centerButton),
+ (ImageButton) mMainView.findViewById(R.id.rightButton)
+ };
+ }
+
+ protected void initTexts() {
+ mTextViews = new TextView[] {
+ (TextView) mMainView.findViewById(R.id.leftText),
+ (TextView) mMainView.findViewById(R.id.centerText),
+ (TextView) mMainView.findViewById(R.id.rightText)
+ };
+ }
+
+ protected void initPanels() {
+ mPanels = new View[] {
+ mMainView.findViewById(R.id.leftPanel),
+ mMainView.findViewById(R.id.centerPanel),
+ mMainView.findViewById(R.id.rightPanel)
+ };
+ }
+}
diff --git a/src/com/android/gallery3d/filtershow/category/EditorCropPanel.java b/src/com/android/gallery3d/filtershow/category/EditorCropPanel.java
new file mode 100644
index 000000000..d98f79d03
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/category/EditorCropPanel.java
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+
+package com.android.gallery3d.filtershow.category;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.android.gallery3d.R;
+import com.android.gallery3d.filtershow.FilterShowActivity;
+import com.android.gallery3d.filtershow.editors.EditorCrop;
+
+public class EditorCropPanel extends BasicGeometryPanel {
+ private EditorCrop mEditorCrop;
+
+ private int mSelectPosition = 0;
+
+ private final int[] mCropAspectIds = {
+ R.id.crop_menu_none,
+ R.id.crop_menu_original,
+ R.id.crop_menu_1to1
+ };
+
+ private final int[] mCropDrawableIds = {
+ R.drawable.crop_free_background,
+ R.drawable.crop_original_background,
+ R.drawable.crop_one_background
+ };
+
+ private final int[] mCropTextIds = {
+ R.string.aspectNone_effect,
+ R.string.aspectOriginal_effect,
+ R.string.aspect1to1_effect
+ };
+
+ private View.OnClickListener mOnClickListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ int index = (int) v.getTag();
+ changeSelection(index);
+ }
+ };
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
+ mEditorCrop = (EditorCrop) filterShowActivity.getEditor(EditorCrop.ID);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mEditorName.setText(R.string.crop);
+ mMainView.setBackgroundColor(getContext().getResources().getColor(
+ R.color.edit_actionbar_background));
+
+ mBottomPanel.setVisibility(View.VISIBLE);
+
+ if (mEditorCrop != null) {
+ mEditorCrop.reflectCurrentFilter();
+ }
+
+ highlightIndex(mSelectPosition);
+
+ final FilterShowActivity activity = (FilterShowActivity) getActivity();
+ mApplyButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mEditorCrop.finalApplyCalled();
+ activity.backToMain();
+ activity.setActionBar(false);
+ }
+ });
+ mExitButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ activity.cancelCurrentFilter();
+ activity.backToMain();
+ activity.setActionBar(false);
+ }
+ });
+ }
+
+ @Override
+ protected void initButtons() {
+ super.initButtons();
+ int size = mButtons.length;
+ for (int i = 0; i < size; i++) {
+ ImageButton view = mButtons[i];
+ view.setImageDrawable(getResources().getDrawable(mCropDrawableIds[i]));
+ // ues tag to store index.
+ view.setTag(i);
+ view.setOnClickListener(mOnClickListener);
+ }
+ }
+
+ @Override
+ protected void initTexts() {
+ super.initTexts();
+ int size = mTextViews.length;
+ for (int i = 0; i < size; i++) {
+ TextView view = mTextViews[i];
+ view.setText(mCropTextIds[i]);
+ }
+ }
+
+ private void changeSelection(int index) {
+ if (index >= 0 && index < mButtons.length) {
+ mSelectPosition = index;
+ mEditorCrop.changeCropAspect(mCropAspectIds[index]);
+ highlightIndex(index);
+ }
+ }
+
+ private void highlightIndex(int index) {
+ int size = mButtons.length;
+ for (int i = 0; i < size; i++) {
+ View view = mButtons[i];
+ view.setSelected(index == i);
+ }
+ size = mTextViews.length;
+ for (int i = 0; i < size; i++) {
+ TextView view = mTextViews[i];
+ view.setTextColor(index == i ?
+ getResources().getColor(R.color.crop_text_color) :
+ Color.WHITE);
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ if (mEditorCrop != null) {
+ mEditorCrop.detach();
+ }
+ super.onDetach();
+ }
+}
diff --git a/src/com/android/gallery3d/filtershow/category/GeometryPanel.java b/src/com/android/gallery3d/filtershow/category/GeometryPanel.java
new file mode 100644
index 000000000..b0d39175c
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/category/GeometryPanel.java
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+package com.android.gallery3d.filtershow.category;
+
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.android.gallery3d.filtershow.FilterShowActivity;
+import com.android.gallery3d.filtershow.filters.FilterRepresentation;
+import com.android.gallery3d.filtershow.filters.FiltersManager;
+
+import java.util.ArrayList;
+
+public class GeometryPanel extends BasicGeometryPanel {
+
+ ArrayList<FilterRepresentation> mFiltersRepresentations;
+
+ private View.OnClickListener mOnClickListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ int index = (int) v.getTag();
+ if (index >= 0 && index < mButtons.length) {
+ final FilterShowActivity activity = (FilterShowActivity) getActivity();
+ activity.showRepresentation(mFiltersRepresentations.get(index));
+ }
+ }
+ };
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ FiltersManager filtersManager = FiltersManager.getManager();
+ mFiltersRepresentations = filtersManager.getTools();
+ return super.onCreateView(inflater, container, savedInstanceState);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ }
+
+ @Override
+ protected void initButtons() {
+ super.initButtons();
+ Resources res = getActivity().getResources();
+ int size = mButtons.length;
+ for (int i = 0; i < size; i++) {
+ ImageButton view = mButtons[i];
+ view.setImageDrawable(res.getDrawable(mFiltersRepresentations.get(i).getOverlayId()));
+ // ues tag to store index.
+ view.setTag(i);
+ view.setOnClickListener(mOnClickListener);
+ }
+ }
+
+ @Override
+ protected void initTexts() {
+ super.initTexts();
+ Resources res = getActivity().getResources();
+ int size = mTextViews.length;
+ for (int i = 0; i < size; i++) {
+ TextView view = mTextViews[i];
+ view.setText(res.getString(mFiltersRepresentations.get(i).getTextId()));
+ }
+ }
+}
diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java
index ef554e615..c68f83cbd 100644
--- a/src/com/android/gallery3d/filtershow/category/MainPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java
@@ -228,7 +228,7 @@ public class MainPanel extends Fragment {
return true;
}
- private void setCategoryFragment(CategoryPanel category, boolean fromRight) {
+ private void setCategoryFragment(Fragment category, boolean fromRight) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
FilterShowActivity activity = (FilterShowActivity) getActivity();
if (fromRight) {
@@ -289,8 +289,7 @@ public class MainPanel extends Fragment {
}
boolean fromRight = isRightAnimation(GEOMETRY);
selection(mCurrentSelected, false);
- CategoryPanel categoryPanel = new CategoryPanel();
- categoryPanel.setAdapter(GEOMETRY);
+ GeometryPanel categoryPanel = new GeometryPanel();
setCategoryFragment(categoryPanel, fromRight);
mCurrentSelected = GEOMETRY;
selection(mCurrentSelected, true);
diff --git a/src/com/android/gallery3d/filtershow/category/StraightenPanel.java b/src/com/android/gallery3d/filtershow/category/StraightenPanel.java
new file mode 100644
index 000000000..c3be2c956
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/category/StraightenPanel.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+package com.android.gallery3d.filtershow.category;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.View;
+
+import com.android.gallery3d.R;
+import com.android.gallery3d.filtershow.FilterShowActivity;
+import com.android.gallery3d.filtershow.editors.EditorStraighten;
+
+public class StraightenPanel extends BasicGeometryPanel {
+ private EditorStraighten mEditorStraighten;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ FilterShowActivity filterShowActivity = (FilterShowActivity) activity;
+ mEditorStraighten = (EditorStraighten) filterShowActivity.getEditor(EditorStraighten.ID);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mEditorName.setText(R.string.straighten);
+
+ mBottomPanel.setVisibility(View.VISIBLE);
+
+ final FilterShowActivity activity = (FilterShowActivity) getActivity();
+ mExitButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ activity.cancelCurrentFilter();
+ activity.backToMain();
+ activity.setActionBar(false);
+ }
+ });
+ mApplyButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mEditorStraighten.finalApplyCalled();
+ activity.backToMain();
+ activity.setActionBar(false);
+ }
+ });
+ }
+
+ @Override
+ protected void initPanels() {
+ super.initPanels();
+ int size = mPanels.length;
+ for (int i = 0; i < size; i++) {
+ View view = mPanels[i];
+ view.setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void onDetach() {
+ if (mEditorStraighten != null) {
+ mEditorStraighten.detach();
+ }
+ super.onDetach();
+ }
+}
diff --git a/src/com/android/gallery3d/filtershow/controller/BasicSlider.java b/src/com/android/gallery3d/filtershow/controller/BasicSlider.java
index 1ff3e1677..10ac65985 100644
--- a/src/com/android/gallery3d/filtershow/controller/BasicSlider.java
+++ b/src/com/android/gallery3d/filtershow/controller/BasicSlider.java
@@ -21,17 +21,15 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
-import android.widget.TextView;
import com.android.gallery3d.R;
+import com.android.gallery3d.filtershow.FilterShowActivity;
import com.android.gallery3d.filtershow.editors.Editor;
public class BasicSlider implements Control {
private SeekBar mSeekBar;
- private TextView mFilterValue,mFilterText;
private ParameterInteger mParameter;
Editor mEditor;
@@ -39,18 +37,38 @@ public class BasicSlider implements Control {
public void setUp(ViewGroup container, Parameter parameter, Editor editor) {
container.removeAllViews();
mEditor = editor;
- Context context = container.getContext();
+ final Context context = container.getContext();
mParameter = (ParameterInteger) parameter;
LayoutInflater inflater =
(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout lp = (LinearLayout) inflater.inflate(
R.layout.filtershow_seekbar, container, true);
- LinearLayout lpBasicFilterContainer = (LinearLayout) lp.findViewById(R.id.basicFilterContainer);
mSeekBar = (SeekBar) lp.findViewById(R.id.primarySeekBar);
- mFilterText = (TextView)lpBasicFilterContainer.findViewById(R.id.tvFilterName);
- mFilterValue = (TextView)lpBasicFilterContainer.findViewById(R.id.tvFilterValue);
mSeekBar.setVisibility(View.VISIBLE);
- mEditor.setBasicFilterUI(mFilterText, mFilterValue);
+ View saveButton = lp.findViewById(R.id.slider_save);
+ if (saveButton != null) {
+ saveButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ FilterShowActivity activity = (FilterShowActivity) context;
+ mEditor.finalApplyCalled();
+ activity.backToMain();
+ activity.setActionBar();
+ }
+ });
+ }
+ View cancelButton = lp.findViewById(R.id.slider_cancel);
+ if (cancelButton != null) {
+ cancelButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ FilterShowActivity activity = (FilterShowActivity) context;
+ activity.cancelCurrentFilter();
+ activity.backToMain();
+ activity.setActionBar();
+ }
+ });
+ }
updateUI();
mSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
diff --git a/src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java b/src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java
index df0f14fe0..8edbcba8f 100644
--- a/src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java
+++ b/src/com/android/gallery3d/filtershow/crop/CropDrawingUtils.java
@@ -16,6 +16,7 @@
package com.android.gallery3d.filtershow.crop;
+import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
@@ -25,13 +26,16 @@ import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
+import com.android.gallery3d.R;
+
public abstract class CropDrawingUtils {
- public static void drawRuleOfThird(Canvas canvas, RectF bounds) {
+ public static void drawRuleOfThird(Canvas canvas, RectF bounds, Context context) {
Paint p = new Paint();
p.setStyle(Paint.Style.STROKE);
- p.setColor(Color.argb(128, 255, 255, 255));
- p.setStrokeWidth(2);
+ p.setColor(Color.argb(75, 255, 255, 255));
+ p.setStrokeWidth(context.getResources().getDimensionPixelOffset(
+ R.dimen.crop_line_stroke));
float stepX = bounds.width() / 3.0f;
float stepY = bounds.height() / 3.0f;
float x = bounds.left + stepX;
@@ -46,14 +50,42 @@ public abstract class CropDrawingUtils {
}
}
- public static void drawCropRect(Canvas canvas, RectF bounds) {
+ public static void drawCropRect(Canvas canvas, RectF bounds, Context context) {
Paint p = new Paint();
p.setStyle(Paint.Style.STROKE);
p.setColor(Color.WHITE);
- p.setStrokeWidth(3);
+ p.setAlpha(75);
+ p.setStrokeWidth(context.getResources().getDimensionPixelOffset(
+ R.dimen.crop_rect_stroke));
canvas.drawRect(bounds, p);
}
+ public static void drawCorner(Canvas canvas, RectF bounds, Context context) {
+ int strokeWidth = context.getResources().getDimensionPixelOffset(
+ R.dimen.crop_rect_stroke);
+ Paint p = new Paint();
+ p.setStyle(Paint.Style.FILL);
+ p.setColor(Color.WHITE);
+ p.setAntiAlias(true);
+ p.setStrokeWidth(strokeWidth);
+ float cornerLength = context.getResources().getDimensionPixelOffset(
+ R.dimen.crop_corner_length);
+ float rectWidth = bounds.right - bounds.left;
+ float rectHeight = bounds.bottom - bounds.top;
+ float x = 0;
+ float y = 0;
+ for (int i = 0; i < 2; i++) {
+ y = i * rectHeight + bounds.top + strokeWidth / 2;
+ canvas.drawLine(bounds.left - strokeWidth / 2, y, cornerLength + bounds.left, y, p);
+ canvas.drawLine(bounds.right - cornerLength, y, bounds.right + strokeWidth / 2, y, p);
+ }
+ for (int j = 0; j < 2; j++) {
+ x = j * rectWidth + bounds.left;
+ canvas.drawLine(x, bounds.top, x, bounds.top + cornerLength, p);
+ canvas.drawLine(x, bounds.bottom - cornerLength, x, bounds.bottom, p);
+ }
+ }
+
public static void drawShade(Canvas canvas, RectF bounds) {
int w = canvas.getWidth();
int h = canvas.getHeight();
diff --git a/src/com/android/gallery3d/filtershow/crop/CropView.java b/src/com/android/gallery3d/filtershow/crop/CropView.java
index bbb7cfd4c..e1f42066c 100644
--- a/src/com/android/gallery3d/filtershow/crop/CropView.java
+++ b/src/com/android/gallery3d/filtershow/crop/CropView.java
@@ -356,9 +356,10 @@ public class CropView extends View {
CropDrawingUtils.drawShadows(canvas, p, mScreenCropBounds, mScreenImageBounds);
// Draw crop rect and markers
- CropDrawingUtils.drawCropRect(canvas, mScreenCropBounds);
+ CropDrawingUtils.drawCropRect(canvas, mScreenCropBounds, getContext());
+ CropDrawingUtils.drawCorner(canvas, mScreenCropBounds, getContext());
if (!mDoSpot) {
- CropDrawingUtils.drawRuleOfThird(canvas, mScreenCropBounds);
+ CropDrawingUtils.drawRuleOfThird(canvas, mScreenCropBounds, getContext());
} else {
Paint wpPaint = new Paint();
wpPaint.setColor(mWPMarkerColor);
@@ -370,8 +371,6 @@ public class CropView extends View {
CropDrawingUtils.drawWallpaperSelectionFrame(canvas, mScreenCropBounds,
mSpotX, mSpotY, wpPaint, p);
}
- CropDrawingUtils.drawIndicators(canvas, mCropIndicator, mIndicatorSize,
- mScreenCropBounds, mCropObj.isFixedAspect(), decode(mCropObj.getSelectState(), mRotation));
}
}
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorCrop.java b/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
index 6b19d3c2f..9312091d5 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
@@ -114,7 +114,7 @@ public class EditorCrop extends Editor implements EditorInfo {
});
}
- private void changeCropAspect(int itemId) {
+ public void changeCropAspect(int itemId) {
AspectInfo info = sAspects.get(itemId);
if (info == null) {
throw new IllegalArgumentException("Invalid resource ID: " + itemId);
diff --git a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
index 8398c31c2..d7b7f5724 100644
--- a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
+++ b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
@@ -79,7 +79,7 @@ public class ParametricEditor extends Editor {
landscapeMap.put(ParameterColor.sParameterType, ColorChooser.class);
portraitMap.put(ParameterInteger.sParameterType, BasicSlider.class);
- landscapeMap.put(ParameterInteger.sParameterType, TitledSlider.class);
+ landscapeMap.put(ParameterInteger.sParameterType, BasicSlider.class);
portraitMap.put(ParameterActionAndInt.sParameterType, ActionSlider.class);
landscapeMap.put(ParameterActionAndInt.sParameterType, ActionSlider.class);
portraitMap.put(ParameterStyles.sParameterType, StyleChooser.class);
diff --git a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java
index b72b5d2fd..d9b28cef1 100644
--- a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java
+++ b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java
@@ -388,9 +388,9 @@ public abstract class BaseFiltersManager implements FiltersManagerInterface {
};
int[] overlayId = {
- R.drawable.filtershow_button_geometry_crop,
- R.drawable.filtershow_button_geometry_straighten,
- R.drawable.filtershow_button_geometry_rotate
+ R.drawable.crop_crop,
+ R.drawable.crop_straighten,
+ R.drawable.crop_rotate
};
FilterRepresentation[] geometryFilters = {
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
index 2161f9af5..e2de11e8c 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
@@ -188,6 +188,8 @@ public class ImageCrop extends ImageShow {
x = y;
y = tmp;
}
+ RectF outer = mCropObj.getOuterBounds();
+ mCropObj.resetBoundsTo(outer, outer);
if (!mCropObj.setInnerAspectRatio(x, y)) {
Log.w(TAG, "failed to set aspect ratio");
}
@@ -267,12 +269,17 @@ public class ImageCrop extends ImageShow {
// If display matrix doesn't exist, create it and its dependencies
if (mDisplayCropMatrix == null || mDisplayMatrix == null || mDisplayMatrixInverse == null) {
mCropObj.unsetAspectRatio();
+ Resources res = getContext().getResources();
+ int panelHeight = res.getDimensionPixelOffset(R.dimen.category_panel_height) +
+ res.getDimensionPixelOffset(R.dimen.category_actionbar_panel_height);
mDisplayMatrix = GeometryMathUtils.getFullGeometryToScreenMatrix(mGeometry,
- bitmap.getWidth(), bitmap.getHeight(), canvas.getWidth(), canvas.getHeight());
+ bitmap.getWidth(), bitmap.getHeight(), canvas.getWidth(),
+ canvas.getHeight() - panelHeight);
float straighten = mGeometry.straighten;
mGeometry.straighten = 0;
mDisplayCropMatrix = GeometryMathUtils.getFullGeometryToScreenMatrix(mGeometry,
- bitmap.getWidth(), bitmap.getHeight(), canvas.getWidth(), canvas.getHeight());
+ bitmap.getWidth(), bitmap.getHeight(), canvas.getWidth(),
+ canvas.getHeight() - panelHeight);
mGeometry.straighten = straighten;
mDisplayMatrixInverse = new Matrix();
mDisplayMatrixInverse.reset();
@@ -314,12 +321,10 @@ public class ImageCrop extends ImageShow {
bitmap.getHeight());
if (mDisplayCropMatrix.mapRect(mScreenCropBounds)) {
// Draw crop rect and markers
- CropDrawingUtils.drawCropRect(canvas, mScreenCropBounds);
CropDrawingUtils.drawShade(canvas, mScreenCropBounds);
- CropDrawingUtils.drawRuleOfThird(canvas, mScreenCropBounds);
- CropDrawingUtils.drawIndicators(canvas, mCropIndicator, mIndicatorSize,
- mScreenCropBounds, mCropObj.isFixedAspect(),
- decode(mCropObj.getSelectState(), mGeometry.rotation.value()));
+ CropDrawingUtils.drawCropRect(canvas, mScreenCropBounds, getContext());
+ CropDrawingUtils.drawCorner(canvas, mScreenCropBounds, getContext());
+ CropDrawingUtils.drawRuleOfThird(canvas, mScreenCropBounds, getContext());
}
}