diff options
| author | huiyan <huiyan@codeaurora.org> | 2016-03-11 15:00:03 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-24 18:40:56 -0700 |
| commit | 88592e7579104869bb5440e27442eb8eee2d3a6a (patch) | |
| tree | 225d3ef4df80ae281fa81d56f194a76803381103 | |
| parent | afbd6845a03f8982a8503eba5aa41bc973537a2c (diff) | |
| download | android_packages_apps_Gallery2-88592e7579104869bb5440e27442eb8eee2d3a6a.tar.gz android_packages_apps_Gallery2-88592e7579104869bb5440e27442eb8eee2d3a6a.tar.bz2 android_packages_apps_Gallery2-88592e7579104869bb5440e27442eb8eee2d3a6a.zip | |
Gallery2: Adjust the style of share and change icons in action bar
Implement new requirement: change the share option to diplay in screen bottom,
and change the svg image of icons in tool bar.
Change-Id: I7b49232b83379a16bc6e962d0c3d009cbf0cfe24
CRs-Fixed: 988020
| -rw-r--r-- | res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png | bin | 508 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png | bin | 443 -> 0 bytes | |||
| -rw-r--r-- | res/drawable-xhdpi/dropdown_ic_arrow_normal_holo_dark.png | bin | 810 -> 0 bytes | |||
| -rw-r--r-- | res/drawable/dropdown_ic_arrow_normal_holo_dark.xml | 40 | ||||
| -rw-r--r-- | res/drawable/multiselect_delete.xml | 12 | ||||
| -rw-r--r-- | res/drawable/multiselect_share.xml | 12 | ||||
| -rw-r--r-- | res/layout/action_mode.xml | 6 | ||||
| -rw-r--r-- | res/menu/operation.xml | 1 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 2 | ||||
| -rw-r--r-- | src/com/android/gallery3d/ui/ActionModeHandler.java | 17 |
10 files changed, 64 insertions, 26 deletions
diff --git a/res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png b/res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png Binary files differdeleted file mode 100644 index 06e5b4730..000000000 --- a/res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png +++ /dev/null diff --git a/res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png b/res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png Binary files differdeleted file mode 100644 index 81de1bb46..000000000 --- a/res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png +++ /dev/null diff --git a/res/drawable-xhdpi/dropdown_ic_arrow_normal_holo_dark.png b/res/drawable-xhdpi/dropdown_ic_arrow_normal_holo_dark.png Binary files differdeleted file mode 100644 index 36d8cf47e..000000000 --- a/res/drawable-xhdpi/dropdown_ic_arrow_normal_holo_dark.png +++ /dev/null diff --git a/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml b/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml new file mode 100644 index 000000000..6f9216205 --- /dev/null +++ b/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml @@ -0,0 +1,40 @@ +<?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 xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + <path + android:fillAlpha="0.54" + android:fillColor="#FF000000" + android:pathData="M0,5h24l-12,14L0,5z" /> +</vector>
\ No newline at end of file diff --git a/res/drawable/multiselect_delete.xml b/res/drawable/multiselect_delete.xml index aade6c28b..6ac9b0f35 100644 --- a/res/drawable/multiselect_delete.xml +++ b/res/drawable/multiselect_delete.xml @@ -1,5 +1,5 @@ <!-- - Copyright (c) 2015, The Linux Foundation. All rights reserved. + Copyright (c) 2015-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 @@ -28,12 +28,12 @@ --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> + android:width="24dp" + android:height="24dp" + android:viewportWidth="72.0" + android:viewportHeight="72.0"> <path android:fillColor="#FF000000" - android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6V19zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" + android:pathData="M59,10L46.92,10l-2.16,-4L27,6l-2.16,4L13,10a1,1 0,0 0,-1 1v4a1,1 0,0 0,1 1h46a1,1 0,0 0,1 -1L60,11A1,1 0,0 0,59 10ZM16,60a6,6 0,0 0,6 6h28a6,6 0,0 0,6 -6L56,20L16,20v40Z" android:fillAlpha="0.54"/> </vector> diff --git a/res/drawable/multiselect_share.xml b/res/drawable/multiselect_share.xml index 1cf741806..30f50c026 100644 --- a/res/drawable/multiselect_share.xml +++ b/res/drawable/multiselect_share.xml @@ -1,5 +1,5 @@ <!-- - Copyright (c) 2015, The Linux Foundation. All rights reserved. + Copyright (c) 2015-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 @@ -28,12 +28,12 @@ --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> + android:width="24dp" + android:height="24dp" + android:viewportWidth="72.0" + android:viewportHeight="72.0"> <path android:fillColor="#FF000000" - android:pathData="M18,16.12c-0.76,0 -1.439,0.3 -1.96,0.77L8.91,12.74C8.96,12.51 9,12.28 9,12.04s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81c1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3s-3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.85C7.5,9.35 6.79,9.04 6,9.04c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.311 2.04,-0.811l7.12,4.16c-0.051,0.211 -0.08,0.43 -0.08,0.65c0,1.609 1.311,2.92 2.92,2.92s2.92,-1.311 2.92,-2.92S19.609,16.12 18,16.12z" + android:pathData="M54,48c-2.4,0 -4.5,0.9 -6.1,2.4L26.7,38.3c0.2,-0.8 0.3,-1.5 0.3,-2.4c0,-0.8 -0.1,-1.6 -0.3,-2.4l21.2,-12.1c1.6,1.7 3.7,2.6 6.1,2.6c5,0 9,-4 9,-9s-4,-9 -9,-9s-9,4 -9,9c0,0.8 0.1,1.6 0.3,2.3L24.1,29.4C22.5,27.9 20.4,27 18,27c-5,0 -9,4 -9,9s4,9 9,9c2.4,0 4.5,-0.9 6.1,-2.4l21.2,12.1C45.1,55.4 45,56.2 45,57c0,5 4,9 9,9s9,-4 9,-9S59,48 54,48z" android:fillAlpha="0.54"/> </vector> diff --git a/res/layout/action_mode.xml b/res/layout/action_mode.xml index a8f5fc2e7..f941b6427 100644 --- a/res/layout/action_mode.xml +++ b/res/layout/action_mode.xml @@ -24,9 +24,9 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent"> - <ImageView android:layout_gravity="right" - android:layout_width="wrap_content" - android:layout_height="match_parent" + <ImageView android:layout_gravity="right|center_vertical" + android:layout_width="8dp" + android:layout_height="8dp" android:src="@drawable/dropdown_ic_arrow_normal_holo_dark" /> <Button android:id="@+id/selection_menu" style="?android:attr/actionButtonStyle" diff --git a/res/menu/operation.xml b/res/menu/operation.xml index b34cd6803..2403f09fc 100644 --- a/res/menu/operation.xml +++ b/res/menu/operation.xml @@ -33,7 +33,6 @@ android:icon="@drawable/multiselect_share" android:title="@string/share" android:visible="false" - android:actionProviderClass="android.widget.ShareActionProvider" android:showAsAction="never"> </item> <item android:id="@+id/action_delete" diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index a84a5cca6..deb3b855c 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -914,7 +914,7 @@ public abstract class PhotoPage extends ActivityState implements mShowBars = true; mOrientationManager.unlockOrientation(); mActionBar.show(); - mActivity.getGLRoot().setLightsOutMode(false); + mActivity.getGLRoot().setLightsOutMode(true); refreshHidingMessage(); refreshBottomControlsWhenReady(); } diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java index 226dcea10..301d2e4e4 100644 --- a/src/com/android/gallery3d/ui/ActionModeHandler.java +++ b/src/com/android/gallery3d/ui/ActionModeHandler.java @@ -74,8 +74,8 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi private Menu mMenu; private MenuItem mSharePanoramaMenuItem; private MenuItem mShareMenuItem; + private Intent shareIntent; private ShareActionProvider mSharePanoramaActionProvider; - private ShareActionProvider mShareActionProvider; private SelectionMenu mSelectionMenu; private ActionModeListener mListener; private Future<?> mMenuTask; @@ -191,6 +191,12 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi "Gallery Delete Progress Listener"); } listener = mDeleteProgressListener; + } else if (action == R.id.action_share) { + String shareTitle = mActivity.getResources(). + getString(R.string.share_dialogue_title); + mActivity.startActivity(Intent.createChooser( + shareIntent, shareTitle)); + return true; } mMenuExecutor.onMenuClicked(item, confirmMsg, listener); } finally { @@ -258,13 +264,6 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi mSharePanoramaActionProvider.setShareHistoryFileName("panorama_share_history.xml"); } mShareMenuItem = menu.findItem(R.id.action_share); - if (mShareMenuItem != null) { - mShareActionProvider = (ShareActionProvider) mShareMenuItem - .getActionProvider(); - mShareActionProvider.setOnShareTargetSelectedListener( - mShareTargetSelectedListener); - mShareActionProvider.setShareHistoryFileName("share_history.xml"); - } return true; } @@ -527,7 +526,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi } mShareMenuItem.setEnabled(canShare); - mShareActionProvider.setShareIntent(share_intent); + shareIntent = share_intent; } } }); |
