Replace for loop with foreach

This commit is contained in:
Martin Fietz 2018-01-14 17:50:59 +01:00
parent cbc3b23753
commit a8e4fcf1b0
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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;
} }