本文整理汇总了Java中android.provider.Settings.System.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java System.getInt方法的具体用法?Java System.getInt怎么用?Java System.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.provider.Settings.System
的用法示例。
在下文中一共展示了System.getInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMeizuNaviogationBarHeight
import android.provider.Settings.System; //导入方法依赖的package包/类
@Nullable
private static int getMeizuNaviogationBarHeight(Context context) {
int dimensionPixelSize;
boolean autoHideSmartBar = true;
boolean z = false;
boolean isMeiZu = Build.MANUFACTURER.equals("Meizu");
if (System.getInt(context.getContentResolver(), "mz_smartbar_auto_hide", z) != 1) {
autoHideSmartBar = z;
}
if (isMeiZu && !autoHideSmartBar) {
try {
Class c = Class.forName("com.android.internal.R$dimen");
dimensionPixelSize = context.getResources().getDimensionPixelSize(
Integer.parseInt(c.getField("mz_action_button_min_height")
.get(c.newInstance()).toString()));
} catch (Throwable th) {
}
}
return dimensionPixelSize;
}
示例2: getInt
import android.provider.Settings.System; //导入方法依赖的package包/类
protected static int getInt(int type, ContentResolver cr, String setting, int def) {
switch(type) {
case TYPE_GLOBAL:
return Global.getInt(cr, setting, def);
case TYPE_SYSTEM:
return System.getInt(cr, setting, def);
}
throw new IllegalArgumentException();
}
示例3: getScreenBrightness
import android.provider.Settings.System; //导入方法依赖的package包/类
private int getScreenBrightness() {
int screenBrightness = 255;
try {
screenBrightness = System.getInt(this.mActivity.getContentResolver(), "screen_brightness");
} catch (Exception exception) {
exception.printStackTrace();
}
return screenBrightness;
}
示例4: getScreenBrightness
import android.provider.Settings.System; //导入方法依赖的package包/类
private int getScreenBrightness() {
int screenBrightness = 255;
try {
screenBrightness = System.getInt(getActivity().getContentResolver(), "screen_brightness");
} catch (SettingNotFoundException e) {
}
return screenBrightness;
}
示例5: isAutoBrightness
import android.provider.Settings.System; //导入方法依赖的package包/类
private boolean isAutoBrightness() {
try {
return System.getInt(this.mContext.getContentResolver(), "screen_brightness_mode") == 1;
} catch (SettingNotFoundException e) {
e.printStackTrace();
return false;
}
}
示例6: getBrightnessLevel
import android.provider.Settings.System; //导入方法依赖的package包/类
private int getBrightnessLevel() {
try {
return System.getInt(this.mContext.getContentResolver(), "screen_brightness");
} catch (SettingNotFoundException e) {
return 0;
}
}
示例7: isAirplaneModeOn
import android.provider.Settings.System; //导入方法依赖的package包/类
@SuppressLint("NewApi")
public static boolean isAirplaneModeOn(Context context) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
return Global.getInt(context.getContentResolver(), Global.AIRPLANE_MODE_ON, 0) != 0;
} else {
return System.getInt(context.getContentResolver(), System.AIRPLANE_MODE_ON, 0) != 0;
}
}
示例8: getScreenBrightnessStatus
import android.provider.Settings.System; //导入方法依赖的package包/类
public boolean getScreenBrightnessStatus() {
int auto_screen_bright;
int screen_bright_level;
try {
auto_screen_bright = System.getInt(getContentResolver(),
System.SCREEN_BRIGHTNESS_MODE);
screen_bright_level = System.getInt(getContentResolver(),
System.SCREEN_BRIGHTNESS);
if (auto_screen_bright == 1 || screen_bright_level > 10)
return Boolean.TRUE;
else
return Boolean.FALSE;
} catch(Settings.SettingNotFoundException e){
Log.e("Can't get Setting: ", e.toString());
}
return Boolean.FALSE;
}
示例9: getScreenBrightLevel
import android.provider.Settings.System; //导入方法依赖的package包/类
public String getScreenBrightLevel(){
int screen_bright = 2;
try{
screen_bright = System.getInt(getContentResolver(), System.SCREEN_BRIGHTNESS);
} catch(Settings.SettingNotFoundException e){
Log.e("Can't get Setting: ", e.toString());
}
return Integer.toString(screen_bright);
}
示例10: onChange
import android.provider.Settings.System; //导入方法依赖的package包/类
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
if (mSeekBar != null) {
int volume = System.getInt(mContext.getContentResolver(),
System.VOLUME_SETTINGS[AlarmPlayer.SAMPLE_STREAM], -1);
// Works around an atomicity problem with volume updates
// TODO: Fix the actual issue, probably in AudioService
if (volume >= 0) {
mSeekBar.setProgress(volume);
}
}
}
示例11: checkGlobalSetting
import android.provider.Settings.System; //导入方法依赖的package包/类
private static boolean checkGlobalSetting(Context context) {
return System.getInt(context.getContentResolver(), "haptic_feedback_enabled", 0) == 1;
}
示例12: getShowTouches
import android.provider.Settings.System; //导入方法依赖的package包/类
public boolean getShowTouches() {
int setting = System.getInt(contentResolver, SHOW_TOUCHES_SETTING, 0);
return setting == 1;
}
示例13: getLightness
import android.provider.Settings.System; //导入方法依赖的package包/类
public static int getLightness(Activity act) {
return System.getInt(act.getContentResolver(), System.SCREEN_BRIGHTNESS, -1);
}
示例14: getScreenOffTimeout
import android.provider.Settings.System; //导入方法依赖的package包/类
public static int getScreenOffTimeout(Context context){
return System.getInt(context.getContentResolver(), System.SCREEN_OFF_TIMEOUT, -1);
}
示例15: getSystemBrightnessMode
import android.provider.Settings.System; //导入方法依赖的package包/类
public void getSystemBrightnessMode() {
system_brightness_mode = System.getInt(mContext.getContentResolver(),
System.SCREEN_BRIGHTNESS_MODE,
System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
}