Skip to content

Commit 152596f

Browse files
Fixed weird shit with android compatibility
1 parent d3c442f commit 152596f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

app/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ android {
6363
}
6464

6565
compileOptions {
66-
coreLibraryDesugaringEnabled true
6766
sourceCompatibility JavaVersion.VERSION_17
6867
targetCompatibility JavaVersion.VERSION_17
6968
}
@@ -76,7 +75,6 @@ android {
7675

7776
dependencies {
7877
// Compatibility for new methods in old Api
79-
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
8078
implementation "androidx.core:core-ktx:1.12.0"
8179
implementation "androidx.work:work-runtime-ktx:2.9.0"
8280
implementation "androidx.appcompat:appcompat:1.6.1"

app/src/main/java/com/mrboomdev/awery/ui/activity/settings/SettingsAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
160160

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

165165
AweryApp.runOnUiThread(() -> {
166166
createRadioButtons(radioGroup, sorted, selectedItem);
@@ -178,7 +178,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
178178
settingItem.getKey(),
179179
settingItem.getTitle(parent.getContext()),
180180
settingItem.getKey().equals(selected)))
181-
.toList(), selectedItem);
181+
.collect(Collectors.toList()), selectedItem);
182182

183183
contentView.addView(radioGroup);
184184
} else {

app/src/main/java/com/mrboomdev/awery/util/MediaUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Collection;
3131
import java.util.HashMap;
3232
import java.util.concurrent.atomic.AtomicReference;
33+
import java.util.stream.Collectors;
3334

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

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

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

224225
var current = AweryApp.getDatabase().getMediaDao().get(media.globalId);
225226
var mediaDao = AweryApp.getDatabase().getMediaDao();

0 commit comments

Comments
 (0)