|
|
@ -34,6 +34,7 @@ import android.view.Menu;
|
|
|
|
import android.view.MenuItem;
|
|
|
|
import android.view.MenuItem;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
|
|
import android.widget.Button;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
|
@ -87,6 +88,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|
|
|
private TextView tvDrafts;
|
|
|
|
private TextView tvDrafts;
|
|
|
|
private TextView tvWarning;
|
|
|
|
private TextView tvWarning;
|
|
|
|
private TextView tvError;
|
|
|
|
private TextView tvError;
|
|
|
|
|
|
|
|
private Button btnHelp;
|
|
|
|
private Group grpSettings;
|
|
|
|
private Group grpSettings;
|
|
|
|
|
|
|
|
|
|
|
|
private TwoStateOwner powner = new TwoStateOwner(owner, "AccountPopup");
|
|
|
|
private TwoStateOwner powner = new TwoStateOwner(owner, "AccountPopup");
|
|
|
@ -109,17 +111,20 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|
|
|
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
|
|
|
tvDrafts = itemView.findViewById(R.id.tvDrafts);
|
|
|
|
tvWarning = itemView.findViewById(R.id.tvWarning);
|
|
|
|
tvWarning = itemView.findViewById(R.id.tvWarning);
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
tvError = itemView.findViewById(R.id.tvError);
|
|
|
|
|
|
|
|
btnHelp = itemView.findViewById(R.id.btnHelp);
|
|
|
|
grpSettings = itemView.findViewById(R.id.grpSettings);
|
|
|
|
grpSettings = itemView.findViewById(R.id.grpSettings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void wire() {
|
|
|
|
private void wire() {
|
|
|
|
view.setOnClickListener(this);
|
|
|
|
view.setOnClickListener(this);
|
|
|
|
view.setOnLongClickListener(this);
|
|
|
|
view.setOnLongClickListener(this);
|
|
|
|
|
|
|
|
btnHelp.setOnClickListener(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void unwire() {
|
|
|
|
private void unwire() {
|
|
|
|
view.setOnClickListener(null);
|
|
|
|
view.setOnClickListener(null);
|
|
|
|
view.setOnLongClickListener(null);
|
|
|
|
view.setOnLongClickListener(null);
|
|
|
|
|
|
|
|
btnHelp.setOnClickListener(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void bindTo(TupleAccountEx account) {
|
|
|
|
private void bindTo(TupleAccountEx account) {
|
|
|
@ -169,12 +174,16 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|
|
|
|
|
|
|
|
|
|
|
tvError.setText(account.error);
|
|
|
|
tvError.setText(account.error);
|
|
|
|
tvError.setVisibility(account.error == null ? View.GONE : View.VISIBLE);
|
|
|
|
tvError.setVisibility(account.error == null ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
|
btnHelp.setVisibility(account.error == null ? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
|
|
grpSettings.setVisibility(settings ? View.VISIBLE : View.GONE);
|
|
|
|
grpSettings.setVisibility(settings ? View.VISIBLE : View.GONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View view) {
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
if (view.getId() == R.id.btnHelp)
|
|
|
|
|
|
|
|
Helper.viewFAQ(context, 22);
|
|
|
|
|
|
|
|
else {
|
|
|
|
int pos = getAdapterPosition();
|
|
|
|
int pos = getAdapterPosition();
|
|
|
|
if (pos == RecyclerView.NO_POSITION)
|
|
|
|
if (pos == RecyclerView.NO_POSITION)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -188,6 +197,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|
|
|
new Intent(settings ? ActivitySetup.ACTION_EDIT_ACCOUNT : ActivityView.ACTION_VIEW_FOLDERS)
|
|
|
|
new Intent(settings ? ActivitySetup.ACTION_EDIT_ACCOUNT : ActivityView.ACTION_VIEW_FOLDERS)
|
|
|
|
.putExtra("id", account.id));
|
|
|
|
.putExtra("id", account.id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean onLongClick(View v) {
|
|
|
|
public boolean onLongClick(View v) {
|
|
|
|