@@ -46,19 +46,20 @@ public class UploadPresenter {
46
46
new Class []{SimilarImageInterface .class }, (proxy , method , methodArgs ) -> null );
47
47
private SimilarImageInterface similarImageInterface = SIMILAR_IMAGE ;
48
48
49
- @ UploadView .UploadPage int currentPage = UploadView .PLEASE_WAIT ;
49
+ @ UploadView .UploadPage
50
+ private int currentPage = UploadView .PLEASE_WAIT ;
50
51
51
52
52
53
@ Inject
53
- public UploadPresenter (UploadModel uploadModel ,
54
- UploadController uploadController ,
55
- MediaWikiApi mediaWikiApi ) {
54
+ UploadPresenter (UploadModel uploadModel ,
55
+ UploadController uploadController ,
56
+ MediaWikiApi mediaWikiApi ) {
56
57
this .uploadModel = uploadModel ;
57
58
this .uploadController = uploadController ;
58
59
this .mediaWikiApi = mediaWikiApi ;
59
60
}
60
61
61
- public void receive (Uri mediaUri , String mimeType , String source ) {
62
+ void receive (Uri mediaUri , String mimeType , String source ) {
62
63
receive (Collections .singletonList (mediaUri ), mimeType , source );
63
64
}
64
65
@@ -70,7 +71,7 @@ public void receive(Uri mediaUri, String mimeType, String source) {
70
71
* @param source File source from {@link Contribution.FileSource}
71
72
*/
72
73
@ SuppressLint ("CheckResult" )
73
- public void receive (List <Uri > media , String mimeType , @ Contribution .FileSource String source ) {
74
+ void receive (List <Uri > media , String mimeType , @ Contribution .FileSource String source ) {
74
75
Completable .fromRunnable (() -> uploadModel .receive (media , mimeType , source , similarImageInterface ))
75
76
.subscribeOn (Schedulers .io ())
76
77
.observeOn (AndroidSchedulers .mainThread ())
@@ -91,7 +92,7 @@ public void receive(List<Uri> media, String mimeType, @Contribution.FileSource S
91
92
* @param source File source from {@link Contribution.FileSource}
92
93
*/
93
94
@ SuppressLint ("CheckResult" )
94
- public void receiveDirect (Uri media , String mimeType , @ Contribution .FileSource String source , String wikidataEntityIdPref , String title , String desc ) {
95
+ void receiveDirect (Uri media , String mimeType , @ Contribution .FileSource String source , String wikidataEntityIdPref , String title , String desc ) {
95
96
Completable .fromRunnable (() -> uploadModel .receiveDirect (media , mimeType , source , wikidataEntityIdPref , title , desc , similarImageInterface ))
96
97
.subscribeOn (Schedulers .io ())
97
98
.observeOn (AndroidSchedulers .mainThread ())
@@ -108,7 +109,7 @@ public void receiveDirect(Uri media, String mimeType, @Contribution.FileSource S
108
109
*
109
110
* @param licenseName license name
110
111
*/
111
- public void selectLicense (String licenseName ) {
112
+ void selectLicense (String licenseName ) {
112
113
uploadModel .setSelectedLicense (licenseName );
113
114
view .updateLicenseSummary (uploadModel .getSelectedLicense ());
114
115
}
@@ -119,7 +120,7 @@ public void selectLicense(String licenseName) {
119
120
* Called by the next button in {@link UploadActivity}
120
121
*/
121
122
@ SuppressLint ("CheckResult" )
122
- public void handleNext (CategoriesModel categoriesModel , boolean noCategoryWarningShown ) {
123
+ void handleNext (CategoriesModel categoriesModel , boolean noCategoryWarningShown ) {
123
124
if (currentPage == UploadView .TITLE_CARD ) {
124
125
validateCurrentItemTitle ()
125
126
.subscribeOn (Schedulers .io ())
@@ -167,7 +168,7 @@ private Title getCurrentImageTitle() {
167
168
return getCurrentItem ().title ;
168
169
}
169
170
170
- public String getCurrentImageFileName () {
171
+ String getCurrentImageFileName () {
171
172
UploadItem currentItem = getCurrentItem ();
172
173
return currentItem .title + "." + uploadModel .getCurrentItem ().fileExt ;
173
174
}
@@ -193,7 +194,7 @@ private Observable<Integer> validateCurrentItemTitle() {
193
194
/**
194
195
* Called by the previous button in {@link UploadActivity}
195
196
*/
196
- public void handlePrevious () {
197
+ void handlePrevious () {
197
198
uploadModel .previous ();
198
199
updateContent ();
199
200
if (uploadModel .isShowingItem ()) {
@@ -205,7 +206,7 @@ public void handlePrevious() {
205
206
/**
206
207
* Called when one of the pictures on the top card is clicked on in {@link UploadActivity}
207
208
*/
208
- public void thumbnailClicked (UploadItem item ) {
209
+ void thumbnailClicked (UploadItem item ) {
209
210
uploadModel .jumpTo (item );
210
211
updateContent ();
211
212
}
@@ -214,7 +215,7 @@ public void thumbnailClicked(UploadItem item) {
214
215
* Called by the submit button in {@link UploadActivity}
215
216
*/
216
217
@ SuppressLint ("CheckResult" )
217
- public void handleSubmit (CategoriesModel categoriesModel ) {
218
+ void handleSubmit (CategoriesModel categoriesModel ) {
218
219
if (view .checkIfLoggedIn ())
219
220
uploadModel .buildContributions (categoriesModel .getCategoryStringList ())
220
221
.observeOn (Schedulers .io ())
@@ -224,7 +225,7 @@ public void handleSubmit(CategoriesModel categoriesModel) {
224
225
/**
225
226
* Called by the map button on the right card in {@link UploadActivity}
226
227
*/
227
- public void openCoordinateMap () {
228
+ void openCoordinateMap () {
228
229
GPSExtractor gpsObj = uploadModel .getCurrentItem ().gpsCoords ;
229
230
if (gpsObj != null && gpsObj .imageCoordsExists ) {
230
231
view .launchMapActivity (gpsObj .getDecLatitude () + "," + gpsObj .getDecLongitude ());
@@ -241,11 +242,11 @@ private void handleBadPicture(@ImageUtils.Result int result) {
241
242
view .showBadPicturePopup (result );
242
243
}
243
244
244
- public void keepPicture () {
245
+ void keepPicture () {
245
246
uploadModel .keepPicture ();
246
247
}
247
248
248
- public void deletePicture () {
249
+ void deletePicture () {
249
250
if (uploadModel .getCount () == 1 )
250
251
view .finish ();
251
252
else {
@@ -265,31 +266,31 @@ public void deletePicture() {
265
266
/**
266
267
* Toggles the top card's state between open and closed.
267
268
*/
268
- public void toggleTopCardState () {
269
+ void toggleTopCardState () {
269
270
uploadModel .setTopCardState (!uploadModel .isTopCardState ());
270
271
view .setTopCardState (uploadModel .isTopCardState ());
271
272
}
272
273
273
274
/**
274
275
* Toggles the bottom card's state between open and closed.
275
276
*/
276
- public void toggleBottomCardState () {
277
+ void toggleBottomCardState () {
277
278
uploadModel .setBottomCardState (!uploadModel .isBottomCardState ());
278
279
view .setBottomCardState (uploadModel .isBottomCardState ());
279
280
}
280
281
281
282
/**
282
283
* Toggles the right card's state between open and closed.
283
284
*/
284
- public void toggleRightCardState () {
285
+ void toggleRightCardState () {
285
286
uploadModel .setRightCardState (!uploadModel .isRightCardState ());
286
287
view .setRightCardState (uploadModel .isRightCardState ());
287
288
}
288
289
289
290
/**
290
291
* Sets all the cards' states to closed.
291
292
*/
292
- public void closeAllCards () {
293
+ void closeAllCards () {
293
294
if (uploadModel .isTopCardState ()) {
294
295
uploadModel .setTopCardState (false );
295
296
view .setTopCardState (false );
@@ -310,15 +311,15 @@ public void init() {
310
311
uploadController .prepareService ();
311
312
}
312
313
313
- public void cleanup () {
314
+ void cleanup () {
314
315
uploadController .cleanup ();
315
316
}
316
317
317
- public void removeView () {
318
+ void removeView () {
318
319
this .view = DUMMY ;
319
320
}
320
321
321
- public void addView (UploadView view ) {
322
+ void addView (UploadView view ) {
322
323
this .view = view ;
323
324
324
325
updateCards ();
@@ -399,11 +400,11 @@ private void showCorrectCards(int currentStep, int uploadCount) {
399
400
/**
400
401
* @return the item currently being displayed
401
402
*/
402
- public UploadItem getCurrentItem () {
403
+ private UploadItem getCurrentItem () {
403
404
return uploadModel .getCurrentItem ();
404
405
}
405
406
406
- public List <String > getImageTitleList () {
407
+ List <String > getImageTitleList () {
407
408
List <String > titleList = new ArrayList <>();
408
409
for (UploadItem item : uploadModel .getUploads ()) {
409
410
if (item .title .isSet ()) {
0 commit comments