Hide old password field in SetPasswordFragment if none is set
This commit is contained in:
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user