corrigir os novos erros amnhã e adicionar qual tipo de sexo a pessoa é no register
This commit is contained in:
@@ -11,8 +11,9 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class EstatisticasActivity extends AppCompatActivity {
|
public class EstatisticasActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private TextView tvValorIMC, tvStatusIMC;
|
private TextView tvValorIMC, tvStatusIMC, tvCaloriasMeta;
|
||||||
private TextView tvProtGramas, tvHidrGramas, tvGordGramas, tvComida1;
|
private TextView tvProtGramas, tvHidrGramas, tvGordGramas, tvComida1;
|
||||||
|
private TextView tvAguaStats;
|
||||||
private ProgressBar progressProt, progressHidr, progressGord;
|
private ProgressBar progressProt, progressHidr, progressGord;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -23,12 +24,15 @@ public class EstatisticasActivity extends AppCompatActivity {
|
|||||||
// Ligar o layout (XML) às variáveis do Java
|
// Ligar o layout (XML) às variáveis do Java
|
||||||
tvValorIMC = findViewById(R.id.tvValorIMC);
|
tvValorIMC = findViewById(R.id.tvValorIMC);
|
||||||
tvStatusIMC = findViewById(R.id.tvStatusIMC);
|
tvStatusIMC = findViewById(R.id.tvStatusIMC);
|
||||||
|
tvCaloriasMeta = findViewById(R.id.tvCaloriasMeta);
|
||||||
|
|
||||||
tvProtGramas = findViewById(R.id.tvProtGramas);
|
tvProtGramas = findViewById(R.id.tvProtGramas);
|
||||||
tvHidrGramas = findViewById(R.id.tvHidrGramas);
|
tvHidrGramas = findViewById(R.id.tvHidrGramas);
|
||||||
tvGordGramas = findViewById(R.id.tvGordGramas);
|
tvGordGramas = findViewById(R.id.tvGordGramas);
|
||||||
tvComida1 = findViewById(R.id.tvComida1);
|
tvComida1 = findViewById(R.id.tvComida1);
|
||||||
|
|
||||||
|
tvAguaStats = findViewById(R.id.tvAguaStats);
|
||||||
|
|
||||||
progressProt = findViewById(R.id.progressProt);
|
progressProt = findViewById(R.id.progressProt);
|
||||||
progressHidr = findViewById(R.id.progressHidr);
|
progressHidr = findViewById(R.id.progressHidr);
|
||||||
progressGord = findViewById(R.id.progressGord);
|
progressGord = findViewById(R.id.progressGord);
|
||||||
@@ -36,9 +40,11 @@ public class EstatisticasActivity extends AppCompatActivity {
|
|||||||
// Botão voltar
|
// Botão voltar
|
||||||
findViewById(R.id.btnVoltarStats).setOnClickListener(v -> finish());
|
findViewById(R.id.btnVoltarStats).setOnClickListener(v -> finish());
|
||||||
|
|
||||||
// Chamar as duas funções que preenchem os dados
|
// Chamar as funções que preenchem os dados
|
||||||
calcularIMC();
|
calcularIMC();
|
||||||
|
calcularTMB();
|
||||||
carregarMacrosDaIA();
|
carregarMacrosDaIA();
|
||||||
|
carregarAgua();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calcularIMC() {
|
private void calcularIMC() {
|
||||||
@@ -69,8 +75,36 @@ public class EstatisticasActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void calcularTMB() {
|
||||||
|
SharedPreferences prefs = getSharedPreferences("MeusDadosApp", MODE_PRIVATE);
|
||||||
|
float peso = prefs.getFloat("peso", 0);
|
||||||
|
float alturaMetros = prefs.getFloat("altura", 0);
|
||||||
|
String sexo = prefs.getString("sexo", "");
|
||||||
|
|
||||||
|
// Puxa a idade real. Se der erro ou não existir, assume 20.
|
||||||
|
int idade = prefs.getInt("idade", 20);
|
||||||
|
|
||||||
|
if (peso > 0 && alturaMetros > 0 && !sexo.isEmpty()) {
|
||||||
|
float alturaCm = alturaMetros * 100; // Passar para centímetros
|
||||||
|
double tmb;
|
||||||
|
|
||||||
|
// Fórmula de Harris-Benedict
|
||||||
|
if (sexo.equals("Masculino")) {
|
||||||
|
tmb = (10 * peso) + (6.25 * alturaCm) - (5 * idade) + 5;
|
||||||
|
} else {
|
||||||
|
tmb = (10 * peso) + (6.25 * alturaCm) - (5 * idade) - 161;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fator de atividade leve para dar uma meta real (1.2)
|
||||||
|
double caloriasTotais = tmb * 1.2;
|
||||||
|
|
||||||
|
tvCaloriasMeta.setText(String.valueOf((int) caloriasTotais));
|
||||||
|
} else {
|
||||||
|
tvCaloriasMeta.setText("--");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void carregarMacrosDaIA() {
|
private void carregarMacrosDaIA() {
|
||||||
// Abre a memória onde a FotoActivity guardou os dados
|
|
||||||
SharedPreferences prefs = getSharedPreferences("DadosSaude", MODE_PRIVATE);
|
SharedPreferences prefs = getSharedPreferences("DadosSaude", MODE_PRIVATE);
|
||||||
|
|
||||||
int prot = prefs.getInt("prot_hoje", 0);
|
int prot = prefs.getInt("prot_hoje", 0);
|
||||||
@@ -78,17 +112,23 @@ public class EstatisticasActivity extends AppCompatActivity {
|
|||||||
int gord = prefs.getInt("gord_hoje", 0);
|
int gord = prefs.getInt("gord_hoje", 0);
|
||||||
String ultimaComida = prefs.getString("ultimo_prato", "Ainda não leste nada hoje.");
|
String ultimaComida = prefs.getString("ultimo_prato", "Ainda não leste nada hoje.");
|
||||||
|
|
||||||
// Atualizar os Textos (ex: "Proteína: 25g")
|
|
||||||
tvProtGramas.setText("Proteína: " + prot + "g");
|
tvProtGramas.setText("Proteína: " + prot + "g");
|
||||||
tvHidrGramas.setText("Hidratos: " + hidr + "g");
|
tvHidrGramas.setText("Hidratos: " + hidr + "g");
|
||||||
tvGordGramas.setText("Gordura: " + gord + "g");
|
tvGordGramas.setText("Gordura: " + gord + "g");
|
||||||
|
|
||||||
// Atualizar as Barras (Vai enchendo de 0 até ao limite máximo que definiste no XML)
|
|
||||||
progressProt.setProgress(prot);
|
progressProt.setProgress(prot);
|
||||||
progressHidr.setProgress(hidr);
|
progressHidr.setProgress(hidr);
|
||||||
progressGord.setProgress(gord);
|
progressGord.setProgress(gord);
|
||||||
|
|
||||||
// Atualiza a Última Comida
|
tvComida1.setText(ultimaComida);
|
||||||
tvComida1.setText("1. " + ultimaComida);
|
}
|
||||||
|
|
||||||
|
private void carregarAgua() {
|
||||||
|
SharedPreferences prefs = getSharedPreferences("DadosGamificacao", MODE_PRIVATE);
|
||||||
|
int coposBebidos = prefs.getInt("agua_hoje", 0);
|
||||||
|
|
||||||
|
float litrosTotais = coposBebidos * 0.25f;
|
||||||
|
|
||||||
|
tvAguaStats.setText(String.format(Locale.getDefault(), "💧 %.2f L", litrosTotais));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,10 @@ package com.example.pap;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@@ -16,7 +17,8 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class RegisterActivity extends AppCompatActivity {
|
public class RegisterActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private EditText etRegNome, etRegEmail, etRegPassword, etRegAltura, etRegPeso;
|
private EditText etRegNome, etRegEmail, etRegPassword, etRegAltura, etRegPeso, etRegIdade;
|
||||||
|
private RadioGroup radioGroupSexo;
|
||||||
private Button btnRegister;
|
private Button btnRegister;
|
||||||
private TextView tvGoToLogin;
|
private TextView tvGoToLogin;
|
||||||
|
|
||||||
@@ -29,8 +31,10 @@ public class RegisterActivity extends AppCompatActivity {
|
|||||||
etRegNome = findViewById(R.id.etRegNome);
|
etRegNome = findViewById(R.id.etRegNome);
|
||||||
etRegEmail = findViewById(R.id.etRegEmail);
|
etRegEmail = findViewById(R.id.etRegEmail);
|
||||||
etRegPassword = findViewById(R.id.etRegPassword);
|
etRegPassword = findViewById(R.id.etRegPassword);
|
||||||
|
etRegIdade = findViewById(R.id.etRegIdade);
|
||||||
etRegAltura = findViewById(R.id.etRegAltura);
|
etRegAltura = findViewById(R.id.etRegAltura);
|
||||||
etRegPeso = findViewById(R.id.etRegPeso);
|
etRegPeso = findViewById(R.id.etRegPeso);
|
||||||
|
radioGroupSexo = findViewById(R.id.radioGroupSexo);
|
||||||
btnRegister = findViewById(R.id.btnRegister);
|
btnRegister = findViewById(R.id.btnRegister);
|
||||||
tvGoToLogin = findViewById(R.id.tvGoToLogin);
|
tvGoToLogin = findViewById(R.id.tvGoToLogin);
|
||||||
|
|
||||||
@@ -42,20 +46,37 @@ public class RegisterActivity extends AppCompatActivity {
|
|||||||
String nome = etRegNome.getText().toString().trim();
|
String nome = etRegNome.getText().toString().trim();
|
||||||
String email = etRegEmail.getText().toString().trim();
|
String email = etRegEmail.getText().toString().trim();
|
||||||
String password = etRegPassword.getText().toString().trim();
|
String password = etRegPassword.getText().toString().trim();
|
||||||
|
String idadeStr = etRegIdade.getText().toString().trim();
|
||||||
String alturaStr = etRegAltura.getText().toString().trim();
|
String alturaStr = etRegAltura.getText().toString().trim();
|
||||||
String pesoStr = etRegPeso.getText().toString().trim();
|
String pesoStr = etRegPeso.getText().toString().trim();
|
||||||
|
|
||||||
// 1. Verificar se não há campos vazios
|
// 1. Verificar se não há campos vazios
|
||||||
if (nome.isEmpty() || email.isEmpty() || password.isEmpty() || alturaStr.isEmpty() || pesoStr.isEmpty()) {
|
if (nome.isEmpty() || email.isEmpty() || password.isEmpty() || idadeStr.isEmpty() || alturaStr.isEmpty() || pesoStr.isEmpty()) {
|
||||||
Toast.makeText(this, "Por favor, preenche todos os campos!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Por favor, preenche todos os campos!", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. GUARDAR NOME, ALTURA E PESO NA MEMÓRIA (SharedPreferences)
|
// 1.1 Verificar se o utilizador escolheu o sexo
|
||||||
|
int selectedSexoId = radioGroupSexo.getCheckedRadioButtonId();
|
||||||
|
if (selectedSexoId == -1) {
|
||||||
|
Toast.makeText(this, "Por favor, escolhe o teu sexo!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String sexoSelecionado = "";
|
||||||
|
if (selectedSexoId == R.id.radioMasculino) {
|
||||||
|
sexoSelecionado = "Masculino";
|
||||||
|
} else if (selectedSexoId == R.id.radioFeminino) {
|
||||||
|
sexoSelecionado = "Feminino";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. GUARDAR TODOS OS DADOS NA MEMÓRIA (SharedPreferences)
|
||||||
SharedPreferences prefs = getSharedPreferences("MeusDadosApp", MODE_PRIVATE);
|
SharedPreferences prefs = getSharedPreferences("MeusDadosApp", MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
editor.putString("nome", nome);
|
editor.putString("nome", nome);
|
||||||
editor.putString("email", email);
|
editor.putString("email", email);
|
||||||
|
editor.putString("sexo", sexoSelecionado);
|
||||||
|
editor.putInt("idade", Integer.parseInt(idadeStr));
|
||||||
editor.putFloat("altura", Float.parseFloat(alturaStr));
|
editor.putFloat("altura", Float.parseFloat(alturaStr));
|
||||||
editor.putFloat("peso", Float.parseFloat(pesoStr));
|
editor.putFloat("peso", Float.parseFloat(pesoStr));
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -73,7 +94,7 @@ public class RegisterActivity extends AppCompatActivity {
|
|||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
Toast.makeText(RegisterActivity.this, "Conta criada! Verifica o teu email.", Toast.LENGTH_LONG).show();
|
Toast.makeText(RegisterActivity.this, "Conta criada! Verifica o teu email.", Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
// NOVO FLUXO: Mandar para o ecrã de espera com os dados passados em segurança!
|
// Mandar para o ecrã de espera
|
||||||
Intent intent = new Intent(RegisterActivity.this, VerificacaoActivity.class);
|
Intent intent = new Intent(RegisterActivity.this, VerificacaoActivity.class);
|
||||||
intent.putExtra("email_registo", email);
|
intent.putExtra("email_registo", email);
|
||||||
intent.putExtra("password_registo", password);
|
intent.putExtra("password_registo", password);
|
||||||
@@ -87,7 +108,6 @@ public class RegisterActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<SupabaseResponse> call, Throwable t) {
|
public void onFailure(Call<SupabaseResponse> call, Throwable t) {
|
||||||
// Sem internet ou falha de ligação
|
|
||||||
Toast.makeText(RegisterActivity.this, "Falha na ligação! Verifica a tua internet.", Toast.LENGTH_LONG).show();
|
Toast.makeText(RegisterActivity.this, "Falha na ligação! Verifica a tua internet.", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
muda<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Visão Geral"
|
android:text="Estatísticas"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="#1C1C1E"
|
android:textColor="#1C1C1E"
|
||||||
@@ -45,7 +45,6 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="40dp">
|
android:paddingBottom="40dp">
|
||||||
|
|
||||||
<!-- Insight da IA -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -57,12 +56,11 @@
|
|||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="✨" android:textSize="24sp" android:layout_marginEnd="12dp"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="✨" android:textSize="24sp" android:layout_marginEnd="12dp"/>
|
||||||
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical">
|
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical">
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Insight da IA" android:textSize="12sp" android:textStyle="bold" android:textColor="#0284C7"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Insight da IA" android:textSize="12sp" android:textStyle="bold" android:textColor="#0284C7"/>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Estás a ir muito bem nas tuas refeições de hoje!" android:textSize="14sp" android:textColor="#334155" android:layout_marginTop="2dp"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Continua a registar as tuas refeições para ver dicas." android:textSize="14sp" android:textColor="#334155" android:layout_marginTop="2dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Health Score -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -81,15 +79,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Índice Nutri AI" android:textSize="14sp" android:textColor="#A1A1AA"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Meta Diária (TMB)" android:textSize="14sp" android:textColor="#A1A1AA"/>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Excelente" android:textSize="22sp" android:textStyle="bold" android:textColor="#10B981" android:layout_marginTop="2dp"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Manter Peso" android:textSize="18sp" android:textStyle="bold" android:textColor="#10B981" android:layout_marginTop="2dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="85" android:textSize="48sp" android:textStyle="bold" android:textColor="#FFFFFF"/>
|
<TextView android:id="@+id/tvCaloriasMeta" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="--" android:textSize="36sp" android:textStyle="bold" android:textColor="#FFFFFF"/>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="/100" android:textSize="16sp" android:textColor="#A1A1AA" android:layout_marginStart="4dp" android:layout_marginBottom="8dp"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="kcal" android:textSize="16sp" android:textColor="#A1A1AA" android:layout_marginStart="4dp" android:layout_marginBottom="8dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- IMC Adicionado -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -122,45 +119,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Jejum e Passos -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:baselineAligned="false">
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
app:cardCornerRadius="20dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardBackgroundColor="#F2F2F7">
|
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="⏱️" android:textSize="20sp"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="14h 20m" android:textSize="18sp" android:textStyle="bold" android:textColor="#1C1C1E" android:layout_marginTop="4dp"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Em Jejum" android:textSize="12sp" android:textColor="#8E8E93"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
app:cardCornerRadius="20dp"
|
|
||||||
app:cardElevation="0dp"
|
|
||||||
app:cardBackgroundColor="#F2F2F7">
|
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="👟" android:textSize="20sp"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="6,432" android:textSize="18sp" android:textStyle="bold" android:textColor="#1C1C1E" android:layout_marginTop="4dp"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Passos" android:textSize="12sp" android:textColor="#8E8E93"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Água e Peso -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -177,7 +135,7 @@
|
|||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="#E0F2FE">
|
app:cardBackgroundColor="#E0F2FE">
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="💧 1.5 L" android:textSize="18sp" android:textStyle="bold" android:textColor="#0284C7"/>
|
<TextView android:id="@+id/tvAguaStats" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="💧 0 L" android:textSize="18sp" android:textStyle="bold" android:textColor="#0284C7"/>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hidratação" android:textSize="12sp" android:textColor="#38BDF8"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hidratação" android:textSize="12sp" android:textColor="#38BDF8"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
@@ -189,15 +147,15 @@
|
|||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
app:cardCornerRadius="20dp"
|
app:cardCornerRadius="20dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="#FEF2F2">
|
app:cardBackgroundColor="#F2F2F7">
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp" android:gravity="center">
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="📉 -1.2 Kg" android:textSize="18sp" android:textStyle="bold" android:textColor="#EF4444"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="👟" android:textSize="20sp"/>
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Este mês" android:textSize="12sp" android:textColor="#F87171"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="0" android:textSize="18sp" android:textStyle="bold" android:textColor="#1C1C1E" android:layout_marginTop="4dp"/>
|
||||||
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Passos" android:textSize="12sp" android:textColor="#8E8E93"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Macros e Micronutrientes (COM IDs AGORA!) -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -216,28 +174,10 @@
|
|||||||
<ProgressBar android:id="@+id/progressHidr" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="6dp" android:max="250" android:progress="0" android:progressTint="#1C1C1E" android:layout_marginBottom="12dp"/>
|
<ProgressBar android:id="@+id/progressHidr" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="6dp" android:max="250" android:progress="0" android:progressTint="#1C1C1E" android:layout_marginBottom="12dp"/>
|
||||||
|
|
||||||
<TextView android:id="@+id/tvGordGramas" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Gordura: 0g" android:textSize="13sp" android:textColor="#3A3A3C"/>
|
<TextView android:id="@+id/tvGordGramas" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Gordura: 0g" android:textSize="13sp" android:textColor="#3A3A3C"/>
|
||||||
<ProgressBar android:id="@+id/progressGord" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="6dp" android:max="80" android:progress="0" android:progressTint="#1C1C1E" android:layout_marginBottom="24dp"/>
|
<ProgressBar android:id="@+id/progressGord" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="6dp" android:max="80" android:progress="0" android:progressTint="#1C1C1E" android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Alertas de Micronutrientes" android:textStyle="bold" android:textColor="#1C1C1E" android:textSize="16sp" android:layout_marginBottom="12dp"/>
|
|
||||||
|
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="3">
|
|
||||||
<LinearLayout android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:orientation="vertical">
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Açúcar" android:textSize="12sp" android:textColor="#8E8E93"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Normal ✅" android:textSize="14sp" android:textStyle="bold" android:textColor="#10B981"/>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:orientation="vertical">
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Fibras" android:textSize="12sp" android:textColor="#8E8E93"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Normal ✅" android:textSize="14sp" android:textStyle="bold" android:textColor="#10B981"/>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:orientation="vertical">
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Sódio" android:textSize="12sp" android:textColor="#8E8E93"/>
|
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Normal ✅" android:textSize="14sp" android:textStyle="bold" android:textColor="#10B981"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<!-- Top Comidas -->
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -245,7 +185,7 @@
|
|||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="#F2F2F7">
|
app:cardBackgroundColor="#F2F2F7">
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="20dp">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="20dp">
|
||||||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Últimas Refeições" android:textSize="16sp" android:textStyle="bold" android:textColor="#1C1C1E" android:layout_marginBottom="16dp"/>
|
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Última Refeição Lida" android:textSize="16sp" android:textStyle="bold" android:textColor="#1C1C1E" android:layout_marginBottom="16dp"/>
|
||||||
<TextView android:id="@+id/tvComida1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Nenhuma refeição lida hoje." android:textColor="#3A3A3C" android:textSize="15sp" android:layout_marginBottom="12dp"/>
|
<TextView android:id="@+id/tvComida1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Nenhuma refeição lida hoje." android:textColor="#3A3A3C" android:textSize="15sp" android:layout_marginBottom="12dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
@@ -83,6 +83,53 @@
|
|||||||
android:paddingEnd="16dp"/>
|
android:paddingEnd="16dp"/>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Sexo Biológico:"
|
||||||
|
android:textColor="#6B7280"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroupSexo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginBottom="16dp">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioMasculino"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Masculino"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioFeminino"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Feminino"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="2dp">
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etRegIdade"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="55dp"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Idade (ex: 18)"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"/>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
Reference in New Issue
Block a user