有源码吗???

来源:3-3 调节音量度(三)

一个小屁孩儿

2017-02-04 21:36

you 源码吗?

写回答 关注

3回答

  • 有泪的光
    2017-10-11 17:26:02

    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 07:54:17

    copy神器用不了啦。。。。

  • qq_和仙人掌握手_0
    2017-03-07 13:45:54

    我也在想这个问题

Android视频播放器

Android系统自带的以及自定义播放器

20457 学习 · 80 问题

查看课程

相似问题