本文整理汇总了Java中de.robv.android.xposed.XSharedPreferences.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java XSharedPreferences.getInt方法的具体用法?Java XSharedPreferences.getInt怎么用?Java XSharedPreferences.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.robv.android.xposed.XSharedPreferences
的用法示例。
在下文中一共展示了XSharedPreferences.getInt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPreferences
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
private void initPreferences(XSharedPreferences prefs) {
mBgType = prefs.getString(
GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND,
GravityBoxSettings.NOTIF_BG_DEFAULT);
mColor = prefs.getInt(
GravityBoxSettings.PREF_KEY_NOTIF_COLOR, Color.BLACK);
setAlpha(prefs.getInt(
GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND_ALPHA, 0));
}
示例2: StatusbarClock
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public StatusbarClock(XSharedPreferences prefs) {
mClockShowDate = prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DATE, "disabled");
mClockShowDow = Integer.valueOf(
prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DOW, "0"));
mAmPmHide = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_AMPM_HIDE, false);
mClockHidden = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_HIDE, false);
mDowSize = prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DOW_SIZE, 70) / 100f;
mAmPmSize = prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_AMPM_SIZE, 70) / 100f;
mShowSeconds = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_SHOW_SECONDS, false);
}
示例3: 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();
}
示例4: 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();
}
示例5: 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);
}
}
示例6: PieController
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public PieController(Context context, Context gbContext, XSharedPreferences prefs) {
mContext = context;
mGbContext = gbContext;
mGbResources = gbContext.getResources();
mLongPressHandler = new PieLongPressHandler(context, prefs);
mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
final PackageManager pm = mContext.getPackageManager();
mHasTelephony = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
final Resources res = mContext.getResources();
Tracker.sDistance = mGbResources.getDimensionPixelSize(R.dimen.pie_trigger_distance);
mBackIcon = res.getDrawable(context.getResources().getIdentifier(
"ic_sysbar_back", "drawable", PACKAGE_NAME), null).mutate();
mBackAltIcon = res.getDrawable(context.getResources().getIdentifier(
"ic_sysbar_back_ime", "drawable", PACKAGE_NAME), null).mutate();
mRecentIcon = res.getDrawable(res.getIdentifier(
"ic_sysbar_recent", "drawable", PACKAGE_NAME), null).mutate();
mRecentAltIcon = mGbResources.getDrawable(R.drawable.ic_sysbar_recent_clear, null).mutate();
try {
mBaseStatusBarClass = XposedHelpers.findClass(CLASS_BASE_STATUSBAR, mContext.getClassLoader());
} catch (ClassNotFoundError e) {
XposedBridge.log(e);
}
mSysinfoDisabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_PIE_SYSINFO_DISABLE, false);
setLongpressDelay(Integer.valueOf(prefs.getString(
GravityBoxSettings.PREF_KEY_PIE_LONGPRESS_DELAY, "0")));;
mColorInfo = new ColorInfo();
mColorInfo.bgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_BG,
mGbResources.getColor(R.color.pie_background_color));
mColorInfo.selectedColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_SELECTED,
mGbResources.getColor(R.color.pie_selected_color));
mColorInfo.outlineColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_OUTLINE,
mGbResources.getColor(R.color.pie_outline_color));
mColorInfo.fgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_FG,
mGbResources.getColor(R.color.pie_foreground_color));
mColorInfo.textColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_TEXT,
mGbResources.getColor(R.color.pie_text_color));
updateColors();
}
示例7: init
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
try {
final Class<?> classSystemUIService = XposedHelpers.findClass(
"com.android.systemui.SystemUIService", classLoader);
mNormalMode = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_NORMAL_MODE, -1);
mPowerSavingMode = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_POWER_SAVING_MODE, -1);
mPowerSaveWhenScreenOff = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_SCREEN_OFF, false);
mIgnoreWhileLocked = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_IGNORE_LOCKED, true);
mModeChangeDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_MODE_CHANGE_DELAY, 5);
mScreenOffDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_SCREEN_OFF_DELAY, 0);
mIgnoreMobileDataAvailability = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_MDA_IGNORE, false);
mAdaptiveDelayThreshold = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_ADAPTIVE_DELAY, 0);
XposedHelpers.findAndHookMethod(classSystemUIService, "onCreate", new XC_MethodHook() {
@Override
protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
mContext = (Context) param.thisObject;
if (mContext != null) {
if (DEBUG) log("Initializing SmartRadio");
mSmartRadioEnabled = Settings.System.getInt(mContext.getContentResolver(),
SETTING_SMART_RADIO_ENABLED, 1) == 1;
mConnManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
mKeyguardManager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
mNetworkModeChanger = new NetworkModeChanger(mContext, new Handler());
Settings.System.putString(mContext.getContentResolver(),
SETTING_SMART_RADIO_STATE, mCurrentState.toString());
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(GravityBoxSettings.ACTION_PREF_SMART_RADIO_CHANGED);
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
intentFilter.addAction(Intent.ACTION_SCREEN_ON);
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
intentFilter.addAction(Intent.ACTION_USER_PRESENT);
intentFilter.addAction(NetworkModeChanger.ACTION_CHANGE_MODE_ALARM);
intentFilter.addAction(ACTION_TOGGLE_SMART_RADIO);
intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
intentFilter.addAction(PhoneWrapper.ACTION_NETWORK_TYPE_CHANGED);
mContext.registerReceiver(mBroadcastReceiver, intentFilter);
}
}
});
} catch (Throwable t) {
XposedBridge.log(t);
}
}
示例8: init
import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
public static void init(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
XSharedPreferences pre = new XSharedPreferences(BuildConfig.APPLICATION_ID, "xpnavbar");
pre.makeWorldReadable();
String json = pre.getString(ConstantStr.SHORT_CUT_DATA, "");
XpLog.i("short_cut_data " + json);
expandStatusBarWithRoot = pre.getBoolean(SPUtil.ROOT_DOWN, false);
clearMenLevel = pre.getInt(SPUtil.CLEAR_MEM_LEVEL, 200);
//获取主导行栏小点的位置
homePointPosition = pre.getInt(ConstantStr.HOME_POINT, 0);
chameleonNavbar = pre.getBoolean(SPUtil.CHAMELEON_NAVBAR, false);
rootDown = pre.getBoolean(SPUtil.ROOT_DOWN, false);
vibrate = pre.getBoolean(SPUtil.NAVBAR_VIBRATE, false);
//获取快捷按钮设置数据
Gson gson = new Gson();
//在第一次激活重新启动的时候,可能因为没有设置任何快捷按钮,导致这里报错
try {
shortCutList = gson.fromJson(json, ShortCutData.class).getData();
} catch (Exception e) {
shortCutList = new ArrayList<>();
}
//获取图片缩放大小
iconScale = pre.getInt(ConstantStr.ICON_SIZE, 40);
navbarHeight = pre.getInt(SPUtil.NAVBAR_HEIGHT, 100);
//加载图片资源文件
Resources res = XModuleResources.createInstance(startupParam.modulePath, null);
byte[] backImg = XposedHelpers.assetAsByteArray(res, "back.png");
byte[] clearMenImg = XposedHelpers.assetAsByteArray(res, "clear_mem.png");
byte[] clearNotificationImg = XposedHelpers.assetAsByteArray(res, "clear_notification.png");
byte[] downImg = XposedHelpers.assetAsByteArray(res, "down.png");
byte[] lightImg = XposedHelpers.assetAsByteArray(res, "light.png");
byte[] quickNoticesImg = XposedHelpers.assetAsByteArray(res, "quick_notices.png");
byte[] screenOffImg = XposedHelpers.assetAsByteArray(res, "screenoff.png");
// byte[] upImg = XposedHelpers.assetAsByteArray(res, "up.png");
byte[] volume = XposedHelpers.assetAsByteArray(res, "volume.png");
byte[] smallPonit = XposedHelpers.assetAsByteArray(res, "small_point.png");
byte[] home = XposedHelpers.assetAsByteArray(res, "ic_home.png");
byte[] startActs = XposedHelpers.assetAsByteArray(res, "start_acts.png");
byte[] playMusic = XposedHelpers.assetAsByteArray(res, "ic_music.png");
byte[] pauseMusic = XposedHelpers.assetAsByteArray(res, "ic_pause.png");
byte[] previousMusic = XposedHelpers.assetAsByteArray(res, "ic_previous.png");
byte[] nextMusic = XposedHelpers.assetAsByteArray(res, "ic_next.png");
byte[] scanWeChat = XposedHelpers.assetAsByteArray(res, "wechat_qr.png");
byte[] scanAlipay = XposedHelpers.assetAsByteArray(res, "alipay_qr.png");
byte[] screenshot = XposedHelpers.assetAsByteArray(res, "ic_image.png");
byte[] navBack = XposedHelpers.assetAsByteArray(res, "ic_sysbar_back.png");
byte[] navHome = XposedHelpers.assetAsByteArray(res, "ic_sysbar_home.png");
byte[] navRecent = XposedHelpers.assetAsByteArray(res, "ic_sysbar_recent.png");
byte[] clipBoard = XposedHelpers.assetAsByteArray(res, "ic_clipboard.png");
byte[] command = XposedHelpers.assetAsByteArray(res, "ic_command.png");
byte[] navHide = XposedHelpers.assetAsByteArray(res, "ic_nav_down.png");
mapImgRes.put(ConstantStr.FUNC_BACK_CODE, backImg);
mapImgRes.put(ConstantStr.FUNC_CLEAR_MEM_CODE, clearMenImg);
mapImgRes.put(ConstantStr.FUNC_CLEAR_NOTIFICATION_CODE, clearNotificationImg);
mapImgRes.put(ConstantStr.FUNC_DOWN_CODE, downImg);
mapImgRes.put(ConstantStr.FUNC_LIGHT_CODE, lightImg);
mapImgRes.put(ConstantStr.FUNC_QUICK_NOTICE_CODE, quickNoticesImg);
mapImgRes.put(ConstantStr.FUNC_SCREEN_OFF_CODE, screenOffImg);
// mapImgRes.put(ConstantStr.UP, upImg);
mapImgRes.put(ConstantStr.FUNC_VOLUME_CODE, volume);
mapImgRes.put(ConstantStr.FUNC_SMALL_POINT_CODE, smallPonit);
mapImgRes.put(ConstantStr.FUNC_HOME_CODE, home);
mapImgRes.put(ConstantStr.FUNC_START_ACTS_CODE, startActs);
mapImgRes.put(ConstantStr.FUNC_PLAY_MUSIC_CODE, playMusic);
mapImgRes.put(ConstantStr.FUNC_NEXT_PLAY_CODE, nextMusic);
mapImgRes.put(ConstantStr.FUNC_PREVIOUS_PLAY_CODE, previousMusic);
mapImgRes.put(ConstantStr.FUNC_WECHAT_SACNNER_CODE, scanWeChat);
mapImgRes.put(ConstantStr.FUNC_ALIPAY_SACNNER_CODE, scanAlipay);
mapImgRes.put(ConstantStr.FUNC_SCREEN_SHOT_CODE, screenshot);
mapImgRes.put(ConstantStr.FUNC_NAV_BACK_CODE, navBack);
mapImgRes.put(ConstantStr.FUNC_NAV_HOME_CODE, navHome);
mapImgRes.put(ConstantStr.FUNC_NAV_RECENT_CODE, navRecent);
mapImgRes.put(ConstantStr.FUNC_CLIPBOARD_CODE, clipBoard);
mapImgRes.put(ConstantStr.FUNC_COMMAND_CODE, command);
mapImgRes.put(ConstantStr.FUNC_NAV_HIDE_CODE, navHide);
}