Android: seekbar.setMin requires API level 26
This commit is contained in:
parent
57f14b260b
commit
42b2d11f8d
|
@ -2,6 +2,7 @@ package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Build;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -239,7 +240,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||||
|
|
||||||
SeekBar seekbar = view.findViewById(R.id.seekbar);
|
SeekBar seekbar = view.findViewById(R.id.seekbar);
|
||||||
|
|
||||||
seekbar.setMin(item.getMin());
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
|
{
|
||||||
|
seekbar.setMin(item.getMin());
|
||||||
|
}
|
||||||
seekbar.setMax(item.getMax());
|
seekbar.setMax(item.getMax());
|
||||||
seekbar.setProgress(mSeekbarProgress);
|
seekbar.setProgress(mSeekbarProgress);
|
||||||
seekbar.setKeyProgressIncrement(5);
|
seekbar.setKeyProgressIncrement(5);
|
||||||
|
@ -413,7 +417,16 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||||
if (sliderSetting.getSelectedValue(getSettings()) != mSeekbarProgress)
|
if (sliderSetting.getSelectedValue(getSettings()) != mSeekbarProgress)
|
||||||
mView.onSettingChanged();
|
mView.onSettingChanged();
|
||||||
|
|
||||||
sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
|
{
|
||||||
|
sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sliderSetting
|
||||||
|
.setSelectedValue(getSettings(),
|
||||||
|
Math.max(mSeekbarProgress, sliderSetting.getMin()));
|
||||||
|
}
|
||||||
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
|
@ -423,7 +436,16 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||||
if (sliderSetting.getSelectedValue(getSettings()) != mSeekbarProgress)
|
if (sliderSetting.getSelectedValue(getSettings()) != mSeekbarProgress)
|
||||||
mView.onSettingChanged();
|
mView.onSettingChanged();
|
||||||
|
|
||||||
sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
|
{
|
||||||
|
sliderSetting.setSelectedValue(getSettings(), mSeekbarProgress);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sliderSetting
|
||||||
|
.setSelectedValue(getSettings(),
|
||||||
|
Math.max(mSeekbarProgress, sliderSetting.getMin()));
|
||||||
|
}
|
||||||
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue