mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Demo: Read long values from trim slider.
Before, slider values were read as `floor()`'ed `longValue()`s, so that trimming to
intervals less than one second would be interpreted as a request for a zero-
duration trim.
Also, rename `radiusRange` references here to `trimRange`, since this is not a
radius range.
PiperOrigin-RevId: 480401556
(cherry picked from commit 6c59f9ece4)
This commit is contained in:
parent
5d8daba5c5
commit
abefef9b59
1 changed files with 5 additions and 5 deletions
|
|
@ -435,17 +435,17 @@ public final class ConfigurationActivity extends AppCompatActivity {
|
|||
return;
|
||||
}
|
||||
View dialogView = getLayoutInflater().inflate(R.layout.trim_options, /* root= */ null);
|
||||
RangeSlider radiusRangeSlider =
|
||||
RangeSlider trimRangeSlider =
|
||||
checkNotNull(dialogView.findViewById(R.id.trim_bounds_range_slider));
|
||||
radiusRangeSlider.setValues(0f, 60f); // seconds
|
||||
trimRangeSlider.setValues(0f, 60f); // seconds
|
||||
new AlertDialog.Builder(/* context= */ this)
|
||||
.setView(dialogView)
|
||||
.setPositiveButton(
|
||||
android.R.string.ok,
|
||||
(DialogInterface dialogInterface, int i) -> {
|
||||
List<Float> radiusRange = radiusRangeSlider.getValues();
|
||||
trimStartMs = 1000 * radiusRange.get(0).longValue();
|
||||
trimEndMs = 1000 * radiusRange.get(1).longValue();
|
||||
List<Float> trimRange = trimRangeSlider.getValues();
|
||||
trimStartMs = Math.round(1000 * trimRange.get(0));
|
||||
trimEndMs = Math.round(1000 * trimRange.get(1));
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
|
|
|
|||
Loading…
Reference in a new issue