mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Fixed issue with "Copy previous captions & descriptions". (#4109)
* Fixed issue with "Copy previous captions & descriptions". * Added comments and also fixed the styling issue. Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
parent
170ecaa570
commit
5bdb21cb3e
1 changed files with 13 additions and 5 deletions
|
|
@ -179,12 +179,20 @@ public class UploadMediaDetailAdapter extends RecyclerView.Adapter<UploadMediaDe
|
||||||
// If user has chosen a default language from settings activity savedLanguageValue is not null
|
// If user has chosen a default language from settings activity savedLanguageValue is not null
|
||||||
spinnerDescriptionLanguages.setSelection(languagesAdapter.getIndexOfLanguageCode(savedLanguageValue));
|
spinnerDescriptionLanguages.setSelection(languagesAdapter.getIndexOfLanguageCode(savedLanguageValue));
|
||||||
} else {
|
} else {
|
||||||
if (position == 0) {
|
//Checking whether Language Code attribute is null or not.
|
||||||
int defaultLocaleIndex = languagesAdapter
|
if(uploadMediaDetails.get(position).getLanguageCode() != null){
|
||||||
.getIndexOfUserDefaultLocale(spinnerDescriptionLanguages.getContext());
|
//If it is not null that means it is fetching details from the previous upload (i.e. when user has pressed copy previous caption & description)
|
||||||
spinnerDescriptionLanguages.setSelection(defaultLocaleIndex, true);
|
//hence providing same language code for the current upload.
|
||||||
|
spinnerDescriptionLanguages.setSelection(languagesAdapter
|
||||||
|
.getIndexOfLanguageCode(uploadMediaDetails.get(position).getLanguageCode()), true);
|
||||||
} else {
|
} else {
|
||||||
spinnerDescriptionLanguages.setSelection(0,true);
|
if (position == 0) {
|
||||||
|
int defaultLocaleIndex = languagesAdapter
|
||||||
|
.getIndexOfUserDefaultLocale(spinnerDescriptionLanguages.getContext());
|
||||||
|
spinnerDescriptionLanguages.setSelection(defaultLocaleIndex, true);
|
||||||
|
} else {
|
||||||
|
spinnerDescriptionLanguages.setSelection(0,true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue