Skip to content

Commit

Permalink
fix: crash on android api 22 & 23
Browse files Browse the repository at this point in the history
  • Loading branch information
sAleksovski committed Nov 19, 2024
1 parent b022ef6 commit 115da7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fix crash on API 22 & 23

## [0.14.1] - 2024-05-25

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import com.facebook.react.bridge.ReadableMap;

public class ClickableView {
public class ClickableView implements Comparable<ClickableView> {
private final String id;
private final View view;
private final String clickAction;
Expand Down Expand Up @@ -32,4 +32,9 @@ public String getClickAction() {
public ReadableMap getClickActionData() {
return clickActionData;
}

@Override
public int compareTo(ClickableView o) {
return this.id.compareTo(o.getId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;

Expand All @@ -47,7 +46,7 @@ public static WidgetWithViews buildWidgetFromRoot(ReactApplicationContext contex

ResourceUtils.clear();

widgetFactory.clickableViews.sort(Comparator.comparing(ClickableView::getId));
Collections.sort(widgetFactory.clickableViews);
return new WidgetWithViews(view, widgetFactory.clickableViews, widgetFactory.collectionViews);
}

Expand Down

0 comments on commit 115da7c

Please sign in to comment.