本文整理汇总了Java中de.robv.android.xposed.XSharedPreferences.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java XSharedPreferences.getBoolean方法的具体用法?Java XSharedPreferences.getBoolean怎么用?Java XSharedPreferences.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.robv.android.xposed.XSharedPreferences
的用法示例。
在下文中一共展示了XSharedPreferences.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPref
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public static void getPref(XSharedPreferences gPref, XSharedPreferences lPref, String packageName) {
SubscriptionKey = gPref.getString("SubscriptionKey", "");
EnableYandex = gPref.getBoolean("EnableYandex", false);
DelayWebView = Integer.parseInt(gPref.getString("DelayWebView", "500"));
//boolean anon = gPref.getBoolean("Anon", true);
//boolean debug = gPref.getBoolean("Debug", false);
//boolean localEnabled = gPref.getBoolean(packageName, false);
if (lPref.contains("OverRide")) {
if (lPref.getBoolean("OverRide", false))
gPref = lPref;
}
TranslateFromLanguage = gPref.getString("TranslateFromLanguage", "");
TranslateToLanguage = gPref.getString("TranslateToLanguage", "");
SetText = gPref.getBoolean("SetText", false);
SetHint = gPref.getBoolean("SetHint", false);
LoadURL = gPref.getBoolean("LoadURL", false);
DrawText = gPref.getBoolean("DrawText", false);
Caching = gPref.getBoolean("Cache", false);
Delay = Integer.parseInt(gPref.getString("Delay", "0"));
}
示例2: LockscreenAppBar
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public LockscreenAppBar(Context ctx, Context gbCtx, ViewGroup container,
Object statusBar, XSharedPreferences prefs) {
mContext = ctx;
mGbContext = gbCtx;
mContainer = container;
mStatusBar = statusBar;
mPrefs = prefs;
mPm = mContext.getPackageManager();
mHandler = new Handler();
mSafeLaunchEnabled = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHORTCUT_SAFE_LAUNCH, false);
mShowBadges = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHORTCUT_SHOW_BADGES, false);
mNdMonitor = SysUiManagers.NotifDataMonitor;
if (mNdMonitor != null) {
mNdMonitor.registerListener(this);
}
initAppSlots();
mKgMonitor = SysUiManagers.KeyguardMonitor;
mKgMonitor.registerListener(this);
}
示例3: initPreferences
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
private void initPreferences(XSharedPreferences prefs) {
mPrefs = prefs;
mBatteryStyle = Integer.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_BATTERY_STYLE, "1"));
mBatteryPercentTextEnabledSb = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_STATUSBAR, false);
mBatteryPercentTextHeaderHide = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_HEADER_HIDE, false);
mBatteryPercentTextKgMode = KeyguardMode.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_KEYGUARD, "DEFAULT"));
mMtkPercentTextEnabled = Utils.isMtkDevice() ?
Settings.Secure.getInt(mContext.getContentResolver(),
SETTING_MTK_BATTERY_PERCENTAGE, 0) == 1 : false;
mBatterySaverIndicationDisabled = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_BATTERY_SAVER_INDICATION_DISABLE, false);
}
示例4: initResources
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public static void initResources(XSharedPreferences prefs, InitPackageResourcesParam resparam) {
XModuleResources modRes = XModuleResources.createInstance(GravityBox.MODULE_PATH, resparam.res);
if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_SIGNAL_CLUSTER_HPLUS, false) &&
!Utils.isMtkDevice() && !Utils.isOxygenOs35Rom()) {
sQsHpResId = XResources.getFakeResId(modRes, R.drawable.ic_qs_signal_hp);
sSbHpResId = XResources.getFakeResId(modRes, R.drawable.stat_sys_data_fully_connected_hp);
resparam.res.setReplacement(sQsHpResId, modRes.fwd(R.drawable.ic_qs_signal_hp));
resparam.res.setReplacement(sSbHpResId, modRes.fwd(R.drawable.stat_sys_data_fully_connected_hp));
DATA_HP = new int[][]{
{sSbHpResId, sSbHpResId, sSbHpResId, sSbHpResId},
{sSbHpResId, sSbHpResId, sSbHpResId, sSbHpResId}
};
QS_DATA_HP = new int[]{sQsHpResId, sQsHpResId};
if (DEBUG) log("H+ icon resources initialized");
}
String lteStyle = prefs.getString(GravityBoxSettings.PREF_KEY_SIGNAL_CLUSTER_LTE_STYLE, "DEFAULT");
if (!lteStyle.equals("DEFAULT")) {
resparam.res.setReplacement(ModStatusBar.PACKAGE_NAME, "bool", "config_show4GForLTE",
lteStyle.equals("4G"));
}
}
示例5: initRecentsTaskMask
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
private static void initRecentsTaskMask(XSharedPreferences prefs, ClassLoader classLoader) {
if (!prefs.getBoolean(GravityBoxSettings.PREF_RECENT_TASK_MASK_ENABLE, false)) {
return;
}
XposedHelpers.findAndHookMethod(CLASS_TASK_THUMB_NAIL, classLoader, "setThumbnail", Bitmap.class, "android.app.ActivityManager$TaskThumbnailInfo", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Bitmap bitmap = (Bitmap) param.args[0];
if (bitmap != null && recentTaskAlpha != 100) {
Bitmap b = GraphicUtils.getBackGroundBitmap(taskMaskColor, bitmap.getWidth(), bitmap.getHeight());
b = GraphicUtils.getAlplaBitmap(b, 100 - recentTaskAlpha);
param.args[0] = GraphicUtils.mergeBitmap(bitmap, b);
}
}
});
}
示例6: SystemIconController
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public SystemIconController(ClassLoader classLoader, XSharedPreferences prefs) {
mBtMode = BtMode.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_STATUSBAR_BT_VISIBILITY, "DEFAULT"));
mHideVibrateIcon = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_STATUSBAR_HIDE_VIBRATE_ICON, false);
createHooks(classLoader);
}
示例7: shouldNotDisturb
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
private static boolean shouldNotDisturb(Context context) {
String pkgName = getTopLevelPackageName(context);
final XSharedPreferences uncPrefs = new XSharedPreferences(GravityBox.PACKAGE_NAME, "ledcontrol");
if(!uncPrefs.getBoolean(LedSettings.PREF_KEY_LOCKED, false) && pkgName != null) {
LedSettings ls = LedSettings.deserialize(uncPrefs.getStringSet(pkgName, null));
return (ls.getEnabled() && ls.getHeadsUpDnd());
} else {
return false;
}
}
示例8: KeyguardStateMonitor
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
protected KeyguardStateMonitor(Context context, XSharedPreferences prefs) {
mContext = context;
mPrefs = prefs;
mPm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mHandler = new Handler();
mProxWakeupEnabled = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_POWER_PROXIMITY_WAKE, false);
mImprintMode = ImprintMode.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_LOCKSCREEN_IMPRINT_MODE, "DEFAULT"));
createHooks();
}
示例9: initZygote
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
pref = new XSharedPreferences("tk.navideju.darkthemefixer","fix_states");
pref.makeWorldReadable();
File test = pref.getFile();
Boolean a = pref.getBoolean("com.android.chrome.toolbar_phone.location_bar",true);
XposedBridge.log(LOG_PRE+"From zygote: "+a+" can read?: "+test.canRead());
MODULE_PATH = startupParam.modulePath;
}
示例10: ProgressBarController
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public ProgressBarController(Context ctx, XSharedPreferences prefs) {
mContext = ctx;
mListeners = new ArrayList<ProgressStateListener>();
mProgressList = new LinkedHashMap<String, ProgressInfo>();
mMode = Mode.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS, "OFF"));
mSoundEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND_ENABLE, false);
mSoundUri = prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND,
"content://settings/system/notification_sound");
mSoundWhenScreenOffOnly = prefs.getBoolean(
GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND_SCREEN_OFF, false);
mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mHandler = new Handler();
}
示例11: ProgressBarView
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public ProgressBarView(ContainerType containerType, ViewGroup container,
XSharedPreferences prefs, ProgressBarController ctrl) {
super(container.getContext());
mContainerType = containerType;
mCtrl = ctrl;
mAnimated = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_ANIMATED, true);
mCentered = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_CENTERED, false);
mHeightPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_THICKNESS, 1),
getResources().getDisplayMetrics());
mEdgeMarginPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_MARGIN, 0),
getResources().getDisplayMetrics());
setScaleX(0f);
setBackgroundColor(Color.WHITE);
setVisibility(View.GONE);
container.addView(this);
mAnimator = new ObjectAnimator();
mAnimator.setTarget(this);
mAnimator.setInterpolator(new DecelerateInterpolator());
mAnimator.setDuration(ANIM_DURATION);
mAnimator.setRepeatCount(0);
}
示例12: updatePreference
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
private static void updatePreference(final XSharedPreferences prefs) {
prefs.reload();
allowSkipTrack = prefs.getBoolean(GravityBoxSettings.PREF_KEY_VOL_MUSIC_CONTROLS, false);
mShoudTriggerWakeUp = "enabled".equals(
prefs.getString(GravityBoxSettings.PREF_KEY_VOLUME_ROCKER_WAKE, "default")) &&
prefs.getBoolean(GravityBoxSettings.PREF_KEY_VOLUME_ROCKER_WAKE_ALLOW_MUSIC, false);
if (DEBUG) log("allowSkipTrack = " + allowSkipTrack + "; " +
"mShoudTriggerWakeUp=" + mShoudTriggerWakeUp);
}
示例13: onInitialize
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
@Override
protected void onInitialize(XSharedPreferences prefs) throws Throwable {
mGbContext = Utils.getGbContext(getContext());
SYMBOLS.put("b/s", mGbContext.getString(R.string.bit_per_sec_abbr));
SYMBOLS.put("B/s", mGbContext.getString(R.string.byte_per_sec_abbr));
SYMBOLS.put("k", mGbContext.getString(R.string.kilo_abbr));
SYMBOLS.put("M", mGbContext.getString(R.string.mega_abbr));
SYMBOLS.put("G", mGbContext.getString(R.string.giga_abbr));
mMode = Mode.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_MODE, "IN_OUT"));
mShowIcon = prefs.getBoolean(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_SHOW_ICON, true);
mAutoHide = prefs.getBoolean(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_AUTOHIDE, false);
mAutoHideThreshold = prefs.getInt(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_AUTOHIDE_TH, 10);
setSize();
}
示例14: BatteryBarView
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public BatteryBarView(ContainerType containerType, ViewGroup container, XSharedPreferences prefs) {
super(container.getContext());
mContainerType = containerType;
mEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_SHOW, false);
mPosition = Position.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_BATTERY_BAR_POSITION, "TOP"));
mMarginPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_MARGIN, 0),
getResources().getDisplayMetrics());
mHeightPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_THICKNESS, 2),
getResources().getDisplayMetrics());
mAnimateCharge = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_CHARGE_ANIM, false);
mDynaColor = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_DYNACOLOR, true);
mColor = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR, Color.WHITE);
mColorLow = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_LOW, 0xffffa500);
mColorCritical = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_CRITICAL, Color.RED);
mColorCharging = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_CHARGING, Color.GREEN);
mCentered = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_CENTERED, false);
container.addView(this);
setScaleX(0f);
setVisibility(View.GONE);
updatePosition();
}
示例15: initResources
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public static void initResources(final XSharedPreferences prefs) {
try {
Resources systemRes = XResources.getSystem();
int translucentDecor = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_TRANSLUCENT_DECOR, "0"));
if (translucentDecor != 0) {
XResources.setSystemWideReplacement("android", "bool", "config_enableTranslucentDecor", translucentDecor == 1);
}
if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_NAVBAR_OVERRIDE, false)) {
XResources.setSystemWideReplacement("android", "bool", "config_showNavigationBar",
prefs.getBoolean(GravityBoxSettings.PREF_KEY_NAVBAR_ENABLE,
SystemPropertyProvider.getSystemConfigBool(systemRes,
"config_showNavigationBar")));
}
XResources.setSystemWideReplacement("android", "bool", "config_unplugTurnsOnScreen",
prefs.getBoolean(GravityBoxSettings.PREF_KEY_UNPLUG_TURNS_ON_SCREEN,
SystemPropertyProvider.getSystemConfigBool(systemRes,
"config_unplugTurnsOnScreen")));
if (!Utils.isVerneeApolloDevice()) {
int pulseNotificationDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_PULSE_NOTIFICATION_DELAY, -1);
if (pulseNotificationDelay != -1) {
XResources.setSystemWideReplacement("android", "integer", "config_defaultNotificationLedOff",
(pulseNotificationDelay));;
}
}
XResources.setSystemWideReplacement("android", "bool", "config_sip_wifi_only", false);
if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_BRIGHTNESS_MASTER_SWITCH, false)) {
int brightnessMin = prefs.getInt(GravityBoxSettings.PREF_KEY_BRIGHTNESS_MIN, 20);
XResources.setSystemWideReplacement(
"android", "integer", "config_screenBrightnessSettingMinimum", brightnessMin);
if (DEBUG) log("Minimum brightness value set to: " + brightnessMin);
int screenDim = prefs.getInt(GravityBoxSettings.PREF_KEY_SCREEN_DIM_LEVEL, 10);
XResources.setSystemWideReplacement(
"android", "integer", "config_screenBrightnessDim", screenDim);
if (DEBUG) log("Screen dim level set to: " + screenDim);
}
// Safe media volume
Utils.TriState triState = Utils.TriState.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_SAFE_MEDIA_VOLUME, "DEFAULT"));
if (DEBUG) log(GravityBoxSettings.PREF_KEY_SAFE_MEDIA_VOLUME + ": " + triState);
if (triState != Utils.TriState.DEFAULT) {
XResources.setSystemWideReplacement("android", "bool", "config_safe_media_volume_enabled",
triState == Utils.TriState.ENABLED);
if (DEBUG) log("config_safe_media_volume_enabled: " + (triState == Utils.TriState.ENABLED));
}
} catch (Throwable t) {
XposedBridge.log(t);
}
}