fix some bugs

This commit is contained in:
Tungstend 2023-07-12 02:40:54 +08:00
parent b1310bfccf
commit 49451944fb
3 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package com.tungsten.fcl.ui.manage;
import android.content.Context;
import android.content.res.ColorStateList;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -36,15 +37,17 @@ public class DatapackListAdapter extends FCLAdapter {
public DatapackListAdapter(Context context) {
super(context);
Handler handler = new Handler();
this.listProperty.addListener((InvalidationListener) observable -> {
fromSelf = true;
selectedItemsProperty.clear();
fromSelf = false;
notifyDataSetChanged();
handler.post(this::notifyDataSetChanged);
});
selectedItemsProperty.addListener((InvalidationListener) observable -> {
if (!fromSelf) {
notifyDataSetChanged();
handler.post(this::notifyDataSetChanged);
}
});
}

View File

@ -192,7 +192,9 @@ public class DatapackListPage extends FCLTempPage implements View.OnClickListene
}
void removeSelected(ObservableList<DatapackInfoObject> selectedItems) {
selectedItems.stream()
ObservableList<DatapackInfoObject> items = FXCollections.observableArrayList();
items.setAll(selectedItems);
items.stream()
.map(DatapackInfoObject::getPackInfo)
.forEach(pack -> {
try {

View File

@ -538,7 +538,7 @@
<string name="mods_disable">禁用</string>
<string name="mods_download">模组下载</string>
<string name="mods_download_title">模组下载 - %1s</string>
<string name="mods_enable"></string>
<string name="mods_enable"></string>
<string name="mods_manage">管理模组</string>
<string name="mods_mcbbs">MCBBS</string>
<string name="mods_mcmod">MCMOD</string>