mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 18:41:20 +01:00
Added capabilities to account
This commit is contained in:
@@ -21,11 +21,13 @@ package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v7.util.DiffUtil;
|
||||
import android.support.v7.util.ListUpdateCallback;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -42,6 +44,7 @@ import java.util.Locale;
|
||||
|
||||
public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHolder> {
|
||||
private Context context;
|
||||
private boolean debug;
|
||||
|
||||
private List<EntityAccount> all = new ArrayList<>();
|
||||
private List<EntityAccount> filtered = new ArrayList<>();
|
||||
@@ -53,6 +56,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
ImageView ivSync;
|
||||
TextView tvHost;
|
||||
TextView tvUser;
|
||||
TextView tvCapabilities;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@@ -63,6 +67,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
ivSync = itemView.findViewById(R.id.ivSync);
|
||||
tvHost = itemView.findViewById(R.id.tvHost);
|
||||
tvUser = itemView.findViewById(R.id.tvUser);
|
||||
tvCapabilities = itemView.findViewById(R.id.tvCapabilities);
|
||||
}
|
||||
|
||||
private void wire() {
|
||||
@@ -89,6 +94,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
|
||||
AdapterAccount(Context context) {
|
||||
this.context = context;
|
||||
this.debug = PreferenceManager.getDefaultSharedPreferences(context).getBoolean("debug", false);
|
||||
setHasStableIds(true);
|
||||
}
|
||||
|
||||
@@ -198,6 +204,8 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
holder.ivSync.setVisibility(account.synchronize ? View.VISIBLE : View.INVISIBLE);
|
||||
holder.tvHost.setText(String.format("%s:%d", account.host, account.port));
|
||||
holder.tvUser.setText(account.user);
|
||||
holder.tvCapabilities.setText(TextUtils.join(", ", account.capabilities));
|
||||
holder.tvCapabilities.setVisibility(debug ? View.VISIBLE : View.GONE);
|
||||
|
||||
holder.wire();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user