melhorias
parent
363ddad842
commit
f8cc655f74
|
|
@ -32,7 +32,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".RecuperarSenhaActivity"
|
||||
android:name=".RecuperarPasswordActivity"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class CriarContaActivity extends AppCompatActivity {
|
|||
btnCreateAccount.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String email = editEmail.getText().toString().trim();
|
||||
String email = editEmail.getText().toString();
|
||||
String pass = editPassword2.getText().toString();
|
||||
String conf = editConfirmPassword.getText().toString();
|
||||
|
||||
|
|
@ -54,16 +54,6 @@ public class CriarContaActivity extends AppCompatActivity {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
Toast.makeText(CriarContaActivity.this, "Por favor, insira um email válido", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (pass.length() < 6) {
|
||||
Toast.makeText(CriarContaActivity.this, "A senha deve ter pelo menos 6 caracteres", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pass.equals(conf)) {
|
||||
Toast.makeText(CriarContaActivity.this, "As passwords não coincidem!", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
|
|
@ -72,17 +62,12 @@ public class CriarContaActivity extends AppCompatActivity {
|
|||
FirebaseAuth auth = FirebaseAuth.getInstance();
|
||||
auth.createUserWithEmailAndPassword(email, pass).addOnCompleteListener(CriarContaActivity.this, task -> {
|
||||
if (task.isSuccessful()) {
|
||||
Toast.makeText(CriarContaActivity.this, "Conta criada com sucesso!", Toast.LENGTH_SHORT).show();
|
||||
|
||||
Intent intent= new Intent(CriarContaActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
String errorMessage = task.getException().getMessage();
|
||||
if (errorMessage != null && errorMessage.contains("email")) {
|
||||
Toast.makeText(CriarContaActivity.this, "Este email já está em uso", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(CriarContaActivity.this, "Erro ao criar conta: " + errorMessage, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Toast.makeText(CriarContaActivity.this, "Erro ao criar conta!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class LoginActivity extends AppCompatActivity {
|
|||
|
||||
btnLogin.setOnClickListener(v -> loginUser());
|
||||
criarContaTextView.setOnClickListener(view -> criarConta());
|
||||
txtForgotPassword.setOnClickListener(view -> recuperarSenha());
|
||||
txtForgotPassword.setOnClickListener(view -> recuperarPassword());
|
||||
}
|
||||
|
||||
private void criarConta() {
|
||||
|
|
@ -43,8 +43,8 @@ public class LoginActivity extends AppCompatActivity {
|
|||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void recuperarSenha() {
|
||||
Intent intent = new Intent(LoginActivity.this, RecuperarSenhaActivity.class);
|
||||
private void recuperarPassword() {
|
||||
Intent intent = new Intent(LoginActivity.this, RecuperarPasswordActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
|
@ -57,11 +57,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
Toast.makeText(this, "Por favor, insira um email válido", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
mAuth.signInWithEmailAndPassword(email, password)
|
||||
.addOnCompleteListener(task -> {
|
||||
if (task.isSuccessful()) {
|
||||
|
|
@ -73,16 +68,9 @@ public class LoginActivity extends AppCompatActivity {
|
|||
finish();
|
||||
|
||||
} else {
|
||||
String errorMessage = task.getException().getMessage();
|
||||
if (errorMessage != null && errorMessage.contains("password")) {
|
||||
Toast.makeText(this,
|
||||
"Senha incorreta. Esqueceu a senha?",
|
||||
Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
"Erro: " + errorMessage,
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
Toast.makeText(this,
|
||||
"Erro: " + task.getException().getMessage(),
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import android.content.Intent;
|
|||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
|
@ -12,38 +13,41 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
|
||||
public class RecuperarSenhaActivity extends AppCompatActivity {
|
||||
public class RecuperarPasswordActivity extends AppCompatActivity {
|
||||
|
||||
private TextInputEditText editEmailRecover;
|
||||
private Button btnSendRecovery;
|
||||
private TextView txtBackToLogin;
|
||||
private TextInputEditText editEmailRecuperar;
|
||||
private Button btnRecuperar;
|
||||
private ImageButton btnBack;
|
||||
private TextView txtVoltarLogin;
|
||||
private FirebaseAuth mAuth;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_recuperar_senha);
|
||||
setContentView(R.layout.activity_recuperar_password);
|
||||
|
||||
editEmailRecover = findViewById(R.id.editEmailRecover);
|
||||
btnSendRecovery = findViewById(R.id.btnSendRecovery);
|
||||
txtBackToLogin = findViewById(R.id.txtBackToLogin);
|
||||
editEmailRecuperar = findViewById(R.id.editEmailRecuperar);
|
||||
btnRecuperar = findViewById(R.id.btnRecuperar);
|
||||
btnBack = findViewById(R.id.btnBack);
|
||||
txtVoltarLogin = findViewById(R.id.txtVoltarLogin);
|
||||
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
|
||||
btnSendRecovery.setOnClickListener(v -> sendRecoveryEmail());
|
||||
txtBackToLogin.setOnClickListener(v -> backToLogin());
|
||||
btnRecuperar.setOnClickListener(v -> recuperarPassword());
|
||||
btnBack.setOnClickListener(v -> voltarLogin());
|
||||
txtVoltarLogin.setOnClickListener(v -> voltarLogin());
|
||||
}
|
||||
|
||||
private void sendRecoveryEmail() {
|
||||
String email = editEmailRecover.getText().toString().trim();
|
||||
private void recuperarPassword() {
|
||||
String email = editEmailRecuperar.getText().toString().trim();
|
||||
|
||||
if (email.isEmpty()) {
|
||||
Toast.makeText(this, "Por favor, insira o seu email", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "Por favor, introduza o seu email", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
Toast.makeText(this, "Por favor, insira um email válido", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "Por favor, introduza um email válido", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -53,8 +57,7 @@ public class RecuperarSenhaActivity extends AppCompatActivity {
|
|||
Toast.makeText(this,
|
||||
"Email de recuperação enviado! Verifique a sua caixa de entrada.",
|
||||
Toast.LENGTH_LONG).show();
|
||||
// Voltar ao login após enviar
|
||||
backToLogin();
|
||||
voltarLogin();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
"Erro: " + task.getException().getMessage(),
|
||||
|
|
@ -63,8 +66,8 @@ public class RecuperarSenhaActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
private void backToLogin() {
|
||||
Intent intent = new Intent(RecuperarSenhaActivity.this, LoginActivity.class);
|
||||
private void voltarLogin() {
|
||||
Intent intent = new Intent(RecuperarPasswordActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:angle="135"
|
||||
android:startColor="#667eea"
|
||||
android:endColor="#764ba2"
|
||||
android:type="linear" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#90A4AE">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#90A4AE">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -5,16 +5,16 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient_login"
|
||||
android:background="@drawable/bg_gradient"
|
||||
android:id="@+id/main">
|
||||
|
||||
<!-- Título Criar Conta -->
|
||||
<!-- Logo/Title -->
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text="Criar Conta"
|
||||
android:text="VdcScore"
|
||||
android:textSize="42sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FFFFFF"
|
||||
|
|
@ -23,48 +23,47 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Subtítulo VdcScore -->
|
||||
<!-- Subtitle -->
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="VdcScore"
|
||||
android:textSize="18sp"
|
||||
android:text="Criar Conta"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:alpha="0.9"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
|
||||
<!-- Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardRegister"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:elevation="16dp"
|
||||
android:padding="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:elevation="8dp"
|
||||
android:padding="28dp"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4"
|
||||
android:layout_marginTop="48dp">
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Título do Card -->
|
||||
<!-- Title inside card -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Registar"
|
||||
android:text="Registo"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#263238"
|
||||
|
|
@ -73,7 +72,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Cria a tua conta para começar"
|
||||
android:text="Cria a tua conta"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#90A4AE"
|
||||
android:layout_marginBottom="24dp" />
|
||||
|
|
@ -84,15 +83,15 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Email"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_dialog_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editEmail"
|
||||
|
|
@ -100,7 +99,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
|
@ -110,17 +110,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Password"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_lock_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editPassword2"
|
||||
|
|
@ -128,7 +127,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
|
@ -138,17 +138,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:hint="Confirmar Password"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_lock_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editConfirmPassword"
|
||||
|
|
@ -156,7 +155,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
|
@ -182,8 +182,9 @@
|
|||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardRegister">
|
||||
|
|
@ -206,7 +207,8 @@
|
|||
android:textSize="14sp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="4dp" />
|
||||
android:padding="4dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient_login">
|
||||
android:background="@drawable/bg_gradient">
|
||||
|
||||
<!-- Título VdcScore -->
|
||||
<!-- Logo/Title -->
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -22,14 +22,14 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Subtítulo -->
|
||||
<!-- Subtitle -->
|
||||
<TextView
|
||||
android:id="@+id/textViewSubtitle"
|
||||
android:id="@+id/textSubtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Bem-vindo de volta!"
|
||||
android:textSize="18sp"
|
||||
android:text="Bem-vindo de volta"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:alpha="0.9"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
@ -41,29 +41,28 @@
|
|||
android:id="@+id/cardLogin"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:elevation="16dp"
|
||||
android:padding="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:elevation="8dp"
|
||||
android:padding="28dp"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewSubtitle"
|
||||
android:layout_marginTop="48dp">
|
||||
app:layout_constraintTop_toBottomOf="@+id/textSubtitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Título do Card -->
|
||||
<!-- Title inside card -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Entrar"
|
||||
android:text="Login"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#263238"
|
||||
|
|
@ -72,7 +71,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Insira as suas credenciais"
|
||||
android:text="Entre na sua conta"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#90A4AE"
|
||||
android:layout_marginBottom="24dp" />
|
||||
|
|
@ -83,15 +82,15 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Email"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_dialog_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editEmail"
|
||||
|
|
@ -99,7 +98,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
|
@ -109,17 +109,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:hint="Password"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_lock_lock"
|
||||
app:startIconTint="#667eea"
|
||||
app:endIconMode="password_toggle"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editPassword2"
|
||||
|
|
@ -127,24 +126,25 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Esqueceu a senha -->
|
||||
<!-- Forgot Password Link -->
|
||||
<TextView
|
||||
android:id="@+id/txtForgotPassword"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:text="Esqueceu a senha?"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="Esqueceu a palavra-passe?"
|
||||
android:textColor="#667eea"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:padding="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:layout_marginBottom="24dp" />
|
||||
android:padding="4dp" />
|
||||
|
||||
<!-- Botão -->
|
||||
<Button
|
||||
|
|
@ -168,8 +168,9 @@
|
|||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardLogin">
|
||||
|
|
@ -192,7 +193,8 @@
|
|||
android:textSize="14sp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="4dp" />
|
||||
android:padding="4dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,63 +5,74 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient_login">
|
||||
android:background="@drawable/bg_gradient">
|
||||
|
||||
<!-- Título -->
|
||||
<!-- Back Button -->
|
||||
<ImageButton
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
android:tint="#FFFFFF"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Logo/Title -->
|
||||
<TextView
|
||||
android:id="@+id/textViewTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:text="Recuperar Senha"
|
||||
android:textSize="42sp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text="Recuperar Palavra-passe"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#FFFFFF"
|
||||
android:letterSpacing="0.1"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Subtítulo -->
|
||||
<!-- Subtitle -->
|
||||
<TextView
|
||||
android:id="@+id/textViewSubtitle"
|
||||
android:id="@+id/textSubtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Insira o seu email e enviaremos um link para redefinir a sua senha"
|
||||
android:textSize="16sp"
|
||||
android:text="Introduza o seu email e enviaremos instruções para recuperar a sua palavra-passe"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:alpha="0.9"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewTitle" />
|
||||
|
||||
<!-- Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardRecover"
|
||||
android:id="@+id/cardRecuperar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:elevation="16dp"
|
||||
android:padding="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:elevation="8dp"
|
||||
android:padding="28dp"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardBackgroundColor="#FFFFFF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textViewSubtitle"
|
||||
android:layout_marginTop="48dp">
|
||||
app:layout_constraintTop_toBottomOf="@+id/textSubtitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Email -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
|
@ -69,34 +80,35 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:hint="Email"
|
||||
app:boxStrokeColor="#667eea"
|
||||
app:hintTextColor="#667eea"
|
||||
app:startIconDrawable="@drawable/ic_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp">
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:startIconDrawable="@android:drawable/ic_dialog_email"
|
||||
app:startIconTint="#667eea"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editEmailRecover"
|
||||
android:id="@+id/editEmailRecuperar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
android:textColorHint="#90A4AE"
|
||||
android:padding="16dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Botão -->
|
||||
<Button
|
||||
android:id="@+id/btnSendRecovery"
|
||||
android:id="@+id/btnRecuperar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/button_modern"
|
||||
android:text="Enviar Link de Recuperação"
|
||||
android:text="Enviar Email"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
|
|
@ -111,31 +123,33 @@
|
|||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardRecover">
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardRecuperar">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Lembras-te da senha? "
|
||||
android:text="Lembras-te da palavra-passe? "
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:alpha="0.9" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtBackToLogin"
|
||||
android:id="@+id/txtVoltarLogin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Voltar ao Login"
|
||||
android:text="Entrar"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:textSize="14sp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="4dp" />
|
||||
android:padding="4dp"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Loading…
Reference in New Issue