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,13 +12,14 @@ 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) {
case R.string.category_All:
return "All"; return "All";
} else if (id == R.string.category_Recently_Updated) { case R.string.category_Recently_Updated:
return "Recently Updated"; return "Recently Updated";
} else if (id == R.string.category_Whats_New) { case R.string.category_Whats_New:
return "Whats New"; return "Whats New";
} else { default:
return ""; return "";
} }
} }

View File

@ -20,15 +20,16 @@ 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) {
case R.integer.fdroid_repo_inuse:
return 1; return 1;
} else if (id == R.integer.fdroid_archive_inuse) { case R.integer.fdroid_archive_inuse:
return 0; return 0;
} else if (id == R.integer.fdroid_repo_priority) { case R.integer.fdroid_repo_priority:
return 10; return 10;
} else if (id == R.integer.fdroid_archive_priority) { case R.integer.fdroid_archive_priority:
return 20; return 20;
} else { default:
return 0; return 0;
} }
} }