Show Gmail app delete button for Gmail/OAuth

pull/209/head
M66B 2 years ago
parent 25e39d9e12
commit a11aa323c8

@ -21,6 +21,7 @@ package eu.faircode.email;
import static android.app.Activity.RESULT_OK;
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_GMAIL;
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_OAUTH;
import android.app.Dialog;
import android.content.Context;
@ -166,9 +167,9 @@ public class FragmentDialogAccount extends FragmentDialogBase {
public void onChanged(EntityAccount account) {
tvName.setText(account.name);
ibEditName.setEnabled(true);
btnGmail.setVisibility(
hasGmail && account.auth_type == AUTH_TYPE_GMAIL
? View.VISIBLE : View.GONE);
boolean isGmail = (account.auth_type == AUTH_TYPE_GMAIL ||
(account.auth_type == AUTH_TYPE_OAUTH && "gmail".equals(account.provider)));
btnGmail.setVisibility(hasGmail && isGmail ? View.VISIBLE : View.GONE);
}
});

Loading…
Cancel
Save