summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PopupList.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-07-17 16:50:31 +0800
committerOwen Lin <owenlin@google.com>2012-08-15 16:57:18 +0800
commit92f8a567fb47496df3a6b3f4a68b5359b0371fd2 (patch)
tree436ed5d845a9d47b1f4516f793b57a6efa3ce331 /src/com/android/gallery3d/ui/PopupList.java
parent7c1e03a70f54fb735e6ef59733a02131579ae1f8 (diff)
downloadandroid_packages_apps_Snap-92f8a567fb47496df3a6b3f4a68b5359b0371fd2.tar.gz
android_packages_apps_Snap-92f8a567fb47496df3a6b3f4a68b5359b0371fd2.tar.bz2
android_packages_apps_Snap-92f8a567fb47496df3a6b3f4a68b5359b0371fd2.zip
Add SimpleMenuXXX implementation for the Gingerbread platform.
1. Add a SimpleMenuInflator to parse the res/menu/xxx.xml files. 2. Add minimal code to show the menu. **NOTE** This change is going to be replaced by the ActionBar compat library when it gets ready and integrated. The purpose of this change is making Gallery/Camera run on GB. Change-Id: Ia7d402c82a6da1b9558ebbd103e161d2471b34dd
Diffstat (limited to 'src/com/android/gallery3d/ui/PopupList.java')
-rw-r--r--src/com/android/gallery3d/ui/PopupList.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java
index a5fbb09a8..9cd381430 100644
--- a/src/com/android/gallery3d/ui/PopupList.java
+++ b/src/com/android/gallery3d/ui/PopupList.java
@@ -1,4 +1,18 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.gallery3d.ui;
@@ -65,6 +79,10 @@ public class PopupList {
mItems.add(new Item(id, title));
}
+ public void clearItems() {
+ mItems.clear();
+ }
+
private final PopupWindow.OnDismissListener mOnDismissListener =
new PopupWindow.OnDismissListener() {
@SuppressWarnings("deprecation")
@@ -134,7 +152,7 @@ public class PopupList {
}
private PopupWindow createPopupWindow() {
- PopupWindow popup = new PopupWindow();
+ PopupWindow popup = new PopupWindow(mContext);
popup.setOnDismissListener(mOnDismissListener);
popup.setBackgroundDrawable(mContext.getResources().getDrawable(