Skip to content

Commit 0f98bca

Browse files
authored
Merge pull request commons-app#5 from commons-app/master
Update to latest upstream
2 parents ad9e848 + 401de30 commit 0f98bca

Some content is hidden

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

50 files changed

+835
-961
lines changed

README.md

+20-109
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,38 @@
11
# Wikimedia Commons Android app [![Build status](https://api.travis-ci.org/commons-app/apps-android-commons.svg)](https://travis-ci.org/commons-app/apps-android-commons)
22

3-
The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Download the app [here][8], or view our [website][9].
3+
The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Download the app [here][1], or view our [website][2].
44

5-
Initially started by the Wikimedia Foundation, this app is now maintained by volunteers. Anyone is welcome to improve it, just choose among the [open issues](https://github.com/commons-app/apps-android-commons/issues) and send us a pull request :-)
5+
Initially started by the Wikimedia Foundation, this app is now maintained by volunteers. Anyone is welcome to improve it, just choose among the [open issues][3] and send us a pull request :-)
66

7-
We are currently applying for an [IEG renewal][15] to work on the app for the next 6 months. Feedback is very much welcomed.
7+
We are currently applying for an [IEG renewal][10] to work on the app for the next 6 months. Feedback is very much welcomed.
88

99
<a href="https://f-droid.org/repository/browse/?fdid=fr.free.nrw.commons" target="_blank">
1010
<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="90"/></a>
1111
<a href="https://play.google.com/store/apps/details?id=fr.free.nrw.commons" target="_blank">
1212
<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="90"/></a>
1313

14+
## Documentation
1415

15-
## Develop with Android Studio or IntelliJ ##
16+
We try to have an extensive documentation at [our wiki here at Github][5]:
1617

17-
[Download Android Studio][1] (recommended) or [IntelliJ][2].
18-
19-
1. Open Android Studio/IntelliJ. Open the project:
20-
``File`` > ``New`` > ``Project from Version Control...`` > ``Git``
21-
or
22-
(From Quick Start menu): ``Check out project from Version Control``
23-
2. Enter ``https://github.com/commons-app/apps-android-commons/`` as Git Repository URL. Specify a (new) local directory you would like to clone into and select ``OK``.
24-
25-
## Build Manually ##
26-
27-
### Requirements ###
28-
29-
1. Java SDK 8 (OpenJDK 8 or Oracle Java SE 8)
30-
2. [Android SDK][3] (Level 23)
31-
3. [Gradle][4]
32-
33-
### Build Instructions ###
34-
35-
1. Set the environment variable `ANDROID_HOME` to be the path to your Android SDK
36-
2. Set the environment variable `JAVA_HOME` to the path to your Java SDK
37-
3. Run `gradlew.bat assembleDebug` (Windows) or `./gradlew assembleDebug` (Mac / Linux) to build an unisgned apk
38-
4. Alternatively, you can also connect your Android device via USB and install the app on it directly by running `gradlew.bat installDebug` (Windows) or `./gradlew installDebug` (Mac / Linux)
39-
40-
There are more thorough instructions on the [Android Developers website][5]
18+
* [User Documentation][6]
19+
* [Contributor Documentation][7]
20+
* [Volunteers Welcome!][9]
21+
* [Developer Documentation][8]
4122

4223
## License ##
4324

