Bug 869123: Make a "menu" package for menu related stuff. [r=wesj]

--HG--
rename : mobile/android/base/GeckoMenu.java => mobile/android/base/menu/GeckoMenu.java
rename : mobile/android/base/GeckoMenuInflater.java => mobile/android/base/menu/GeckoMenuInflater.java
rename : mobile/android/base/GeckoMenuItem.java => mobile/android/base/menu/GeckoMenuItem.java
rename : mobile/android/base/GeckoSubMenu.java => mobile/android/base/menu/GeckoSubMenu.java
rename : mobile/android/base/MenuItemActionBar.java => mobile/android/base/menu/MenuItemActionBar.java
rename : mobile/android/base/MenuItemDefault.java => mobile/android/base/menu/MenuItemDefault.java
rename : mobile/android/base/MenuPanel.java => mobile/android/base/menu/MenuPanel.java
rename : mobile/android/base/MenuPopup.java => mobile/android/base/menu/MenuPopup.java
rename : mobile/android/base/Divider.java => mobile/android/base/widget/Divider.java
rename : mobile/android/base/GeckoPopupMenu.java => mobile/android/base/widget/GeckoPopupMenu.java
extra : rebase_source : 3b51b8af8318e346fe41b3ab7c18421d67b1359b
This commit is contained in:
Sriram Ramasubramanian 2013-05-15 10:41:25 -07:00
parent d90bc9e08c
commit 5c140c7ef2
17 changed files with 49 additions and 22 deletions

View File

@ -13,6 +13,7 @@ import org.mozilla.gecko.gfx.GeckoLayerClient;
import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.PanZoomController;
import org.mozilla.gecko.menu.GeckoMenu;
import org.mozilla.gecko.util.FloatUtils;
import org.mozilla.gecko.util.GamepadUtils;
import org.mozilla.gecko.util.HardwareUtils;

View File

@ -9,6 +9,8 @@ import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.menu.GeckoMenu;
import org.mozilla.gecko.menu.MenuPopup;
import org.mozilla.gecko.util.StringUtils;
import org.mozilla.gecko.util.HardwareUtils;

View File

@ -5,6 +5,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.widget.Divider;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

View File

@ -14,6 +14,9 @@ import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.PanZoomController;
import org.mozilla.gecko.gfx.PluginLayer;
import org.mozilla.gecko.gfx.PointUtils;
import org.mozilla.gecko.menu.GeckoMenu;
import org.mozilla.gecko.menu.GeckoMenuInflater;
import org.mozilla.gecko.menu.MenuPanel;
import org.mozilla.gecko.health.BrowserHealthRecorder;
import org.mozilla.gecko.updater.UpdateService;
import org.mozilla.gecko.updater.UpdateServiceHelper;

View File

@ -5,6 +5,7 @@
package org.mozilla.gecko;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.menu.MenuItemDefault;
import org.mozilla.gecko.widget.AboutHomeView;
import org.mozilla.gecko.widget.AddonsSection;
import org.mozilla.gecko.widget.FaviconView;

View File

@ -79,7 +79,6 @@ FENNEC_JAVA_FILES = \
db/DBUtils.java \
DataReportingNotification.java \
Distribution.java \
Divider.java \
DoorHanger.java \
DoorHangerPopup.java \
Favicons.java \
@ -101,15 +100,10 @@ FENNEC_JAVA_FILES = \
GeckoEvent.java \
GeckoHalDefines.java \
GeckoInputConnection.java \
GeckoMenu.java \
GeckoMenuInflater.java \
GeckoMenuItem.java \
GeckoMessageReceiver.java \
GeckoSubMenu.java \
GeckoPreferences.java \
GeckoPreferenceFragment.java \
GeckoProfile.java \
GeckoPopupMenu.java \
GeckoSmsManager.java \
GeckoThread.java \
GeckoJavaSampler.java \
@ -122,10 +116,6 @@ FENNEC_JAVA_FILES = \
LightweightThemeDrawable.java \
LinkPreference.java \
MemoryMonitor.java \
MenuItemActionBar.java \
MenuItemDefault.java \
MenuPanel.java \
MenuPopup.java \
MotionEventInterceptor.java \
MultiChoicePreference.java \
NotificationClient.java \
@ -221,12 +211,22 @@ FENNEC_JAVA_FILES = \
gfx/TouchEventHandler.java \
gfx/ViewTransform.java \
gfx/VirtualLayer.java \
menu/GeckoMenu.java \
menu/GeckoMenuInflater.java \
menu/GeckoMenuItem.java \
menu/GeckoSubMenu.java \
menu/MenuItemActionBar.java \
menu/MenuItemDefault.java \
menu/MenuPanel.java \
menu/MenuPopup.java \
widget/AboutHome.java \
widget/AboutHomeView.java \
widget/AboutHomeSection.java \
widget/AddonsSection.java \
widget/DateTimePicker.java \
widget/Divider.java \
widget/FaviconView.java \
widget/GeckoPopupMenu.java \
widget/IconTabWidget.java \
widget/LastTabsSection.java \
widget/LinkTextView.java \

View File

@ -2,7 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import org.mozilla.gecko.widget.Divider;
import android.content.ComponentName;
import android.content.Context;

View File

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import android.content.Context;
import android.content.Intent;

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import android.content.Context;
import android.graphics.drawable.Drawable;

View File

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import android.content.Context;
import android.graphics.drawable.Drawable;

View File

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import android.content.Context;
import android.content.res.Resources;

View File

@ -3,7 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import android.content.Context;
import android.os.Build;
@ -31,7 +33,7 @@ public class MenuPanel extends LinearLayout {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Restrict the height to 75% of the screen-height. heightPixels changes during rotation.
DisplayMetrics metrics = GeckoApp.mAppContext.getResources().getDisplayMetrics();
DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
int restrictedHeightSpec = MeasureSpec.makeMeasureSpec((int) (0.75 * metrics.heightPixels), MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, restrictedHeightSpec);

View File

@ -3,7 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.menu;
import org.mozilla.gecko.R;
import android.content.Context;
import android.content.res.Resources;

View File

@ -4,10 +4,10 @@
package org.mozilla.gecko.widget;
import org.mozilla.gecko.Divider;
import org.mozilla.gecko.GeckoLinearLayout;
import org.mozilla.gecko.R;
import org.mozilla.gecko.util.GamepadUtils;
import org.mozilla.gecko.widget.Divider;
import android.content.Context;
import android.content.res.TypedArray;

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.widget;
import android.content.Context;
import android.util.AttributeSet;

View File

@ -3,7 +3,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
package org.mozilla.gecko.widget;
import org.mozilla.gecko.menu.GeckoMenu;
import org.mozilla.gecko.menu.GeckoMenuInflater;
import org.mozilla.gecko.menu.MenuPanel;
import org.mozilla.gecko.menu.MenuPopup;
import android.content.Context;
import android.view.Menu;