Commit 5c4bb503 authored by divyanshu's avatar divyanshu

Show menu in the toolbar for "terms and service" and "privacy policy".

parent 71ab8f68
......@@ -277,16 +277,10 @@ class LoginFragment : Fragment(), LoginView {
override fun setupForgotPasswordView() {
ui {
val reset = getString(R.string.msg_reset)
val forgotPassword = String.format(getString(R.string.msg_forgot_password), reset)
text_forgot_your_password.text = forgotPassword
val resetListener = object : ClickableSpan() {
override fun onClick(view: View) = presenter.forgotPassword()
text_forgot_your_password.text = String.format(getString(R.string.msg_forgot_password))
text_forgot_your_password.setOnClickListener {
presenter.forgotPassword()
}
TextHelper.addLink(text_forgot_your_password, arrayOf(reset), arrayOf(resetListener))
}
}
......
......@@ -3,6 +3,8 @@ package chat.rocket.android.authentication.ui
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.fragment.app.Fragment
import androidx.appcompat.app.AppCompatActivity
import chat.rocket.android.R
......@@ -47,10 +49,8 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
override fun onStart() {
super.onStart()
val deepLinkInfo = intent.getLoginDeepLinkInfo()
launch(UI + job) {
val newServer = intent.getBooleanExtra(INTENT_ADD_NEW_SERVER, false)
// if we got authenticateWithDeepLink information, pass true to newServer also
presenter.loadCredentials(newServer) { authenticated ->
if (!authenticated) {
showOnBoarding()
......@@ -79,6 +79,19 @@ class AuthenticationActivity : AppCompatActivity(), HasSupportFragmentInjector {
OnBoardingFragment.newInstance()
}
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.legal, menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when(item?.itemId){
R.id.action_terms_of_Service -> presenter.termsOfService(getString(R.string.action_terms_of_service))
R.id.action_privacy_policy -> presenter.privacyPolicy(getString(R.string.action_privacy_policy))
}
return super.onOptionsItemSelected(item)
}
}
const val INTENT_ADD_NEW_SERVER = "INTENT_ADD_NEW_SERVER"
......
......@@ -14,6 +14,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="32dp"
......@@ -34,6 +35,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_facebook"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
......@@ -54,6 +56,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_github"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
......@@ -74,6 +77,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_google"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
......@@ -96,6 +100,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_linkedin"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="10dp"
......
......@@ -47,6 +47,7 @@
app:layout_constraintTop_toBottomOf="@id/text_onboarding_description"
android:layout_marginTop="48dp"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
>
......@@ -90,6 +91,7 @@
app:layout_constraintTop_toBottomOf="@id/button_connect_server"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
>
......@@ -147,7 +149,8 @@
android:layout_marginTop="10dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/rounded_color_accent">
android:background="@drawable/rounded_color_accent"
android:foreground="?selectableItemBackground">
<ImageView
android:id="@+id/image_new_server"
android:layout_width="30dp"
......
......@@ -4,11 +4,11 @@
<item
android:id="@+id/action_terms_of_Service"
android:title="Terms of Service"
android:title="@string/action_terms_of_service"
app:showAsAction="never" />
<item
android:id="@+id/action_privacy_policy"
android:title="Privacy Policy"
android:title="@string/action_privacy_policy"
app:showAsAction="never" />
</menu>
\ No newline at end of file
......@@ -69,7 +69,7 @@
<string name="msg_avatar_url">Avatar URL</string>
<string name="msg_or_continue_using_social_accounts">Oder weiter mit einem Social Account</string>
<string name="msg_new_user">Neuer Benutzer? %1$s</string>
<string name="msg_forgot_password">Passwort vergessen? %1$s</string>
<string name="msg_forgot_password">Passwort vergessen?</string>
<string name="msg_reset">Zurücksetzen</string>
<string name="msg_check_your_email_to_reset_your_password">E-Mail gesendet! Prüfe dein E-Mail Posteingang um dein Passwort zurückzusetzen.</string>
<string name="msg_invalid_email">Bitte eine korrekte E-Mail Adresse eingeben</string>
......
......@@ -69,7 +69,7 @@
<string name="msg_avatar_url">URL del avatar</string>
<string name="msg_or_continue_using_social_accounts">O continuar usando cuentas sociales</string>
<string name="msg_new_user">Nuevo usuario? %1$s</string>
<string name="msg_forgot_password">Se te olvidó tu contraseña? %1$s</string>
<string name="msg_forgot_password">Se te olvidó tu contraseña?</string>
<string name="msg_reset">reiniciar</string>
<string name="msg_check_your_email_to_reset_your_password">¡Email enviado! Verifique su bandeja de entrada para restablecer su contraseña.</string>
<string name="msg_invalid_email">Por favor escriba un correo electrónico válido</string>
......
......@@ -73,7 +73,7 @@
<string name="msg_or_continue_using_social_accounts">Ou continuer en utilisant les comptes sociaux</string>
<string name="msg_new_user">Nouvel utilisateur? %1$s</string>
// TODO: Add proper translation.
<string name="msg_forgot_password">Forgot password? %1$s</string>
<string name="msg_forgot_password">Forgot password?</string>
// TODO: Add proper translation.
<string name="msg_reset">Reset</string>
// TODO: Add proper translation.
......
......@@ -70,7 +70,7 @@
<string name="msg_avatar_url">अवतार यूआरएल</string>
<string name="msg_or_continue_using_social_accounts">या सामाजिक खाते का उपयोग करना जारी रखें</string>
<string name="msg_new_user">नया उपयोगकर्ता? %1$s</string>
<string name="msg_forgot_password">पासवर्ड भूल गए? %1$s</string>
<string name="msg_forgot_password">पासवर्ड भूल गए?</string>
<string name="msg_reset">रीसेट करें</string>
<string name="msg_check_your_email_to_reset_your_password">ईमेल गया गया है! अपना पासवर्ड रीसेट करने के लिए अपने इनबॉक्स की जांच करें।</string>
<string name="msg_invalid_email">कृपया एक वैध ई-मेल टाइप करें</string>
......
......@@ -70,7 +70,7 @@
<string name="msg_avatar_url">URL do avatar</string>
<string name="msg_or_continue_using_social_accounts">Ou continue através de contas sociais</string>
<string name="msg_new_user">Novo usuário? %1$s</string>
<string name="msg_forgot_password">Esqueceu a senha? %1$s</string>
<string name="msg_forgot_password">Esqueceu a senha?</string>
<string name="msg_reset">Redefinir</string>
<string name="msg_check_your_email_to_reset_your_password">Email enviado! Verifique sua caixa de entrada para redefinir sua senha.</string>
<string name="msg_invalid_email">Por favor informe um e-mail válido</string>
......
......@@ -70,7 +70,7 @@
<string name="msg_avatar_url">URL аватара</string>
<string name="msg_or_continue_using_social_accounts">Или продолжить, используя социальные учетные записи</string>
<string name="msg_new_user">Новый пользователь? %1$s</string>
<string name="msg_forgot_password">Забыли пароль? %1$s</string>
<string name="msg_forgot_password">Забыли пароль?</string>
<string name="msg_reset">Сброс</string>
<string name="msg_check_your_email_to_reset_your_password">Письмо отправлено! Проверьте свой почтовый ящик, чтобы сбросить пароль.</string>
<string name="msg_invalid_email">Введите действующий e-mail</string>
......
......@@ -71,7 +71,7 @@
<string name="msg_avatar_url">avatar URL</string>
<string name="msg_or_continue_using_social_accounts">Or continue using social accounts</string>
<string name="msg_new_user">New user? %1$s</string>
<string name="msg_forgot_password">Forgot password? %1$s</string>
<string name="msg_forgot_password">Forgot password?</string>
<string name="msg_reset">Reset</string>
<string name="msg_check_your_email_to_reset_your_password">Email sent! Check your inbox to reset your password.</string>
<string name="msg_invalid_email">Please type a valid e-mail</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