Hide old password field in SetPasswordFragment if none is set

This commit is contained in:
str4d
2014-08-18 11:56:11 +00:00
parent ee926ff23b
commit 208c69fb15
3 changed files with 13 additions and 0 deletions

View File

@ -81,6 +81,11 @@ public class SetPasswordFragment extends Fragment {
mNewField = (EditText) view.findViewById(R.id.password_new);
mConfirmField = (EditText) view.findViewById(R.id.password_confirm);
mError = (TextView) view.findViewById(R.id.error);
if (!I2PBote.getInstance().getConfiguration().getPasswordFile().exists()) {
mOldField.setVisibility(View.GONE);
view.findViewById(R.id.msg_remove_password).setVisibility(View.GONE);
}
}
@Override

View File

@ -35,6 +35,13 @@
android:hint="@string/confirm_new_password"
android:inputType="textPassword" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/remove_password_info"
android:id="@+id/msg_remove_password"
android:layout_margin="5dp" />
<TextView
android:id="@+id/error"
android:layout_width="wrap_content"

View File

@ -158,6 +158,7 @@
<string name="old_password">Old password</string>
<string name="new_password">New password</string>
<string name="confirm_new_password">Confirm new password</string>
<string name="remove_password_info">To remove the password, leave the \'New password\' fields blank.</string>
<string name="password_changed">Password changed successfully</string>
<string name="pref_title_identities">Identities</string>
<string name="new_identity">New identity…</string>