Merge "Revert "Gallery2: Set PhotoPage GL root reset when rotate"" into android_ui.lnx.1.2-dev
diff --git a/res/drawable/adjust.xml b/res/drawable/adjust.xml
index 3ce4ed2..ac0cff0 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 0000000..332eff7
--- /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 0000000..8928707
--- /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 0000000..0272da2
--- /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 0000000..eac62fb
--- /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 0000000..4404d4e
--- /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 0000000..f246997
--- /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 0000000..aa035ed
--- /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 0000000..91eef6c
--- /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 0000000..eafe861
--- /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 0000000..3bb0f76
--- /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 0000000..8caf459
--- /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 0000000..9fda1f4
--- /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 974ab91..efc809f 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 9ca10b6..5c2b541 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 26b92e7..0000000
--- 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 59885e0..0000000
--- 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 7e6d625..a23ca80 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 0000000..92dc359
--- /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 8fc01ec..b7ec266 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 f4d5577..5b884ae 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/colors.xml b/res/values/colors.xml
index b664562..9fd9192 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -79,7 +79,7 @@
<color name="toolbar_theme">#e53935</color>
<color name="multiselect_background">#ffffff</color>
<color name="edit_background">#212121</color>
- <color name="edit_actionbar_background">#000000</color>
+ <color name="edit_actionbar_background">#8A000000</color>
<color name="dialog_button_color">#009688</color>
<color name="timeline_title_text_color">#26000000</color>
<color name="timeline_title_number_text_color">#1a000000</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index ea0ced6..6b5a515 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 8d6bf04..a768e69 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 d3a4e7c..1a4d2cd 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 1e97acc..974b813 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 1af341e..c15df94 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/res/values/styles.xml b/res/values/styles.xml
index f34f829..e4b02fc 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -35,7 +35,6 @@
</style>
<style name="Theme.FilterShow" parent="Theme.Gallery">
<item name="android:windowBackground">@null</item>
- <item name="android:windowTranslucentStatus">false</item>
<item name="android:actionBarStyle">@style/FilterShowActionBar</item>
</style>
<style name="Theme.Crop" parent="Theme.GalleryBase">
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 39dfbd4..102aaaa 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -49,7 +49,6 @@
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.print.PrintHelper;
import android.util.DisplayMetrics;
@@ -86,16 +85,18 @@
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;
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
import com.android.gallery3d.filtershow.filters.FilterRotateRepresentation;
@@ -103,7 +104,6 @@
import com.android.gallery3d.filtershow.filters.FiltersManager;
import com.android.gallery3d.filtershow.filters.ImageFilter;
import com.android.gallery3d.filtershow.filters.SimpleMakeupImageFilter;
-import com.android.gallery3d.filtershow.filters.TrueScannerActs;
import com.android.gallery3d.filtershow.history.HistoryItem;
import com.android.gallery3d.filtershow.history.HistoryManager;
import com.android.gallery3d.filtershow.imageshow.ImageShow;
@@ -327,11 +327,50 @@
public void loadEditorPanel(FilterRepresentation representation,
final Editor currentEditor) {
+ if (currentEditor.showsActionBar()) {
+ setActionBar();
+ showActionBar(true);
+ } else {
+ showActionBar(false);
+ }
+
if (representation.getEditorId() == ImageOnlyEditor.ID) {
currentEditor.reflectCurrentFilter();
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() {
@@ -404,9 +443,8 @@
HistoryManager adapter = mMasterImage.getHistory();
int position = adapter.backToOriginal();// adapter.undo();
- mMasterImage.onHistoryItemClick(position);
+ mMasterImage.onHistoryItemClick(position, false);
v.setPressed(true);
- backToMain();
invalidateViews();
}
if (action == MotionEvent.ACTION_UP
@@ -415,7 +453,7 @@
v.setPressed(false);
HistoryManager adapter = mMasterImage.getHistory();
int position = adapter.backToCurrent();
- mMasterImage.onHistoryItemClick(position);
+ mMasterImage.onHistoryItemClick(position, false);
invalidateViews();
}
@@ -430,12 +468,21 @@
imgComparison.setVisibility(View.GONE);
}
+ private void showSaveButtonIfNeed() {
+ if (MasterImage.getImage().hasModifications()) {
+ mSaveButton.setVisibility(View.VISIBLE);
+ } else {
+ mSaveButton.setVisibility(View.GONE);
+ }
+ }
+
public void setActionBar() {
setActionBar(false);
}
public void setActionBar(boolean isEffectClicked) {
ActionBar actionBar = getActionBar();
+ actionBar.setShowHideAnimationEnabled(false);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setBackgroundDrawable(new ColorDrawable(getResources()
.getColor(R.color.edit_actionbar_background)));
@@ -452,6 +499,9 @@
saveImage();
}
});
+
+ showSaveButtonIfNeed();
+
mExitButton = actionBar.getCustomView().findViewById(R.id.filtershow_exit);
mExitButton.setOnClickListener(new OnClickListener() {
@Override
@@ -515,6 +565,21 @@
}
}
+ private void showActionBar(boolean show) {
+ ActionBar actionBar = getActionBar();
+ if (actionBar != null ) {
+ if (show) {
+ if (!actionBar.isShowing()) {
+ actionBar.show();
+ }
+ } else {
+ if (actionBar.isShowing()) {
+ actionBar.hide();
+ }
+ }
+ }
+ }
+
public void cancelCurrentFilter() {
MasterImage masterImage = MasterImage.getImage();
HistoryManager adapter = masterImage.getHistory();
@@ -924,6 +989,7 @@
FilterRepresentation filterRepresentation = representation.copy();
MasterImage.getImage().setPreset(copy, filterRepresentation, true);
MasterImage.getImage().setCurrentFilterRepresentation(null);
+ showSaveButtonIfNeed();
return;
}
}
@@ -1349,6 +1415,9 @@
//MenuItem redoItem = mMenu.findItem(R.id.redoButton);
MenuItem resetItem = mMenu.findItem(R.id.resetHistoryButton);
//mMasterImage.getHistory().setMenuItems(undoItem, redoItem, resetItem);
+ if (!mMasterImage.hasModifications()) {
+ mMenu.removeItem(R.id.resetHistoryButton);
+ }
}
@Override
@@ -1634,6 +1703,7 @@
mMasterImage.setPreset(original, rep, true);
invalidateViews();
backToMain();
+ showSaveButtonIfNeed();
}
public void showDefaultImageView() {
@@ -1648,19 +1718,25 @@
}
public void backToMain() {
+ showActionBar(true);
Fragment currentPanel = getSupportFragmentManager().findFragmentByTag(MainPanel.FRAGMENT_TAG);
if (currentPanel instanceof MainPanel) {
return;
}
loadMainPanel();
showDefaultImageView();
+ showComparisonButton();
+ }
+
+ private void showComparisonButton() {
+ if (imgComparison != null && imgComparison.getVisibility() == View.GONE) {
+ imgComparison.setVisibility(View.VISIBLE);
+ }
}
@Override
public void onBackPressed() {
- if (imgComparison != null && imgComparison.getVisibility() == View.GONE) {
- imgComparison.setVisibility(View.VISIBLE);
- }
+ showComparisonButton();
Fragment currentPanel = getSupportFragmentManager().findFragmentByTag(
MainPanel.FRAGMENT_TAG);
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 0000000..30d8740
--- /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 0000000..d98f79d
--- /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 0000000..b0d3917
--- /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 ef554e6..c68f83c 100644
--- a/src/com/android/gallery3d/filtershow/category/MainPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java
@@ -228,7 +228,7 @@
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 @@
}
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 0000000..c3be2c9
--- /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 1ff3e16..10ac659 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.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 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 df0f14f..8edbcba 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.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 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 bbb7cfd..e1f4206 100644
--- a/src/com/android/gallery3d/filtershow/crop/CropView.java
+++ b/src/com/android/gallery3d/filtershow/crop/CropView.java
@@ -356,9 +356,10 @@
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 @@
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/Editor.java b/src/com/android/gallery3d/filtershow/editors/Editor.java
index d4d872a..6161f19 100644
--- a/src/com/android/gallery3d/filtershow/editors/Editor.java
+++ b/src/com/android/gallery3d/filtershow/editors/Editor.java
@@ -96,6 +96,12 @@
return true;
}
+ public boolean showsActionBar() {
+ // ActionBar is not need if has seek bar in default.
+ // Subclasses should override if need.
+ return !showsSeekBar();
+ }
+
/*public void setUpEditorUI(View actionButton, View editControl,
Button editTitle, Button stateButton) {
mEditTitle = editTitle;
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorCrop.java b/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
index 6b19d3c..1f8b448 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorCrop.java
@@ -114,7 +114,7 @@
});
}
- 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);
@@ -156,6 +156,11 @@
}
@Override
+ public boolean showsActionBar() {
+ return false;
+ }
+
+ @Override
public int getTextId() {
return R.string.crop;
}
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorStraighten.java b/src/com/android/gallery3d/filtershow/editors/EditorStraighten.java
index d77df71..b2c0e9a 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorStraighten.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorStraighten.java
@@ -97,6 +97,11 @@
}
@Override
+ public boolean showsActionBar() {
+ return false;
+ }
+
+ @Override
public boolean showsPopupIndicator() {
return false;
}
diff --git a/src/com/android/gallery3d/filtershow/editors/ImageOnlyEditor.java b/src/com/android/gallery3d/filtershow/editors/ImageOnlyEditor.java
index d4e66ed..0858a01 100644
--- a/src/com/android/gallery3d/filtershow/editors/ImageOnlyEditor.java
+++ b/src/com/android/gallery3d/filtershow/editors/ImageOnlyEditor.java
@@ -37,6 +37,11 @@
super(id);
}
+ @Override
+ public boolean showsActionBar() {
+ return true;
+ }
+
public boolean useUtilityPanel() {
return false;
}
diff --git a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
index 8398c31..d7b7f57 100644
--- a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
+++ b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java
@@ -79,7 +79,7 @@
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 b72b5d2..d9b28ce 100644
--- a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java
+++ b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java
@@ -388,9 +388,9 @@
};
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 2161f9a..e2de11e 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
@@ -188,6 +188,8 @@
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 @@
// 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 @@
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());
}
}
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageStraighten.java b/src/com/android/gallery3d/filtershow/imageshow/ImageStraighten.java
index 829af18..cec45f1 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageStraighten.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageStraighten.java
@@ -249,6 +249,7 @@
MasterImage.getImage().invalidateFiltersOnly();
return;
}
+ toggleComparisonButtonVisibility();
GeometryMathUtils.initializeHolder(mDrawHolder, mLocalRep);
mDrawHolder.straighten = mAngle;
int imageWidth = image.getWidth();
diff --git a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
index c1c9d69..b2aae85 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
@@ -334,6 +334,12 @@
public synchronized void setPreset(ImagePreset preset,
FilterRepresentation change,
boolean addToHistory) {
+ setPreset(preset, change, addToHistory, true);
+ }
+
+ public synchronized void setPreset(ImagePreset preset,
+ FilterRepresentation change,
+ boolean addToHistory, boolean updateCategory) {
if (DEBUG) {
preset.showFilters();
}
@@ -345,10 +351,16 @@
}
updatePresets(true);
resetGeometryImages(false);
- mActivity.updateCategories();
+ if (updateCategory) {
+ mActivity.updateCategories();
+ }
}
public void onHistoryItemClick(int position) {
+ onHistoryItemClick(position, true);
+ }
+
+ public void onHistoryItemClick(int position, boolean updateCategory) {
HistoryItem historyItem = mHistory.getItem(position);
// We need a copy from the history
if (historyItem == null) {
@@ -356,7 +368,7 @@
}
ImagePreset newPreset = new ImagePreset(historyItem.getImagePreset());
// don't need to add it to the history
- setPreset(newPreset, historyItem.getFilterRepresentation(), false);
+ setPreset(newPreset, historyItem.getFilterRepresentation(), false, updateCategory);
mHistory.setCurrentPreset(position);
}