Skip to content

Commit d1bd1c8

Browse files
author
maxieds
committed
Small bug in selected theme in the theme change dialog (III)
1 parent 4494931 commit d1bd1c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,12 @@ public void actionButtonAppSettings(View view) {
537537
}
538538
// set the correct current theme as the selected radio button:
539539
RadioGroup themeRadioGroup = (RadioGroup) dialogView.findViewById(R.id.themeRadioGroup);
540-
ArrayList<View> curThemeRadioBtns = new ArrayList<View>();
541-
themeRadioGroup.findViewsWithText(curThemeRadioBtns, "Theme: " + storedAppTheme, android.view.View.FIND_VIEWS_WITH_TEXT);
542-
if(curThemeRadioBtns.size() > 0) {
543-
((RadioButton) curThemeRadioBtns.get(0)).setSelected(true);
540+
for(int rb = 0; rb < themeRadioGroup.getChildCount(); rb++) {
541+
RadioButton curThemeBtn = (RadioButton) themeRadioGroup.getChildAt(rb);
542+
if(curThemeBtn.isEnabled() && curThemeBtn.getText().toString().equals("Theme: " + storedAppTheme)) {
543+
curThemeBtn.setSelected(true);
544+
break;
545+
}
544546
}
545547
// finish constructing the theme selection dialog:
546548
ScrollView themesScroller = new ScrollView(this);

0 commit comments

Comments
 (0)