File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -276,17 +276,25 @@ private void setUploadCount() {
276276 .getUploadCount (sessionManager .getCurrentAccount ().name )
277277 .subscribeOn (Schedulers .io ())
278278 .observeOn (AndroidSchedulers .mainThread ())
279- .subscribe (
280- uploadCount -> getSupportActionBar ().setSubtitle (getResources ()
281- .getQuantityString (R .plurals .contributions_subtitle ,
282- uploadCount , uploadCount )),
279+ .subscribe (this ::displayUploadCount ,
283280 t -> Timber .e (t , "Fetching upload count failed" )
284281 ));
285282 }
286283
287- public void betaSetUploadCount (int betaUploadCount ){
284+ private void displayUploadCount (Integer uploadCount ) {
285+ if (isFinishing ()
286+ || getSupportActionBar () == null
287+ || getResources () == null ) {
288+ return ;
289+ }
290+
288291 getSupportActionBar ().setSubtitle (getResources ()
289- .getQuantityString (R .plurals .contributions_subtitle , betaUploadCount , betaUploadCount ));
292+ .getQuantityString (R .plurals .contributions_subtitle ,
293+ uploadCount , uploadCount ));
294+ }
295+
296+ public void betaSetUploadCount (int betaUploadCount ) {
297+ displayUploadCount (betaUploadCount );
290298 }
291299
292300
Original file line number Diff line number Diff line change @@ -74,13 +74,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
7474 //What happens when the 'submit' icon is tapped
7575 case R .id .menu_upload_single :
7676
77- if (titleEdit .getText ().toString ().isEmpty ()) {
77+ if (titleEdit .getText ().toString ().trim (). isEmpty ()) {
7878 Toast .makeText (getContext (), R .string .add_title_toast , Toast .LENGTH_LONG ).show ();
7979 return false ;
8080 }
8181
82- String title = titleEdit .getText ().toString ();
83- String desc = descEdit .getText ().toString ();
82+ String title = titleEdit .getText ().toString (). trim () ;
83+ String desc = descEdit .getText ().toString (). trim () ;
8484
8585 //Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
8686 prefs .edit ()
Original file line number Diff line number Diff line change 284284 <string name =" error_fetching_nearby_places" >Error fetching nearby places.</string >
285285
286286 <string name =" successful_wikidata_edit" >Image successfully added to %1$s on Wikidata!</string >
287- <string name =" wikidata_edit_failure" >Failed to update corresponding wiki data entity!</string >
287+ <string name =" wikidata_edit_failure" >Failed to update corresponding Wikidata entity!</string >
288288 <string name =" menu_set_wallpaper" >Set wallpaper</string >
289289 <string name =" wallpaper_set_successfully" >Wallpaper set successfully!</string >
290290</resources >
You can’t perform that action at this time.
0 commit comments