mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-05 20:52:14 -05:00
move main project files into standard gradle/Android Studio layout
This makes it a lot easier to setup all the testing stuff. Mostly, I'm tired of fighting Android Studio's fragility, so I want to remove as much non-standardness as possible in the hopes of improving that situation. closes #534 https://gitlab.com/fdroid/fdroidclient/issues/534
This commit is contained in:
37
app/src/androidTest/java/mock/MockFDroidResources.java
Normal file
37
app/src/androidTest/java/mock/MockFDroidResources.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package mock;
|
||||
|
||||
import android.content.Context;
|
||||
import android.test.mock.MockResources;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
|
||||
public class MockFDroidResources extends MockResources {
|
||||
|
||||
private Context getStringDelegatingContext;
|
||||
|
||||
public MockFDroidResources(Context getStringDelegatingContext) {
|
||||
this.getStringDelegatingContext = getStringDelegatingContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString(int id) {
|
||||
return getStringDelegatingContext.getString(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInteger(int id) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user