Revert "Quick rule edit"

This reverts commit 16cb2e9b31.
pull/190/head
M66B 4 years ago
parent f7ad38a016
commit d287229452

@ -117,7 +117,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private ImageView ivUnified;
private ImageView ivSubscribed;
private ImageButton ibRule;
private ImageView ivRule;
private ImageView ivNotify;
private TextView tvName;
private TextView tvMessages;
@ -155,7 +155,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
ivUnified = itemView.findViewById(R.id.ivUnified);
ivSubscribed = itemView.findViewById(R.id.ivSubscribed);
ibRule = itemView.findViewById(R.id.ibRule);
ivRule = itemView.findViewById(R.id.ivRule);
ivNotify = itemView.findViewById(R.id.ivNotify);
tvName = itemView.findViewById(R.id.tvName);
tvMessages = itemView.findViewById(R.id.tvMessages);
@ -181,8 +181,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private void wire() {
view.setOnClickListener(this);
ibExpander.setOnClickListener(this);
if (ibRule != null)
ibRule.setOnClickListener(this);
if (tvFlagged != null)
tvFlagged.setOnClickListener(this);
if (ibFlagged != null)
@ -196,8 +194,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private void unwire() {
view.setOnClickListener(null);
ibExpander.setOnClickListener(null);
if (ibRule != null)
ibRule.setOnClickListener(null);
if (tvFlagged != null)
tvFlagged.setOnClickListener(null);
if (ibFlagged != null)
@ -274,7 +270,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
if (listener == null && folder.selectable) {
ivUnified.setVisibility((account > 0 || primary) && folder.unified ? View.VISIBLE : View.GONE);
ivSubscribed.setVisibility(subscriptions && folder.subscribed != null && folder.subscribed ? View.VISIBLE : View.GONE);
ibRule.setVisibility(folder.rules > 0 ? View.VISIBLE : View.GONE);
ivRule.setVisibility(folder.rules > 0 ? View.VISIBLE : View.GONE);
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
}
@ -393,9 +389,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
case R.id.ibExpander:
onCollapse(folder);
break;
case R.id.ibRule:
onActionEditRules(folder);
break;
case R.id.tvFlagged:
case R.id.ibFlagged:
onFlagged(folder);
@ -452,16 +445,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
}.execute(context, owner, args, "folder:collapse");
}
private void onActionEditRules(TupleFolderEx folder) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_RULES)
.putExtra("account", folder.account)
.putExtra("protocol", folder.accountProtocol)
.putExtra("folder", folder.id)
.putExtra("type", folder.type));
}
private void onFlagged(TupleFolderEx folder) {
BoundaryCallbackMessages.SearchCriteria criteria = new BoundaryCallbackMessages.SearchCriteria();
criteria.in_senders = false;
@ -643,7 +626,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
return true;
case R.string.title_edit_rules:
onActionEditRules(folder);
onActionEditRules();
return true;
case R.string.title_edit_properties:
@ -839,6 +822,16 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
ask.show(parentFragment.getParentFragmentManager(), "folder:empty");
}
private void onActionEditRules() {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_RULES)
.putExtra("account", folder.account)
.putExtra("protocol", folder.accountProtocol)
.putExtra("folder", folder.id)
.putExtra("type", folder.type));
}
private void onActionEditProperties() {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(

@ -89,11 +89,10 @@
app:layout_constraintTop_toTopOf="@+id/tvName"
app:srcCompat="@drawable/twotone_bookmark_24" />
<ImageButton
android:id="@+id/ibRule"
<ImageView
android:id="@+id/ivRule"
android:layout_width="30dp"
android:layout_height="24dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_edit_rules"
android:paddingEnd="6dp"
app:layout_constraintBottom_toBottomOf="@+id/tvName"
@ -108,7 +107,7 @@
android:contentDescription="@string/title_legend_notify"
android:paddingEnd="6dp"
app:layout_constraintBottom_toBottomOf="@+id/tvName"
app:layout_constraintStart_toEndOf="@id/ibRule"
app:layout_constraintStart_toEndOf="@id/ivRule"
app:layout_constraintTop_toTopOf="@+id/tvName"
app:srcCompat="@drawable/twotone_notifications_24" />

Loading…
Cancel
Save