diff --git a/README.md b/README.md index 7785ec546a6874fdb3cd30da0321c575bf114668..0c5d906298b90bb12be74630fb391ea395d2cc74 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # xxmessenger (Android) -***Current Version:*** 2.9/627 (MainNet)<br> +***Current Version:*** 2.92/629 (MainNet)<br> ***Device Orientation:*** Portrait<br> ***API Target:*** Android 26+ (Oreo) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3de355a0894d483f72185b9f08727f1006ef7031..008f0b2e5f75c41bc17bff02908f8bb1e5dee0eb 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -35,8 +35,8 @@ android { defaultConfig { applicationId = "io.xxlabs.messenger" - versionCode = 627 - versionName = "2.9" + versionCode = 629 + versionName = "2.92" minSdk = 26 targetSdk = 31 testInstrumentationRunner = "io.xxlabs.messenger.CustomTestRunner" diff --git a/app/src/main/java/io/xxlabs/messenger/ui/intro/registration/username/UsernameRegistration.kt b/app/src/main/java/io/xxlabs/messenger/ui/intro/registration/username/UsernameRegistration.kt index d029f00f2e1eca695c6397b2f6037a46ca4bc697..dfc7dd9b7db233ab16d44519e03a6850c7ed7c62 100644 --- a/app/src/main/java/io/xxlabs/messenger/ui/intro/registration/username/UsernameRegistration.kt +++ b/app/src/main/java/io/xxlabs/messenger/ui/intro/registration/username/UsernameRegistration.kt @@ -113,12 +113,12 @@ class UsernameRegistration @AssistedInject constructor( override val usernameFilters: Array<InputFilter> = arrayOf( - InputFilter { source, start, end, _, _, _ -> - val input = source?.subSequence(start, end) - val filtered = source?.subSequence(start, end) - ?.replace(Regex(USERNAME_FILTER_REGEX), "") - if (filtered == input) null else filtered - }, +// InputFilter { source, start, end, _, _, _ -> +// val input = source?.subSequence(start, end) +// val filtered = source?.subSequence(start, end) +// ?.replace(Regex(USERNAME_FILTER_REGEX), "") +// if (filtered == input) null else filtered +// }, InputFilter.LengthFilter(MAX_USERNAME_LENGTH) ) @@ -179,17 +179,23 @@ class UsernameRegistration @AssistedInject constructor( this.equals(PLAY_STORE_DEMO_USERNAME, true) private fun String?.isValidUsername(): Boolean { - if (isNullOrEmpty() || !isMinimumLength()) { - minimumLengthError() - return false - } - - return if (this.matches(USERNAME_VALIDATION_REGEX.toRegex())) { - error.value = null - true - } else { - invalidUsernameError() - false + return when { + isNullOrEmpty() || !isMinimumLength() -> { + minimumLengthError() + false + } + matches(USERNAME_VALIDATION_REGEX.toRegex()) -> { + error.value = null + true + } + contains(Regex(USERNAME_FILTER_REGEX)) -> { + invalidCharsInUsernameError() + false + } + else -> { + invalidUsernameError() + false + } } } @@ -203,6 +209,12 @@ class UsernameRegistration @AssistedInject constructor( error.value = application.getString(R.string.registration_error_username_invalid) } + private fun invalidCharsInUsernameError() { + error.postValue( + application.getString(R.string.registration_error_username_invalid_chars) + ) + } + private fun registerUsername(username: String, isDemoAcct: Boolean = false) { if (!loggedIn) { getOrCreateSession() diff --git a/app/src/main/java/io/xxlabs/messenger/ui/main/settings/SettingsFragment.kt b/app/src/main/java/io/xxlabs/messenger/ui/main/settings/SettingsFragment.kt index c42c69d89d2379b1056a08a0bd97cb84cdd6512b..d11c69a0121cd6b16ab87bc396cc58269529b86d 100755 --- a/app/src/main/java/io/xxlabs/messenger/ui/main/settings/SettingsFragment.kt +++ b/app/src/main/java/io/xxlabs/messenger/ui/main/settings/SettingsFragment.kt @@ -146,7 +146,7 @@ class SettingsFragment : BaseFragment() { DialogUtils.getWebPopup( requireContext(), getString(R.string.settings_disclosures), - "https://xx.network/privategrity-corporation-terms-of-use" + requireContext().getString(R.string.settings_disclosures_url) ).show() } @@ -154,7 +154,7 @@ class SettingsFragment : BaseFragment() { DialogUtils.getWebPopup( requireContext(), getString(R.string.settings_privacy_policy), - "https://xx.network/privategrity-corporation-privacy-policy" + requireContext().getString(R.string.settings_privacy_policy_url) ).show() } @@ -162,7 +162,7 @@ class SettingsFragment : BaseFragment() { DialogUtils.getWebPopup( requireContext(), "Terms of Use", - "https://xx.network/terms-of-use" + requireContext().getString(R.string.settings_disclosures_url) ).show() } diff --git a/app/src/main/res/layout/activity_sftp_auth.xml b/app/src/main/res/layout/activity_sftp_auth.xml index ee33fc6474ff8c660678e9d1c6058b73bfddaed0..62dcd5d9d762de179ca2032a3258e09e797256f5 100644 --- a/app/src/main/res/layout/activity_sftp_auth.xml +++ b/app/src/main/res/layout/activity_sftp_auth.xml @@ -9,148 +9,153 @@ type="io.xxlabs.messenger.backup.cloud.sftp.login.ui.SshLoginUi" /> </data> - <androidx.constraintlayout.widget.ConstraintLayout + <androidx.core.widget.NestedScrollView android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".backup.cloud.sftp.login.ui.SshLoginActivity"> + android:layout_height="match_parent"> - <TextView - android:id="@+id/sftp_login_title" - style="@style/dialog_title" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:text="@string/sftp_login_title" - android:layout_marginTop="24dp" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" /> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".backup.cloud.sftp.login.ui.SshLoginActivity"> - <TextView - android:id="@+id/sftp_login_body" - style="@style/dialog_body" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:text="@string/stfp_login_body" - android:layout_marginTop="24dp" - app:layout_constraintTop_toBottomOf="@id/sftp_login_title" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" /> + <TextView + android:id="@+id/sftp_login_title" + style="@style/dialog_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/sftp_login_title" + android:layout_marginTop="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/stfp_login_host" - style="@style/registration_text_input" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:enabled="@{ui.textInputEnabled}" - android:layout_marginTop="24dp" - app:error="@{ui.hostError}" - app:layout_constraintTop_toBottomOf="@id/sftp_login_body" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + <TextView + android:id="@+id/sftp_login_body" + style="@style/dialog_body" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:text="@string/stfp_login_body" + android:layout_marginTop="24dp" + app:layout_constraintTop_toBottomOf="@id/sftp_login_title" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> - <com.google.android.material.textfield.TextInputEditText - style="@style/registration_text_input_edittext" - android:layout_width="match_parent" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/stfp_login_host" + style="@style/registration_text_input" + android:layout_width="0dp" android:layout_height="wrap_content" - android:hint="@string/sftp_login_host_hint" - android:imeOptions="actionNext" - android:maxLength="@{ui.maxHostLength}" - android:afterTextChanged="@{ui::onHostInput}" /> - </com.google.android.material.textfield.TextInputLayout> + android:enabled="@{ui.textInputEnabled}" + android:layout_marginTop="24dp" + app:error="@{ui.hostError}" + app:layout_constraintTop_toBottomOf="@id/sftp_login_body" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/stfp_login_port" - style="@style/registration_text_input" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:enabled="@{ui.textInputEnabled}" - android:layout_marginTop="18dp" - android:visibility="gone" - app:error="@{ui.portError}" - app:layout_constraintTop_toBottomOf="@id/stfp_login_host" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + <com.google.android.material.textfield.TextInputEditText + style="@style/registration_text_input_edittext" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/sftp_login_host_hint" + android:imeOptions="actionNext" + android:maxLength="@{ui.maxHostLength}" + android:afterTextChanged="@{ui::onHostInput}" /> + </com.google.android.material.textfield.TextInputLayout> - <com.google.android.material.textfield.TextInputEditText - style="@style/registration_text_input_edittext" - android:layout_width="match_parent" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/stfp_login_port" + style="@style/registration_text_input" + android:layout_width="0dp" android:layout_height="wrap_content" - android:hint="@string/sftp_login_port_hint" - android:imeOptions="actionNext" - android:maxLength="@{ui.maxPortLength}" - android:afterTextChanged="@{ui::onPortInput}" /> - </com.google.android.material.textfield.TextInputLayout> + android:enabled="@{ui.textInputEnabled}" + android:layout_marginTop="18dp" + android:visibility="gone" + app:error="@{ui.portError}" + app:layout_constraintTop_toBottomOf="@id/stfp_login_host" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/sftp_login_username" - style="@style/registration_text_input" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:enabled="@{ui.textInputEnabled}" - android:layout_marginTop="18dp" - app:error="@{ui.usernameError}" - app:layout_constraintTop_toBottomOf="@id/stfp_login_port" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + <com.google.android.material.textfield.TextInputEditText + style="@style/registration_text_input_edittext" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/sftp_login_port_hint" + android:imeOptions="actionNext" + android:maxLength="@{ui.maxPortLength}" + android:afterTextChanged="@{ui::onPortInput}" /> + </com.google.android.material.textfield.TextInputLayout> - <com.google.android.material.textfield.TextInputEditText - style="@style/registration_text_input_edittext" - android:layout_width="match_parent" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/sftp_login_username" + style="@style/registration_text_input" + android:layout_width="0dp" android:layout_height="wrap_content" - android:hint="@string/sftp_login_username_hint" - android:imeOptions="actionNext" - android:maxLength="@{ui.maxUsernameLength}" - android:afterTextChanged="@{ui::onUsernameInput}" /> - </com.google.android.material.textfield.TextInputLayout> + android:enabled="@{ui.textInputEnabled}" + android:layout_marginTop="18dp" + app:error="@{ui.usernameError}" + app:layout_constraintTop_toBottomOf="@id/stfp_login_port" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/sftp_login_password" - style="@style/registration_text_input" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:enabled="@{ui.textInputEnabled}" - android:layout_marginTop="24dp" - app:passwordToggleEnabled="true" - app:error="@{ui.passwordError}" - app:layout_constraintTop_toBottomOf="@id/sftp_login_username" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + <com.google.android.material.textfield.TextInputEditText + style="@style/registration_text_input_edittext" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/sftp_login_username_hint" + android:imeOptions="actionNext" + android:maxLength="@{ui.maxUsernameLength}" + android:afterTextChanged="@{ui::onUsernameInput}" /> + </com.google.android.material.textfield.TextInputLayout> - <com.google.android.material.textfield.TextInputEditText - style="@style/registration_text_input_edittext" - android:layout_width="match_parent" + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/sftp_login_password" + style="@style/registration_text_input" + android:layout_width="0dp" android:layout_height="wrap_content" - android:hint="@string/sftp_login_password_hint" - android:imeOptions="actionDone" - android:maxLength="@{ui.maxPasswordLength}" - android:inputType="textPassword" - android:afterTextChanged="@{ui::onPasswordInput}" /> - </com.google.android.material.textfield.TextInputLayout> + android:enabled="@{ui.textInputEnabled}" + android:layout_marginTop="24dp" + app:passwordToggleEnabled="true" + app:error="@{ui.passwordError}" + app:layout_constraintTop_toBottomOf="@id/sftp_login_username" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - <io.xxlabs.messenger.support.view.SingleClickButton - android:id="@+id/sftp_login_button" - style="@style/registration_step_next_button" - android:layout_marginTop="18dp" - android:enabled="@{ui.submitButtonEnabled}" - android:onClick="@{() -> ui.onSubmitClicked()}" - android:text="@string/registration_flow_next" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/sftp_login_password" - app:layout_constraintVertical_bias="0.0" - tools:enabled="false" /> + <com.google.android.material.textfield.TextInputEditText + style="@style/registration_text_input_edittext" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/sftp_login_password_hint" + android:imeOptions="actionDone" + android:maxLength="@{ui.maxPasswordLength}" + android:inputType="textPassword" + android:afterTextChanged="@{ui::onPasswordInput}" /> + </com.google.android.material.textfield.TextInputLayout> - <ProgressBar - android:id="@+id/sftp_progressbar" - style="?android:attr/progressBarStyle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:progressTint="@color/brand_default" - android:visibility="@{!ui.textInputEnabled}" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> - </androidx.constraintlayout.widget.ConstraintLayout> + <io.xxlabs.messenger.support.view.SingleClickButton + android:id="@+id/sftp_login_button" + style="@style/registration_step_next_button" + android:layout_marginTop="18dp" + android:enabled="@{ui.submitButtonEnabled}" + android:onClick="@{() -> ui.onSubmitClicked()}" + android:text="@string/registration_flow_next" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/sftp_login_password" + app:layout_constraintVertical_bias="0.0" + tools:enabled="false" /> + + <ProgressBar + android:id="@+id/sftp_progressbar" + style="?android:attr/progressBarStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:progressTint="@color/brand_default" + android:visibility="@{!ui.textInputEnabled}" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" /> + </androidx.constraintlayout.widget.ConstraintLayout> + </androidx.core.widget.NestedScrollView> </layout> \ No newline at end of file diff --git a/app/src/main/res/layout/component_menu.xml b/app/src/main/res/layout/component_menu.xml index 4ef67ac467bad8005965fc8ebb8ebedad4c5fd86..96d721f939ee86793e1652dd54f06143ae2928cf 100644 --- a/app/src/main/res/layout/component_menu.xml +++ b/app/src/main/res/layout/component_menu.xml @@ -342,7 +342,6 @@ android:layout_height="@dimen/spacing_24" android:layout_marginTop="@dimen/spacing_24" android:src="@drawable/ic_share" - android:visibility="gone" app:layout_constraintStart_toEndOf="@id/menuGuideStart" app:layout_constraintTop_toBottomOf="@id/menuJoinXxTxt" style="@style/menu_icon" /> @@ -358,7 +357,6 @@ android:text="Share my profile" android:textColor="@color/neutral_weak" android:textSize="@dimen/text_14" - android:visibility="gone" app:layout_constraintBottom_toBottomOf="@id/menuShareIcon" app:layout_constraintStart_toEndOf="@id/menuShareIcon" app:layout_constraintTop_toTopOf="@id/menuShareIcon" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7a8bab9d42bf236571ab91bf2b88acadba3759e3..d03c49d8a52d775d25f4d0d7ee960a945dd7ec00 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -485,7 +485,9 @@ <string name="contacts_max_members_msg">You have reached the maximum amount of members.</string> <string name="contacts_requests">Requests</string> <string name="settings_disclosures">Disclosures</string> + <string name="settings_disclosures_url">https://elixxir.io/privategrity-corporation-terms-of-use/</string> <string name="settings_privacy_policy">Privacy Policy</string> + <string name="settings_privacy_policy_url">https://elixxir.io/privategrity-corporation-privacy-policy/</string> <string name="settings_cover_traffic_title">Cover Traffic</string> <string name="settings_cover_traffic_description">Hide when you send messages.</string> <string name="settings_cover_traffic_dialog_body"> @@ -519,6 +521,7 @@ <string name="label_edit">Edit</string> <string name="notification_group_request_text">Group request received</string> <string name="registration_error_username_invalid">Username must start and end with an alphanumeric character.</string> + <string name="registration_error_username_invalid_chars">Username contains invalid characters.</string> <string name="settings_confirm_delete_button">Confirm Delete</string> <string name="settings_delete_account_confirm_username_hint">Username</string> <string name="settings_account_recovery_dialog_title">Please note</string>