Skip to content
Snippets Groups Projects
Commit 23e314a0 authored by Taras's avatar Taras
Browse files

Create warning dialog

parent 1ba9409f
No related branches found
No related tags found
No related merge requests found
package org.futo.circles.auth.feature.sign_up.password.confirmation
import android.app.ActionBar
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.InsetDrawable
import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatDialog
import org.futo.circles.auth.databinding.DialogSetupPasswordWarningBinding
class SetupPasswordWarningDialog(context: Context) :
AppCompatDialog(context) {
private val binding = DialogSetupPasswordWarningBinding.inflate(LayoutInflater.from(context))
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
setCancelable(false)
window?.apply {
setBackgroundDrawable(InsetDrawable(ColorDrawable(Color.TRANSPARENT), 20))
setLayout(ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT)
}
binding.btnUnderstand.setOnClickListener { dismiss() }
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="@color/menu_icon_color"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M9,21c0,0.5 0.4,1 1,1h4c0.6,0 1,-0.5 1,-1v-1L9,20v1zM12,2C8.1,2 5,5.1 5,9c0,2.4 1.2,4.5 3,5.7L8,17c0,0.5 0.4,1 1,1h6c0.6,0 1,-0.5 1,-1v-2.3c1.8,-1.3 3,-3.4 3,-5.7 0,-3.9 -3.1,-7 -7,-7z" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="12dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvTitle"
style="@style/title2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:lines="1"
android:paddingVertical="8dp"
android:text="@string/circles_is_different"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/titleDivider"
android:layout_width="0dp"
android:layout_height="@dimen/divider_height"
android:background="@color/divider_color"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
<TextView
android:id="@+id/tvPassphraseExplanation"
style="@style/body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="@string/passphrase_usage_explanation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titleDivider" />
<TextView
android:id="@+id/tvPassphraseWarningMessage"
style="@style/body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="@string/forget_passphrase_warning"
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassphraseExplanation" />
<TextView
android:id="@+id/tvPassphraseTip"
style="@style/body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:drawablePadding="4dp"
android:text="@string/passphrase_tip"
app:drawableStartCompat="@drawable/ic_lightbulb"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassphraseWarningMessage" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnUnderstand"
style="@style/AccentButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="16dp"
android:enabled="false"
android:text="@string/i_understand"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassphraseTip" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
......@@ -168,6 +168,11 @@ Or, think about all of your friends across all of the places you\'ve ever lived.
<string name="is_auto_renew_message">Subscription will renew automatically</string>
<string name="is_not_auto_renew_message">Subscription will not renew automatically</string>
<string name="can_not_open_google_play">Can not open Google Play</string>
<string name="i_understand">I understand</string>
<string name="circles_is_different">Circles is different!</string>
<string name="passphrase_usage_explanation">On the next screen we will ask you to set up a passphrase to your account.\n\nCircles uses your passphrase to log in AND to protect your encryption keys.</string>
<string name="forget_passphrase_warning">If you forget your passphrase, you won\'t be able to recover posts or photos on a new device.</string>
<string name="passphrase_tip">Tip: It\'s OK to write your passphrase down and store it in a secure location.</string>
<plurals name="days">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment