diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml
index 05c51b5..dbc65bb 100644
--- a/.idea/caches/deviceStreaming.xml
+++ b/.idea/caches/deviceStreaming.xml
@@ -580,6 +580,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -760,6 +784,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1278,6 +1314,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1664,6 +1712,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/fluxup/app/InicioFragment.java b/app/src/main/java/com/fluxup/app/InicioFragment.java
index c44ce1f..2946bb7 100644
--- a/app/src/main/java/com/fluxup/app/InicioFragment.java
+++ b/app/src/main/java/com/fluxup/app/InicioFragment.java
@@ -421,8 +421,8 @@ public class InicioFragment extends Fragment {
for (int i = 0; i < 7; i++) {
View node = LayoutInflater.from(getContext()).inflate(R.layout.item_day_node, progressPathContainer, false);
- View topConnector = node.findViewById(R.id.topConnector);
- View bottomConnector = node.findViewById(R.id.bottomConnector);
+ View leftConnector = node.findViewById(R.id.leftConnector);
+ View rightConnector = node.findViewById(R.id.rightConnector);
View nodeCircle = node.findViewById(R.id.nodeCircle);
TextView nodeDayInitial = node.findViewById(R.id.nodeDayInitial);
TextView nodeDayLabel = node.findViewById(R.id.nodeDayLabel);
@@ -432,8 +432,8 @@ public class InicioFragment extends Fragment {
nodeDayInitial.setText(initials[i]);
// Hide connectors at ends
- if (i == 0) topConnector.setVisibility(View.INVISIBLE);
- if (i == 6) bottomConnector.setVisibility(View.INVISIBLE);
+ if (i == 0) leftConnector.setVisibility(View.INVISIBLE);
+ if (i == 6) rightConnector.setVisibility(View.INVISIBLE);
// Style based on state
if (i < currentDayIndex) {
diff --git a/app/src/main/java/com/fluxup/app/ProfileFragment.java b/app/src/main/java/com/fluxup/app/ProfileFragment.java
index 5579369..b125dc7 100644
--- a/app/src/main/java/com/fluxup/app/ProfileFragment.java
+++ b/app/src/main/java/com/fluxup/app/ProfileFragment.java
@@ -18,7 +18,8 @@ import com.google.firebase.firestore.ListenerRegistration;
public class ProfileFragment extends Fragment {
- private TextView tvProfileName, tvProfileTitle, tvProfileBio;
+ private TextView tvProfileName, tvProfileHandle, tvProfileSince, tvProfileBio;
+ private TextView tvStatTopXP, tvStatFollowing, tvStatFollowers, tvStatActiveDays;
private GridLayout badgesGrid;
private LinearLayout friendsListContainer;
private ListenerRegistration userListener, friendsListener;
@@ -39,8 +40,13 @@ public class ProfileFragment extends Fragment {
private void initViews(View view) {
tvProfileName = view.findViewById(R.id.tvProfileName);
- tvProfileTitle = view.findViewById(R.id.tvProfileTitle);
+ tvProfileHandle = view.findViewById(R.id.tvProfileHandle);
+ tvProfileSince = view.findViewById(R.id.tvProfileSince);
tvProfileBio = view.findViewById(R.id.tvProfileBio);
+ tvStatTopXP = view.findViewById(R.id.tvStatTopXP);
+ tvStatFollowing = view.findViewById(R.id.tvStatFollowing);
+ tvStatFollowers = view.findViewById(R.id.tvStatFollowers);
+ tvStatActiveDays = view.findViewById(R.id.tvStatActiveDays);
badgesGrid = view.findViewById(R.id.badgesGrid);
friendsListContainer = view.findViewById(R.id.friendsListContainer);
}
@@ -50,13 +56,18 @@ public class ProfileFragment extends Fragment {
startActivity(new Intent(getActivity(), SettingsActivity.class));
});
- view.findViewById(R.id.btnManageFriends).setOnClickListener(v -> {
- startActivity(new Intent(getActivity(), MyFriendsActivity.class));
- });
-
- view.findViewById(R.id.btnViewStatsDetails).setOnClickListener(v -> {
- startActivity(new Intent(getActivity(), StatisticsActivity.class));
- });
+ View btnAddFriends = view.findViewById(R.id.btnAddFriends);
+ if (btnAddFriends != null) {
+ btnAddFriends.setOnClickListener(v -> startActivity(new Intent(getActivity(), MyFriendsActivity.class)));
+ }
+ View btnViewAllFriends = view.findViewById(R.id.btnViewAllFriends);
+ if (btnViewAllFriends != null) {
+ btnViewAllFriends.setOnClickListener(v -> startActivity(new Intent(getActivity(), MyFriendsActivity.class)));
+ }
+ View btnFindFriends = view.findViewById(R.id.btnFindFriends);
+ if (btnFindFriends != null) {
+ btnFindFriends.setOnClickListener(v -> startActivity(new Intent(getActivity(), MyFriendsActivity.class)));
+ }
view.findViewById(R.id.btnLogout).setOnClickListener(v -> {
AuthManager.getInstance().logout();
@@ -73,20 +84,26 @@ public class ProfileFragment extends Fragment {
if (getContext() == null || view == null) return;
updateStats(view, user);
tvProfileName.setText(user.usuario);
- tvProfileBio.setText(user.bio.isEmpty() ? "Sem bio definida." : user.bio);
- tvProfileTitle.setText(determineTitle(user));
+ tvProfileHandle.setText(user.handle);
+ String year = (user.created_at != null && user.created_at.length() >= 4) ? user.created_at.substring(0, 4) : "2024";
+ tvProfileSince.setText("Aqui desde " + year);
+ tvProfileBio.setText(user.bio == null || user.bio.isEmpty() ? "Sem bio definida." : user.bio);
+
+ tvStatTopXP.setText(String.valueOf(user.xp));
+ tvStatFollowing.setText(String.valueOf(user.following));
+ tvStatFollowers.setText(String.valueOf(user.followers));
+ tvStatActiveDays.setText(String.valueOf(user.dias_ativos));
+
renderBadges(user);
});
}
}
private void updateStats(View view, Usuario user) {
- setStat(view.findViewById(R.id.statXP), "⚡", String.valueOf(user.xp), "Total XP");
setStat(view.findViewById(R.id.statStreak), "🔥", String.valueOf(user.streak), "Ofensiva");
- setStat(view.findViewById(R.id.statLevel), "⭐", String.valueOf(user.level), "Nível");
- setStat(view.findViewById(R.id.statTasks), "✅", String.valueOf(user.total_tasks_concluidas), "Tarefas");
+ setStat(view.findViewById(R.id.statLeague), "🏆", user.league != null ? user.league : "Bronze", "Liga");
+ setStat(view.findViewById(R.id.statXP), "⚡", String.valueOf(user.xp), "Total XP");
setStat(view.findViewById(R.id.statFocusTime), "⏱️", user.tempo_foco_total + "m", "Foco");
- setStat(view.findViewById(R.id.statSessions), "🎯", String.valueOf(user.sessoes_foco_completas), "Sessões");
}
private void setStat(View statView, String icon, String value, String label) {
diff --git a/app/src/main/java/com/fluxup/app/TrophiesActivity.java b/app/src/main/java/com/fluxup/app/TrophiesActivity.java
index 517260e..810abaa 100644
--- a/app/src/main/java/com/fluxup/app/TrophiesActivity.java
+++ b/app/src/main/java/com/fluxup/app/TrophiesActivity.java
@@ -74,7 +74,7 @@ public class TrophiesActivity extends AppCompatActivity {
tvLeagueTimeRemaining.setText(daysLeft + " dias " + hoursLeft + "h restantes");
int progress = (7 - daysLeft) * 100 / 7;
- pbWeeklyProgress.setProgress(progress);
+ animateProgressBar(progress);
}
private void observeUserData() {
@@ -142,6 +142,13 @@ public class TrophiesActivity extends AppCompatActivity {
});
}
+ private void animateProgressBar(int progress) {
+ android.animation.ObjectAnimator animation = android.animation.ObjectAnimator.ofInt(pbWeeklyProgress, "progress", 0, progress);
+ animation.setDuration(1500);
+ animation.setInterpolator(new android.view.animation.DecelerateInterpolator());
+ animation.start();
+ }
+
private void addRankingItem(int pos, Usuario user, String myUid) {
View view = getLayoutInflater().inflate(R.layout.item_ranking_user, rankingContainer, false);
@@ -152,13 +159,26 @@ public class TrophiesActivity extends AppCompatActivity {
ImageView ivAvatar = view.findViewById(R.id.ivRankingAvatar);
androidx.cardview.widget.CardView card = view.findViewById(R.id.cardRankingUser);
- tvPos.setText("#" + pos);
+ if (pos == 1) {
+ tvPos.setText("🥇");
+ tvPos.setTextSize(18f);
+ card.setCardBackgroundColor(android.graphics.Color.parseColor("#FFFDE7")); // Light gold
+ } else if (pos == 2) {
+ tvPos.setText("🥈");
+ tvPos.setTextSize(18f);
+ } else if (pos == 3) {
+ tvPos.setText("🥉");
+ tvPos.setTextSize(18f);
+ } else {
+ tvPos.setText("#" + pos);
+ }
+
tvName.setText(user.usuario);
tvXP.setText(user.xp_semanal + " XP");
if (user.id_usuario.equals(myUid)) {
tvTu.setVisibility(View.VISIBLE);
- card.setCardBackgroundColor(getResources().getColor(R.color.background_light));
+ card.setCardBackgroundColor(android.graphics.Color.parseColor("#F3E5F5")); // Light purple
card.setCardElevation(4f);
}
@@ -177,13 +197,19 @@ public class TrophiesActivity extends AppCompatActivity {
}
private void updateUserProgressCard(int myPos, Usuario me, Usuario aboveMe) {
+ androidx.cardview.widget.CardView cardUserProgress = findViewById(R.id.cardUserProgress);
+
if (myPos <= 3) {
- tvUserRankingStatus.setText("Estás na zona de promoção! 🎉");
- tvXPToNextPosition.setText("Mantém o foco para subir de liga.");
+ tvUserRankingStatus.setText("🎉 Estás na zona de promoção!");
+ tvUserRankingStatus.setTextColor(getResources().getColor(R.color.success_green));
+ tvXPToNextPosition.setText("Mantém o foco para subir de divisão e ganhar recompensas!");
+ cardUserProgress.setCardBackgroundColor(android.graphics.Color.parseColor("#E8F5E9")); // Light green
} else {
int needed = (aboveMe != null) ? (aboveMe.xp_semanal - me.xp_semanal + 1) : 0;
tvUserRankingStatus.setText("Faltam " + needed + " XP para subires de posição");
- tvXPToNextPosition.setText("Estás em #" + myPos);
+ tvUserRankingStatus.setTextColor(getResources().getColor(R.color.text_primary));
+ tvXPToNextPosition.setText("Estás em #" + myPos + " com " + me.xp_semanal + " XP");
+ cardUserProgress.setCardBackgroundColor(getResources().getColor(R.color.white));
}
}
diff --git a/app/src/main/java/com/fluxup/app/Usuario.java b/app/src/main/java/com/fluxup/app/Usuario.java
index 59f02bf..363a48d 100644
--- a/app/src/main/java/com/fluxup/app/Usuario.java
+++ b/app/src/main/java/com/fluxup/app/Usuario.java
@@ -23,6 +23,8 @@ public class Usuario {
public String titulo = "Iniciante";
public int achievementsCount = 0;
public int trophiesCount = 0;
+ public int followers = 0;
+ public int following = 0;
public int tasks_concluidas_hoje = 0;
public int total_tasks_concluidas = 0;
public int meta_diaria_tarefas = 3;
diff --git a/app/src/main/res/layout/activity_trophies.xml b/app/src/main/res/layout/activity_trophies.xml
index bb6da03..5c4178f 100644
--- a/app/src/main/res/layout/activity_trophies.xml
+++ b/app/src/main/res/layout/activity_trophies.xml
@@ -52,31 +52,33 @@
+ android:layout_marginBottom="16dp"
+ app:cardCornerRadius="20dp"
+ app:cardBackgroundColor="@color/primary_purple"
+ app:cardElevation="4dp">
+ android:layout_marginBottom="12dp"
+ app:tint="@color/white" />
+ android:progressTint="@color/reward_yellow"
+ android:progressBackgroundTint="#4DFFFFFF" />
@@ -105,59 +108,29 @@
android:id="@+id/tvLeagueObjective"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="Fica no TOP 3 para subir para Prata"
+ android:text="🚀 Fica no TOP 3 para subir para Prata"
android:textAlignment="center"
android:textColor="@color/primary_purple"
android:textStyle="bold"
- android:textSize="16sp"
- android:layout_marginBottom="24dp"/>
-
-
-
-
-
-
-
-
-
+ app:cardElevation="2dp"
+ app:cardBackgroundColor="@color/white">
+ android:padding="20dp"
+ android:gravity="center">
+ android:textAlignment="center"
+ android:textSize="16sp"/>
+ android:textAlignment="center"
+ android:textSize="14sp"/>
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_marginBottom="16dp"/>
-
+ android:orientation="horizontal"
+ android:weightSum="3"
+ android:layout_marginBottom="32dp">
-
-
+
+
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
+ android:orientation="vertical"
+ android:padding="16dp"
+ android:gravity="center">
+
+
+
+
+
+
+ android:layout_marginBottom="32dp"
+ android:visibility="gone" />
diff --git a/app/src/main/res/layout/fragment_inicio.xml b/app/src/main/res/layout/fragment_inicio.xml
index b93132a..21eb47c 100644
--- a/app/src/main/res/layout/fragment_inicio.xml
+++ b/app/src/main/res/layout/fragment_inicio.xml
@@ -305,16 +305,23 @@
android:textSize="20sp"
android:textStyle="bold" />
-
+ android:scrollbars="none"
+ android:layout_marginBottom="24dp">
+
+
+
+ android:orientation="vertical">
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:background="@color/primary_purple"
+ android:paddingTop="32dp"
+ android:paddingBottom="24dp"
+ android:paddingHorizontal="20dp"
+ android:clipToPadding="false">
-
+ app:tint="@color/white" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_marginTop="16dp"
+ android:gravity="center"
+ android:orientation="vertical">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:padding="20dp">
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_day_node.xml b/app/src/main/res/layout/item_day_node.xml
index b8c3a6b..7680b71 100644
--- a/app/src/main/res/layout/item_day_node.xml
+++ b/app/src/main/res/layout/item_day_node.xml
@@ -1,67 +1,71 @@
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:gravity="center"
+ android:orientation="vertical">
+
+
+
+
+
+
+
+
+
+
+
+