mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1046200 - Introduce NewTabletUI utility API (r=mcomella)
This commit is contained in:
parent
ec58463605
commit
81abf87173
32
mobile/android/base/NewTabletUI.java
Normal file
32
mobile/android/base/NewTabletUI.java
Normal file
@ -0,0 +1,32 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import org.mozilla.gecko.preferences.GeckoPreferences;
|
||||
import org.mozilla.gecko.util.HardwareUtils;
|
||||
|
||||
public class NewTabletUI {
|
||||
// XXX: Change default value to false before merging to m-c.
|
||||
// This value should be in sync with preferences_display.xml.
|
||||
private static final boolean DEFAULT = true;
|
||||
|
||||
private static Boolean sNewTabletUI;
|
||||
|
||||
public static synchronized boolean isEnabled(Context context) {
|
||||
if (!HardwareUtils.isTablet()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sNewTabletUI == null) {
|
||||
final SharedPreferences prefs = GeckoSharedPrefs.forApp(context);
|
||||
sNewTabletUI = prefs.getBoolean(GeckoPreferences.PREFS_NEW_TABLET_UI, DEFAULT);
|
||||
}
|
||||
|
||||
return sNewTabletUI;
|
||||
}
|
||||
}
|
@ -328,6 +328,7 @@ gbjar.sources += [
|
||||
'menu/MenuPanel.java',
|
||||
'menu/MenuPopup.java',
|
||||
'MotionEventInterceptor.java',
|
||||
'NewTabletUI.java',
|
||||
'NotificationClient.java',
|
||||
'NotificationHandler.java',
|
||||
'NotificationHelper.java',
|
||||
|
Loading…
Reference in New Issue
Block a user