From 42b2d11f8d351eb79e67a7bd34ec79cce450c199 Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Sat, 26 Sep 2020 23:55:16 -0400 Subject: [PATCH] Android: seekbar.setMin requires API level 26 --- .../features/settings/ui/SettingsAdapter.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index 605c23854e..7095b195a8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -2,6 +2,7 @@ package org.dolphinemu.dolphinemu.features.settings.ui; import android.content.Context; import android.content.DialogInterface; +import android.os.Build; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -239,7 +240,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.O) + { + seekbar.setMin(item.getMin()); + } seekbar.setMax(item.getMax()); seekbar.setProgress(mSeekbarProgress); seekbar.setKeyProgressIncrement(5); @@ -413,7 +417,16 @@ public final class SettingsAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.O) + { + sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress); + } + else + { + sliderSetting + .setSelectedValue(getSettings(), + Math.max(mSeekbarProgress, sliderSetting.getMin())); + } closeDialog(); } @@ -423,7 +436,16 @@ public final class SettingsAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.O) + { + sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress); + } + else + { + sliderSetting + .setSelectedValue(getSettings(), + Math.max(mSeekbarProgress, sliderSetting.getMin())); + } closeDialog(); }