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 @Override
public String getString(int id) { public String getString(int id) {
if (id == R.string.category_All) { switch (id) {
return "All"; case R.string.category_All:
} else if (id == R.string.category_Recently_Updated) { return "All";
return "Recently Updated"; case R.string.category_Recently_Updated:
} else if (id == R.string.category_Whats_New) { return "Recently Updated";
return "Whats New"; case R.string.category_Whats_New:
} else { return "Whats New";
return ""; default:
return "";
} }
} }

View File

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