acabar
This commit is contained in:
@@ -26,14 +26,16 @@
|
||||
android:name=".CriarContaActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:name=".SplashActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
||||
74
app/src/main/java/com/example/lifegrid/SplashActivity.java
Normal file
74
app/src/main/java/com/example/lifegrid/SplashActivity.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.example.lifegrid;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
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;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_splash);
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
FirebaseApp.initializeApp(this);
|
||||
|
||||
ImageView ivSplashLogo = findViewById(R.id.ivSplashLogo);
|
||||
// Configuração inicial da animação
|
||||
ivSplashLogo.setAlpha(0f);
|
||||
ivSplashLogo.setScaleX(0f);
|
||||
ivSplashLogo.setScaleY(0f);
|
||||
|
||||
// Animação do Logo (aumenta e depois diminui um bocado)
|
||||
ivSplashLogo.animate()
|
||||
.alpha(1f)
|
||||
.scaleX(1f)
|
||||
.scaleY(1f)
|
||||
.setDuration(1200)
|
||||
.setInterpolator(new OvershootInterpolator(2.0f))
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
// Aguarda um pouco e avança
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> navigateToNextActivity(), 600);
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
private void navigateToNextActivity() {
|
||||
FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();
|
||||
Intent intent;
|
||||
if (currentUser != null) {
|
||||
intent = new Intent(SplashActivity.this, TelaInicialActivity.class);
|
||||
} else {
|
||||
intent = new Intent(SplashActivity.this, LoginActivity.class);
|
||||
}
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
30
app/src/main/res/layout/activity_splash.xml
Normal file
30
app/src/main/res/layout/activity_splash.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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="#F5F5F5"
|
||||
tools:context=".SplashActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSplashLogo"
|
||||
android:layout_width="236dp"
|
||||
android:layout_height="238dp"
|
||||
android:src="@drawable/logo"
|
||||
app:tint="#000000" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -85,10 +85,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Valor Total do Portfólio"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -98,10 +98,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:text="0,00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#1A202C"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
@@ -123,10 +123,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Total Investido"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -136,10 +136,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:text="0,00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#1A202C"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
@@ -161,10 +161,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="ROI Total"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -174,10 +174,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:text="0,00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="+0.00%"
|
||||
android:textColor="#22C55E"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Receitas (Mês Atual)"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -54,10 +54,10 @@
|
||||
android:layout_below="@id/tvTitulo"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#1A202C"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo" />
|
||||
|
||||
@@ -67,8 +67,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor"
|
||||
android:layout_marginStart="7dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="0 transações"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textColor="#718096"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -98,10 +99,10 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Despesas (Mês Atual)"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -125,10 +126,10 @@
|
||||
android:layout_below="@id/tvTitulo2"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#1A202C"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo2" />
|
||||
|
||||
@@ -138,8 +139,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor2"
|
||||
android:layout_marginStart="7dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="0 transações"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textColor="#718096"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -169,10 +171,10 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Saldo do Mês"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -196,10 +198,10 @@
|
||||
android:layout_below="@id/tvTitulo3"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#22C55E"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo3" />
|
||||
|
||||
@@ -209,8 +211,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor3"
|
||||
android:layout_marginStart="7dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Poupança positiva"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textColor="#718096"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -243,10 +246,10 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Valor do Ativos"
|
||||
android:textColor="#3A3A3A"
|
||||
android:textColor="#4A5568"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -270,10 +273,10 @@
|
||||
android:layout_below="@id/tvTitulo4"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="0.00€"
|
||||
android:textColor="#000000"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#1A202C"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitulo4" />
|
||||
|
||||
@@ -283,8 +286,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tvValor4"
|
||||
android:layout_marginStart="7dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="+0.00% ROI"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textColor="#22C55E"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/cardview_background"
|
||||
android:padding="16dp">
|
||||
@@ -22,11 +22,15 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Asset Name -->
|
||||
|
||||
<!-- Asset Type Badge -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNome"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/preto"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="normal"
|
||||
@@ -34,7 +38,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="bitcoins" />
|
||||
|
||||
<!-- Asset Type Badge -->
|
||||
<TextView
|
||||
android:id="@+id/tvTipo"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -87,11 +90,13 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Current Price -->
|
||||
|
||||
<!-- Percentage Change -->
|
||||
<TextView
|
||||
android:id="@+id/tvPrecoAtual"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:textColor="@color/preto"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="normal"
|
||||
@@ -101,7 +106,6 @@
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="193.19€" />
|
||||
|
||||
<!-- Percentage Change -->
|
||||
<TextView
|
||||
android:id="@+id/tvPercentagem"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user