44-
This software is open source, licensed under the [Apache License 2.0][6].
45-
46-
## Code Structure ##
47-
48-
Key breakdowns:
49-
50-
Activities started within the UI:
51-
* ContributionsActivity (ContributionsListFragment, MediaDetailPagerFragment, MediaDetailFragment) - main "my uploads" list and detail view
52-
* LoginActivity - login screen when setting up an account
53-
* SettingsActivity - settings screen
54-
* AboutActivity - about screen
55-
56-
Activities receiving intents:
57-
* ShareActivity (SingleUploadFragment, CategorizationFragment) - handles receiving a file from another app, accepting a title/desc, and slating it for upload
58-
* MultipleShareActivity (MultipleUploadListFragment, CategorizationFragment) - handles receiving a batch of multiple files from another app, accepting a title/desc, and slating them for upload
59-
60-
Services:
61-
* WikiAccountAuthenticatorService - authentication service
62-
* UploadService - performs actual file uploads in background
63-
* ContributionsSyncService - polls for updated contributions list from server
64-
* ModificationsSyncService - pushes category additions up to server
65-
66-
Content providers:
67-
* ContributionsContentProvider - private storage for local copy of user's contribution list
68-
* ModificationsContentProvider - private storage for pending category and template modifications
69-
* CategoryContentProvider - private storage for recently used categories
70-
71-
72-
## On-Device Storage ##
73-
74-
Account credentials are encapsulated in an account provider. Currently only one Wikimedia Commons account is supported at a time. (Question: what is the actual storage for credentials?)
75-
76-
Preferences are stored in Android's SharedPreferences.
77-
78-
Information about past and pending uploads is stored in the Contributions content provider, which uses an SQLite database on the backend.
79-
80-
A list of recently-used categories is stored in the Categories content provider, which uses an SQLite database on the backend.
81-
82-
Captured files are not currently stored within the app, but are passed by content: or file: URI from other apps.
83-
84-
Thumbnail images are not currently cached.
85-
86-
## Volunteers welcome! ##
87-
88-
We are always looking for volunteers, feel free to step in! It is very easy:
89-
90-
1. Fork the repository and clone it to your computer, then follow the build instructions above.
91-
2. Choose an [unassigned issue](https://github.com/commons-app/apps-android-commons/issues?q=is%3Aopen+is%3Aissue+no%3Aassignee) that sounds interesting to you.
92-
3. Read the issue's comments to make sure you understand what is the bug, or what feature is being proposed.
93-
4. Write a "I start working on this" comment on the issue
94-
5. Write the code :-)
95-
6. Commit and push
96-
7. Go to your fork's Github webpage, select the "Pull Requests" tab and click "create a pull request", as a comment, write something like "Fix for issue #12345 crash when rotating screen", then submit the pull request.
97-
8. Within a few hours or days, a core developer will review your patch, and either merge it or suggest a few corrections.
98-
9. If you change your mind, or if it is too difficult, no problem, just write "Sorry I don't work on this anymore" on the issue, if possible including feedback (for instance what approaches failed) and ideas.
99-
100-
Thanks a lot!
101-
102-
## Translating the app ##
103-
104-
Thanks to the translation work of many volunteers this app is available in a multitude of languages.
105-
106-
Translation of the text content of the Wikimedia Commons Android app happens on the [Commons Android App project][10] on [translatewiki.net][11]. If you want to help translate the app please create an account there (to get "translate rights" edit 20 [random keys][13] or ask in their [chat][14]).
107-
108-
The translations from the translatewiki project are [periodically committed directly to this project][12] by the translatewiki team and later released with the normal updates to the Play Store.
109-
25+
This software is open source, licensed under the [Apache License 2.0][4].
11026

11127

11228

