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

Fixed tapping account warning icon

This commit is contained in:
M66B 2021-08-13 10:31:48 +02:00
parent 82d7f0bb37
commit 49937beb5a

View file

@ -132,12 +132,10 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
Integer percent = account.getQuotaPercentage();
if (account.error != null) {
ivWarning.setEnabled(false);
ivWarning.setImageResource(R.drawable.twotone_warning_24);
ivWarning.setVisibility(expanded ? View.VISIBLE : View.GONE);
view.setBackgroundColor(expanded ? Color.TRANSPARENT : colorWarning);
} else if (percent != null && percent > QUOTA_WARNING) {
ivWarning.setEnabled(true);
ivWarning.setImageResource(R.drawable.twotone_disc_full_24);
ivWarning.setVisibility(expanded ? View.VISIBLE : View.GONE);
view.setBackgroundColor(expanded ? Color.TRANSPARENT : colorWarning);
@ -149,11 +147,6 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
@Override
public void onClick(View v) {
if (v.getId() == R.id.ivWarning) {
ToastEx.makeText(context, R.string.title_legend_quota, Toast.LENGTH_LONG).show();
return;
}
int pos = getAdapterPosition();
if (pos == RecyclerView.NO_POSITION)
return;
@ -162,6 +155,11 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
if (account == null)
return;
if (v.getId() == R.id.ivWarning && account.error == null) {
ToastEx.makeText(context, R.string.title_legend_quota, Toast.LENGTH_LONG).show();
return;
}
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_VIEW_FOLDERS)