Commit e13102c4 authored by Antonia Wüst's avatar Antonia Wüst

add password description and include rule constants

parent f54fd033
......@@ -29,9 +29,16 @@ class ChangePasswordActivity :
setSupportActionBar(toolbar_change_password)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
presenter = ChangePasswordPresenter(PasswordInteractor(PasswordDataSourceImpl()),
UserInteractor(UserDataSourceImpl()), this)
textView_changepassword_rules.text = getString(
R.string.password_rules,
Constants.MIN_PASSWORD_LENGTH,
Constants.MAX_PASSWORD_LENGTH
)
presenter = ChangePasswordPresenter(
PasswordInteractor(PasswordDataSourceImpl()),
UserInteractor(UserDataSourceImpl()), this
)
user = AppUserUtil.getLocalAppUser(this)
......
......@@ -45,24 +45,37 @@
android:paddingStart="@dimen/activity_margin_side"
android:paddingEnd="@dimen/activity_margin_side"
android:text="@string/change_pw_descr"
android:textColor="@color/textLight"
android:textColor="@color/textLight"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView_changepassword_title" />
<TextView
android:id="@+id/textView_changepassword_rules"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="@dimen/activity_margin_side"
android:paddingEnd="@dimen/activity_margin_side"
android:text="@string/password_rules"
android:textColor="@color/textLight"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView_changepassword_descr" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_changepasswordscreen_currentpw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin_side"
android:layout_marginTop="50dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="@dimen/activity_margin_side"
android:hint="@string/current_password"
android:textColor="@color/darkText"
android:textColorHint="@color/textLight"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView_changepassword_descr"
app:layout_constraintTop_toBottomOf="@+id/textView_changepassword_rules"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/akamu_blue">
......@@ -70,10 +83,10 @@
android:id="@+id/changepw_current"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/textLight"
android:inputType="textPassword"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/akamu_blue"
android:backgroundTint="@color/textLight"/>
app:passwordToggleTint="@color/akamu_blue" />
</com.google.android.material.textfield.TextInputLayout>
......
......@@ -24,7 +24,7 @@
<string name="error_invalid_password">Falsches Passwort.</string>
<string name="logging_in">Wird eingeloggt...</string>
<string name="hint_signup_chooseusername">Wähle einen Usernamen</string>
<string name="error_invalid_password_short">Passwort muss mindestens 8 Zeichen lang sein.</string>
<string name="error_invalid_password_short">Passwort muss mindestens %1$d Zeichen lang sein.</string>
<string name="error_username_notavailable">Dieser Username existiert bereits.</string>
<string name="username_available">Username verfügbar!</string>
<string name="hint_signup_reenterpassword">Passwort erneut eingeben</string>
......@@ -71,7 +71,7 @@
<string name="error_invalid_username_short">Dein Username muss mindestens 4 Zeichen lang sein.</string>
<string name="error_invalid_username_notalpha">Dein Username darf nur alphabetische oder numerische Zeichen enthalten</string>
<string name="error_invalid_username_long">Dein Username darf nicht länger als 12 Zeichen sein.</string>
<string name="error_invalid_password_long">Dein Passwort darf nicht mehr als 50 Zeichen enthalten.</string>
<string name="error_invalid_password_long">Dein Passwort darf nicht mehr als %1$d Zeichen enthalten.</string>
<string name="could_not_update_title">Titel konnte nicht aktualisiert werden.</string>
<string name="change_title">Titel ändern</string>
<string name="profilesubjectactivity_button">Der Button zum Hinzufügen oder Entfernen von Fragenpools</string>
......
......@@ -18,10 +18,8 @@
<!-- Strings related to SignUp -->
<string name="hint_signup_chooseusername">Choose a username</string>
<string name="error_invalid_password_short">Password must be at least 8 characters long</string>
<string name="error_invalid_password_long">Password may not have more than
50 characters
</string>
<string name="error_invalid_password_short">Password must be at least %1$d characters long</string>
<string name="error_invalid_password_long">Password may not have more than %1$d characters \t</string>
<string name="error_invalid_username_notalpha">Your username must contain only alphabetic or numeric character</string>
<string name="error_invalid_username_short">Your username must be at least 4
characters long
......@@ -276,7 +274,7 @@
<string name="load_user_failed">Failed to load user: %1$s</string>
<string name="no_common_questionpools">No common question pools</string>
<string name="no_common_questionpool_info">In order to play a duel, you and your friend need to have a common question pool. Either your friend hasn\'t chosen any pools yet or you can try to select other pools.</string>
<string name="password_rules">Your password must contain at least %1$d characters, at most %2$d characters, at least one lower case and at leat one upper case letter.</string>
<string name="password_rules">Your password must contain at least %1$d characters, at most %2$d characters, at least one lower case and at least one upper case letter.</string>
<string name="info_needs_pools">Thanks for playing Akamu! Before you can start dueling with your friends, you should first choose your question pools.</string>
<string name="choose_pools">Choose pools</string>
<string name="updated_pools_success">Successfully updated your pools.</string>
......
......@@ -97,10 +97,8 @@
<!-- Strings related to SignUp -->
<string name="hint_signup_chooseusername">Choose a username</string>
<string name="error_invalid_password_short">Password must be at least 8 characters long\n\t</string>
<string name="error_invalid_password_long">Password may not have more than
50 characters
</string>
<string name="error_invalid_password_short">Password must be at least %1$d characters long\n\t</string>
<string name="error_invalid_password_long">Password may not have more than %1$d characters\n\t</string>
<string name="error_invalid_username_notalpha">Your username must contain
only alphabetic or numeric characters
</string>
......@@ -346,7 +344,7 @@
<string name="OK" translatable="false">OK</string>
<string name="no_common_questionpools" >No common question pools</string>
<string name="no_common_questionpool_info" >In order to play a duel, you and your friend need to have a common question pool. Either your friend hasn\'t chosen any pools yet or you can try to select other pools.</string>
<string name="password_rules">Your password must contain at least %1$d characters, at most %2$d characters, at least one lower case and at leat one upper case letter.</string>
<string name="password_rules">Your password must contain at least %1$d characters, at most %2$d characters, at least one lower case and at least one upper case letter.</string>
<string name="info_needs_pools">Thanks for playing Akamu! Before you can start dueling with your friends, you should first choose your question pools.</string>
<string name="choose_pools">Choose pools</string>
<string name="updated_pools_success">Successfully updated your pools.</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment