diff options
author | stefan-niedermann <info@niedermann.it> | 2019-06-19 22:39:08 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-06-19 22:39:08 +0300 |
commit | 92d3b9d0fe36448f4fc575e1c784b386c90a90df (patch) | |
tree | 75771d3de3b2f592beb0d8c6cee1e3d368c0531f /app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java | |
parent | 8c2d516c020b6f7d86f7984f883449afd56a15b3 (diff) |
#51 Display "create"-button for labels as last item in autocomplete
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java index faa45adc0..974aa3970 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java @@ -37,6 +37,7 @@ public class LabelAutoCompleteAdapter extends BaseAdapter implements Filterable private LifecycleOwner owner; private Label createLabel; private String createLabelText; + private String lastFilterText; public LabelAutoCompleteAdapter(@NonNull LifecycleOwner owner, Activity activity, long accountId, long boardId) { this.owner = owner; @@ -109,6 +110,7 @@ public class LabelAutoCompleteAdapter extends BaseAdapter implements Filterable @Override protected FilterResults performFiltering(CharSequence constraint) { if (constraint != null) { + lastFilterText = constraint.toString(); ((Fragment) owner).getActivity().runOnUiThread(() -> { LiveData<List<Label>> labelLiveData = syncManager.searchLabelByTitle(accountId, boardId, constraint.toString()); Observer<List<Label>> observer = new Observer<List<Label>>() { @@ -149,6 +151,10 @@ public class LabelAutoCompleteAdapter extends BaseAdapter implements Filterable }; } + public String getLastFilterText() { + return this.lastFilterText; + } + static class ViewHolder { @BindView(R.id.icon) ImageView icon; |