Browse Source

Allow viewing account/identity password

main
M66B 6 years ago
parent
commit
485ef3ff56
5 changed files with 35 additions and 19 deletions
  1. +1
    -1
      .idea/misc.xml
  2. +5
    -4
      app/src/main/java/eu/faircode/email/FragmentAccount.java
  3. +5
    -4
      app/src/main/java/eu/faircode/email/FragmentIdentity.java
  4. +12
    -5
      app/src/main/res/layout/fragment_account.xml
  5. +12
    -5
      app/src/main/res/layout/fragment_identity.xml

+ 1
- 1
.idea/misc.xml View File

@ -25,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">


+ 5
- 4
app/src/main/java/eu/faircode/email/FragmentAccount.java View File

@ -24,6 +24,7 @@ import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
@ -63,7 +64,7 @@ public class FragmentAccount extends Fragment {
private EditText etHost;
private EditText etPort;
private EditText etUser;
private EditText etPassword;
private TextInputLayout tilPassword;
private CheckBox cbPrimary;
private CheckBox cbSynchronize;
private Button btnOk;
@ -96,7 +97,7 @@ public class FragmentAccount extends Fragment {
etHost = view.findViewById(R.id.etHost);
etPort = view.findViewById(R.id.etPort);
etUser = view.findViewById(R.id.etUser);
etPassword = view.findViewById(R.id.etPassword);
tilPassword = view.findViewById(R.id.tilPassword);
cbPrimary = view.findViewById(R.id.cbPrimary);
cbSynchronize = view.findViewById(R.id.cbSynchronize);
btnOk = view.findViewById(R.id.btnOk);
@ -138,7 +139,7 @@ public class FragmentAccount extends Fragment {
args.putString("host", etHost.getText().toString());
args.putString("port", etPort.getText().toString());
args.putString("user", etUser.getText().toString());
args.putString("password", etPassword.getText().toString());
args.putString("password", tilPassword.getEditText().getText().toString());
args.putBoolean("primary", cbPrimary.isChecked());
args.putBoolean("synchronize", cbSynchronize.isChecked());
@ -153,7 +154,7 @@ public class FragmentAccount extends Fragment {
etHost.setText(account == null ? null : account.host);
etPort.setText(account == null ? null : Long.toString(account.port));
etUser.setText(account == null ? null : account.user);
etPassword.setText(account == null ? null : account.password);
tilPassword.getEditText().setText(account == null ? null : account.password);
cbPrimary.setChecked(account == null ? true : account.primary);
cbSynchronize.setChecked(account == null ? true : account.synchronize);
}


+ 5
- 4
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -24,6 +24,7 @@ import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
@ -64,7 +65,7 @@ public class FragmentIdentity extends Fragment {
private CheckBox cbStartTls;
private EditText etPort;
private EditText etUser;
private EditText etPassword;
private TextInputLayout tilPassword;
private CheckBox cbPrimary;
private CheckBox cbSynchronize;
private Button btnOk;
@ -92,7 +93,7 @@ public class FragmentIdentity extends Fragment {
cbStartTls = view.findViewById(R.id.cbStartTls);
etPort = view.findViewById(R.id.etPort);
etUser = view.findViewById(R.id.etUser);
etPassword = view.findViewById(R.id.etPassword);
tilPassword = view.findViewById(R.id.tilPassword);
cbPrimary = view.findViewById(R.id.cbPrimary);
cbSynchronize = view.findViewById(R.id.cbSynchronize);
btnOk = view.findViewById(R.id.btnOk);
@ -159,7 +160,7 @@ public class FragmentIdentity extends Fragment {
args.putBoolean("starttls", cbStartTls.isChecked());
args.putString("port", etPort.getText().toString());
args.putString("user", etUser.getText().toString());
args.putString("password", etPassword.getText().toString());
args.putString("password", tilPassword.getEditText().toString());
args.putBoolean("primary", cbPrimary.isChecked());
args.putBoolean("synchronize", cbSynchronize.isChecked());
@ -177,7 +178,7 @@ public class FragmentIdentity extends Fragment {
cbStartTls.setChecked(identity == null ? false : identity.starttls);
etPort.setText(identity == null ? null : Long.toString(identity.port));
etUser.setText(identity == null ? null : identity.user);
etPassword.setText(identity == null ? null : identity.password);
tilPassword.getEditText().setText(identity == null ? null : identity.password);
cbPrimary.setChecked(identity == null ? true : identity.primary);
cbSynchronize.setChecked(identity == null ? true : identity.synchronize);
}


+ 12
- 5
app/src/main/res/layout/fragment_account.xml View File

@ -142,14 +142,21 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etUser" />
<EditText
android:id="@+id/etPassword"
<android.support.design.widget.TextInputLayout
android:id="@+id/tilPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassword" />
app:layout_constraintTop_toBottomOf="@id/tvPassword"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<CheckBox
android:id="@+id/cbPrimary"
@ -158,7 +165,7 @@
android:layout_marginTop="12dp"
android:text="@string/title_primary_account"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etPassword" />
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
<CheckBox
android:id="@+id/cbSynchronize"
@ -193,6 +200,6 @@
android:id="@+id/grpReady"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="spProvider,etName,etHost,etPort,etUser,etPassword,cbPrimary,cbSynchronize,btnOk" />
app:constraint_referenced_ids="spProvider,etName,etHost,etPort,etUser,tilPassword,cbPrimary,cbSynchronize,btnOk" />
</android.support.constraint.ConstraintLayout>
</ScrollView>

+ 12
- 5
app/src/main/res/layout/fragment_identity.xml View File

@ -194,14 +194,21 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etUser" />
<EditText
android:id="@+id/etPassword"
<android.support.design.widget.TextInputLayout
android:id="@+id/tilPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassword" />
app:layout_constraintTop_toBottomOf="@id/tvPassword"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
<CheckBox
android:id="@+id/cbPrimary"
@ -210,7 +217,7 @@
android:layout_marginTop="12dp"
android:text="@string/title_primary_identity"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etPassword" />
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
<CheckBox
android:id="@+id/cbSynchronize"
@ -245,6 +252,6 @@
android:id="@+id/grpReady"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="etName,etEmail,spProvider,etHost,cbStartTls,etPort,etUser,etPassword,cbPrimary,cbSynchronize,btnOk" />
app:constraint_referenced_ids="etName,etEmail,spProvider,etHost,cbStartTls,etPort,etUser,tilPassword,cbPrimary,cbSynchronize,btnOk" />
</android.support.constraint.ConstraintLayout>
</ScrollView>

Loading…
Cancel
Save