mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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
|
||||
spinnerDescriptionLanguages.setSelection(languagesAdapter.getIndexOfLanguageCode(savedLanguageValue));
|
||||
} else {
|
||||
if (position == 0) {
|
||||
int defaultLocaleIndex = languagesAdapter
|
||||
.getIndexOfUserDefaultLocale(spinnerDescriptionLanguages.getContext());
|
||||
spinnerDescriptionLanguages.setSelection(defaultLocaleIndex, true);
|
||||
//Checking whether Language Code attribute is null or not.
|
||||
if(uploadMediaDetails.get(position).getLanguageCode() != null){
|
||||
//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)
|
||||
//hence providing same language code for the current upload.
|
||||
spinnerDescriptionLanguages.setSelection(languagesAdapter
|
||||
.getIndexOfLanguageCode(uploadMediaDetails.get(position).getLanguageCode()), true);
|
||||
} 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