Use more switches

This commit is contained in:
Daniel Martí 2015-12-07 21:20:11 +01:00
parent 62f6fd3d44
commit e20188b804
2 changed files with 20 additions and 18 deletions

View File

@ -12,14 +12,15 @@ public class MockCategoryResources extends MockFDroidResources {
@Override
public String getString(int id) {
if (id == R.string.category_All) {
return "All";
} else if (id == R.string.category_Recently_Updated) {
return "Recently Updated";
} else if (id == R.string.category_Whats_New) {
return "Whats New";
} else {
return "";
switch (id) {
case R.string.category_All:
return "All";
case R.string.category_Recently_Updated:
return "Recently Updated";
case R.string.category_Whats_New:
return "Whats New";
default:
return "";
}
}

View File

@ -20,16 +20,17 @@ public class MockFDroidResources extends MockResources {
@Override
public int getInteger(int id) {
if (id == R.integer.fdroid_repo_inuse) {
return 1;
} else if (id == R.integer.fdroid_archive_inuse) {
return 0;
} else if (id == R.integer.fdroid_repo_priority) {
return 10;
} else if (id == R.integer.fdroid_archive_priority) {
return 20;
} else {
return 0;
switch (id) {
case R.integer.fdroid_repo_inuse:
return 1;
case R.integer.fdroid_archive_inuse:
return 0;
case R.integer.fdroid_repo_priority:
return 10;
case R.integer.fdroid_archive_priority:
return 20;
default:
return 0;
}
}