提交 0993a844 编写于 作者: T Takeya Yuki

Add Volume Control Features

上级 019927e6
......@@ -8,6 +8,7 @@ Storage IO<br/>
Command Line Support<br/>
UI Control Features (Status Bar and Navigation Bar)<br/>
TTS Features<br/>
Volume Control Features<br/>
## Current Version
1.0-git-201708111646
......@@ -7,7 +7,7 @@ publish {
userOrg = 'takeya-yuki-studio' //bintray注册的用户名
groupId = 'jp.ruby.rubylib' //compile引用时的第1部分groupId
artifactId = 'rubylib' //compile引用时的第2部分项目名
publishVersion = '1.0.5' //compile引用时的第3部分版本号
publishVersion = '1.0.6' //compile引用时的第3部分版本号
desc = 'Ruby Extended Controls'
website = 'https://github.com/Takeya-Yuki/RubyLib.git'
}
......@@ -20,8 +20,8 @@ android {
defaultConfig {
minSdkVersion 17
targetSdkVersion 26
versionCode 5
versionName "1.0.5"
versionCode 6
versionName "1.0.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......
......@@ -8,4 +8,7 @@
</application>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SETTINGS"/>
</manifest>
package yuki.media.extended;
import android.content.Context;
import android.media.AudioManager;
/**
* Created by Akeno on 2017/08/12.
*/
public class VolumeControl {
public void GetMaxVolume(Context context,int streamType){
AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
am.getStreamMaxVolume(streamType);
}
public void SetVolume(Context context,int streamType,int volume,int flag){
AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
am.setStreamVolume(streamType,volume,flag);
}
public int GetVolume(Context context, int streamType){
AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
return am.getStreamVolume(streamType);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册