mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge remote-tracking branch 'refs/remotes/commons-app/2.8-release' into 2.8-release-fork
This commit is contained in:
commit
5be4d1764a
3 changed files with 18 additions and 10 deletions
|
|
@ -275,17 +275,25 @@ public class ContributionsActivity
|
|||
.getUploadCount(sessionManager.getCurrentAccount().name)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
uploadCount -> getSupportActionBar().setSubtitle(getResources()
|
||||
.getQuantityString(R.plurals.contributions_subtitle,
|
||||
uploadCount, uploadCount)),
|
||||
.subscribe(this::displayUploadCount,
|
||||
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()
|
||||
.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
|
||||
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();
|
||||
return false;
|
||||
}
|
||||
|
||||
String title = titleEdit.getText().toString();
|
||||
String desc = descEdit.getText().toString();
|
||||
String title = titleEdit.getText().toString().trim();
|
||||
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
|
||||
prefs.edit()
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@
|
|||
<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="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="wallpaper_set_successfully">Wallpaper set successfully!</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue