mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-05 10:49:26 +02:00
Merge pull request #8651 from Isira-Seneviratne/Use_limiting_methods
Use range-limiting methods.
This commit is contained in:
commit
cacce6d2d0
10 changed files with 49 additions and 75 deletions
|
@ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.ServiceCompat;
|
||||
import androidx.core.math.MathUtils;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
|
@ -451,7 +452,7 @@ public class RouterActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
selectedRadioPosition = Math.min(Math.max(-1, selectedRadioPosition), choices.size() - 1);
|
||||
selectedRadioPosition = MathUtils.clamp(selectedRadioPosition, -1, choices.size() - 1);
|
||||
if (selectedRadioPosition != -1) {
|
||||
((RadioButton) radioGroup.getChildAt(selectedRadioPosition)).setChecked(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue