mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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,
|
RecognizerIntent.EXTRA_LANGUAGE,
|
||||||
locale
|
locale
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (activity == null) {
|
if (activity == null) {
|
||||||
fragment.startActivityForResult(intent, REQUEST_CODE_FOR_VOICE_INPUT);
|
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) {
|
public void removeDescription(final UploadMediaDetail uploadMediaDetail, final int position) {
|
||||||
selectedLanguages.remove(position);
|
selectedLanguages.remove(position);
|
||||||
final int ListPosition =
|
int listPosition = 0;
|
||||||
(int) selectedLanguages.keySet().stream().filter(e -> e < position).count();
|
List<Integer> keysList = new ArrayList<>(selectedLanguages.keySet());
|
||||||
this.uploadMediaDetails.remove(uploadMediaDetails.get(ListPosition));
|
for (Integer key : keysList) {
|
||||||
|
if (key < position) {
|
||||||
|
listPosition++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.uploadMediaDetails.remove(uploadMediaDetails.get(listPosition));
|
||||||
int i = position + 1;
|
int i = position + 1;
|
||||||
while (selectedLanguages.containsKey(i)) {
|
while (selectedLanguages.containsKey(i)) {
|
||||||
selectedLanguages.remove(i);
|
selectedLanguages.remove(i);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class CommonsDateUtil {
|
||||||
* @return timestamp
|
* @return timestamp
|
||||||
*/
|
*/
|
||||||
public static SimpleDateFormat getIso8601DateFormatTimestamp() {
|
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);
|
Locale.ROOT);
|
||||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
return simpleDateFormat;
|
return simpleDateFormat;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue