Skip to content

Commit f46da66

Browse files
committed
2 parents 18fbd47 + 12a83da commit f46da66

Some content is hidden

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

51 files changed

+1472
-162
lines changed

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,33 @@ We try to have an extensive documentation at [our wiki here at Github][5]:
1818
* [Volunteers Welcome!][9]
1919
* [Developer Documentation][8]
2020

21+
## Libraries Used ##
22+
23+
* [Picasso][11]
24+
* [RSS-Parser][12]
25+
* [ViewPagerIndicator][13]
26+
* [PhotoView][14]
27+
* [Acra][15]
28+
* [Renderers][16]
29+
* [Gson][17]
30+
* [Timber][18]
31+
* [Java-String-Similarity][19]
32+
* [ReadMoreTextView][20]
33+
* [MaterialShowcaseView][21]
34+
* [Butterknife][22]
35+
* [OKHttp][23]
36+
* [Okio][24]
37+
* [RxJava][25]
38+
* [JSoup][26]
39+
* [Fresco][27]
40+
* [Stetho][28]
41+
* [Dagger][29]
42+
* [AndroidSVG][30]
43+
* [Java-HTTP-Fluent][31]
44+
* [CircleProgressBar][32]
45+
* [Glide][33]
46+
* [Leak Canary][34]
47+
2148
## License ##
2249

2350
This software is open source, licensed under the [Apache License 2.0][4].
@@ -34,3 +61,27 @@ This software is open source, licensed under the [Apache License 2.0][4].
3461
[8]: https://github.com/commons-app/apps-android-commons/wiki#developer-documentation
3562
[9]: https://github.com/commons-app/apps-android-commons/wiki/Volunteers-welcome%21
3663
[10]: https://meta.wikimedia.org/wiki/Grants:Project/Improve_%27Upload_to_Commons%27_Android_App/Renewal
64+
[11]: https://github.com/square/picasso
65+
[12]: https://github.com/prof18/RSS-Parser
66+
[13]: https://github.com/avianey/Android-ViewPagerIndicator
67+
[14]: https://github.com/chrisbanes/PhotoView
68+
[15]: https://github.com/ACRA/acra
69+
[16]: https://github.com/pedrovgs/Renderers
70+
[17]: https://github.com/google/gson
71+
[18]: https://github.com/JakeWharton/timber
72+
[19]: https://github.com/tdebatty/java-string-similarity
73+
[20]: https://github.com/bravoborja/ReadMoreTextView
74+
[21]: https://github.com/deano2390/MaterialShowcaseView
75+
[22]: https://github.com/JakeWharton/butterknife
76+
[23]: https://github.com/square/okhttp
77+
[24]: https://github.com/square/okio
78+
[25]: https://github.com/ReactiveX/RxJava
79+
[26]: https://github.com/jhy/jsoup
80+
[27]: https://github.com/facebook/fresco
81+
[28]: https://github.com/facebook/stetho
82+
[29]: https://github.com/google/dagger
83+
[30]: https://github.com/BigBadaboom/androidsvg
84+
[31]: https://github.com/yuvipanda/java-http-fluent/blob/master/src/main/java/in/yuvi/http/fluent/Http.java
85+
[32]: https://github.com/dinuscxj/CircleProgressBar
86+
[33]: https://github.com/bumptech/glide
87+
[34]: https://github.com/square/leakcanary

app/build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ dependencies {
7777
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY"
7878
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY"
7979

80-
implementation 'com.borjabravo:readmoretextview:2.1.0'
81-
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
8280
}
8381

8482
android {

app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<activity
115115
android:name=".explore.SearchActivity"
116116
android:label="@string/title_activity_search"
117+
android:configChanges="orientation|keyboardHidden"
117118
android:parentActivityName=".contributions.ContributionsActivity"
118119
/>
119120

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
144144
@OnClick(R.id.about_translate)
145145
public void launchTranslate(View view) {
146146
final ArrayAdapter<String> languageAdapter = new ArrayAdapter<String>(AboutActivity.this,
147-
android.R.layout.simple_spinner_item, language);
147+
android.R.layout.simple_spinner_dropdown_item, language);
148148
final Spinner spinner = new Spinner(AboutActivity.this);
149149
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
150150
spinner.setAdapter(languageAdapter);
151151
spinner.setGravity(17);
152+
spinner.setPadding(50,0,0,0);
152153

153154
AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this);
154155
builder.setView(spinner);

