File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
app/src/main/java/fr/free/nrw/commons/achievements Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 37
37
import io .reactivex .android .schedulers .AndroidSchedulers ;
38
38
import io .reactivex .disposables .CompositeDisposable ;
39
39
import io .reactivex .schedulers .Schedulers ;
40
+ import timber .log .Timber ;
40
41
41
42
/**
42
43
* activity for sharing feedback on uploaded activity
@@ -97,6 +98,7 @@ protected void onCreate(Bundle savedInstanceState) {
97
98
98
99
setSupportActionBar (toolbar );
99
100
setAchievements ();
101
+ setUploadCount ();
100
102
initDrawer ();
101
103
}
102
104
@@ -156,6 +158,22 @@ private void setAchievements() {
156
158
));
157
159
}
158
160
161
+ private void setUploadCount () {
162
+ compositeDisposable .add (mediaWikiApi
163
+ .getUploadCount (sessionManager .getCurrentAccount ().name )
164
+ .subscribeOn (Schedulers .io ())
165
+ .observeOn (AndroidSchedulers .mainThread ())
166
+ .subscribe (
167
+ uploadCount -> setUploadProgress (uploadCount ),
168
+ t -> Timber .e (t , "Fetching upload count failed" )
169
+ ));
170
+ }
171
+
172
+ private void setUploadProgress ( int uploadCount ){
173
+ imagesUploadedProgressbar .setProgress (100 *uploadCount /25 );
174
+ imagesUploadedProgressbar .setProgressTextFormatPattern (uploadCount +"/25" );
175
+ }
176
+
159
177
/**
160
178
* used to parse the JSONObject containing results
161
179
*
You can’t perform that action at this time.
0 commit comments