Skip to content

Commit 32744d0

Browse files
committed
fix multi-select and show custom_checkbox
Signed-off-by: alperozturk <[email protected]>
1 parent 3aa1c00 commit 32744d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import android.annotation.SuppressLint;
1212
import android.content.Context;
13+
import android.os.Handler;
14+
import android.os.Looper;
1315
import android.text.TextUtils;
1416
import android.view.LayoutInflater;
1517
import android.view.View;
@@ -178,8 +180,7 @@ public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int
178180
holder.itemView.setBackgroundColor(holder.itemView.getContext().getColor(com.nextcloud.android.common.ui.R.color.bg_default));
179181
((ImageView) holder.itemView.findViewById(R.id.custom_checkbox)).setImageResource(R.drawable.ic_checkbox_blank_outline);
180182
}
181-
//holder.itemView.findViewById(R.id.custom_checkbox).setVisibility(isMultiSelect ? View.VISIBLE : View.GONE);
182-
holder.itemView.findViewById(R.id.custom_checkbox).setVisibility(View.GONE);
183+
holder.itemView.findViewById(R.id.custom_checkbox).setVisibility(isMultiSelect ? View.VISIBLE : View.GONE);
183184
((NoteViewHolder) holder).bind(isSelected, (Note) itemList.get(position), showCategory, color, searchQuery);
184185
}
185186
}
@@ -193,8 +194,7 @@ public void setTracker(SelectionTracker<Long> tracker) {
193194
public void setMultiSelect(boolean bool) {
194195
if (isMultiSelect != bool) {
195196
isMultiSelect = bool;
196-
// endless loop incoming...
197-
//notifyDataSetChanged();
197+
new Handler(Looper.getMainLooper()).post(this::notifyDataSetChanged);
198198
}
199199
}
200200

0 commit comments

Comments
 (0)