| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -23,8 +23,10 @@ import android.content.Context;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.content.DialogInterface;
 | 
					 | 
					 | 
					 | 
					import android.content.DialogInterface;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.os.Bundle;
 | 
					 | 
					 | 
					 | 
					import android.os.Bundle;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.text.Editable;
 | 
					 | 
					 | 
					 | 
					import android.text.Editable;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import android.text.Html;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.text.TextUtils;
 | 
					 | 
					 | 
					 | 
					import android.text.TextUtils;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.text.TextWatcher;
 | 
					 | 
					 | 
					 | 
					import android.text.TextWatcher;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import android.text.method.LinkMovementMethod;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.view.LayoutInflater;
 | 
					 | 
					 | 
					 | 
					import android.view.LayoutInflater;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.view.View;
 | 
					 | 
					 | 
					 | 
					import android.view.View;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.view.ViewGroup;
 | 
					 | 
					 | 
					 | 
					import android.view.ViewGroup;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -37,6 +39,7 @@ import android.widget.EditText;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.widget.ImageButton;
 | 
					 | 
					 | 
					 | 
					import android.widget.ImageButton;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.widget.ProgressBar;
 | 
					 | 
					 | 
					 | 
					import android.widget.ProgressBar;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.widget.Spinner;
 | 
					 | 
					 | 
					 | 
					import android.widget.Spinner;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import android.widget.TextView;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import android.widget.Toast;
 | 
					 | 
					 | 
					 | 
					import android.widget.Toast;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.google.android.material.textfield.TextInputLayout;
 | 
					 | 
					 | 
					 | 
					import com.google.android.material.textfield.TextInputLayout;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -51,6 +54,7 @@ import javax.mail.Transport;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import androidx.annotation.NonNull;
 | 
					 | 
					 | 
					 | 
					import androidx.annotation.NonNull;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import androidx.annotation.Nullable;
 | 
					 | 
					 | 
					 | 
					import androidx.annotation.Nullable;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import androidx.appcompat.app.AlertDialog;
 | 
					 | 
					 | 
					 | 
					import androidx.appcompat.app.AlertDialog;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import androidx.constraintlayout.widget.Group;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import androidx.lifecycle.Observer;
 | 
					 | 
					 | 
					 | 
					import androidx.lifecycle.Observer;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					public class FragmentIdentity extends FragmentEx {
 | 
					 | 
					 | 
					 | 
					public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -65,12 +69,14 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private EditText etPort;
 | 
					 | 
					 | 
					 | 
					    private EditText etPort;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private EditText etUser;
 | 
					 | 
					 | 
					 | 
					    private EditText etUser;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private TextInputLayout tilPassword;
 | 
					 | 
					 | 
					 | 
					    private TextInputLayout tilPassword;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private TextView tvLink;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private CheckBox cbSynchronize;
 | 
					 | 
					 | 
					 | 
					    private CheckBox cbSynchronize;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private CheckBox cbPrimary;
 | 
					 | 
					 | 
					 | 
					    private CheckBox cbPrimary;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private Button btnSave;
 | 
					 | 
					 | 
					 | 
					    private Button btnSave;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private ProgressBar pbSave;
 | 
					 | 
					 | 
					 | 
					    private ProgressBar pbSave;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private ImageButton ibDelete;
 | 
					 | 
					 | 
					 | 
					    private ImageButton ibDelete;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private ProgressBar pbWait;
 | 
					 | 
					 | 
					 | 
					    private ProgressBar pbWait;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private Group grpInstructions;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Override
 | 
					 | 
					 | 
					 | 
					    @Override
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Nullable
 | 
					 | 
					 | 
					 | 
					    @Nullable
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -94,12 +100,14 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        etPort = view.findViewById(R.id.etPort);
 | 
					 | 
					 | 
					 | 
					        etPort = view.findViewById(R.id.etPort);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        etUser = view.findViewById(R.id.etUser);
 | 
					 | 
					 | 
					 | 
					        etUser = view.findViewById(R.id.etUser);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        tilPassword = view.findViewById(R.id.tilPassword);
 | 
					 | 
					 | 
					 | 
					        tilPassword = view.findViewById(R.id.tilPassword);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        tvLink = view.findViewById(R.id.tvLink);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cbSynchronize = view.findViewById(R.id.cbSynchronize);
 | 
					 | 
					 | 
					 | 
					        cbSynchronize = view.findViewById(R.id.cbSynchronize);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cbPrimary = view.findViewById(R.id.cbPrimary);
 | 
					 | 
					 | 
					 | 
					        cbPrimary = view.findViewById(R.id.cbPrimary);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        btnSave = view.findViewById(R.id.btnSave);
 | 
					 | 
					 | 
					 | 
					        btnSave = view.findViewById(R.id.btnSave);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pbSave = view.findViewById(R.id.pbSave);
 | 
					 | 
					 | 
					 | 
					        pbSave = view.findViewById(R.id.pbSave);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ibDelete = view.findViewById(R.id.ibDelete);
 | 
					 | 
					 | 
					 | 
					        ibDelete = view.findViewById(R.id.ibDelete);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pbWait = view.findViewById(R.id.pbWait);
 | 
					 | 
					 | 
					 | 
					        pbWait = view.findViewById(R.id.pbWait);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        grpInstructions = view.findViewById(R.id.grpInstructions);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // Wire controls
 | 
					 | 
					 | 
					 | 
					        // Wire controls
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -159,6 +167,10 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                adapterView.setTag(position);
 | 
					 | 
					 | 
					 | 
					                adapterView.setTag(position);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                Provider provider = (Provider) adapterView.getSelectedItem();
 | 
					 | 
					 | 
					 | 
					                Provider provider = (Provider) adapterView.getSelectedItem();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                tvLink.setText(Html.fromHtml("<a href=\"" + provider.link + "\">" + provider.link + "</a>"));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                grpInstructions.setVisibility(provider.link == null ? View.GONE : View.VISIBLE);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (provider.smtp_port != 0) {
 | 
					 | 
					 | 
					 | 
					                if (provider.smtp_port != 0) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    etHost.setText(provider.smtp_host);
 | 
					 | 
					 | 
					 | 
					                    etHost.setText(provider.smtp_host);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    etPort.setText(Integer.toString(provider.smtp_port));
 | 
					 | 
					 | 
					 | 
					                    etPort.setText(Integer.toString(provider.smtp_port));
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -357,6 +369,7 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // Initialize
 | 
					 | 
					 | 
					 | 
					        // Initialize
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        Helper.setViewsEnabled(view, false);
 | 
					 | 
					 | 
					 | 
					        Helper.setViewsEnabled(view, false);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        tilPassword.setPasswordVisibilityToggleEnabled(id < 0);
 | 
					 | 
					 | 
					 | 
					        tilPassword.setPasswordVisibilityToggleEnabled(id < 0);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        tvLink.setMovementMethod(LinkMovementMethod.getInstance());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        btnSave.setEnabled(false);
 | 
					 | 
					 | 
					 | 
					        btnSave.setEnabled(false);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pbSave.setVisibility(View.GONE);
 | 
					 | 
					 | 
					 | 
					        pbSave.setVisibility(View.GONE);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        ibDelete.setVisibility(View.GONE);
 | 
					 | 
					 | 
					 | 
					        ibDelete.setVisibility(View.GONE);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -370,6 +383,7 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        outState.putInt("account", spAccount.getSelectedItemPosition());
 | 
					 | 
					 | 
					 | 
					        outState.putInt("account", spAccount.getSelectedItemPosition());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        outState.putInt("provider", spProvider.getSelectedItemPosition());
 | 
					 | 
					 | 
					 | 
					        outState.putInt("provider", spProvider.getSelectedItemPosition());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        outState.putString("password", tilPassword.getEditText().getText().toString());
 | 
					 | 
					 | 
					 | 
					        outState.putString("password", tilPassword.getEditText().getText().toString());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        outState.putInt("instructions", grpInstructions.getVisibility());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Override
 | 
					 | 
					 | 
					 | 
					    @Override
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -405,8 +419,10 @@ public class FragmentIdentity extends FragmentEx {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    cbPrimary.setChecked(identity == null ? true : identity.primary);
 | 
					 | 
					 | 
					 | 
					                    cbPrimary.setChecked(identity == null ? true : identity.primary);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    etName.requestFocus();
 | 
					 | 
					 | 
					 | 
					                    etName.requestFocus();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } else
 | 
					 | 
					 | 
					 | 
					                } else {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    tilPassword.getEditText().setText(savedInstanceState.getString("password"));
 | 
					 | 
					 | 
					 | 
					                    tilPassword.getEditText().setText(savedInstanceState.getString("password"));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    grpInstructions.setVisibility(savedInstanceState.getInt("instructions"));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                Helper.setViewsEnabled(view, true);
 | 
					 | 
					 | 
					 | 
					                Helper.setViewsEnabled(view, true);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |