Skip to content

Commit

Permalink
Fixed weird shit with android compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBoomDeveloper committed Mar 20, 2024
1 parent d3c442f commit 152596f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ android {
}

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
Expand All @@ -76,7 +75,6 @@ android {

dependencies {
// Compatibility for new methods in old Api
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
implementation "androidx.core:core-ktx:1.12.0"
implementation "androidx.work:work-runtime-ktx:2.9.0"
implementation "androidx.appcompat:appcompat:1.6.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

var sorted = new ArrayList<>(items).stream()
.sorted((a, b) -> a.getTitle().compareToIgnoreCase(b.getTitle()))
.toList();
.collect(Collectors.toList());

AweryApp.runOnUiThread(() -> {
createRadioButtons(radioGroup, sorted, selectedItem);
Expand All @@ -178,7 +178,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
settingItem.getKey(),
settingItem.getTitle(parent.getContext()),
settingItem.getKey().equals(selected)))
.toList(), selectedItem);
.collect(Collectors.toList()), selectedItem);

contentView.addView(radioGroup);
} else {
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/mrboomdev/awery/util/MediaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

public class MediaUtils {
public static final String ACTION_INFO = "info";
Expand All @@ -49,7 +50,7 @@ public static void launchMediaActivity(Context context, CatalogMedia media) {
}

public static Collection<CatalogMedia> filterMedia(@NonNull Collection<CatalogMedia> items) {
return items.stream().filter(item -> !isMediaFiltered(item)).toList();
return items.stream().filter(item -> !isMediaFiltered(item)).collect(Collectors.toList());
}

@Contract(pure = true)
Expand Down Expand Up @@ -219,7 +220,7 @@ public static void openMediaBookmarkMenu(Context context, CatalogMedia media) {
new Thread(() -> {
var lists = AweryApp.getDatabase().getListDao().getAll().stream()
.filter(item -> !AweryApp.HIDDEN_LISTS.contains(item.getId()))
.toList();
.collect(Collectors.toList());

var current = AweryApp.getDatabase().getMediaDao().get(media.globalId);
var mediaDao = AweryApp.getDatabase().getMediaDao();
Expand Down

0 comments on commit 152596f

Please sign in to comment.