Compare commits
2 Commits
main
...
atualizado
| Author | SHA1 | Date | |
|---|---|---|---|
| a9746c042c | |||
| 9058c57c5b |
4
.idea/deploymentTargetSelector.xml
generated
@@ -4,10 +4,10 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-03-18T10:38:49.186279Z">
|
||||
<DropdownSelection timestamp="2025-12-14T18:12:56.139375400Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/230410/.android/avd/Medium_Phone.avd" />
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\lucas\.android\avd\Pixel_9_Pro.avd" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
||||
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
}
|
||||
@@ -44,12 +44,6 @@ dependencies {
|
||||
implementation("com.google.firebase:firebase-auth")
|
||||
implementation("com.google.firebase:firebase-firestore")
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
// Retrofit & Gson
|
||||
implementation(libs.retrofit)
|
||||
implementation(libs.converter.gson)
|
||||
implementation(libs.gson)
|
||||
implementation(libs.play.services.location)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
|
||||
@@ -10,19 +10,16 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@drawable/logo_bem"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@drawable/logo_bem"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Bem">
|
||||
<activity
|
||||
@@ -66,12 +63,6 @@
|
||||
android:enabled="true"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="mediaPlayback" />
|
||||
|
||||
<service
|
||||
android:name=".GuardianNotificationService"
|
||||
android:enabled="true"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -23,7 +23,6 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||
String message = intent.getStringExtra("alarm_message");
|
||||
String ringtoneUriString = intent.getStringExtra("ringtone_uri");
|
||||
int alarmId = intent.getIntExtra("alarm_id", -1);
|
||||
String docId = intent.getStringExtra("alarm_doc_id");
|
||||
|
||||
if (title == null) {
|
||||
title = "Alarme de Medicamento";
|
||||
@@ -40,7 +39,6 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||
activityIntent.putExtra("alarm_time", new java.text.SimpleDateFormat("HH:mm", java.util.Locale.getDefault()).format(new java.util.Date()));
|
||||
activityIntent.putExtra("ringtone_uri", ringtoneUriString);
|
||||
activityIntent.putExtra("alarm_id", alarmId);
|
||||
activityIntent.putExtra("alarm_doc_id", docId);
|
||||
context.startActivity(activityIntent);
|
||||
|
||||
Intent serviceIntent = new Intent(context, AlarmSoundService.class);
|
||||
@@ -54,7 +52,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
createNotificationChannel(context);
|
||||
showNotification(context, title, message, ringtoneUriString, alarmId, docId);
|
||||
showNotification(context, title, message, ringtoneUriString, alarmId);
|
||||
}
|
||||
|
||||
private void createNotificationChannel(Context context) {
|
||||
@@ -74,14 +72,13 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
private void showNotification(Context context, String title, String message, String ringtoneUriString, int alarmId, String docId) {
|
||||
private void showNotification(Context context, String title, String message, String ringtoneUriString, int alarmId) {
|
||||
Intent activityIntent = new Intent(context, AlarmRingingActivity.class);
|
||||
activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
activityIntent.putExtra("alarm_title", title);
|
||||
activityIntent.putExtra("alarm_time", new java.text.SimpleDateFormat("HH:mm", java.util.Locale.getDefault()).format(new java.util.Date()));
|
||||
activityIntent.putExtra("ringtone_uri", ringtoneUriString);
|
||||
activityIntent.putExtra("alarm_id", alarmId);
|
||||
activityIntent.putExtra("alarm_doc_id", docId);
|
||||
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(
|
||||
context,
|
||||
|
||||
@@ -38,7 +38,6 @@ public class AlarmRingingActivity extends AppCompatActivity {
|
||||
String time = getIntent().getStringExtra("alarm_time");
|
||||
String ringtoneUri = getIntent().getStringExtra("ringtone_uri");
|
||||
int alarmId = getIntent().getIntExtra("alarm_id", -1);
|
||||
String docId = getIntent().getStringExtra("alarm_doc_id");
|
||||
|
||||
TextView textTitle = findViewById(R.id.textAlarmTitle);
|
||||
TextView textTime = findViewById(R.id.textAlarmTime);
|
||||
@@ -60,53 +59,9 @@ public class AlarmRingingActivity extends AppCompatActivity {
|
||||
|
||||
btnStop.setOnClickListener(v -> {
|
||||
stopAlarmService();
|
||||
confirmInFirestore(title, docId);
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
private void confirmInFirestore(String title, String docId) {
|
||||
com.google.firebase.auth.FirebaseUser user = com.google.firebase.auth.FirebaseAuth.getInstance().getCurrentUser();
|
||||
if (user == null) return;
|
||||
|
||||
String uid = user.getUid();
|
||||
com.google.firebase.firestore.FirebaseFirestore db = com.google.firebase.firestore.FirebaseFirestore.getInstance();
|
||||
|
||||
if (docId != null) {
|
||||
updateAlarmDocument(db, uid, docId, title);
|
||||
} else {
|
||||
// Fallback to title search if docId is missing
|
||||
db.collection("users").document(uid).collection("alarms")
|
||||
.whereEqualTo("title", title)
|
||||
.get()
|
||||
.addOnSuccessListener(snapshots -> {
|
||||
for (com.google.firebase.firestore.DocumentSnapshot doc : snapshots) {
|
||||
updateAlarmDocument(db, uid, doc.getId(), title);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAlarmDocument(com.google.firebase.firestore.FirebaseFirestore db, String uid, String documentId, String title) {
|
||||
java.util.Map<String, Object> update = new java.util.HashMap<>();
|
||||
long now = System.currentTimeMillis();
|
||||
update.put("lastTakenTimestamp", now);
|
||||
update.put("takenToday", true);
|
||||
|
||||
db.collection("users").document(uid).collection("alarms").document(documentId).update(update);
|
||||
|
||||
// Also add to history
|
||||
String dateKey = new java.text.SimpleDateFormat("yyyyMMdd", java.util.Locale.getDefault()).format(new java.util.Date());
|
||||
java.util.Map<String, Object> hist = new java.util.HashMap<>();
|
||||
hist.put("date", dateKey);
|
||||
hist.put("alarmId", documentId);
|
||||
hist.put("title", title);
|
||||
hist.put("takenAt", now);
|
||||
|
||||
db.collection("users").document(uid).collection("history")
|
||||
.document(dateKey + "_" + documentId)
|
||||
.set(hist);
|
||||
}
|
||||
|
||||
private void snoozeAlarm(String title, String ringtoneUri, int alarmId) {
|
||||
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GenerateCodeActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
String code = String.format("%06d", new Random().nextInt(1000000));
|
||||
String code = String.format("%06d", new Random().nextInt(999999));
|
||||
|
||||
Map<String, Object> codeData = new HashMap<>();
|
||||
codeData.put("userId", userId);
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.example.bem;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -16,9 +15,6 @@ import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.firestore.FieldValue;
|
||||
import com.google.firebase.firestore.FirebaseFirestore;
|
||||
import android.util.Log;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class InviteCodeActivity extends AppCompatActivity {
|
||||
|
||||
@@ -48,27 +44,7 @@ public class InviteCodeActivity extends AppCompatActivity {
|
||||
String code = inputCode.getText().toString().trim();
|
||||
FirebaseUser currentUser = mAuth.getCurrentUser();
|
||||
|
||||
if (TextUtils.isEmpty(code)) {
|
||||
inputCode.setError("Insira o código.");
|
||||
return;
|
||||
}
|
||||
|
||||
// MASTER CODE CHECK
|
||||
if (code.equals("47281935")) {
|
||||
getSharedPreferences("app_prefs", MODE_PRIVATE)
|
||||
.edit()
|
||||
.putString("user_type", "guardian")
|
||||
.apply();
|
||||
|
||||
Toast.makeText(this, "Modo Responsável Ativado", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (code.length() != 6) {
|
||||
if (TextUtils.isEmpty(code) || code.length() != 6) {
|
||||
inputCode.setError("O código deve ter 6 dígitos.");
|
||||
return;
|
||||
}
|
||||
@@ -87,16 +63,6 @@ public class InviteCodeActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
Long createdAt = documentSnapshot.getLong("createdAt");
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
// Code expires in 30 seconds (same as the timer in GenerateCodeActivity)
|
||||
if (createdAt == null || (currentTime - createdAt) > 30000) {
|
||||
db.collection("inviteCodes").document(code).delete();
|
||||
showError("O código expirou. Por favor, gere um novo.");
|
||||
return;
|
||||
}
|
||||
|
||||
String patientId = documentSnapshot.getString("userId");
|
||||
if (patientId == null) {
|
||||
showError("Erro no código. Tente gerar um novo.");
|
||||
@@ -105,51 +71,30 @@ public class InviteCodeActivity extends AppCompatActivity {
|
||||
|
||||
String guardianId = currentUser.getUid();
|
||||
|
||||
// 1. Atualizar o perfil do responsável PRIMEIRO (ele tem permissão para o seu próprio perfil)
|
||||
db.collection("users").document(guardianId)
|
||||
.update("managedUsers", FieldValue.arrayUnion(patientId), "type", "guardian")
|
||||
// 2. Atualizar o perfil do paciente para adicionar o ID do responsável
|
||||
db.collection("users").document(patientId)
|
||||
.update("guardianId", guardianId)
|
||||
.addOnSuccessListener(aVoid -> {
|
||||
|
||||
// 2. Tentar atualizar o perfil do paciente (pode falhar por permissões se as regras não deixarem,
|
||||
// mas vamos tentar)
|
||||
Map<String, Object> patientUpdate = new HashMap<>();
|
||||
patientUpdate.put("guardianId", guardianId);
|
||||
patientUpdate.put("guardians", FieldValue.arrayUnion(guardianId));
|
||||
|
||||
db.collection("users").document(patientId)
|
||||
.update(patientUpdate)
|
||||
// 3. Atualizar o perfil do responsável para adicionar o ID do paciente
|
||||
db.collection("users").document(guardianId)
|
||||
.update("managedUsers", FieldValue.arrayUnion(patientId))
|
||||
.addOnSuccessListener(aVoid1 -> {
|
||||
completeAssociation(code);
|
||||
})
|
||||
.addOnFailureListener(e -> {
|
||||
// Se falhar o paciente mas o responsável deu certo, avisamos mas prosseguimos
|
||||
Log.e("InviteCode", "Falha ao atualizar paciente (provavelmente permissões): " + e.getMessage());
|
||||
// Even though permissions might fail from the client side, we complete association
|
||||
completeAssociation(code);
|
||||
});
|
||||
|
||||
}).addOnFailureListener(e -> {
|
||||
showError("Falha ao atualizar o seu perfil: " + e.getMessage());
|
||||
});
|
||||
// 4. Apagar o código de convite para que não seja reutilizado
|
||||
db.collection("inviteCodes").document(code).delete();
|
||||
|
||||
}).addOnFailureListener(e -> showError("Erro ao validar o código: " + e.getMessage()));
|
||||
}
|
||||
Toast.makeText(this, "Utilizador associado com sucesso!", Toast.LENGTH_LONG).show();
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
||||
private void completeAssociation(String code) {
|
||||
// 3. Apagar o código de convite
|
||||
db.collection("inviteCodes").document(code).delete();
|
||||
}).addOnFailureListener(e -> showError("Falha ao atualizar o seu perfil. Tente novamente."));
|
||||
|
||||
// Salvar estado local
|
||||
getSharedPreferences("app_prefs", MODE_PRIVATE)
|
||||
.edit()
|
||||
.putString("user_type", "guardian")
|
||||
.apply();
|
||||
}).addOnFailureListener(e -> showError("Falha ao associar. Verifique se o utilizador já tem um responsável."));
|
||||
|
||||
Toast.makeText(this, "Utilizador associado com sucesso!", Toast.LENGTH_LONG).show();
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}).addOnFailureListener(e -> showError("Erro ao validar o código. Verifique a sua ligação."));
|
||||
}
|
||||
|
||||
private void setLoading(boolean loading) {
|
||||
|
||||
@@ -21,9 +21,6 @@ import com.google.firebase.firestore.FirebaseFirestore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
@@ -46,26 +43,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||
private boolean isRegisterMode = false;
|
||||
private boolean isGuardianMode = false;
|
||||
|
||||
// Saved Accounts
|
||||
private LinearLayout storedAccountsContainer;
|
||||
private TextView textStoredAccounts;
|
||||
private static final String PREF_SAVED_ACCOUNTS = "saved_accounts";
|
||||
// Format: "email|name;email2|name2"
|
||||
|
||||
private static class SavedAccount {
|
||||
String email;
|
||||
String name;
|
||||
String type; // "user" or "guardian"
|
||||
String phone;
|
||||
|
||||
SavedAccount(String email, String name, String type, String phone) {
|
||||
this.email = email;
|
||||
this.name = name;
|
||||
this.type = type != null ? type : "user";
|
||||
this.phone = phone != null ? phone : "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -76,11 +53,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
db = FirebaseFirestore.getInstance();
|
||||
|
||||
// Auto-Login: Check if user is already signed in
|
||||
FirebaseUser currentUser = mAuth.getCurrentUser();
|
||||
if (currentUser != null) {
|
||||
checkUserTypeAndRedirect(currentUser.getUid(), false);
|
||||
return; // Don't setup the rest of UI
|
||||
if (mAuth.getCurrentUser() != null) {
|
||||
mAuth.signOut();
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_login);
|
||||
@@ -95,11 +69,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||
textForgotPassword = findViewById(R.id.textForgotPassword);
|
||||
textSwitchToGuardian = findViewById(R.id.textSwitchToGuardian);
|
||||
|
||||
storedAccountsContainer = findViewById(R.id.storedAccountsContainer);
|
||||
textStoredAccounts = findViewById(R.id.textStoredAccounts);
|
||||
|
||||
loadSavedAccounts();
|
||||
|
||||
btnLogin.setOnClickListener(v -> handleLogin());
|
||||
textSwitchMode.setOnClickListener(v -> toggleMode());
|
||||
textForgotPassword.setOnClickListener(v -> showForgotPasswordDialog());
|
||||
@@ -112,7 +81,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
if (isGuardianMode) {
|
||||
textLoginType.setText("Login de Responsável");
|
||||
textSwitchToGuardian.setText("👤 Sou Utilizador");
|
||||
inputPhone.setVisibility(View.GONE);
|
||||
inputPhone.setVisibility(View.VISIBLE);
|
||||
inputPhone.setHint("Número de telemóvel");
|
||||
} else {
|
||||
textLoginType.setText("Login de Utilizador");
|
||||
textSwitchToGuardian.setText("🔒 Sou Responsável");
|
||||
@@ -120,7 +90,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
isRegisterMode = false;
|
||||
loadSavedAccounts(); // Refresh list for new mode
|
||||
updateUI();
|
||||
}
|
||||
|
||||
@@ -134,12 +103,18 @@ public class LoginActivity extends AppCompatActivity {
|
||||
btnLogin.setText("Criar Conta");
|
||||
textSwitchMode.setText("Já tem conta? Entrar");
|
||||
inputName.setVisibility(View.VISIBLE);
|
||||
inputPhone.setVisibility(isGuardianMode ? View.GONE : View.VISIBLE);
|
||||
|
||||
if (isGuardianMode) {
|
||||
inputPhone.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
btnLogin.setText("Entrar");
|
||||
textSwitchMode.setText("Não tem conta? Registar");
|
||||
inputName.setVisibility(View.GONE);
|
||||
inputPhone.setVisibility(View.GONE);
|
||||
|
||||
if (!isGuardianMode) {
|
||||
inputPhone.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,118 +180,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private void saveAccountLocally(String email, String name, String phone, String type) {
|
||||
if (email == null || name == null)
|
||||
return;
|
||||
|
||||
List<SavedAccount> accounts = getSavedAccountsList();
|
||||
|
||||
// Remove if exists to re-add at top (updating type/phone if needed)
|
||||
accounts.removeIf(a -> a.email.equals(email));
|
||||
accounts.add(0, new SavedAccount(email, name, type, phone));
|
||||
|
||||
// Serialize
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (SavedAccount acc : accounts) {
|
||||
if (sb.length() > 0)
|
||||
sb.append(";");
|
||||
sb.append(acc.email).append("|").append(acc.name).append("|").append(acc.type).append("|")
|
||||
.append(acc.phone);
|
||||
}
|
||||
|
||||
prefs.edit().putString(PREF_SAVED_ACCOUNTS, sb.toString()).apply();
|
||||
}
|
||||
|
||||
private List<SavedAccount> getSavedAccountsList() {
|
||||
List<SavedAccount> list = new java.util.ArrayList<>();
|
||||
String saved = prefs.getString(PREF_SAVED_ACCOUNTS, "");
|
||||
if (!TextUtils.isEmpty(saved)) {
|
||||
String[] pairs = saved.split(";");
|
||||
for (String pair : pairs) {
|
||||
String[] parts = pair.split("\\|");
|
||||
if (parts.length >= 2) {
|
||||
// Backwards compatibility
|
||||
String type = parts.length > 2 ? parts[2] : "user";
|
||||
String phone = parts.length > 3 ? parts[3] : "";
|
||||
|
||||
// Auto-correct: If it has a phone number, it's a Guardian account
|
||||
if ("user".equals(type) && !TextUtils.isEmpty(phone)) {
|
||||
type = "guardian";
|
||||
}
|
||||
|
||||
list.add(new SavedAccount(parts[0], parts[1], type, phone));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void loadSavedAccounts() {
|
||||
List<SavedAccount> accounts = getSavedAccountsList();
|
||||
|
||||
// Filter by current mode
|
||||
String currentType = isGuardianMode ? "guardian" : "user";
|
||||
accounts.removeIf(a -> !a.type.equals(currentType));
|
||||
|
||||
if (accounts.isEmpty()) {
|
||||
textStoredAccounts.setVisibility(View.GONE);
|
||||
storedAccountsContainer.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
textStoredAccounts.setVisibility(View.VISIBLE);
|
||||
storedAccountsContainer.setVisibility(View.VISIBLE);
|
||||
storedAccountsContainer.removeAllViews();
|
||||
|
||||
android.view.LayoutInflater inflater = android.view.LayoutInflater.from(this);
|
||||
|
||||
for (SavedAccount acc : accounts) {
|
||||
View itemView = inflater.inflate(R.layout.item_saved_account, storedAccountsContainer, false);
|
||||
TextView nameView = itemView.findViewById(R.id.textSavedName);
|
||||
TextView emailView = itemView.findViewById(R.id.textSavedEmail);
|
||||
ImageView avatarView = itemView.findViewById(R.id.imageViewAvatar); // Need to add ID to XML first if not
|
||||
// present, checking XML... XML didn't
|
||||
// have ID for image.
|
||||
View removeBtn = itemView.findViewById(R.id.btnRemoveAccount);
|
||||
|
||||
nameView.setText(acc.name);
|
||||
emailView.setText(acc.email);
|
||||
// Future: Load custom profile image here if available in SavedAccount
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
inputEmail.setText(acc.email);
|
||||
if (acc.phone != null && !acc.phone.isEmpty()) {
|
||||
inputPhone.setText(acc.phone);
|
||||
}
|
||||
inputPassword.requestFocus();
|
||||
});
|
||||
|
||||
removeBtn.setOnClickListener(v -> {
|
||||
removeSavedAccount(acc.email);
|
||||
loadSavedAccounts(); // Refresh
|
||||
});
|
||||
|
||||
storedAccountsContainer.addView(itemView);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeSavedAccount(String email) {
|
||||
List<SavedAccount> accounts = getSavedAccountsList();
|
||||
accounts.removeIf(a -> a.email.equals(email));
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (SavedAccount acc : accounts) {
|
||||
if (sb.length() > 0)
|
||||
sb.append(";");
|
||||
sb.append(acc.email).append("|").append(acc.name).append("|").append(acc.type).append("|")
|
||||
.append(acc.phone);
|
||||
}
|
||||
prefs.edit().putString(PREF_SAVED_ACCOUNTS, sb.toString()).apply();
|
||||
}
|
||||
|
||||
private void saveUserData(String uid, String email, String name, String phone, boolean fromRegister) {
|
||||
String type = isGuardianMode ? "guardian" : "user";
|
||||
saveAccountLocally(email, name, phone, type); // Save locally on register success
|
||||
Map<String, Object> userData = new HashMap<>();
|
||||
userData.put("email", email);
|
||||
userData.put("name", name);
|
||||
@@ -331,12 +195,12 @@ public class LoginActivity extends AppCompatActivity {
|
||||
Toast.makeText(this, "✓ Conta criada! Faça login para continuar.", Toast.LENGTH_LONG).show();
|
||||
mAuth.signOut();
|
||||
btnLogin.setEnabled(true);
|
||||
// Reload clean screen
|
||||
// Recarrega a tela limpa
|
||||
Intent intent = getIntent();
|
||||
finish();
|
||||
startActivity(intent);
|
||||
} else {
|
||||
checkUserTypeAndRedirect(uid, true);
|
||||
redirectToApp();
|
||||
}
|
||||
})
|
||||
.addOnFailureListener(e -> {
|
||||
@@ -351,15 +215,13 @@ public class LoginActivity extends AppCompatActivity {
|
||||
if (task.isSuccessful()) {
|
||||
FirebaseUser user = mAuth.getCurrentUser();
|
||||
if (user != null) {
|
||||
checkUserTypeAndRedirect(user.getUid(), true);
|
||||
checkUserTypeAndRedirect(user.getUid());
|
||||
} else {
|
||||
if (btnLogin != null)
|
||||
btnLogin.setEnabled(true);
|
||||
btnLogin.setEnabled(true);
|
||||
Toast.makeText(this, "Erro ao iniciar sessão. Tente novamente.", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
if (btnLogin != null)
|
||||
btnLogin.setEnabled(true);
|
||||
btnLogin.setEnabled(true);
|
||||
String error = task.getException() != null ? task.getException().getMessage()
|
||||
: "Credenciais inválidas";
|
||||
Toast.makeText(this, "Erro: " + error, Toast.LENGTH_LONG).show();
|
||||
@@ -367,42 +229,28 @@ public class LoginActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private void checkUserTypeAndRedirect(String uid, boolean isManualLogin) {
|
||||
private void checkUserTypeAndRedirect(String uid) {
|
||||
db.collection("users").document(uid)
|
||||
.get()
|
||||
.addOnSuccessListener(document -> {
|
||||
if (document.exists()) {
|
||||
String type = document.getString("type");
|
||||
if (type == null)
|
||||
type = "user";
|
||||
String currentMode = isGuardianMode ? "guardian" : "user";
|
||||
|
||||
if (isManualLogin && !type.equals(currentMode)) {
|
||||
mAuth.signOut();
|
||||
if (btnLogin != null)
|
||||
btnLogin.setEnabled(true);
|
||||
String modeName = isGuardianMode ? "Responsável" : "Utilizador";
|
||||
String otherMode = isGuardianMode ? "Utilizador" : "Responsável";
|
||||
Toast.makeText(this, "Esta conta é de " + otherMode + ". Mude para o modo " + otherMode
|
||||
+ " para entrar.", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
prefs.edit()
|
||||
.putString("user_type", type)
|
||||
.putString("user_type", type != null ? type : "user")
|
||||
.putString("user_name", document.getString("name"))
|
||||
.apply();
|
||||
|
||||
saveAccountLocally(document.getString("email"), document.getString("name"),
|
||||
document.getString("phone"), type);
|
||||
|
||||
if ("guardian".equals(type)) {
|
||||
// Check if guardian has any patient linked
|
||||
List<String> managed = (List<String>) document.get("managedUsers");
|
||||
if (managed == null || managed.isEmpty()) {
|
||||
redirectToInviteCode();
|
||||
} else {
|
||||
java.util.List<String> managedUsers = (java.util.List<String>) document.get("managedUsers");
|
||||
|
||||
if (managedUsers != null && !managedUsers.isEmpty()) {
|
||||
redirectToApp();
|
||||
} else {
|
||||
Intent intent = new Intent(LoginActivity.this, InviteCodeActivity.class);
|
||||
intent.putExtra("is_guardian", true);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
redirectToApp();
|
||||
@@ -411,8 +259,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
// Se o perfil não existe, cria um com base no modo de login atual.
|
||||
FirebaseUser user = mAuth.getCurrentUser();
|
||||
String email = user != null ? user.getEmail() : "";
|
||||
String name = (email != null && email.contains("@")) ? email.substring(0, email.indexOf("@"))
|
||||
: "Utilizador";
|
||||
String name = (email != null && email.contains("@")) ? email.substring(0, email.indexOf("@")) : "Utilizador";
|
||||
String userType = isGuardianMode ? "guardian" : "user";
|
||||
|
||||
Map<String, Object> userData = new HashMap<>();
|
||||
@@ -430,24 +277,24 @@ public class LoginActivity extends AppCompatActivity {
|
||||
.putString("user_name", name)
|
||||
.apply();
|
||||
|
||||
saveAccountLocally(email, name, "", userType);
|
||||
|
||||
if ("guardian".equals(userType)) {
|
||||
redirectToInviteCode();
|
||||
Intent intent = new Intent(LoginActivity.this, InviteCodeActivity.class);
|
||||
intent.putExtra("is_guardian", true);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
redirectToApp();
|
||||
}
|
||||
})
|
||||
.addOnFailureListener(e -> {
|
||||
Toast.makeText(this, "Erro ao criar perfil: " + e.getMessage(), Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
Toast.makeText(this, "Erro ao criar perfil: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
btnLogin.setEnabled(true);
|
||||
});
|
||||
}
|
||||
})
|
||||
.addOnFailureListener(e -> {
|
||||
Toast.makeText(this, "Erro ao carregar dados do utilizador: " + e.getMessage(), Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
Toast.makeText(this, "Erro ao carregar dados do utilizador: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
btnLogin.setEnabled(true);
|
||||
});
|
||||
}
|
||||
@@ -459,13 +306,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||
finish();
|
||||
}
|
||||
|
||||
private void redirectToInviteCode() {
|
||||
Intent intent = new Intent(this, InviteCodeActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
private void showForgotPasswordDialog() {
|
||||
View dialogView = getLayoutInflater().inflate(android.R.layout.simple_list_item_1, null);
|
||||
EditText emailInput = new EditText(this);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.example.bem;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class WeatherResponse {
|
||||
@SerializedName("current_weather")
|
||||
public CurrentWeather currentWeather;
|
||||
|
||||
public static class CurrentWeather {
|
||||
@SerializedName("temperature")
|
||||
public double temperature;
|
||||
|
||||
@SerializedName("weathercode")
|
||||
public int weatherCode;
|
||||
|
||||
@SerializedName("time")
|
||||
public String time;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.example.bem;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface WeatherService {
|
||||
@GET("v1/forecast?current_weather=true")
|
||||
Call<WeatherResponse> getCurrentWeather(
|
||||
@Query("latitude") double latitude,
|
||||
@Query("longitude") double longitude);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#E3F2FD" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#90CAF9" />
|
||||
</shape>
|
||||
@@ -1,9 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/white" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#E0E0E0" />
|
||||
android:color="#80FFFFFF" />
|
||||
</shape>
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#F0F0F0" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0E0E0" />
|
||||
</shape>
|
||||
@@ -1,13 +0,0 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="@color/guardian_purple_end"
|
||||
android:startColor="@color/guardian_purple_start" />
|
||||
<corners android:radius="24dp" />
|
||||
</shape>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:startColor="@color/login_bg_start"
|
||||
android:endColor="@color/login_bg_end"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners android:radius="12dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0E0E0" />
|
||||
</shape>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/accent" />
|
||||
<size
|
||||
android:width="4dp"
|
||||
android:height="40dp" />
|
||||
<corners android:radius="10dp"/>
|
||||
</shape>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#55FFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#FFFFFF" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,9 +1,74 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
|
||||
@@ -1,12 +1,30 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Negative offsets zoom the image in beyond the bounds -->
|
||||
<item
|
||||
android:bottom="-15dp"
|
||||
android:left="-15dp"
|
||||
android:right="-15dp"
|
||||
android:top="-15dp">
|
||||
<bitmap
|
||||
android:src="@drawable/logo_bem"
|
||||
android:gravity="fill" />
|
||||
</item>
|
||||
</layer-list>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 313 KiB |
23
app/src/main/res/drawable/logo_bem_temp.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/primary" />
|
||||
<size
|
||||
android:width="100dp"
|
||||
android:height="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="20dp"
|
||||
android:left="20dp"
|
||||
android:right="20dp"
|
||||
android:top="20dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
android:layout_marginTop="32dp"
|
||||
android:hint="Código de 6 dígitos"
|
||||
android:inputType="number"
|
||||
android:maxLength="8"
|
||||
android:maxLength="6"
|
||||
android:textAlignment="center"
|
||||
android:textSize="20sp" />
|
||||
|
||||
|
||||
@@ -2,125 +2,109 @@
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_login_gradient"
|
||||
android:background="@color/background_surface"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp">
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:src="@drawable/logo_bem"
|
||||
android:elevation="8dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:src="@drawable/logo_bem_temp"
|
||||
android:contentDescription="Logo Bem+" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bem+"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStoredAccounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="Contas Guardadas"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/storedAccountsContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:visibility="gone" />
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:text="Cuidados de Saúde para Idosos"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textLoginType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="Bem-vindo de volta"
|
||||
android:text="Login de Utilizador"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputEmail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_new_input"
|
||||
android:background="@drawable/bg_search"
|
||||
android:hint="Email"
|
||||
android:inputType="textEmailAddress"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textColorHint="@color/text_hint"
|
||||
android:textSize="15sp"
|
||||
android:elevation="2dp" />
|
||||
android:textSize="15sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_new_input"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_search"
|
||||
android:hint="Palavra-passe"
|
||||
android:inputType="textPassword"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textColorHint="@color/text_hint"
|
||||
android:textSize="15sp"
|
||||
android:elevation="2dp" />
|
||||
android:textSize="15sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_new_input"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_search"
|
||||
android:hint="Nome completo"
|
||||
android:inputType="textPersonName"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textColorHint="@color/text_hint"
|
||||
android:textSize="15sp"
|
||||
android:elevation="2dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/inputPhone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_new_input"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_search"
|
||||
android:hint="Número de telemóvel (opcional)"
|
||||
android:inputType="phone"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textColorHint="@color/text_hint"
|
||||
android:textSize="15sp"
|
||||
android:elevation="2dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textForgotPassword"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="end"
|
||||
android:text="Esqueceu-se da password?"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
android:text="Esqueci-me da palavra-passe"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnLogin"
|
||||
@@ -133,33 +117,30 @@
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:elevation="4dp" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSwitchMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:padding="8dp"
|
||||
android:text="Não tem conta? Registar"
|
||||
android:textColor="@color/primary_soft"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="32dp"
|
||||
android:background="#1A000000" />
|
||||
android:layout_marginVertical="24dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSwitchToGuardian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:padding="12dp"
|
||||
android:text="🔒 Sou Responsável"
|
||||
android:textColor="@color/guardian_purple_end"
|
||||
android:textSize="14sp"
|
||||
|
||||
@@ -20,19 +20,16 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profileButton"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/bg_avatar"
|
||||
android:padding="10dp"
|
||||
android:cropToPadding="false"
|
||||
android:scaleType="fitCenter"
|
||||
android:elevation="8dp"
|
||||
android:src="@drawable/logo_bem"
|
||||
android:padding="12dp"
|
||||
android:src="@mipmap/ic_launcher_round"
|
||||
android:contentDescription="Perfil"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app.layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomBar"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ImageView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@drawable/logo_bem"
|
||||
android:src="@mipmap/ic_launcher_round"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<!-- Header / Avatar Area -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="24dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgProfileAvatar"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/bg_circle_avatar"
|
||||
android:backgroundTint="@color/theme_blue_bg"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/logo_bem"
|
||||
app:tint="@color/theme_blue_primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textProfileName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Utilizador"
|
||||
android:textColor="@color/theme_black_primary"
|
||||
android:textSize="22sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textProfileEmail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="email@exemplo.com"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider"
|
||||
android:layout_marginBottom="24dp" />
|
||||
|
||||
<!-- No theme button here as per user request -->
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnProfileSupport"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_help"
|
||||
app:tint="@color/theme_blue_primary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="Suporte"
|
||||
android:textColor="@color/theme_black_primary"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Exit Guardian Mode Button -->
|
||||
<LinearLayout
|
||||
android:id="@+id/btnProfileExitGuardian"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="12dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_revert"
|
||||
app:tint="@color/guardian_purple_start" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="Sair do Modo Responsável"
|
||||
android:textColor="@color/guardian_purple_start"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnProfileLogout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_lock_power_off"
|
||||
app:tint="@color/delete" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="Sair da Conta"
|
||||
android:textColor="@color/delete"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnProfileClose"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:backgroundTint="@color/theme_blue_bg"
|
||||
android:text="Fechar"
|
||||
android:textColor="@color/theme_blue_primary"
|
||||
android:textAllCaps="false"
|
||||
style="@style/Widget.Material3.Button" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
@@ -18,7 +17,19 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_service_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textAlarmTitle"
|
||||
@@ -37,6 +48,7 @@
|
||||
android:text="09:00 • 100mg"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
@@ -47,9 +59,9 @@
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="Editar alarme"
|
||||
android:src="@android:drawable/ic_menu_edit"
|
||||
app:tint="@color/primary" />
|
||||
android:tint="@color/primary" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
<Switch
|
||||
android:id="@+id/switchAlarm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -62,7 +74,7 @@
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="Remover alarme"
|
||||
android:src="@android:drawable/ic_menu_delete"
|
||||
app:tint="@color/delete" />
|
||||
android:tint="@color/delete" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -100,3 +112,5 @@
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:padding="2dp"
|
||||
android:minHeight="50dp"
|
||||
android:padding="4dp"
|
||||
android:minHeight="60dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_new_input"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewAvatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_avatar"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/logo_bem" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewOnlineStatus"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:background="@drawable/bg_circle_avatar"
|
||||
android:backgroundTint="@color/neutral_medium"
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSavedName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Nome do Utilizador"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSavedEmail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="email@exemplo.com"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnRemoveAccount"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:padding="4dp"
|
||||
android:src="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:tint="@color/neutral_medium" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,123 +2,94 @@
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_smoke"
|
||||
android:background="@color/background_surface"
|
||||
android:overScrollMode="never"
|
||||
android:fillViewport="true">
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="100dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="100dp">
|
||||
|
||||
<!-- Modern Header -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:background="@drawable/bg_header_gradient" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingTop="48dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bem+"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Os seus alarmes"
|
||||
android:textColor="@color/white"
|
||||
android:alpha="0.9"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="Gerencie as suas medicações"
|
||||
android:textColor="@color/white"
|
||||
android:alpha="0.7"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Weather removed from here and moved to Reminders tab -->
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingEnd="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-30dp"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:orientation="vertical">
|
||||
android:background="@drawable/bg_header_gradient"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<!-- Action Row (Title + Button) -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardBackgroundColor="@color/white">
|
||||
android:text="Bem+"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="12dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Lista de Alarmes"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAddAlarm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/bg_new_button"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:text="+ Novo"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- List -->
|
||||
<LinearLayout
|
||||
android:id="@+id/alarmListContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp" />
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Alarmes personalizáveis e fáceis de gerir"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Alarmes de Saúde"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAddAlarm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_new_button"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:text="+ Novo"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/alarmListContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -1,56 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background_surface"
|
||||
android:fillViewport="true">
|
||||
android:overScrollMode="never"
|
||||
android:paddingBottom="32dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp"
|
||||
android:paddingBottom="120dp">
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingEnd="24dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Histórico"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="24sp"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="Registo de medicação tomada"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Calendar Card -->
|
||||
<!-- Calendar Container -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Month Title -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="12dp">
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textMonthTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Março 2026"
|
||||
android:text="Dezembro 2024"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
@@ -62,40 +63,102 @@
|
||||
android:tint="@color/primary" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Weekday Headers - 7 equal TextViews in a TableRow-like layout -->
|
||||
<!-- Weekday Headers -->
|
||||
<LinearLayout
|
||||
android:id="@+id/weekdayHeaders"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<!-- 7 headers added programmatically to guarantee equal width -->
|
||||
</LinearLayout>
|
||||
android:weightSum="7">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="D"
|
||||
android:textColor="@color/delete"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="S"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="T"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="Q"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="Q"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="S"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:padding="4dp"
|
||||
android:text="S"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:background="@color/divider" />
|
||||
android:layout_marginVertical="8dp"
|
||||
android:background="@color/divider"/>
|
||||
|
||||
<!-- Calendar Grid - rows added programmatically -->
|
||||
<!-- Month Grid -->
|
||||
<LinearLayout
|
||||
android:id="@+id/calendarGrid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
android:orientation="vertical">
|
||||
<!-- Rows will be added here -->
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- Legend -->
|
||||
<LinearLayout
|
||||
android:id="@+id/legendContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -103,8 +166,10 @@
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:layout_marginBottom="8dp" />
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<!-- Legend items added programmatically -->
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -3,78 +3,176 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:background="@color/background_surface"
|
||||
android:overScrollMode="never"
|
||||
android:paddingBottom="80dp">
|
||||
android:paddingBottom="32dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingEnd="24dp">
|
||||
|
||||
<!-- Header: Minimalist Patient Info -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="32dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btnRefreshGuardian"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@android:drawable/stat_notify_sync"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:tint="@color/theme_blue_primary" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bem+"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="Cuidados de Saúde para idosos"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_guardian_hero"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPatientName"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/theme_black_primary"
|
||||
android:textSize="22sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPatientStatus"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Controlo de Medicação"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="Monitorização para responsáveis"
|
||||
android:textColor="@color/reminder_info_bg"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@android:drawable/ic_lock_lock"
|
||||
android:tint="@android:color/white" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Tomados"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTakenCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="0"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pendentes"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPendingCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="0"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Adesão"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textAdherenceRate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="0%"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Summary Status Section -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Estado Geral"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp"
|
||||
android:textAllCaps="true"
|
||||
android:letterSpacing="0.1"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cardStatusDashboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:backgroundTint="@color/theme_blue_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp"
|
||||
android:layout_marginBottom="32dp">
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -83,136 +181,512 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iconStatus"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/checkbox_on_background"
|
||||
app:tint="@color/status_taken" />
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:src="@android:drawable/ic_menu_recent_history"
|
||||
android:tint="@color/neutral_dark" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatusTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="Tudo em ordem"
|
||||
android:textColor="@color/theme_blue_primary"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Status de hoje"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatusDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="As medicações estão a ser tomadas conforme o planeado."
|
||||
android:textColor="@color/theme_blue_secondary"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Adherence Timeline / Daily History -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Histórico de Hoje"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp"
|
||||
android:textAllCaps="true"
|
||||
android:letterSpacing="0.1"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/medicationStatusList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="32dp">
|
||||
<!-- Items like: [Med Name] - [Time] - [Check Mark] -->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Next Medication Card - Simplified -->
|
||||
<LinearLayout
|
||||
android:id="@+id/cardNextMedication"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:backgroundTint="@color/theme_purple_bg"
|
||||
android:padding="20dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textNextTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--:--"
|
||||
android:textColor="@color/theme_purple_primary"
|
||||
android:textSize="24sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:id="@+id/statusContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textNextTitle"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Próxima Toma"
|
||||
android:textColor="@color/theme_purple_primary"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textNextDetail"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Aspirina"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="09:00 • 100mg"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="Pendente"
|
||||
android:textColor="@color/guardian_purple_end"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="12dp"
|
||||
android:background="@color/guardian_card_border" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/theme_purple_secondary"
|
||||
android:textSize="14sp" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Vitamina D"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="14:00 • 1 comprimido"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="Pendente"
|
||||
android:textColor="@color/guardian_purple_end"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="12dp"
|
||||
android:background="@color/guardian_card_border" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ómega 3"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="21:00 • 1 cápsula"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:text="Pendente"
|
||||
android:textColor="@color/guardian_purple_end"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- Managed Guardians Section -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="12dp">
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:padding="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Equipa de Cuidado"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp"
|
||||
android:textAllCaps="true"
|
||||
android:letterSpacing="0.1" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnAddGuardian"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Última semana"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="Resumo de adesão"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_week"
|
||||
android:tint="@color/neutral_medium" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+ Adicionar"
|
||||
android:textColor="@color/theme_blue_primary"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Medicamentos tomados"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="0"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="de 21 esperados"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_guardian_chip"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Taxa de adesão"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="0%"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="últimos 7 dias"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/guardianListContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<!-- Dynamic Guardian Items -->
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="18dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Medicamentos"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_new_button"
|
||||
android:paddingHorizontal="18dp"
|
||||
android:text="+ Adicionar"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Aspirina"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="09:00 • 100mg"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_delete"
|
||||
android:tint="@color/delete" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/guardian_card_border" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Vitamina D"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="14:00 • 1 comprimido"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_delete"
|
||||
android:tint="@color/delete" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/guardian_card_border" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ómega 3"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="21:00 • 1 cápsula"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_delete"
|
||||
android:tint="@color/delete" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_guardian_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="18dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Responsáveis"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_new_button"
|
||||
android:paddingHorizontal="18dp"
|
||||
android:text="+ Adicionar"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="@drawable/bg_reminder_info_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Maria Silva"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Filha"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@android:drawable/ic_delete"
|
||||
android:tint="@color/delete" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="+351 912 345 678"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="maria.silva@email.com"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
@@ -3,295 +3,207 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_smoke"
|
||||
android:background="@color/background_surface"
|
||||
android:overScrollMode="never"
|
||||
android:fillViewport="true">
|
||||
android:paddingBottom="32dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="32dp">
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingEnd="24dp">
|
||||
|
||||
<!-- Modern Header with Weather -->
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- Gradient Background -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dp"
|
||||
android:background="@drawable/bg_header_gradient" />
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_header_gradient"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingTop="48dp"
|
||||
android:paddingBottom="24dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Top Row: Logo/Title -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bem+"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textGreeting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bom dia"
|
||||
android:textColor="@color/white"
|
||||
android:alpha="0.9"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
android:text="Bem+"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="O seu assistente diário"
|
||||
android:textColor="@color/white"
|
||||
android:alpha="0.8"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Weather Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="8dp"
|
||||
app:cardBackgroundColor="@color/white">
|
||||
|
||||
<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="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTemperature"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--°C"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textCondition"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@android:drawable/ic_menu_mylocation"
|
||||
android:tint="@color/primary"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textLocation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="Localização"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageWeatherIcon"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:src="@android:drawable/ic_menu_view"
|
||||
android:tint="@color/accent"
|
||||
android:alpha="0.8"/>
|
||||
<!-- Placeholder icon, logic can swap this drawable or hide tint if real image -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
android:text="Cuidados de Saúde para idosos"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- Content Area -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_reminder_hero"
|
||||
android:minHeight="140dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bom dia"
|
||||
android:textColor="@color/background_surface"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Lembretes Inteligentes"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="Portugal • 22°C • Ensolarado"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingTop="8dp">
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@android:drawable/ic_menu_my_calendar"
|
||||
android:tint="@color/primary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="Sugestões do Dia"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Dicas para hoje"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Daily Tip 1 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="@color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/bg_pill_accent"
|
||||
android:backgroundTint="@color/accent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTipTitle1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Clima"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTipDesc1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text=""
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Daily Tip 2 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="@color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/bg_pill_accent"
|
||||
android:backgroundTint="@color/primary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTipTitle2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Saúde"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTipDesc2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Mantenha-se hidratado."
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Default "Safe" Message -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_reminder_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Tenha um excelente dia!"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_hint"/>
|
||||
android:text="Dia Perfeito"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Tempo ideal. Faça uma caminhada no parque."
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_reminder_card"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Ar Fresco"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Abra as janelas para arejar a casa."
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_reminder_card"
|
||||
android:gravity="center_horizontal"
|
||||
android:minHeight="120dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@android:drawable/ic_menu_gallery"
|
||||
android:tint="@color/primary" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="Sem lembretes urgentes"
|
||||
android:textColor="@color/neutral_dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android.layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Relaxe e aproveite o dia"
|
||||
android:textColor="@color/neutral_medium"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 754 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
@@ -3,53 +3,21 @@
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
<color name="primary">#48C090</color> <!-- Soft Green from logo -->
|
||||
<color name="primary_dark">#2E7D5E</color>
|
||||
<color name="accent">#FFAB73</color> <!-- Soft Orange from logo -->
|
||||
|
||||
<color name="primary_light_bg">#F2FCF8</color>
|
||||
<color name="primary_light">#B6E6D2</color>
|
||||
<color name="primary">#00B894</color>
|
||||
<color name="accent">#5FE0C5</color>
|
||||
<color name="primary_light_bg">#E6F8F5</color>
|
||||
<color name="neutral_dark">#1E2A28</color>
|
||||
<color name="neutral_medium">#5E7671</color>
|
||||
<color name="background_surface">#F5FAF8</color>
|
||||
<color name="divider">#E8F2ED</color>
|
||||
|
||||
<color name="background_surface">#EEFFF7</color>
|
||||
<color name="divider">#D7E8E1</color>
|
||||
<color name="card_shadow">#14000000</color>
|
||||
<color name="delete">#FF6F6F</color>
|
||||
|
||||
<color name="reminder_blue_start">#48C090</color>
|
||||
<color name="reminder_blue_end">#81D4B3</color>
|
||||
<color name="reminder_card_border">#D6F2E5</color>
|
||||
<color name="reminder_info_bg">#F2FCF8</color>
|
||||
|
||||
<color name="guardian_purple_start">#FFAB73</color>
|
||||
<color name="guardian_purple_end">#FFCBA6</color>
|
||||
<color name="guardian_card_border">#FFE5D3</color>
|
||||
<color name="guardian_chip_bg">#FFF4EB</color>
|
||||
|
||||
<!-- Redesign Colors -->
|
||||
<color name="login_bg_start">#FFAB73</color> <!-- Orange Start -->
|
||||
<color name="login_bg_end">#48C090</color> <!-- Green End -->
|
||||
<color name="primary_soft">#81D4B3</color>
|
||||
<color name="text_hint">#90A4AE</color>
|
||||
<color name="white_smoke">#F5F5F5</color>
|
||||
|
||||
<!-- Theme: Dark Blue (Minimalist) -->
|
||||
<color name="theme_blue_primary">#1A237E</color>
|
||||
<color name="theme_blue_secondary">#3F51B5</color>
|
||||
<color name="theme_blue_bg">#E8EAF6</color>
|
||||
|
||||
<!-- Theme: Purple (Modern) -->
|
||||
<color name="theme_purple_primary">#4A148C</color>
|
||||
<color name="theme_purple_secondary">#7B1FA2</color>
|
||||
<color name="theme_purple_bg">#F3E5F5</color>
|
||||
|
||||
<!-- Theme: Black (Sleek) -->
|
||||
<color name="theme_black_primary">#212121</color>
|
||||
<color name="theme_black_secondary">#424242</color>
|
||||
<color name="theme_black_bg">#FAFAFA</color>
|
||||
|
||||
<color name="status_taken">#4CAF50</color>
|
||||
<color name="status_pending">#FFC107</color>
|
||||
<color name="status_missed">#F44336</color>
|
||||
<color name="reminder_blue_start">#00C7FF</color>
|
||||
<color name="reminder_blue_end">#0084FF</color>
|
||||
<color name="reminder_card_border">#D2E5FA</color>
|
||||
<color name="reminder_info_bg">#EAF4FF</color>
|
||||
<color name="guardian_purple_start">#B968FF</color>
|
||||
<color name="guardian_purple_end">#7A55FF</color>
|
||||
<color name="guardian_card_border">#E4D8FF</color>
|
||||
<color name="guardian_chip_bg">#F9F2FF</color>
|
||||
</resources>
|
||||
@@ -1,9 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">Bem+</string>
|
||||
<string name="delete_alarm">Eliminar alarme</string>
|
||||
<string name="no_alarms_message">Sem alarmes. Toque em \"+ Novo\" para criar um.</string>
|
||||
<string name="taken_confirmed">✓ Tomado</string>
|
||||
<string name="confirm_medication">✓ Confirmar</string>
|
||||
<string name="online_updated_now">Online • Atualizado agora</string>
|
||||
<string name="pending_status">⚠ Pendente</string>
|
||||
</resources>
|
||||
@@ -9,10 +9,6 @@ activity = "1.11.0"
|
||||
constraintlayout = "2.2.1"
|
||||
firebaseAuth = "24.0.1"
|
||||
|
||||
retrofit = "2.9.0"
|
||||
gson = "2.10.1"
|
||||
playServicesLocation = "21.0.1"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
@@ -22,10 +18,6 @@ material = { group = "com.google.android.material", name = "material", version.r
|
||||
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" }
|
||||
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
|
||||
converter-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit" }
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
||||