a mudar design
This commit is contained in:
@@ -11,11 +11,17 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
|
||||
@@ -28,6 +34,12 @@ public class DefinicoesActivity extends AppCompatActivity {
|
||||
private Switch switchNotifications;
|
||||
private Spinner spinnerCurrency;
|
||||
|
||||
private ImageView ivProfilePicture;
|
||||
private TextView tvChangePhoto;
|
||||
private Uri selectedImageUri;
|
||||
|
||||
private ActivityResultLauncher<String> pickImageLauncher;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -46,9 +58,40 @@ public class DefinicoesActivity extends AppCompatActivity {
|
||||
switchNotifications = findViewById(R.id.switchNotifications);
|
||||
spinnerCurrency = findViewById(R.id.spinnerCurrency);
|
||||
|
||||
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
|
||||
if (user != null && user.getDisplayName() != null && !user.getDisplayName().isEmpty()) {
|
||||
etUsername.setText(user.getDisplayName());
|
||||
ivProfilePicture = findViewById(R.id.ivProfilePicture);
|
||||
tvChangePhoto = findViewById(R.id.tvChangePhoto);
|
||||
|
||||
pickImageLauncher = registerForActivityResult(new ActivityResultContracts.GetContent(),
|
||||
uri -> {
|
||||
if (uri != null) {
|
||||
selectedImageUri = uri;
|
||||
ivProfilePicture.setImageURI(uri);
|
||||
}
|
||||
});
|
||||
|
||||
tvChangePhoto.setOnClickListener(v -> pickImageLauncher.launch("image/*"));
|
||||
ivProfilePicture.setOnClickListener(v -> pickImageLauncher.launch("image/*"));
|
||||
|
||||
SharedPreferences prefs = getSharedPreferences("LifeGridPrefs", Context.MODE_PRIVATE);
|
||||
String savedName = prefs.getString("username", "");
|
||||
String savedPhotoUri = prefs.getString("profile_photo_uri", "");
|
||||
|
||||
if (!savedPhotoUri.isEmpty()) {
|
||||
selectedImageUri = Uri.parse(savedPhotoUri);
|
||||
try {
|
||||
ivProfilePicture.setImageURI(selectedImageUri);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (!savedName.isEmpty()) {
|
||||
etUsername.setText(savedName);
|
||||
} else {
|
||||
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
|
||||
if (user != null && user.getDisplayName() != null && !user.getDisplayName().isEmpty()) {
|
||||
etUsername.setText(user.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
btnBack.setOnClickListener(v -> {
|
||||
@@ -64,8 +107,18 @@ public class DefinicoesActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
btnSaveSettings.setOnClickListener(v -> {
|
||||
// Em implementações futuras isto iria guardar a foto, username (Firebase UserProfileChangeRequest)
|
||||
// Notificações e moeda escolhida no Firebase Realtime Database
|
||||
SharedPreferences.Editor editor = getSharedPreferences("LifeGridPrefs", Context.MODE_PRIVATE).edit();
|
||||
editor.putString("username", etUsername.getText().toString().trim());
|
||||
if (selectedImageUri != null) {
|
||||
editor.putString("profile_photo_uri", selectedImageUri.toString());
|
||||
try {
|
||||
getContentResolver().takePersistableUriPermission(selectedImageUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
editor.apply();
|
||||
|
||||
Toast.makeText(this, "Definições guardadas com sucesso!", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
});
|
||||
|
||||
@@ -279,7 +279,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
// [START create_credential_manager_request]
|
||||
// Instancia um pedido de início de sessão do Google
|
||||
GetGoogleIdOption googleIdOption = new GetGoogleIdOption.Builder()
|
||||
.setFilterByAuthorizedAccounts(true)
|
||||
.setFilterByAuthorizedAccounts(false)
|
||||
.setServerClientId(getString(R.string.default_web_client_id))
|
||||
.build();
|
||||
|
||||
@@ -291,11 +291,11 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
// Lança a interface do Gestor de Credenciais
|
||||
credentialManager.getCredentialAsync(
|
||||
getBaseContext(),
|
||||
LoginActivity.this,
|
||||
request,
|
||||
new CancellationSignal(),
|
||||
Executors.newSingleThreadExecutor(),
|
||||
new CredentialManagerCallback<>() {
|
||||
androidx.core.content.ContextCompat.getMainExecutor(LoginActivity.this),
|
||||
new CredentialManagerCallback<GetCredentialResponse, GetCredentialException>() {
|
||||
@Override
|
||||
public void onResult(GetCredentialResponse result) {
|
||||
// Extrai a credencial do resultado devolvido pelo Gestor de Credenciais
|
||||
@@ -305,6 +305,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onError(GetCredentialException e) {
|
||||
Log.e(TAG, "Couldn't retrieve user's credentials: " + e.getLocalizedMessage());
|
||||
Toast.makeText(LoginActivity.this, "Falha ao abrir Google Sign In.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -4,6 +4,9 @@ import android.os.Bundle;
|
||||
import android.content.Intent;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -56,6 +59,9 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
private TextView tvTitulo;
|
||||
private TextView tvTitulo2;
|
||||
|
||||
private ImageView ivHeaderProfilePicture;
|
||||
private TextView tvHeaderUsername;
|
||||
|
||||
private Spinner spinnerMes;
|
||||
private Spinner spinnerAno;
|
||||
|
||||
@@ -83,6 +89,9 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
tvTitulo = findViewById(R.id.tvTitulo);
|
||||
tvTitulo2 = findViewById(R.id.tvTitulo2);
|
||||
|
||||
ivHeaderProfilePicture = findViewById(R.id.ivHeaderProfilePicture);
|
||||
tvHeaderUsername = findViewById(R.id.tvHeaderUsername);
|
||||
|
||||
spinnerMes = findViewById(R.id.spinnerMes);
|
||||
spinnerAno = findViewById(R.id.spinnerAno);
|
||||
|
||||
@@ -93,19 +102,26 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
.replace(R.id.fragmentContainerView, transacoesFragment2)
|
||||
.commit();
|
||||
|
||||
ImageView carteiraImageView = findViewById(R.id.carteiraImageView);
|
||||
carteiraImageView.setOnClickListener(v -> {
|
||||
android.view.View.OnClickListener openTransacoesListener = v -> {
|
||||
Fragment transacoesFragment = new TransacoesFragment();
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainerView, transacoesFragment)
|
||||
.commit();
|
||||
});
|
||||
scrollToFragment();
|
||||
};
|
||||
|
||||
findViewById(R.id.receitasCardView).setOnClickListener(openTransacoesListener);
|
||||
findViewById(R.id.despesasCardView).setOnClickListener(openTransacoesListener);
|
||||
|
||||
ImageView carteiraImageView = findViewById(R.id.carteiraImageView);
|
||||
carteiraImageView.setOnClickListener(openTransacoesListener);
|
||||
ImageView setaImageView = findViewById(R.id.setaImageView);
|
||||
setaImageView.setOnClickListener(v -> {
|
||||
Fragment ativosFragment = new AtivosFragment();
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainerView, ativosFragment)
|
||||
.commit();
|
||||
scrollToFragment();
|
||||
});
|
||||
ImageView graficoImageView = findViewById(R.id.graficoImageView);
|
||||
graficoImageView.setOnClickListener(v -> {
|
||||
@@ -113,6 +129,7 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainerView, graficosFragment)
|
||||
.commit();
|
||||
scrollToFragment();
|
||||
});
|
||||
ImageView alvoImageView = findViewById(R.id.alvoImageView);
|
||||
alvoImageView.setOnClickListener(v -> {
|
||||
@@ -120,13 +137,7 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainerView, metasFragment)
|
||||
.commit();
|
||||
});
|
||||
ImageView documentoImageView = findViewById(R.id.documentoImageView);
|
||||
documentoImageView.setOnClickListener(v -> {
|
||||
Fragment documentoFragment = new DocumentosFragment();
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainerView, documentoFragment)
|
||||
.commit();
|
||||
scrollToFragment();
|
||||
});
|
||||
ImageView definicoesImageView = findViewById(R.id.definicoesImageView);
|
||||
definicoesImageView.setOnClickListener(v -> {
|
||||
@@ -135,6 +146,43 @@ public class TelaInicialActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
SharedPreferences prefs = getSharedPreferences("LifeGridPrefs", Context.MODE_PRIVATE);
|
||||
String savedName = prefs.getString("username", "");
|
||||
String savedPhotoUri = prefs.getString("profile_photo_uri", "");
|
||||
|
||||
if (ivHeaderProfilePicture != null && !savedPhotoUri.isEmpty()) {
|
||||
try {
|
||||
ivHeaderProfilePicture.setImageURI(Uri.parse(savedPhotoUri));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (tvHeaderUsername != null) {
|
||||
if (!savedName.isEmpty()) {
|
||||
tvHeaderUsername.setText(savedName);
|
||||
} else {
|
||||
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
|
||||
if (user != null && user.getDisplayName() != null && !user.getDisplayName().isEmpty()) {
|
||||
tvHeaderUsername.setText(user.getDisplayName());
|
||||
} else {
|
||||
tvHeaderUsername.setText("Utilizador");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void scrollToFragment() {
|
||||
android.widget.ScrollView scrollView = findViewById(R.id.mainScrollView);
|
||||
android.view.View barraCardView = findViewById(R.id.barraCardView);
|
||||
if (scrollView != null && barraCardView != null) {
|
||||
scrollView.post(() -> scrollView.smoothScrollTo(0, barraCardView.getTop() - 20));
|
||||
}
|
||||
}
|
||||
|
||||
private void setupSpinners() {
|
||||
ArrayAdapter<String> mesAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, meses);
|
||||
mesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.lifegrid.menu;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.example.lifegrid.R;
|
||||
|
||||
|
||||
public class HomeFragment extends Fragment {
|
||||
|
||||
public HomeFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
}
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
tools:context=".TelaInicialActivity">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/mainScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/cinza">
|
||||
@@ -27,12 +28,12 @@
|
||||
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_constraintHorizontal_bias="0.51"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/llFiltros">
|
||||
app:layout_constraintTop_toTopOf="@+id/fragmentContainerView">
|
||||
|
||||
<!-- TRANSAÇÕES -->
|
||||
|
||||
@@ -94,18 +95,70 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llProfileHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="32dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
app:cardCornerRadius="25dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/cinzaescuro">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHeaderProfilePicture"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_launcher_foreground" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGreeting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bem-vindo(a),"
|
||||
android:textColor="#8E8E8E"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHeaderUsername"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Utilizador"
|
||||
android:textColor="@color/preto"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView10"
|
||||
android:layout_width="339dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="64dp"
|
||||
android:layout_marginTop="24dp"
|
||||
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" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/llProfileHeader" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView11"
|
||||
@@ -366,50 +419,43 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragmentContainerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/barraCardView" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/barraCardView"
|
||||
android:layout_width="380dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="44dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/linear_backgound"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.488"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ativosCardView">
|
||||
app:layout_constraintTop_toBottomOf="@+id/llFiltros">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/alvoImageView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/graficoImageView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.473"
|
||||
app:srcCompat="@drawable/alvo" />
|
||||
app:layout_constraintVertical_bias="0.263"
|
||||
app:srcCompat="@drawable/alvo"
|
||||
tools:layout_editor_absoluteX="293dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/carteiraImageView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.428"
|
||||
app:srcCompat="@drawable/carteira" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/documentoImageView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/definicoesImageView"
|
||||
app:layout_constraintStart_toEndOf="@+id/alvoImageView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/documento" />
|
||||
app:layout_constraintVertical_bias="0.263"
|
||||
app:srcCompat="@drawable/carteira"
|
||||
tools:layout_editor_absoluteX="132dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/definicoesImageView"
|
||||
@@ -425,32 +471,21 @@
|
||||
android:id="@+id/graficoImageView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/setaImageView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.473"
|
||||
app:srcCompat="@drawable/grafico" />
|
||||
app:srcCompat="@drawable/grafico"
|
||||
tools:layout_editor_absoluteX="231dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/setaImageView"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginStart="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/carteiraImageView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/diagonalarrowrightup_110941" />
|
||||
app:srcCompat="@drawable/diagonalarrowrightup_110941"
|
||||
tools:layout_editor_absoluteX="169dp"
|
||||
tools:layout_editor_absoluteY="5dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragmentContainerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/barraCardView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
@@ -32,20 +32,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/novaTransacaoButton"
|
||||
android:layout_width="175dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:backgroundTint="@color/preto"
|
||||
android:text=" + Novo Documento"
|
||||
android:textSize="14sp"
|
||||
app:cornerRadius="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.154"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView13"
|
||||
android:layout_width="302dp"
|
||||
@@ -76,11 +62,11 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="348dp"
|
||||
android:layout_height="382dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginTop="40dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.516"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/novaTransacaoButton" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView12" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
82
app/src/main/res/layout/fragment_home.xml
Normal file
82
app/src/main/res/layout/fragment_home.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".menu.HomeFragment">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/receitasCardView"
|
||||
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_constraintHorizontal_bias="0.51"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/fragmentContainerView">
|
||||
|
||||
<!-- 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="23sp"
|
||||
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>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -42,7 +42,13 @@
|
||||
android:text="dinheiro"
|
||||
android:textColor="#000000"
|
||||
android:textSize="18sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivIconBackground"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvCategoria"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
@@ -50,14 +56,19 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_badge_category"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="Outros"
|
||||
android:textColor="#000000"
|
||||
android:textSize="12sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvDescricao"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDescricao"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvValor"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvDescricao" />
|
||||
|
||||
<ImageView
|
||||
@@ -74,11 +85,17 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="23/04/2026"
|
||||
android:textColor="#6B7280"
|
||||
android:textSize="14sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivCalendar"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivCalendar"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvValor"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivCalendar" />
|
||||
|
||||
<ImageView
|
||||
|
||||
Reference in New Issue
Block a user