1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Removed item selection

This commit is contained in:
M66B 2018-08-15 10:35:52 +00:00
parent bb143540f4
commit eb8cc15e11

View file

@ -34,9 +34,7 @@ import android.widget.TextView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
@ -52,7 +50,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
private ViewType viewType;
private boolean debug;
private Map<Long, Boolean> selected = new HashMap<>();
private DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.SHORT, SimpleDateFormat.LONG);
enum ViewType {FOLDER, THREAD}
@ -103,8 +100,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
private void bindTo(final TupleMessageEx message) {
pbLoading.setVisibility(View.GONE);
itemView.setActivated(selected.containsKey(message.id) && selected.get(message.id));
if (EntityFolder.DRAFTS.equals(message.folderType) ||
EntityFolder.OUTBOX.equals(message.folderType) ||
EntityFolder.SENT.equals(message.folderType)) {
@ -192,15 +187,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
TupleMessageEx message = getItem(pos);
if (!selected.containsKey(message.id))
selected.put(message.id, false);
selected.put(message.id, !selected.get(message.id));
notifyItemChanged(pos);
//LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
//lbm.sendBroadcast(
// new Intent(ActivityView.ACTION_VIEW_MESSAGE)
// .putExtra("id", message.id));
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_MESSAGE)
.putExtra("id", message.id));
return true;
}