有源码吗???
you 源码吗?
you 源码吗?
2017-02-04
private void changeVolume(float detlaY){
int max = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);//获得最大音量
int current = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);//获取当前音量
int index = (int) (detlaY/screen_height*max*3);
int volume = Math.max(current+index,0);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0);
volume_seek.setProgress(volume);
}
private void changeBrightness(float detlaY){
WindowManager.LayoutParams attributes = getWindow().getAttributes();
mBrightness = attributes.screenBrightness;//获得当前屏幕的亮度
float index = detlaY/screen_height/3;
mBrightness += index;
if(mBrightness > 1.0f){
mBrightness = 1.0f;
}
if (mBrightness < 0.01f){
mBrightness = 0.01f;
}
attributes.screenBrightness = mBrightness;
getWindow().setAttributes(attributes);
}
举报