課程
/移動開發(fā)
/Android
/Android視頻播放器
you 源碼嗎?
2017-02-04
源自:Android視頻播放器 3-3
正在回答
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);}
copy神器用不了啦。。。。
我也在想這個問題
舉報
Android系統(tǒng)自帶的以及自定義播放器
2 回答有提供資源文件或者源碼嗎?
2 回答可以下載源代碼嗎
1 回答老師,轉化dp和px的工具類的源碼有嗎
3 回答有圖片資源提供嗎
1 回答老師你好 請問有源碼
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-10-11
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);
}
2017-03-11
copy神器用不了啦。。。。
2017-03-07
我也在想這個問題