summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authorChao Zhang <chaoz@codeaurora.org>2016-05-12 17:34:31 +0800
committerLikai Ding <likaid@codeaurora.org>2016-07-08 09:51:18 +0800
commit8724b7e9dd3f64403f9469d20f797d7df379b9e8 (patch)
tree0cdce80efe042ef42a042c56e3abdc5bff883414 /src/com/android/gallery3d/ui
parent8788884b50a0bdaeac563f5b34f56abe79704fe0 (diff)
downloadandroid_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.tar.gz
android_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.tar.bz2
android_packages_apps_Gallery2-8724b7e9dd3f64403f9469d20f797d7df379b9e8.zip
Gallery: Modify the layout according to UX design document.
1. Modify toolbar layout according to UX design document. 2. Add touch effect to all buttons if need. 3. Modify video gesture indicator text color. 4. Don't use createChooser if only one app resolve Intent. 5. Modify export dialog layout in Photo Editor. 6. Modify truescanner icon. 7. Modify filter's label color. Change-Id: I987966ce76e5cab7bc50e5d2e52d1f7b5bdf2113 CRs-Fixed: 1017208
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java15
-rw-r--r--src/com/android/gallery3d/ui/PopupList.java2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index c28fd097b..c57e848e3 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -25,6 +25,8 @@ import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
//import android.drm.DrmHelper;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
@@ -46,6 +48,7 @@ import com.android.gallery3d.util.ThreadPool.Job;
import com.android.gallery3d.util.ThreadPool.JobContext;
import java.util.ArrayList;
+import java.util.List;
public class MenuExecutor {
private static final String TAG = "MenuExecutor";
@@ -254,7 +257,17 @@ public class MenuExecutor {
Intent intent = getIntentBySingleSelectedPath(Intent.ACTION_EDIT);
if (intent != null) {
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- ((Activity) mActivity).startActivity(Intent.createChooser(intent, null));
+
+ List<ResolveInfo> resolveInfoList = mActivity.getPackageManager()
+ .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
+ if (resolveInfoList != null && resolveInfoList.size() > 0) {
+ if (resolveInfoList.size() == 1) {
+ // only one app can resolve intent, don't use createChooser.
+ mActivity.startActivity(intent);
+ } else {
+ mActivity.startActivity(Intent.createChooser(intent, null));
+ }
+ }
}
return;
}
diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java
index efbddd3ea..a9aa2570f 100644
--- a/src/com/android/gallery3d/ui/PopupList.java
+++ b/src/com/android/gallery3d/ui/PopupList.java
@@ -154,7 +154,7 @@ public class PopupList {
}
private PopupWindow createPopupWindow() {
- PopupWindow popup = new PopupWindow(mContext);
+ PopupWindow popup = new PopupWindow(mContext, null, android.R.attr.popupMenuStyle);
popup.setOnDismissListener(mOnDismissListener);
popup.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ffffff")));