Replace for loop with foreach
This commit is contained in:
parent
cbc3b23753
commit
a8e4fcf1b0
|
@ -96,10 +96,10 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2<Preference
|
||||||
solo.clickOnText(solo.getString(R.string.pref_compact_notification_buttons_title));
|
solo.clickOnText(solo.getString(R.string.pref_compact_notification_buttons_title));
|
||||||
solo.waitForDialogToOpen(1000);
|
solo.waitForDialogToOpen(1000);
|
||||||
// First uncheck every checkbox
|
// First uncheck every checkbox
|
||||||
for (int i=0; i<buttons.length; i++) {
|
for (String button : buttons) {
|
||||||
assertTrue(solo.searchText(buttons[i]));
|
assertTrue(solo.searchText(button));
|
||||||
if (solo.isTextChecked(buttons[i])) {
|
if (solo.isTextChecked(button)) {
|
||||||
solo.clickOnText(buttons[i]);
|
solo.clickOnText(button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now try to check all checkboxes
|
// Now try to check all checkboxes
|
||||||
|
|
|
@ -183,8 +183,8 @@ public class UserPreferences {
|
||||||
String.valueOf(NOTIFICATION_BUTTON_SKIP)),
|
String.valueOf(NOTIFICATION_BUTTON_SKIP)),
|
||||||
",");
|
",");
|
||||||
List<Integer> notificationButtons = new ArrayList<>();
|
List<Integer> notificationButtons = new ArrayList<>();
|
||||||
for (int i=0; i<buttons.length; i++) {
|
for (String button : buttons) {
|
||||||
notificationButtons.add(Integer.parseInt(buttons[i]));
|
notificationButtons.add(Integer.parseInt(button));
|
||||||
}
|
}
|
||||||
return notificationButtons;
|
return notificationButtons;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue