Compare commits
13 Commits
9cf8c958ba
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 89a453b1f1 | |||
| d3288c3529 | |||
| b8cf93a7cb | |||
| 711bbf5ae8 | |||
| f6e7372b79 | |||
| a0aa0303c9 | |||
| 502ba7e5f3 | |||
| 661bbaab46 | |||
| 089cb14998 | |||
| 7aa8b79009 | |||
| 85a64eb15f | |||
| 8fb4ceef95 | |||
| 5a7ed084f5 |
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/deviceManager.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeviceTable">
|
||||
<option name="columnSorters">
|
||||
<list>
|
||||
<ColumnSorterState>
|
||||
<option name="column" value="Name" />
|
||||
<option name="order" value="ASCENDING" />
|
||||
</ColumnSorterState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
19
.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/migrations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
9
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/studiobot.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="StudioBotProjectSettings">
|
||||
<option name="shareContext" value="OptedIn" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.google.gms.google.services)
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -26,8 +27,8 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +38,13 @@ dependencies {
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
implementation(libs.firebase.auth)
|
||||
implementation(libs.credentials)
|
||||
implementation(libs.credentials.play.services.auth)
|
||||
implementation(libs.googleid)
|
||||
implementation(libs.firebase.database)
|
||||
implementation(libs.recyclerview)
|
||||
implementation(libs.cardview)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
|
||||
47
app/google-services.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1019731295596",
|
||||
"project_id": "lifegrid-f6692",
|
||||
"storage_bucket": "lifegrid-f6692.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1019731295596:android:7170262ae018291b00c749",
|
||||
"android_client_info": {
|
||||
"package_name": "com.example.lifegrid"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "1019731295596-i3q6aprqj6s55g6s97tpopbk4foutold.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.example.lifegrid",
|
||||
"certificate_hash": "d0d27537414e1e5c5f0dd3bf224dbf819e70668b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "1019731295596-llnufhs1t24ijo7afa5c85lkc98pk27q.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAbQ_-mob81SR07481CSJHP_z3GniS-xdk"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "1019731295596-llnufhs1t24ijo7afa5c85lkc98pk27q.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
@@ -11,7 +13,24 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.LifeGrid">
|
||||
<activity
|
||||
android:name=".TelaInicialActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".RecupearPasswordActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".CriarContaActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
212
app/src/main/java/com/example/lifegrid/CriarContaActivity.java
Normal file
@@ -0,0 +1,212 @@
|
||||
package com.example.lifegrid;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Patterns;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import androidx.credentials.Credential;
|
||||
import androidx.credentials.CustomCredential;
|
||||
import androidx.credentials.GetCredentialRequest;
|
||||
import androidx.credentials.GetCredentialResponse;
|
||||
import androidx.credentials.exceptions.GetCredentialException;
|
||||
import androidx.credentials.exceptions.NoCredentialException;
|
||||
import androidx.credentials.CredentialManager;
|
||||
|
||||
import com.google.android.libraries.identity.googleid.GetGoogleIdOption;
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential;
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.auth.AuthCredential;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.auth.GoogleAuthProvider;
|
||||
|
||||
public class CriarContaActivity extends AppCompatActivity {
|
||||
|
||||
private EditText nomeEditText;
|
||||
private EditText emailEditText2;
|
||||
private EditText passwordEditText3;
|
||||
private EditText passwordEditText2;
|
||||
private Button loginButton2;
|
||||
private Button googleButton2;
|
||||
private ProgressBar loadingProgressBar;
|
||||
private FirebaseAuth firebaseAuth;
|
||||
private CredentialManager credentialManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_criar_conta);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
nomeEditText = findViewById(R.id.emailEditText3);
|
||||
emailEditText2 = findViewById(R.id.emailEditText2);
|
||||
passwordEditText3 = findViewById(R.id.passwordEditText3);
|
||||
passwordEditText2 = findViewById(R.id.passwordEditText2);
|
||||
loginButton2 = findViewById(R.id.loginButton2);
|
||||
googleButton2 = findViewById(R.id.googleButton2);
|
||||
loadingProgressBar = findViewById(R.id.loadingProgressBar);
|
||||
|
||||
FirebaseApp.initializeApp(this);
|
||||
firebaseAuth = FirebaseAuth.getInstance();
|
||||
credentialManager = CredentialManager.create(this);
|
||||
|
||||
loginButton2.setOnClickListener(v -> criarConta());
|
||||
}
|
||||
|
||||
private void criarConta() {
|
||||
String nome = nomeEditText.getText().toString().trim();
|
||||
String email = emailEditText2.getText().toString().trim();
|
||||
String password = passwordEditText3.getText().toString();
|
||||
String confirmarPassword = passwordEditText2.getText().toString();
|
||||
|
||||
if (!validarDados(nome, email, password, confirmarPassword)) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggleLoading(true);
|
||||
|
||||
firebaseAuth.createUserWithEmailAndPassword(email, password)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
FirebaseUser user = firebaseAuth.getCurrentUser();
|
||||
if (user != null) {
|
||||
// Conta criada com sucesso - redirecionar para TelaInicialActivity
|
||||
Toast.makeText(this,
|
||||
"Conta criada com sucesso! Bem-vindo, " + nome,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Redirecionar para TelaInicialActivity apenas após sucesso
|
||||
Intent intent = new Intent(CriarContaActivity.this, TelaInicialActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish(); // Fechar esta atividade
|
||||
}
|
||||
} else {
|
||||
// Erro ao criar conta - mostrar mensagem de erro
|
||||
String errorMessage = "Erro ao criar conta.";
|
||||
if (task.getException() != null) {
|
||||
errorMessage = task.getException().getMessage();
|
||||
// Traduzir alguns erros comuns para português
|
||||
if (errorMessage.contains("email address is already in use")) {
|
||||
errorMessage = "Este email já está em uso. Por favor, use outro email.";
|
||||
} else if (errorMessage.contains("network")) {
|
||||
errorMessage = "Erro de conexão. Verifique sua internet.";
|
||||
} else if (errorMessage.contains("weak password")) {
|
||||
errorMessage = "Palavra-passe muito fraca. Use uma palavra-passe mais forte.";
|
||||
}
|
||||
}
|
||||
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean validarDados(String nome, String email, String password, String confirmarPassword) {
|
||||
// Validar nome
|
||||
if (TextUtils.isEmpty(nome)) {
|
||||
nomeEditText.setError("Nome obrigatório.");
|
||||
nomeEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nome.length() < 2) {
|
||||
nomeEditText.setError("Nome deve ter pelo menos 2 caracteres.");
|
||||
nomeEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validar email
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
emailEditText2.setError("Email obrigatório.");
|
||||
emailEditText2.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
emailEditText2.setError("Formato de email inválido.");
|
||||
emailEditText2.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validar password
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
passwordEditText3.setError("Palavra-passe obrigatória.");
|
||||
passwordEditText3.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.length() < 6) {
|
||||
passwordEditText3.setError("Palavra-passe deve ter pelo menos 6 caracteres.");
|
||||
passwordEditText3.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validar confirmação de password
|
||||
if (TextUtils.isEmpty(confirmarPassword)) {
|
||||
passwordEditText2.setError("Por favor, confirme a palavra-passe.");
|
||||
passwordEditText2.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!password.equals(confirmarPassword)) {
|
||||
passwordEditText2.setError("As palavras-passe não coincidem.");
|
||||
passwordEditText2.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void firebaseAuthWithGoogle(String idToken) {
|
||||
AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);
|
||||
firebaseAuth.signInWithCredential(credential)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
FirebaseUser user = firebaseAuth.getCurrentUser();
|
||||
String welcome = user != null && !TextUtils.isEmpty(user.getDisplayName())
|
||||
? "Conta criada com sucesso! Bem-vindo, " + user.getDisplayName()
|
||||
: "Conta criada com Google com sucesso!";
|
||||
Toast.makeText(this, welcome, Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Redirecionar para TelaInicialActivity após criação bem-sucedida
|
||||
Intent intent = new Intent(CriarContaActivity.this, TelaInicialActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
task.getException() != null ? task.getException().getMessage() : "Falha ao criar conta com Google",
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toggleLoading(boolean show) {
|
||||
loadingProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
loginButton2.setEnabled(!show);
|
||||
googleButton2.setEnabled(!show);
|
||||
nomeEditText.setEnabled(!show);
|
||||
emailEditText2.setEnabled(!show);
|
||||
passwordEditText3.setEnabled(!show);
|
||||
passwordEditText2.setEnabled(!show);
|
||||
}
|
||||
}
|
||||
349
app/src/main/java/com/example/lifegrid/LoginActivity.java
Normal file
@@ -0,0 +1,349 @@
|
||||
package com.example.lifegrid;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CancellationSignal;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.util.Patterns;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import androidx.credentials.ClearCredentialStateRequest;
|
||||
import androidx.credentials.CredentialManager;
|
||||
|
||||
import androidx.credentials.Credential;
|
||||
import androidx.credentials.CredentialManagerCallback;
|
||||
import androidx.credentials.CustomCredential;
|
||||
import androidx.credentials.GetCredentialRequest;
|
||||
import androidx.credentials.GetCredentialResponse;
|
||||
import androidx.credentials.exceptions.ClearCredentialException;
|
||||
import androidx.credentials.exceptions.GetCredentialException;
|
||||
import androidx.credentials.exceptions.NoCredentialException;
|
||||
|
||||
import com.google.android.libraries.identity.googleid.GetGoogleIdOption;
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential;
|
||||
import com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.auth.AuthCredential;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.auth.GoogleAuthProvider;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
private TextView textView5;
|
||||
private TextView textView1;
|
||||
private TextView criarContaTextView;
|
||||
private TextView emailTextView;
|
||||
private EditText emailEditText;
|
||||
private TextView passTextView;
|
||||
private EditText passwordEditText;
|
||||
private TextView passesquecerTextView;
|
||||
private Button loginButton;
|
||||
private Button googleButton;
|
||||
private TextView ouTextView;
|
||||
private ProgressBar loadingProgressBar;
|
||||
private FirebaseAuth firebaseAuth;
|
||||
private CredentialManager credentialManager;
|
||||
private FirebaseAuth mAuth;
|
||||
|
||||
private static final String TAG = "LoginActivity - Google Sign In";
|
||||
private static final String GOOGLE_ID_TOKEN_CREDENTIAL = "1019731295596-i3q6aprqj6s55g6s97tpopbk4foutold.apps.googleusercontent.com";
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_login);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
textView5 = findViewById(R.id.textView5);
|
||||
textView1 = findViewById(R.id.textView1);
|
||||
criarContaTextView = findViewById(R.id.criarContaTextView);
|
||||
emailTextView = findViewById(R.id.emailTextView);
|
||||
emailEditText = findViewById(R.id.emailEditText);
|
||||
passTextView = findViewById(R.id.passTextView);
|
||||
passwordEditText = findViewById(R.id.passwordEditText);
|
||||
passesquecerTextView = findViewById(R.id.passesquecerTextView);
|
||||
loginButton = findViewById(R.id.loginButton);
|
||||
googleButton = findViewById(R.id.googleButton);
|
||||
ouTextView = findViewById(R.id.ouTextView);
|
||||
loadingProgressBar = findViewById(R.id.loadingProgressBar);
|
||||
|
||||
FirebaseApp.initializeApp(this);
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
credentialManager = CredentialManager.create(getBaseContext());
|
||||
|
||||
|
||||
loginButton.setOnClickListener(v -> validarLogin());
|
||||
googleButton.setOnClickListener(v -> launchCredentialManager());
|
||||
|
||||
criarContaTextView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(LoginActivity.this, CriarContaActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
// Inicialmente desabilitar o TextView de recuperar senha
|
||||
passesquecerTextView.setEnabled(false);
|
||||
passesquecerTextView.setAlpha(0.5f); // Visualmente mais claro quando desabilitado
|
||||
|
||||
passesquecerTextView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String email = emailEditText.getText().toString().trim();
|
||||
|
||||
// Validar se há email antes de abrir a atividade de recuperação
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
emailEditText.setError("Por favor, digite seu email primeiro.");
|
||||
emailEditText.requestFocus();
|
||||
Toast.makeText(LoginActivity.this, "Digite seu email para recuperar a senha.", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(LoginActivity.this, RecupearPasswordActivity.class);
|
||||
intent.putExtra("email", email);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
// Adicionar TextWatcher para habilitar/desabilitar o TextView dinamicamente
|
||||
emailEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
String email = s.toString().trim();
|
||||
boolean hasEmail = !TextUtils.isEmpty(email);
|
||||
passesquecerTextView.setEnabled(hasEmail);
|
||||
passesquecerTextView.setAlpha(hasEmail ? 1.0f : 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void validarLogin() {
|
||||
String email = emailEditText.getText().toString().trim();
|
||||
String password = passwordEditText.getText().toString();
|
||||
|
||||
if (!validarEspaços(email, password)) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggleLoading(true);
|
||||
|
||||
firebaseAuth.signInWithEmailAndPassword(email, password)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
FirebaseUser user = task.getResult().getUser();
|
||||
String welcome = user != null && !TextUtils.isEmpty(user.getEmail())
|
||||
? "Bem-vindo, " + user.getEmail()
|
||||
: "Login realizado com sucesso!";
|
||||
Toast.makeText(this, welcome, Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Redirecionar para TelaInicialActivity após login bem-sucedido
|
||||
Intent intent = new Intent(LoginActivity.this, TelaInicialActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish(); // Fechar LoginActivity para não poder voltar com back button
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
task.getException() != null ? task.getException().getMessage() : "Falha no login",
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void recupearPassword() {
|
||||
String email = emailEditText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
emailEditText.setError("Informe o email para recuperar a palavra-passe.");
|
||||
emailEditText.requestFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
toggleLoading(true);
|
||||
firebaseAuth.sendPasswordResetEmail(email)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
Toast.makeText(this,
|
||||
"Email de recuperação enviado para " + email,
|
||||
Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
task.getException() != null ? task.getException().getMessage() : "Erro ao enviar email",
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean validarEspaços(String email, String password) {
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
emailEditText.setError("Email obrigatório.");
|
||||
emailEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
emailEditText.setError("Formato de email inválido.");
|
||||
emailEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
passwordEditText.setError("Palavra-passe obrigatória.");
|
||||
passwordEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password.length() < 6) {
|
||||
passwordEditText.setError("Mínimo de 6 caracteres.");
|
||||
passwordEditText.requestFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void firebaseAuthWithGoogle(String idToken) {
|
||||
AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);
|
||||
firebaseAuth.signInWithCredential(credential)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
FirebaseUser user = firebaseAuth.getCurrentUser();
|
||||
String welcome = user != null && !TextUtils.isEmpty(user.getDisplayName())
|
||||
? "Bem-vindo, " + user.getDisplayName()
|
||||
: "Login com Google realizado com sucesso!";
|
||||
Toast.makeText(this, welcome, Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Redirecionar para TelaInicialActivity após login bem-sucedido
|
||||
Intent intent = new Intent(LoginActivity.this, TelaInicialActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(this,
|
||||
task.getException() != null ? task.getException().getMessage() : "Falha no login com Google",
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toggleLoading(boolean show) {
|
||||
loadingProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
loginButton.setEnabled(!show);
|
||||
googleButton.setEnabled(!show);
|
||||
criarContaTextView.setEnabled(!show);
|
||||
passesquecerTextView.setEnabled(!show);
|
||||
}
|
||||
|
||||
private void launchCredentialManager() {
|
||||
// [START create_credential_manager_request]
|
||||
// Instantiate a Google sign-in request
|
||||
GetGoogleIdOption googleIdOption = new GetGoogleIdOption.Builder()
|
||||
.setFilterByAuthorizedAccounts(true)
|
||||
.setServerClientId(getString(R.string.default_web_client_id))
|
||||
.build();
|
||||
|
||||
// Create the Credential Manager request
|
||||
GetCredentialRequest request = new GetCredentialRequest.Builder()
|
||||
.addCredentialOption(googleIdOption)
|
||||
.build();
|
||||
// [END create_credential_manager_request]
|
||||
|
||||
// Launch Credential Manager UI
|
||||
credentialManager.getCredentialAsync(
|
||||
getBaseContext(),
|
||||
request,
|
||||
new CancellationSignal(),
|
||||
Executors.newSingleThreadExecutor(),
|
||||
new CredentialManagerCallback<>() {
|
||||
@Override
|
||||
public void onResult(GetCredentialResponse result) {
|
||||
// Extract credential from the result returned by Credential Manager
|
||||
handleSignIn(result.getCredential());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(GetCredentialException e) {
|
||||
Log.e(TAG, "Couldn't retrieve user's credentials: " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void handleSignIn(Credential credential) {
|
||||
// Check if credential is of type Google ID
|
||||
if (credential instanceof CustomCredential customCredential
|
||||
&& credential.getType().equals(GOOGLE_ID_TOKEN_CREDENTIAL)) {
|
||||
// Create Google ID Token
|
||||
Bundle credentialData = customCredential.getData();
|
||||
GoogleIdTokenCredential googleIdTokenCredential = GoogleIdTokenCredential.createFrom(credentialData);
|
||||
|
||||
// Sign in to Firebase with using the token
|
||||
firebaseAuthWithGoogle(googleIdTokenCredential.getIdToken());
|
||||
} else {
|
||||
Log.w(TAG, "Credential is not of type Google ID!");
|
||||
}
|
||||
}
|
||||
|
||||
private void signOut() {
|
||||
// Firebase sign out
|
||||
mAuth.signOut();
|
||||
|
||||
// When a user signs out, clear the current user credential state from all credential providers.
|
||||
ClearCredentialStateRequest clearRequest = new ClearCredentialStateRequest();
|
||||
credentialManager.clearCredentialStateAsync(
|
||||
clearRequest,
|
||||
new CancellationSignal(),
|
||||
Executors.newSingleThreadExecutor(),
|
||||
new CredentialManagerCallback<>() {
|
||||
@Override
|
||||
public void onResult(@NonNull Void result) {
|
||||
//updateUI(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull ClearCredentialException e) {
|
||||
Log.e(TAG, "Couldn't clear user credentials: " + e.getLocalizedMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// Check if user is signed in (non-null) and update UI accordingly.
|
||||
FirebaseUser currentUser = mAuth.getCurrentUser();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.example.lifegrid;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Patterns;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
|
||||
public class RecupearPasswordActivity extends AppCompatActivity {
|
||||
|
||||
private EditText emailEditText4;
|
||||
private Button loginButton3;
|
||||
private ProgressBar loadingProgressBar;
|
||||
private FirebaseAuth firebaseAuth;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_recupear_password);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
emailEditText4 = findViewById(R.id.emailEditText4);
|
||||
loginButton3 = findViewById(R.id.loginButton3);
|
||||
loadingProgressBar = findViewById(R.id.loadingProgressBar);
|
||||
|
||||
FirebaseApp.initializeApp(this);
|
||||
firebaseAuth = FirebaseAuth.getInstance();
|
||||
|
||||
// Receber o email passado do LoginActivity e pré-preencher o campo
|
||||
String emailPassado = getIntent().getStringExtra("email");
|
||||
if (!TextUtils.isEmpty(emailPassado)) {
|
||||
emailEditText4.setText(emailPassado);
|
||||
// Tornar o campo não editável quando vier do login
|
||||
emailEditText4.setEnabled(false);
|
||||
emailEditText4.setFocusable(false);
|
||||
emailEditText4.setClickable(false);
|
||||
}
|
||||
|
||||
loginButton3.setOnClickListener(v -> recuperarPassword());
|
||||
}
|
||||
|
||||
private void recuperarPassword() {
|
||||
String email = emailEditText4.getText().toString().trim();
|
||||
String emailPassado = getIntent().getStringExtra("email");
|
||||
|
||||
// Validar email
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
emailEditText4.setError("Email obrigatório.");
|
||||
emailEditText4.requestFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
emailEditText4.setError("Formato de email inválido.");
|
||||
emailEditText4.requestFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
// Se o email veio do login, garantimos que é o mesmo (campo já está desabilitado)
|
||||
// Não precisa validar novamente, pois o campo não pode ser modificado
|
||||
|
||||
toggleLoading(true);
|
||||
|
||||
// Enviar email de recuperação de senha
|
||||
firebaseAuth.sendPasswordResetEmail(email)
|
||||
.addOnCompleteListener(this, task -> {
|
||||
toggleLoading(false);
|
||||
if (task.isSuccessful()) {
|
||||
// Email enviado com sucesso
|
||||
Toast.makeText(this,
|
||||
"Email de recuperação enviado para " + email + "\nVerifique sua caixa de entrada.",
|
||||
Toast.LENGTH_LONG).show();
|
||||
// Limpar o campo após sucesso
|
||||
emailEditText4.setText("");
|
||||
} else {
|
||||
// Erro ao enviar email
|
||||
String errorMessage = "Erro ao enviar email de recuperação.";
|
||||
if (task.getException() != null) {
|
||||
errorMessage = task.getException().getMessage();
|
||||
// Traduzir alguns erros comuns para português
|
||||
if (errorMessage.contains("user-not-found")) {
|
||||
errorMessage = "Nenhuma conta encontrada com este email.";
|
||||
} else if (errorMessage.contains("invalid-email")) {
|
||||
errorMessage = "Formato de email inválido.";
|
||||
} else if (errorMessage.contains("network")) {
|
||||
errorMessage = "Erro de conexão. Verifique sua internet.";
|
||||
} else if (errorMessage.contains("too-many-requests")) {
|
||||
errorMessage = "Muitas tentativas. Tente novamente mais tarde.";
|
||||
}
|
||||
}
|
||||
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toggleLoading(boolean show) {
|
||||
loadingProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
loginButton3.setEnabled(!show);
|
||||
emailEditText4.setEnabled(!show);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.lifegrid;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
public class TelaInicialActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_tela_inicial);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable/alvo.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
17
app/src/main/res/drawable/button_background.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FFFFFF"/>
|
||||
|
||||
<corners android:radius="14dp"/>
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#DADCE0"/>
|
||||
|
||||
<padding
|
||||
android:left="16dp"
|
||||
android:top="12dp"
|
||||
android:right="16dp"
|
||||
android:bottom="12dp"/>
|
||||
</shape>
|
||||
12
app/src/main/res/drawable/cardview_background.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/branco"/>
|
||||
<corners android:radius="20dp"/>
|
||||
<stroke
|
||||
android:color="@color/cinzabordas"
|
||||
android:width="1dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable/carteira.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable/diagonalarrowrightup_110941.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable/documento.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/drawable/engrenaje.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
app/src/main/res/drawable/grafico.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
9
app/src/main/res/drawable/linear_backgound.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/cinzaescuro"/>
|
||||
<corners android:radius="15dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable/logo.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
201
app/src/main/res/layout/activity_criar_conta.xml
Normal file
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:background="#FFFFFF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".CriarContaActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoImageView"
|
||||
android:layout_width="213dp"
|
||||
android:layout_height="97dp"
|
||||
android:layout_marginTop="56dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.08"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Começe a gerir as suas finanças hoje"
|
||||
android:textColor="#8A8484"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.251"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView6" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="Criar conta"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.128"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/logoImageView" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwordEditText2"
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="**********"
|
||||
android:inputType="textPassword"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwordEditText3"
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="**********"
|
||||
android:inputType="textPassword"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView3" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/emailEditText2"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="seu@email.com"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView2" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/emailEditText3"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="O seu nome"
|
||||
android:inputType="textPersonName"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.52"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/loginButton2"
|
||||
android:layout_width="315dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:backgroundTint="#050505"
|
||||
android:text="Criar conta ->"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordEditText2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ouTextView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="22dp"
|
||||
android:text="_____________________ OU _____________________"
|
||||
android:textColor="@color/cinza"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginButton2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/googleButton2"
|
||||
android:layout_width="316dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:backgroundTint="#FFFFFF"
|
||||
android:text="Continuar com o Google"
|
||||
android:textColor="#0F0E0E"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ouTextView2"
|
||||
app:strokeColor="@color/cinza"
|
||||
app:strokeWidth="1sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="Nome"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.128"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView7" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Email"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.125"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailEditText3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Password"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.134"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailEditText2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Confirmar password"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.159"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordEditText3" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loadingProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/googleButton2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
178
app/src/main/res/layout/activity_login.xml
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:padding="24dp"
|
||||
tools:context=".LoginActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="Bem-vindo/a de volta"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.154"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/logoImageView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Entre na sua conta para continuar"
|
||||
android:textColor="#8A8484"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView5"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emailTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="Email"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.057"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/loginButton"
|
||||
android:layout_width="315dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:backgroundTint="#050505"
|
||||
android:text="Entrar ->"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passesquecerTextView" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/googleButton"
|
||||
android:layout_width="316dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:backgroundTint="#FFFFFF"
|
||||
android:text="Continuar com o Google"
|
||||
android:textColor="#0F0E0E"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.483"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginButton"
|
||||
app:strokeColor="@color/cinza"
|
||||
app:strokeWidth="1sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ouTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="_____________________ OU _____________________"
|
||||
android:textColor="@color/cinza"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.492"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/googleButton" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwordEditText"
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="**********"
|
||||
android:inputType="textPassword"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.444"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passTextView" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/emailEditText"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="seu@email.com"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.48"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailTextView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Password"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.061"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailEditText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passesquecerTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Esqueceu-se a palavra passe?"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordEditText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/criarContaTextView"
|
||||
android:layout_width="181dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:text="Não tens conta? Clica aqui"
|
||||
android:textColor="#121111"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ouTextView" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loadingProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/criarContaTextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoImageView"
|
||||
android:layout_width="194dp"
|
||||
android:layout_height="81dp"
|
||||
android:layout_marginTop="92dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/logo" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
96
app/src/main/res/layout/activity_recupear_password.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:background="#FFFFFF"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".RecupearPasswordActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/loginButton3"
|
||||
android:layout_width="315dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:backgroundTint="#050505"
|
||||
android:text="Entrar ->"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailEditText4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emailTextView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="Email"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.104"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView9" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/emailEditText4"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="seu@email.com"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textSize="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.493"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailTextView2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoImageView2"
|
||||
android:layout_width="211dp"
|
||||
android:layout_height="105dp"
|
||||
android:layout_marginTop="204dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.08"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Recuperar password"
|
||||
android:textSize="26dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.23"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/logoImageView2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Insira o seu email para recuperar a password"
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.425"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView8" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loadingProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginButton3" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
360
app/src/main/res/layout/activity_tela_inicial.xml
Normal file
@@ -0,0 +1,360 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:backgroundTint="@color/preto"
|
||||
tools:context=".TelaInicialActivity">
|
||||
|
||||
<!-- <ScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="@color/cinza">-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/receitasCardView"
|
||||
android:layout_width="379dp"
|
||||
android:layout_height="175dp"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView11">
|
||||
|
||||
<!-- TRANSAÇÕES -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitulo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Receitas (Mês Atual)"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivArrow"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/diagonalarrowrightup_110941"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="#2ECC71" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvValor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvTitulo"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTransacoes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="0 transações"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvValor"
|
||||
app:layout_constraintVertical_bias="0.277" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView10"
|
||||
android:layout_width="339dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="64dp"
|
||||
android:text="Plataforma de Gestão Financeira"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.375"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView11"
|
||||
android:layout_width="338dp"
|
||||
android:layout_height="49dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="Transparência completa sobre o seu fluxo de caixa"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.369"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/despesasCardView"
|
||||
android:layout_width="379dp"
|
||||
android:layout_height="175dp"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/receitasCardView">
|
||||
|
||||
<!-- TRANSAÇÕES -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitulo2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Despesas (Mês Atual)"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivArrow2"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/diagonalarrowleftdownoutline_110924"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="#FF0000" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvValor2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvTitulo2"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTransacoes2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor2"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="0 transações"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvValor2"
|
||||
app:layout_constraintVertical_bias="0.277" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/saldoCardView"
|
||||
android:layout_width="379dp"
|
||||
android:layout_height="175dp"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/despesasCardView">
|
||||
|
||||
<!-- TRANSAÇÕES -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitulo3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Saldo do Mês"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivArrow3"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/carteira"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="#0000FF" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvValor3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvTitulo3"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTransacoes3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor3"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="Poupança positiva"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvValor3"
|
||||
app:layout_constraintVertical_bias="0.277" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ativosCardView"
|
||||
android:layout_width="379dp"
|
||||
android:layout_height="175dp"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
android:padding="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/saldoCardView">
|
||||
|
||||
<!-- TRANSAÇÕES -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitulo4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Valor do Ativos"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivArrow4"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/diagonalarrowrightup_110941"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="#2ECC71" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvValor4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvTitulo4"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTransacoes4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor4"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="+0.00% ROI"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvValor4"
|
||||
app:layout_constraintVertical_bias="0.277" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/shapeLinearLayout"
|
||||
android:layout_width="422dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@drawable/linear_backgound"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ativosCardView">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
app:srcCompat="@drawable/alvo" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
app:srcCompat="@drawable/carteira" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- </ScrollView>-->
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/ativos.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/definicoes.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/documentos.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/graficos.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
6
app/src/main/res/layout/meta.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
18
app/src/main/res/layout/transacoes.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/transacoesCardView"
|
||||
android:layout_width="379dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="preto">#FF000000</color>
|
||||
<color name="branco">#FFFFFFFF</color>
|
||||
<color name="cinza">#F8F8F8</color>
|
||||
<color name="cinzabordas">#EDEDED</color>
|
||||
<color name="cinzaescuro">#CCC9C9</color>
|
||||
</resources>
|
||||
@@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">LifeGrid</string>
|
||||
<!-- Substitua pelo Web Client ID do Firebase Console -> Authentication -> Sign-in method -> Google -->
|
||||
</resources>
|
||||
@@ -1,4 +1,5 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.google.gms.google.services) apply false
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
agp = "8.13.1"
|
||||
agp = "8.13.2"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.3.0"
|
||||
espressoCore = "3.7.0"
|
||||
@@ -7,6 +7,15 @@ appcompat = "1.7.1"
|
||||
material = "1.13.0"
|
||||
activity = "1.11.0"
|
||||
constraintlayout = "2.2.1"
|
||||
googleGmsGoogleServices = "4.4.4"
|
||||
firebaseAuth = "24.0.1"
|
||||
credentials = "1.5.0"
|
||||
credentialsPlayServicesAuth = "1.5.0"
|
||||
googleid = "1.1.1"
|
||||
firebaseDatabase = "22.0.1"
|
||||
recyclerview = "1.4.0"
|
||||
playServicesAuth = "21.2.0"
|
||||
cardview = "1.0.0"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
@@ -16,7 +25,16 @@ appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "a
|
||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||
firebase-auth = { group = "com.google.firebase", name = "firebase-auth", version.ref = "firebaseAuth" }
|
||||
credentials = { group = "androidx.credentials", name = "credentials", version.ref = "credentials" }
|
||||
credentials-play-services-auth = { group = "androidx.credentials", name = "credentials-play-services-auth", version.ref = "credentialsPlayServicesAuth" }
|
||||
googleid = { group = "com.google.android.libraries.identity.googleid", name = "googleid", version.ref = "googleid" }
|
||||
firebase-database = { group = "com.google.firebase", name = "firebase-database", version.ref = "firebaseDatabase" }
|
||||
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
|
||||
play-services-auth = { group = "com.google.android.gms", name = "play-services-auth", version.ref = "playServicesAuth" }
|
||||
cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardview" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
google-gms-google-services = { id = "com.google.gms.google-services", version.ref = "googleGmsGoogleServices" }
|
||||
|
||||
|
||||