Skip to content

Commit

Permalink
Fix Methods Usage Incompatible with Android API Level 21 (#5525)
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankiitbhu authored Feb 14, 2024
1 parent 8df7f66 commit a308a1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private void startSpeechInput(String locale) {
RecognizerIntent.EXTRA_LANGUAGE,
locale
);

try {
if (activity == null) {
fragment.startActivityForResult(intent, REQUEST_CODE_FOR_VOICE_INPUT);
Expand Down Expand Up @@ -182,9 +183,14 @@ public void handleSpeechResult(String spokenText) {
*/
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static SimpleDateFormat getMediaSimpleDateFormat() {
* @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;
Expand Down

0 comments on commit a308a1c

Please sign in to comment.