Skip to content

Commit 4e1d239

Browse files
authored
Merge branch 'master' into master
2 parents c69a1b3 + 2e4a15f commit 4e1d239

File tree

172 files changed

+954
-808
lines changed

Some content is hidden

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

172 files changed

+954
-808
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ after_success:
3333
after_failure:
3434
- echo '*** Connected Test Rsults ***'
3535
- w3m -dump ${TRAVIS_BUILD_DIR}/app/build/reports/androidTests/connected/*Test.html
36-
- echo '*** Lint Results ***'
37-
- cat ${TRAVIS_BUILD_DIR}/app/build/reports/lint-results.xml
3836
jdk:
3937
# - openjdk8 # not yet available
4038
- oraclejdk8

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Wikimedia Commons for Android
22

3+
## v2.5.0 beta
4+
- Added one-time popup for beta users to provide feedback on IEG renewal proposal
5+
- Added link to Commons policies in ShareActivity
6+
- Various string fixes
7+
- Switched to using vector icons for map markers
8+
- Added filter for irrelevant categories
9+
- Fixed various crashes
10+
- Incremented target SDK to 25
11+
- Improved appearance of navigation drawer
12+
- Replaced proprietary app image in tutorial with one that isn't Telegram
13+
- Fixed camera issue with FileProvider
14+
- Added RxJava library, migrated to Java 8
15+
- Various code and continuous integration optimizations
16+
317
## v2.4.2 beta
418
- Added option to launch tutorial again from nav drawer
519
- Added marker for current location in Nearby map

CREDITS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ their contribution to the product.
2424
* Dmitry Brant
2525
* Adam Shorland
2626
* John Lubbock
27+
* Mikel Pascual
28+
* Jan Piotrowski
2729

2830
3rd party open source libraries used:
2931
* Butterknife

app/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'me.tatarka.retrolambda'
23
apply plugin: 'jacoco-android'
34
apply from: 'quality.gradle'
45
apply plugin: 'com.getkeepsafe.dexcount'
@@ -51,8 +52,8 @@ android {
5152

5253
defaultConfig {
5354
applicationId 'fr.free.nrw.commons'
54-
versionCode 73
55-
versionName '2.4.2'
55+
versionCode 74
56+
versionName '2.5.0'
5657
minSdkVersion project.minSdkVersion
5758
targetSdkVersion project.targetSdkVersion
5859
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -75,6 +76,11 @@ android {
7576
abortOnError false
7677
}
7778

79+
compileOptions {
80+
sourceCompatibility JavaVersion.VERSION_1_8
81+
targetCompatibility JavaVersion.VERSION_1_8
82+
}
83+
7884
//FIXME: Temporary fix for https://github.com/commons-app/apps-android-commons/issues/709
7985
configurations.all {
8086
resolutionStrategy.force 'com.android.support:support-annotations:25.2.0'

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.database.sqlite.SQLiteDatabase;
1212
import android.preference.PreferenceManager;
1313
import android.support.v4.util.LruCache;
14+
import android.util.Log;
1415

1516
import com.facebook.drawee.backends.pipeline.Fresco;
1617
import com.facebook.stetho.Stetho;
@@ -139,6 +140,10 @@ public void onCreate() {
139140
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
140141

141142
Fresco.initialize(this);
143+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(
144+
CommonsApplication.getInstance());
145+
// Increase counter by one, starts from 1
146+
prefs.edit().putInt("app_start_counter", prefs.getInt("app_start_counter" ,0) + 1).commit();
142147

143148
//For caching area -> categories
144149
cacheData = new CacheController();
@@ -197,8 +202,8 @@ public void clearApplicationData(Context context) {
197202

198203
AccountManager accountManager = AccountManager.get(this);
199204
Account[] allAccounts = accountManager.getAccountsByType(AccountUtil.accountType());
200-
for (int index = 0; index < allAccounts.length; index++) {
201-
accountManager.removeAccount(allAccounts[index], null, null);
205+
for (Account allAccount : allAccounts) {
206+
accountManager.removeAccount(allAccount, null, null);
202207
}
203208

204209
//TODO: fix preference manager

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void setLicense(String license) {
142142
return coordinates;
143143
}
144144

145-
public void setCoordinates(LatLng coordinates) {
145+
public void setCoordinates(@Nullable LatLng coordinates) {
146146
this.coordinates = coordinates;
147147
}
148148

@@ -201,7 +201,7 @@ public Media(String filename) {
201201
this.filename = filename;
202202
}
203203

204-
public Media(Uri localUri, String imageUrl, String filename, String description, long dataLength, Date dateCreated, Date dateUploaded, String creator) {
204+
public Media(Uri localUri, String imageUrl, String filename, String description, long dataLength, Date dateCreated, @Nullable Date dateUploaded, String creator) {
205205
this();
206206
this.localUri = localUri;
207207
this.imageUrl = imageUrl;

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ public void onCreate(Bundle savedInstanceState) {
2727

2828
pager.setAdapter(adapter);
2929
indicator.setViewPager(pager);
30-
adapter.setCallback(new WelcomePagerAdapter.Callback() {
31-
@Override
32-
public void onYesClicked() {
33-
finish();
34-
}
35-
});
30+
adapter.setCallback(this::finish);
3631
}
3732

3833
@Override

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import fr.free.nrw.commons.contributions.ContributionsActivity;
2727
import timber.log.Timber;
2828

29+
import static android.view.KeyEvent.KEYCODE_ENTER;
30+
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
31+
2932

3033
public class LoginActivity extends AccountAuthenticatorActivity {
3134

@@ -63,18 +66,8 @@ public void onCreate(Bundle savedInstanceState) {
6366
twoFactorEdit.addTextChangedListener(textWatcher);
6467
passwordEdit.setOnEditorActionListener(newLoginInputActionListener());
6568

66-
loginButton.setOnClickListener(new View.OnClickListener() {
67-
@Override
68-
public void onClick(View v) {
69-
performLogin();
70-
}
71-
});
72-
signupButton.setOnClickListener(new View.OnClickListener() {
73-
@Override
74-
public void onClick(View v) {
75-
signUp(v);
76-
}
77-
});
69+
loginButton.setOnClickListener(this::performLogin);
70+
signupButton.setOnClickListener(this::signUp);
7871
}
7972

8073
private class LoginTextWatcher implements TextWatcher {
@@ -98,20 +91,17 @@ public void afterTextChanged(Editable editable) {
9891
}
9992

10093
private TextView.OnEditorActionListener newLoginInputActionListener() {
101-
return new TextView.OnEditorActionListener() {
102-
@Override
103-
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
104-
if (loginButton.isEnabled()) {
105-
if (actionId == EditorInfo.IME_ACTION_DONE) {
106-
performLogin();
107-
return true;
108-
} else if ((keyEvent != null) && keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
109-
performLogin();
110-
return true;
111-
}
94+
return (textView, actionId, keyEvent) -> {
95+
if (loginButton.isEnabled()) {
96+
if (actionId == IME_ACTION_DONE) {
97+
performLogin(textView);
98+
return true;
99+
} else if ((keyEvent != null) && keyEvent.getKeyCode() == KEYCODE_ENTER) {
100+
performLogin(textView);
101+
return true;
112102
}
113-
return false;
114103
}
104+
return false;
115105
};
116106
}
117107

@@ -142,7 +132,7 @@ protected void onDestroy() {
142132
super.onDestroy();
143133
}
144134

145-
private void performLogin() {
135+
private void performLogin(View view) {
146136
Timber.d("Login to start!");
147137
LoginTask task = getLoginTask();
148138
task.execute();

app/src/main/java/fr/free/nrw/commons/category/CategoriesAdapter.java

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package fr.free.nrw.commons.category;
2+
3+
import com.pedrogomez.renderers.ListAdapteeCollection;
4+
import com.pedrogomez.renderers.RVRendererAdapter;
5+
import com.pedrogomez.renderers.RendererBuilder;
6+
7+
import java.util.Collections;
8+
import java.util.List;
9+
10+
class CategoriesAdapterFactory {
11+
private final CategoriesRenderer.CategoryClickedListener listener;
12+
13+
CategoriesAdapterFactory(CategoriesRenderer.CategoryClickedListener listener) {
14+
this.listener = listener;
15+
}
16+
17+
public RVRendererAdapter<CategoryItem> create(List<CategoryItem> placeList) {
18+
RendererBuilder<CategoryItem> builder = new RendererBuilder<CategoryItem>()
19+
.bind(CategoryItem.class, new CategoriesRenderer(listener));
20+
ListAdapteeCollection<CategoryItem> collection = new ListAdapteeCollection<>(
21+
placeList != null ? placeList : Collections.<CategoryItem>emptyList());
22+
return new RVRendererAdapter<>(builder, collection);
23+
}
24+
}

0 commit comments

Comments
 (0)