113-
[1]: https://developer.android.com/studio/index.html
114-
[2]: http://www.jetbrains.com/idea/download/index.html
115-
[3]: https://developer.android.com/sdk/index.html
116-
[4]: http://gradle.org/gradle-download/
117-
[5]: https://developer.android.com/studio/build/building-cmdline.html
118-
[6]: https://www.apache.org/licenses/LICENSE-2.0
119-
[7]: https://github.com/commons-app/apps-android-commons/issues
120-
[8]: https://play.google.com/store/apps/details?id=fr.free.nrw.commons
121-
[9]: https://commons-app.github.io/
122-
[10]: https://translatewiki.net/w/i.php?title=Special:Translate&group=commons-android
123-
[11]: https://translatewiki.net
124-
[12]: https://github.com/commons-app/apps-android-commons/commits/master?author=translatewiki
125-
[13]: https://translatewiki.net/wiki/Special:TranslationStash?
126-
[14]: https://translatewiki.net/wiki/Special:WebChat
127-
[15]: https://meta.wikimedia.org/wiki/Grants:Project/Improve_%27Upload_to_Commons%27_Android_App/Renewal
29+
[1]: https://play.google.com/store/apps/details?id=fr.free.nrw.commons
30+
[2]: https://commons-app.github.io/
31+
[3]: https://github.com/commons-app/apps-android-commons/issues
32+
[4]: https://www.apache.org/licenses/LICENSE-2.0
33+
[5]: https://github.com/commons-app/apps-android-commons/wiki
34+
[6]: https://github.com/commons-app/apps-android-commons/wiki#user-documentation
35+
[7]: https://github.com/commons-app/apps-android-commons/wiki#contributor-documentation
36+
[8]: https://github.com/commons-app/apps-android-commons/wiki#developer-documentation
37+
[9]: https://github.com/commons-app/apps-android-commons/wiki/Volunteers-welcome%21
38+
[10]: https://meta.wikimedia.org/wiki/Grants:Project/Improve_%27Upload_to_Commons%27_Android_App/Renewal

app/build.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies {
1717
compile "com.android.support:design:${project.supportLibVersion}"
1818
compile 'com.google.code.gson:gson:2.8.0'
1919
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
20-
compile 'com.github.pedrovgs:renderers:3.3.0'
20+
compile 'com.github.pedrovgs:renderers:3.3.3'
2121
annotationProcessor "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
2222
compile 'com.jakewharton.timber:timber:4.5.1'
2323
compile 'com.squareup.okhttp3:okhttp:3.8.1'
@@ -30,7 +30,10 @@ dependencies {
3030
// Because RxAndroid releases are few and far between, it is recommended you also
3131
// explicitly depend on RxJava's latest version for bug fixes and new features.
3232
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
33-
33+
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
34+
compile 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
35+
compile 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
36+
compile 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
3437

3538
compile 'com.facebook.fresco:fresco:1.3.0'
3639
compile 'com.facebook.stetho:stetho:1.5.0'

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import android.database.sqlite.SQLiteDatabase;
1212
import android.preference.PreferenceManager;
1313
import android.support.v4.util.LruCache;
14-
import android.util.Log;
1514

1615
import com.facebook.drawee.backends.pipeline.Fresco;
1716
import com.facebook.stetho.Stetho;
@@ -26,8 +25,8 @@
2625

2726
import fr.free.nrw.commons.auth.AccountUtil;
2827
import fr.free.nrw.commons.caching.CacheController;
29-
import fr.free.nrw.commons.category.Category;
3028
import fr.free.nrw.commons.contributions.Contribution;
29+
import fr.free.nrw.commons.data.Category;
3130
import fr.free.nrw.commons.data.DBOpenHelper;
3231
import fr.free.nrw.commons.modifications.ModifierSequence;
3332
import fr.free.nrw.commons.mwapi.ApacheHttpClientMediaWikiApi;
@@ -131,11 +130,14 @@ public void onCreate() {
131130

132131
Timber.plant(new Timber.DebugTree());
133132

134-
Stetho.initializeWithDefaults(this);
133+
135134

136135
if (!BuildConfig.DEBUG) {
137136
ACRA.init(this);
137+
} else {
138+
Stetho.initializeWithDefaults(this);
138139
}
140+
139141
// Fire progress callbacks for every 3% of uploaded content
140142
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
141143

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,6 @@ public static boolean isNullOrWhiteSpace(String value) {
277277
}
278278

279279
public static boolean isDarkTheme(Context context) {
280-
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme",true);
280+
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("theme",false);
281281
}
282282
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ protected String doInBackground(String... params) {
5858
protected void onPostExecute(String result) {
5959
super.onPostExecute(result);
6060
Timber.d("Login done!");
61-
6261
EventLog.schema(CommonsApplication.EVENT_LOGIN_ATTEMPT)
6362
.param("username", username)
6463
.param("result", result)

0 commit comments

Comments
 (0)