You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add ProgressBar.incrementProgressBy() and AudioManager.setStreamVolume()
This commit is contained in:
@@ -48,4 +48,8 @@ public class AudioManager {
|
||||
public boolean isWiredHeadsetOn() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setStreamVolume(int streamType, int index, int flags) {
|
||||
System.out.println("AudioManager.setStreamVolume: >" + streamType + "< >" + index + "< >" + flags + "<");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,10 @@ public class ProgressBar extends View {
|
||||
}
|
||||
|
||||
public void setProgress(int progress) {
|
||||
if (progress > max)
|
||||
progress = max;
|
||||
else if (progress < 0)
|
||||
progress = 0;
|
||||
this.progress = progress;
|
||||
native_setProgress(widget, progress / (float)max);
|
||||
}
|
||||
@@ -96,4 +100,8 @@ public class ProgressBar extends View {
|
||||
}
|
||||
|
||||
public native void native_setIndeterminate(boolean indeterminate);
|
||||
|
||||
public void incrementProgressBy(int diff) {
|
||||
setProgress(progress + diff);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user