当前位置: 首页>>代码示例>>Java>>正文


Java System.getInt方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:UIsUtils.java

示例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();
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:10,代码来源:SettingPref.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:AlbumGestureController.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:BasePlayController.java

示例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;
    }
}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:9,代码来源:SystemOverlayMenuService.java

示例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;
    }
}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:8,代码来源:SystemOverlayMenuService.java

示例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;
    }
}
 
开发者ID:firebirdberlin,项目名称:tinytimetracker,代码行数:9,代码来源:TinyTimeTracker.java

示例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;
}
 
开发者ID:ismisepaul,项目名称:trainingmode,代码行数:20,代码来源:MainActivity.java

示例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);
}
 
开发者ID:ismisepaul,项目名称:trainingmode,代码行数:12,代码来源:MainActivity.java

示例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);
        }
    }
}
 
开发者ID:aulanov,项目名称:altidroid,代码行数:14,代码来源:VolumePreference.java

示例11: checkGlobalSetting

import android.provider.Settings.System; //导入方法依赖的package包/类
private static boolean checkGlobalSetting(Context context) {
    return System.getInt(context.getContentResolver(), "haptic_feedback_enabled", 0) == 1;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:HapticFeedbackController.java

示例12: getShowTouches

import android.provider.Settings.System; //导入方法依赖的package包/类
public boolean getShowTouches() {
    int setting = System.getInt(contentResolver, SHOW_TOUCHES_SETTING, 0);
    return setting == 1;
}
 
开发者ID:iwo,项目名称:SCR-Screen-Recorder-app,代码行数:5,代码来源:ShowTouchesController.java

示例13: getLightness

import android.provider.Settings.System; //导入方法依赖的package包/类
public static int getLightness(Activity act) {
	return System.getInt(act.getContentResolver(), System.SCREEN_BRIGHTNESS, -1);
}
 
开发者ID:korrio,项目名称:AdvancedVideoView,代码行数:4,代码来源:LightnessController.java

示例14: getScreenOffTimeout

import android.provider.Settings.System; //导入方法依赖的package包/类
public static int getScreenOffTimeout(Context context){
    return System.getInt(context.getContentResolver(), System.SCREEN_OFF_TIMEOUT, -1);
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:4,代码来源:Utility.java

示例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);
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:6,代码来源:Utility.java


注:本文中的android.provider.Settings.System.getInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。