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


Java System.putInt方法代码示例

本文整理汇总了Java中android.provider.Settings.System.putInt方法的典型用法代码示例。如果您正苦于以下问题:Java System.putInt方法的具体用法?Java System.putInt怎么用?Java System.putInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.provider.Settings.System的用法示例。


在下文中一共展示了System.putInt方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: putInt

import android.provider.Settings.System; //导入方法依赖的package包/类
protected static boolean putInt(int type, ContentResolver cr, String setting, int value) {
    switch(type) {
        case TYPE_GLOBAL:
            return Global.putInt(cr, setting, value);
        case TYPE_SYSTEM:
            return System.putInt(cr, setting, value);
    }
    throw new IllegalArgumentException();
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:10,代码来源:SettingPref.java

示例2: setAutoBrightness

import android.provider.Settings.System; //导入方法依赖的package包/类
private void setAutoBrightness(boolean value) {
    if (value) {
        System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", 1);
    } else {
        System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", 0);
    }
}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:8,代码来源:SystemOverlayMenuService.java

示例3: changeScreenBrightness

import android.provider.Settings.System; //导入方法依赖的package包/类
public void changeScreenBrightness(float brightness)
{
       //system setting brightness values ranges between 0 - 255
       //We scale up by multiplying by 255
       //This change the brightness for over all system settings
	System.putInt(mContentResolver, System.SCREEN_BRIGHTNESS, (int) (brightness*255));
       //screen brightness values ranges between 0 - 1
       //This only changes the brightness for the current window
       LayoutParams mLayoutParams = mWindow.getAttributes();
       mLayoutParams.screenBrightness = brightness;
	mWindow.setAttributes(mLayoutParams);
}
 
开发者ID:PacktPublishing,项目名称:Android-Sensor-Programming-By-Example,代码行数:13,代码来源:LightSensorActivity.java

示例4: setLightness

import android.provider.Settings.System; //导入方法依赖的package包/类
public static void setLightness(Activity act, int value) {
	try {
		System.putInt(act.getContentResolver(), System.SCREEN_BRIGHTNESS, value);
		WindowManager.LayoutParams lp = act.getWindow().getAttributes();
		lp.screenBrightness = (value <= 0 ? 1 : value) / 255f;
		act.getWindow().setAttributes(lp);
	} catch (Exception e) {
		Toast.makeText(act, "Error set lightness", Toast.LENGTH_SHORT).show();
	}
}
 
开发者ID:korrio,项目名称:AdvancedVideoView,代码行数:11,代码来源:LightnessController.java

示例5: setLightness

import android.provider.Settings.System; //导入方法依赖的package包/类
/**
 * @param context
 * @param value
 */
public void setLightness(Activity act, int value) {
    System.putInt(act.getContentResolver(), System.SCREEN_BRIGHTNESS, value);
    try {
        WindowManager.LayoutParams lp = act.getWindow().getAttributes();
        lp.screenBrightness = (value < 0 ? 1 : value) / 255f;
        act.getWindow().setAttributes(lp);

        //saveBrightness(act,value);
    } catch (Exception e) {
        // TODO: handle exception
        e.printStackTrace();
    }
}
 
开发者ID:peterfuture,项目名称:dttv-android,代码行数:18,代码来源:ControlLightness.java

示例6: setBrightnessLevel

import android.provider.Settings.System; //导入方法依赖的package包/类
private void setBrightnessLevel(int brightness) {
    System.putInt(this.mContext.getContentResolver(), "screen_brightness", brightness);
}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:4,代码来源:SystemOverlayMenuService.java

示例7: setShowTouches

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

示例8: setManualBrightnessMode

import android.provider.Settings.System; //导入方法依赖的package包/类
public void setManualBrightnessMode() {
    System.putInt(mContext.getContentResolver(), System.SCREEN_BRIGHTNESS_MODE,
            System.SCREEN_BRIGHTNESS_MODE_MANUAL);
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:5,代码来源:Utility.java

示例9: setAutoBrightnessMode

import android.provider.Settings.System; //导入方法依赖的package包/类
public void setAutoBrightnessMode() {
    System.putInt(mContext.getContentResolver(), System.SCREEN_BRIGHTNESS_MODE,
            System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:5,代码来源:Utility.java

示例10: restoreSystemBrightnessMode

import android.provider.Settings.System; //导入方法依赖的package包/类
public void restoreSystemBrightnessMode() {
    System.putInt(mContext.getContentResolver(), System.SCREEN_BRIGHTNESS_MODE,
            system_brightness_mode);
}
 
开发者ID:firebirdberlin,项目名称:nightdream,代码行数:5,代码来源:Utility.java

示例11: setScreenBrightnessStatus

import android.provider.Settings.System; //导入方法依赖的package包/类
public void setScreenBrightnessStatus(int auto_bright, int bright_level) {
    System.putInt(getContentResolver(), System.SCREEN_BRIGHTNESS_MODE, auto_bright);
    System.putInt(getContentResolver(),  System.SCREEN_BRIGHTNESS, bright_level);

}
 
开发者ID:ismisepaul,项目名称:trainingmode,代码行数:6,代码来源:MainActivity.java


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