app/src/main/java/fr/free/nrw/commons/achievements/LevelController.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ public enum LevelInfo{
2525
LEVEL_12(12,R.style.LevelTwo,65 , 130, 90),
2626
LEVEL_13(13,R.style.LevelThree, 70, 140, 90),
2727
LEVEL_14(14,R.style.LevelFour, 75 , 150, 90),
28-
LEVEL_15(15,R.style.LevelFive, 80, 160, 90);
28+
LEVEL_15(15,R.style.LevelFive, 80, 160, 90),
29+
LEVEL_16(16,R.style.LevelOne, 160, 320, 91),
30+
LEVEL_17(17,R.style.LevelTwo, 320, 640, 92),
31+
LEVEL_18(18,R.style.LevelThree, 640, 1280, 93),
32+
LEVEL_19(19,R.style.LevelFour, 1280, 2560, 94),
33+
LEVEL_20(20,R.style.LevelFive, 2560, 5120, 95),
34+
LEVEL_21(21,R.style.LevelOne, 5120, 10240, 96),
35+
LEVEL_22(22,R.style.LevelTwo, 10240, 20480, 97),
36+
LEVEL_23(23,R.style.LevelThree, 20480, 40960, 98),
37+
LEVEL_24(24,R.style.LevelFour, 40960, 81920, 98),
38+
LEVEL_25(25,R.style.LevelFive, 81920, 163840, 98),
39+
LEVEL_26(26,R.style.LevelOne, 163840, 327680, 98),
40+
LEVEL_27(27,R.style.LevelTwo, 327680, 655360, 98);
2941

3042
private int levelNumber;
3143
private int levelStyle;

app/src/main/java/fr/free/nrw/commons/contributions/Contribution.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import fr.free.nrw.commons.Media;
1414
import fr.free.nrw.commons.settings.Prefs;
1515

16-
public class Contribution extends Media {
16+
public class Contribution extends Media {
1717

1818
public static Creator<Contribution> CREATOR = new Creator<Contribution>() {
1919
@Override

app/src/main/java/fr/free/nrw/commons/explore/SearchActivity.java

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.explore;
22

3+
import android.content.res.Configuration;
34
import android.database.DataSetObserver;
45
import android.os.Bundle;
56
import android.support.design.widget.TabLayout;
@@ -194,6 +195,10 @@ public void onSearchImageClicked(int index) {
194195
mediaDetails.showImage(index);
195196
forceInitBackButton();
196197
}
198+
@Override
199+
public void onConfigurationChanged(Configuration newConfig) {
200+
super.onConfigurationChanged(newConfig);
201+
}
197202

198203
/**
199204
* This method is called on Screen Rotation

app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
6060
private boolean isCategoryImage;
6161
private MediaDetailPagerFragment.MediaDetailProvider detailProvider;
6262
private int index;
63+
private Locale locale;
6364

6465
public static MediaDetailFragment forMedia(int index, boolean editable, boolean isCategoryImage) {
6566
MediaDetailFragment mf = new MediaDetailFragment();
@@ -198,6 +199,7 @@ public void onGlobalLayout() {
198199
}
199200
};
200201
view.getViewTreeObserver().addOnGlobalLayoutListener(layoutListener);
202+
locale = getResources().getConfiguration().locale;
201203
return view;
202204
}
203205

@@ -455,7 +457,7 @@ private void updateTheDarkness() {
455457

456458
private String prettyDescription(Media media) {
457459
// @todo use UI language when multilingual descs are available
458-
String desc = media.getDescription("en").trim();
460+
String desc = media.getDescription(locale.getLanguage()).trim();
459461
if (desc.equals("")) {
460462
return getString(R.string.detail_description_empty);
461463
} else {

app/src/main/java/fr/free/nrw/commons/quiz/QuizController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void initialize(Context context){
4343
quiz.add(q3);
4444

4545
QuizQuestion q4 = new QuizQuestion(4,
46-
context.getResources().getString(R.string.quiz_question_string),
46+
context.getResources().getString(R.string.quiz_screenshot_question),
4747
URL_FOR_SCREENSHOT,
4848
false,
4949
context.getResources().getString(R.string.screenshot_answer));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package fr.free.nrw.commons.upload;
2+
3+
import android.text.TextUtils;
4+
import android.util.TimeUtils;
5+
6+
class Description {
7+
8+
private String languageId;
9+
private String languageDisplayText;
10+
private String descriptionText;
11+
private boolean set;
12+
private int selectedLanguageIndex = -1;
13+
14+
public String getLanguageId() {
15+
return languageId;
16+
}
17+
18+
public void setLanguageId(String languageId) {
19+
this.languageId = languageId;
20+
}
21+
22+
public String getLanguageDisplayText() {
23+
return languageDisplayText;
24+
}
25+
26+
public void setLanguageDisplayText(String languageDisplayText) {
27+
this.languageDisplayText = languageDisplayText;
28+
}
29+
30+
public String getDescriptionText() {
31+
return descriptionText;
32+
}
33+
34+
public void setDescriptionText(String descriptionText) {
35+
this.descriptionText = descriptionText;
36+
37+
if (!TextUtils.isEmpty(descriptionText)) {
38+
set = true;
39+
}
40+
}
41+
42+
public boolean isSet() {
43+
return set;
44+
}
45+
46+
public void setSet(boolean set) {
47+
this.set = set;
48+
}
49+
50+
public int getSelectedLanguageIndex() {
51+
return selectedLanguageIndex;
52+
}
53+
54+
public void setSelectedLanguageIndex(int selectedLanguageIndex) {
55+
this.selectedLanguageIndex = selectedLanguageIndex;
56+
}
57+
}

0 commit comments

Comments
 (0)