mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix Methods Usage Incompatible with Android API Level 21 (#5525)
This commit is contained in:
parent
8df7f66992
commit
a308a1c8b5
2 changed files with 10 additions and 4 deletions
|
|
@ -146,6 +146,7 @@ public class UploadMediaDetailAdapter extends
|
|||
RecognizerIntent.EXTRA_LANGUAGE,
|
||||
locale
|
||||
);
|
||||
|
||||
try {
|
||||
if (activity == null) {
|
||||
fragment.startActivityForResult(intent, REQUEST_CODE_FOR_VOICE_INPUT);
|
||||
|
|
@ -182,9 +183,14 @@ public class UploadMediaDetailAdapter extends
|
|||
*/
|
||||
public void removeDescription(final UploadMediaDetail uploadMediaDetail, final int position) {
|
||||
selectedLanguages.remove(position);
|
||||
final int ListPosition =
|
||||
(int) selectedLanguages.keySet().stream().filter(e -> e < position).count();
|
||||
this.uploadMediaDetails.remove(uploadMediaDetails.get(ListPosition));
|
||||
int listPosition = 0;
|
||||
List<Integer> keysList = new ArrayList<>(selectedLanguages.keySet());
|
||||
for (Integer key : keysList) {
|
||||
if (key < position) {
|
||||
listPosition++;
|
||||
}
|
||||
}
|
||||
this.uploadMediaDetails.remove(uploadMediaDetails.get(listPosition));
|
||||
int i = position + 1;
|
||||
while (selectedLanguages.containsKey(i)) {
|
||||
selectedLanguages.remove(i);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class CommonsDateUtil {
|
|||
* @return timestamp
|
||||
*/
|
||||
public static SimpleDateFormat getIso8601DateFormatTimestamp() {
|
||||
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX",
|
||||
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'",
|
||||
Locale.ROOT);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return simpleDateFormat;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue