Skip to content

Commit f134d23

Browse files
committed
Merge branch 'master' into dependency-injection
2 parents c2b21eb + 1bd782f commit f134d23

File tree

111 files changed

+1239
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1239
-373
lines changed

app/build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ dependencies {
1212
compile 'ch.acra:acra:4.7.0'
1313
compile 'org.mediawiki:api:1.3'
1414
compile 'commons-codec:commons-codec:1.10'
15+
compile 'com.github.pedrovgs:renderers:3.3.3'
16+
compile 'com.google.code.gson:gson:2.8.1'
17+
compile 'com.jakewharton.timber:timber:4.5.1'
18+
compile 'info.debatty:java-string-similarity:0.24'
19+
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0@aar'){
20+
transitive=true
21+
}
22+
1523
compile "com.android.support:support-v4:${project.supportLibVersion}"
1624
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
1725
compile "com.android.support:design:${project.supportLibVersion}"
18-
compile 'com.google.code.gson:gson:2.8.0'
26+
27+
compile "com.android.support:cardview-v7:${project.supportLibVersion}"
28+
1929
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
20-
compile 'com.github.pedrovgs:renderers:3.3.3'
2130
annotationProcessor "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
22-
compile 'com.jakewharton.timber:timber:4.5.1'
31+
2332
compile 'com.squareup.okhttp3:okhttp:3.8.1'
2433
compile 'com.squareup.okio:okio:1.13.0'
25-
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0@aar'){
26-
transitive=true
27-
}
2834

2935
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
3036
// Because RxAndroid releases are few and far between, it is recommended you also
@@ -39,12 +45,12 @@ dependencies {
3945
compile 'com.facebook.stetho:stetho:1.5.0'
4046

4147
testCompile 'junit:junit:4.12'
42-
testCompile 'org.robolectric:robolectric:3.3.2'
48+
testCompile 'org.robolectric:robolectric:3.4'
4349

4450
testCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
4551
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
4652
androidTestCompile "com.android.support:support-annotations:${project.supportLibVersion}"
47-
androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.2'){
53+
androidTestCompile ('com.android.support.test.espresso:espresso-core:3.0.1'){
4854
exclude group: 'com.google.code.findbugs'
4955
}
5056

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
android:name=".CommonsApplication"
2020
android:icon="@drawable/ic_launcher"
2121
android:label="@string/app_name"
22-
android:supportsRtl="true"
23-
android:theme="@style/Theme.AppCompat">
22+
android:theme="@style/LightAppTheme"
23+
android:supportsRtl="true" >
24+
<activity android:name="org.acra.CrashReportDialog"
25+
android:theme="@android:style/Theme.Dialog"
26+
android:launchMode="singleInstance"
27+
android:excludeFromRecents="true"
28+
android:finishOnTaskLaunch="true" />
2429

2530
<activity
2631
android:name="org.acra.CrashReportDialog"

app/src/main/java/fr/free/nrw/commons/CommonsApplication.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void onCreate() {
8787
}
8888

8989
@Override
90-
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
90+
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
9191
return injector();
9292
}
9393

@@ -120,8 +120,7 @@ public void clearApplicationData(Context context, LogoutListener logoutListener)
120120
//TODO: fix preference manager
121121
defaultPrefs.edit().clear().commit();
122122
applicationPrefs.edit().clear().commit();
123-
applicationPrefs.edit().putBoolean("firstrun", false).apply();
124-
otherPrefs.edit().clear().commit();
123+
applicationPrefs.edit().putBoolean("firstrun", false).apply();otherPrefs.edit().clear().commit();
125124
updateAllDatabases();
126125

127126
logoutListener.onLogoutComplete();

app/src/main/java/fr/free/nrw/commons/License.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import android.support.annotation.Nullable;
44

55
public class License {
6-
String key;
7-
String template;
8-
String url;
9-
String name;
6+
private String key;
7+
private String template;
8+
private String url;
9+
private String name;
1010

1111
public License(String key, String template, String url, String name) {
1212
if (key == null) {

app/src/main/java/fr/free/nrw/commons/Utils.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package fr.free.nrw.commons;
22

3+
import android.content.Context;
4+
import android.preference.PreferenceManager;
5+
36
import org.apache.commons.codec.binary.Hex;
47
import org.apache.commons.codec.digest.DigestUtils;
58

@@ -9,9 +12,9 @@
912
import java.util.regex.Matcher;
1013
import java.util.regex.Pattern;
1114

15+
import fr.free.nrw.commons.auth.LoginActivity;
1216
import fr.free.nrw.commons.settings.Prefs;
1317

14-
1518
public class Utils {
1619

1720
/**
@@ -76,10 +79,14 @@ public static String fixExtension(String title, String extension) {
7679
extension = "jpg";
7780
}
7881
title = jpegPattern.matcher(title).replaceFirst(".jpg");
79-
if (extension != null && !title.toLowerCase(Locale.getDefault()).endsWith("." + extension.toLowerCase(Locale.ENGLISH))) {
82+
if (extension != null && !title.toLowerCase(Locale.getDefault())
83+
.endsWith("." + extension.toLowerCase(Locale.ENGLISH))) {
8084
title += "." + extension;
8185
}
8286
return title;
8387
}
8488

89+
public static boolean isDarkTheme(Context context) {
90+
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme", false);
91+
}
8592
}

app/src/main/java/fr/free/nrw/commons/auth/AuthenticatedActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public abstract class AuthenticatedActivity extends NavigationBaseActivity {
2121
@Inject SessionManager sessionManager;
2222

2323
private String authCookie;
24-
24+
2525

2626
private void getAuthCookie(Account account, AccountManager accountManager) {
2727
Single.fromCallable(() -> accountManager.blockingGetAuthToken(account, "", false))

0 commit comments

Comments
 (0)