Fix issue #497 - Filter view is not syncing after edition

This commit is contained in:
Thomas 2022-11-21 14:46:53 +01:00
parent 03f0ac4be3
commit 59a21008f1
2 changed files with 6 additions and 2 deletions

View file

@ -106,7 +106,6 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
});
if (filter != null) {
filterParams.filter_action = filter.filter_action;
@ -166,7 +165,9 @@ public class FilterActivity extends BaseActivity implements FilterAdapter.Delete
popupAddFilterBinding.lvKeywords.setLayoutManager(new LinearLayoutManager(context));
popupAddFilterBinding.addKeyword.setOnClickListener(v -> {
filterParams.keywords.add(new Filter.KeywordsParams());
Filter.KeywordsParams keywordsParams = new Filter.KeywordsParams();
keywordsParams.whole_word = true;
filterParams.keywords.add(keywordsParams);
keywordAdapter.notifyItemInserted(filterParams.keywords.size() - 1);
});

View file

@ -81,6 +81,9 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.FilterView
if (filter1 != null) {
BaseMainActivity.mainFilters.get(position).context = filter1.context;
BaseMainActivity.mainFilters.get(position).expires_at = filter1.expires_at;
BaseMainActivity.mainFilters.get(position).filter_action = filter1.filter_action;
BaseMainActivity.mainFilters.get(position).keywords = filter1.keywords;
BaseMainActivity.mainFilters.get(position).title = filter1.title;
}
filterAdapter.notifyItemChanged(position);
}));