diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index cdb5266146c..c3119de1568 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -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; diff --git a/mobile/android/base/BrowserToolbar.java b/mobile/android/base/BrowserToolbar.java index 751e3d29fbc..289ae78e166 100644 --- a/mobile/android/base/BrowserToolbar.java +++ b/mobile/android/base/BrowserToolbar.java @@ -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; diff --git a/mobile/android/base/DoorHanger.java b/mobile/android/base/DoorHanger.java index 36f1669f736..e14d15438df 100644 --- a/mobile/android/base/DoorHanger.java +++ b/mobile/android/base/DoorHanger.java @@ -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; diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 14b7cb6ab67..537608b6f14 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -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; diff --git a/mobile/android/base/GeckoViewsFactory.java b/mobile/android/base/GeckoViewsFactory.java index bad108559cb..be136174d9a 100644 --- a/mobile/android/base/GeckoViewsFactory.java +++ b/mobile/android/base/GeckoViewsFactory.java @@ -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; diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index 6c538fd5da3..13e3e7f1517 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -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 \ diff --git a/mobile/android/base/GeckoMenu.java b/mobile/android/base/menu/GeckoMenu.java similarity index 99% rename from mobile/android/base/GeckoMenu.java rename to mobile/android/base/menu/GeckoMenu.java index 85c57ac77dc..03a2e797609 100644 --- a/mobile/android/base/GeckoMenu.java +++ b/mobile/android/base/menu/GeckoMenu.java @@ -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; diff --git a/mobile/android/base/GeckoMenuInflater.java b/mobile/android/base/menu/GeckoMenuInflater.java similarity index 98% rename from mobile/android/base/GeckoMenuInflater.java rename to mobile/android/base/menu/GeckoMenuInflater.java index 2dfafabb3fa..9c2b52d689f 100644 --- a/mobile/android/base/GeckoMenuInflater.java +++ b/mobile/android/base/menu/GeckoMenuInflater.java @@ -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; diff --git a/mobile/android/base/GeckoMenuItem.java b/mobile/android/base/menu/GeckoMenuItem.java similarity index 99% rename from mobile/android/base/GeckoMenuItem.java rename to mobile/android/base/menu/GeckoMenuItem.java index a6be4ac8c5c..02b18bef70c 100644 --- a/mobile/android/base/GeckoMenuItem.java +++ b/mobile/android/base/menu/GeckoMenuItem.java @@ -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; diff --git a/mobile/android/base/GeckoSubMenu.java b/mobile/android/base/menu/GeckoSubMenu.java similarity index 98% rename from mobile/android/base/GeckoSubMenu.java rename to mobile/android/base/menu/GeckoSubMenu.java index 8b2d1de0d57..da6f9331fde 100644 --- a/mobile/android/base/GeckoSubMenu.java +++ b/mobile/android/base/menu/GeckoSubMenu.java @@ -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; diff --git a/mobile/android/base/MenuItemActionBar.java b/mobile/android/base/menu/MenuItemActionBar.java similarity index 97% rename from mobile/android/base/MenuItemActionBar.java rename to mobile/android/base/menu/MenuItemActionBar.java index acfa0076e4a..c1505b3ffd1 100644 --- a/mobile/android/base/MenuItemActionBar.java +++ b/mobile/android/base/menu/MenuItemActionBar.java @@ -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; diff --git a/mobile/android/base/MenuItemDefault.java b/mobile/android/base/menu/MenuItemDefault.java similarity index 98% rename from mobile/android/base/MenuItemDefault.java rename to mobile/android/base/menu/MenuItemDefault.java index a14aa4544d0..2e9317265ed 100644 --- a/mobile/android/base/MenuItemDefault.java +++ b/mobile/android/base/menu/MenuItemDefault.java @@ -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; diff --git a/mobile/android/base/MenuPanel.java b/mobile/android/base/menu/MenuPanel.java similarity index 92% rename from mobile/android/base/MenuPanel.java rename to mobile/android/base/menu/MenuPanel.java index 3eb9578864b..cacbad858f0 100644 --- a/mobile/android/base/MenuPanel.java +++ b/mobile/android/base/menu/MenuPanel.java @@ -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); diff --git a/mobile/android/base/MenuPopup.java b/mobile/android/base/menu/MenuPopup.java similarity index 98% rename from mobile/android/base/MenuPopup.java rename to mobile/android/base/menu/MenuPopup.java index 95ffc4879e5..dba20007611 100644 --- a/mobile/android/base/MenuPopup.java +++ b/mobile/android/base/menu/MenuPopup.java @@ -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; diff --git a/mobile/android/base/widget/AboutHomeSection.java b/mobile/android/base/widget/AboutHomeSection.java index 93c8cd56ebb..8d3d60adcf6 100644 --- a/mobile/android/base/widget/AboutHomeSection.java +++ b/mobile/android/base/widget/AboutHomeSection.java @@ -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; diff --git a/mobile/android/base/Divider.java b/mobile/android/base/widget/Divider.java similarity index 97% rename from mobile/android/base/Divider.java rename to mobile/android/base/widget/Divider.java index b71d93f5669..a9664ea4b64 100644 --- a/mobile/android/base/Divider.java +++ b/mobile/android/base/widget/Divider.java @@ -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; diff --git a/mobile/android/base/GeckoPopupMenu.java b/mobile/android/base/widget/GeckoPopupMenu.java similarity index 95% rename from mobile/android/base/GeckoPopupMenu.java rename to mobile/android/base/widget/GeckoPopupMenu.java index 143684a1065..9814ec455e8 100644 --- a/mobile/android/base/GeckoPopupMenu.java +++ b/mobile/android/base/widget/GeckoPopupMenu.java @@ -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;