fix some bugs
This commit is contained in:
parent
b1310bfccf
commit
49451944fb
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue