mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Merge remote-tracking branch 'refs/remotes/origin/2.8-release'
This commit is contained in:
commit
54246fda6b
3 changed files with 18 additions and 10 deletions
|
|
@ -276,17 +276,25 @@ public class ContributionsActivity
|
||||||
.getUploadCount(sessionManager.getCurrentAccount().name)
|
.getUploadCount(sessionManager.getCurrentAccount().name)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(this::displayUploadCount,
|
||||||
uploadCount -> getSupportActionBar().setSubtitle(getResources()
|
|
||||||
.getQuantityString(R.plurals.contributions_subtitle,
|
|
||||||
uploadCount, uploadCount)),
|
|
||||||
t -> Timber.e(t, "Fetching upload count failed")
|
t -> Timber.e(t, "Fetching upload count failed")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void betaSetUploadCount(int betaUploadCount){
|
private void displayUploadCount(Integer uploadCount) {
|
||||||
|
if (isFinishing()
|
||||||
|
|| getSupportActionBar() == null
|
||||||
|
|| getResources() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
getSupportActionBar().setSubtitle(getResources()
|
getSupportActionBar().setSubtitle(getResources()
|
||||||
.getQuantityString(R.plurals.contributions_subtitle, betaUploadCount, betaUploadCount));
|
.getQuantityString(R.plurals.contributions_subtitle,
|
||||||
|
uploadCount, uploadCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void betaSetUploadCount(int betaUploadCount) {
|
||||||
|
displayUploadCount(betaUploadCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
|
||||||
//What happens when the 'submit' icon is tapped
|
//What happens when the 'submit' icon is tapped
|
||||||
case R.id.menu_upload_single:
|
case R.id.menu_upload_single:
|
||||||
|
|
||||||
if (titleEdit.getText().toString().isEmpty()) {
|
if (titleEdit.getText().toString().trim().isEmpty()) {
|
||||||
Toast.makeText(getContext(), R.string.add_title_toast, Toast.LENGTH_LONG).show();
|
Toast.makeText(getContext(), R.string.add_title_toast, Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = titleEdit.getText().toString();
|
String title = titleEdit.getText().toString().trim();
|
||||||
String desc = descEdit.getText().toString();
|
String desc = descEdit.getText().toString().trim();
|
||||||
|
|
||||||
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
|
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@
|
||||||
<string name="error_fetching_nearby_places">Error fetching nearby places.</string>
|
<string name="error_fetching_nearby_places">Error fetching nearby places.</string>
|
||||||
|
|
||||||
<string name="successful_wikidata_edit">Image successfully added to %1$s on Wikidata!</string>
|
<string name="successful_wikidata_edit">Image successfully added to %1$s on Wikidata!</string>
|
||||||
<string name="wikidata_edit_failure">Failed to update corresponding wiki data entity!</string>
|
<string name="wikidata_edit_failure">Failed to update corresponding Wikidata entity!</string>
|
||||||
<string name="menu_set_wallpaper">Set wallpaper</string>
|
<string name="menu_set_wallpaper">Set wallpaper</string>
|
||||||
<string name="wallpaper_set_successfully">Wallpaper set successfully!</string>
|
<string name="wallpaper_set_successfully">Wallpaper set successfully!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue