mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-26 06:22:45 +00:00
Use a 1 Mbps key increment for bitrate
This commit is contained in:
parent
32171bb70c
commit
6391f2c43d
@ -32,6 +32,7 @@ public class SeekBarPreference extends DialogPreference
|
|||||||
private final int maxValue;
|
private final int maxValue;
|
||||||
private final int minValue;
|
private final int minValue;
|
||||||
private final int stepSize;
|
private final int stepSize;
|
||||||
|
private final int keyStepSize;
|
||||||
private final int divisor;
|
private final int divisor;
|
||||||
private int currentValue;
|
private int currentValue;
|
||||||
|
|
||||||
@ -63,6 +64,7 @@ public class SeekBarPreference extends DialogPreference
|
|||||||
minValue = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "min", 1);
|
minValue = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "min", 1);
|
||||||
stepSize = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "step", 1);
|
stepSize = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "step", 1);
|
||||||
divisor = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "divisor", 1);
|
divisor = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "divisor", 1);
|
||||||
|
keyStepSize = attrs.getAttributeIntValue(SEEKBAR_SCHEMA_URL, "keyStep", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,6 +132,9 @@ public class SeekBarPreference extends DialogPreference
|
|||||||
}
|
}
|
||||||
|
|
||||||
seekBar.setMax(maxValue);
|
seekBar.setMax(maxValue);
|
||||||
|
if (keyStepSize != 0) {
|
||||||
|
seekBar.setKeyProgressIncrement(keyStepSize);
|
||||||
|
}
|
||||||
seekBar.setProgress(currentValue);
|
seekBar.setProgress(currentValue);
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
@ -139,6 +144,9 @@ public class SeekBarPreference extends DialogPreference
|
|||||||
protected void onBindDialogView(View v) {
|
protected void onBindDialogView(View v) {
|
||||||
super.onBindDialogView(v);
|
super.onBindDialogView(v);
|
||||||
seekBar.setMax(maxValue);
|
seekBar.setMax(maxValue);
|
||||||
|
if (keyStepSize != 0) {
|
||||||
|
seekBar.setKeyProgressIncrement(keyStepSize);
|
||||||
|
}
|
||||||
seekBar.setProgress(currentValue);
|
seekBar.setProgress(currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
seekbar:min="500"
|
seekbar:min="500"
|
||||||
seekbar:step="500"
|
seekbar:step="500"
|
||||||
android:max="100000"
|
android:max="100000"
|
||||||
|
seekbar:keyStep="1000"
|
||||||
seekbar:divisor="1000"
|
seekbar:divisor="1000"
|
||||||
android:summary="@string/summary_seekbar_bitrate"
|
android:summary="@string/summary_seekbar_bitrate"
|
||||||
android:text="@string/suffix_seekbar_bitrate_mbps"
|
android:text="@string/suffix_seekbar_bitrate_mbps"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user