diff --git a/app/src/main/java/com/fluxup/app/DailyProgress.java b/app/src/main/java/com/fluxup/app/DailyProgress.java new file mode 100644 index 0000000..b2541b5 --- /dev/null +++ b/app/src/main/java/com/fluxup/app/DailyProgress.java @@ -0,0 +1,31 @@ +package com.fluxup.app; + +public class DailyProgress { + public String date; + public int completedTasks; + public int dailyGoal; + public int focusSessions; + public int xp; + public String status; // "complete", "partial", "empty" + + public DailyProgress() {} + + public DailyProgress(String date, int dailyGoal) { + this.date = date; + this.dailyGoal = dailyGoal; + this.completedTasks = 0; + this.focusSessions = 0; + this.xp = 0; + this.status = "empty"; + } + + public void updateStatus() { + if (completedTasks >= dailyGoal && dailyGoal > 0) { + status = "complete"; + } else if (completedTasks > 0) { + status = "partial"; + } else { + status = "empty"; + } + } +} diff --git a/app/src/main/java/com/fluxup/app/InicioFragment.java b/app/src/main/java/com/fluxup/app/InicioFragment.java index ce5455b..3b90707 100644 --- a/app/src/main/java/com/fluxup/app/InicioFragment.java +++ b/app/src/main/java/com/fluxup/app/InicioFragment.java @@ -628,20 +628,21 @@ public class InicioFragment extends Fragment { int dailyTaskGoal = (dp != null && dp.dailyGoal > 0) ? dp.dailyGoal : 3; if (dailyTaskGoal <= 0) dailyTaskGoal = 3; + // LÓGICA DE STATUS SOLICITADA String status = "empty"; if (completedTasksForDay >= dailyTaskGoal) { status = "completed"; } else if (isToday) { status = "today"; - } else if (completedTasksForDay > 0) { - status = "partial"; } - android.util.Log.d("FLUXUP_DEBUG", "WEEK_DAY_DATE: " + dateStr); - android.util.Log.d("FLUXUP_DEBUG", "COMPLETED_TASKS_FOR_DAY: " + completedTasksForDay); - android.util.Log.d("FLUXUP_DEBUG", "DAILY_TASK_GOAL: " + dailyTaskGoal); + // DEBUG LOGS + android.util.Log.d("FLUXUP_DEBUG", "WEEK_DAY: " + i); + android.util.Log.d("FLUXUP_DEBUG", "DATE: " + dateStr); + android.util.Log.d("FLUXUP_DEBUG", "COMPLETED_TASKS: " + completedTasksForDay); + android.util.Log.d("FLUXUP_DEBUG", "DAILY_GOAL: " + dailyTaskGoal); android.util.Log.d("FLUXUP_DEBUG", "IS_TODAY: " + isToday); - android.util.Log.d("FLUXUP_DEBUG", "DAY_STATUS: " + status); + android.util.Log.d("FLUXUP_DEBUG", "FINAL_STATUS: " + status); // RENDERIZAÇÃO if ("completed".equals(status)) { @@ -651,7 +652,10 @@ public class InicioFragment extends Fragment { // Verificação para conector verde (dia seguinte também completo) Calendar nextDayCal = (Calendar) dayCal.clone(); nextDayCal.add(Calendar.DAY_OF_YEAR, 1); - DailyProgress nextDp = progressMap.get(sdf.format(nextDayCal.getTime())); + String nextDateStr = sdf.format(nextDayCal.getTime()); + DailyProgress nextDp = progressMap.get(nextDateStr); + + // Se o próximo dia também estiver completo, conector verde if (nextDp != null && nextDp.completedTasks >= nextDp.dailyGoal && nextDp.dailyGoal > 0) { rightConnector.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.success_green)); } else { @@ -662,11 +666,8 @@ public class InicioFragment extends Fragment { nodeCircle.getBackground().setTint(ContextCompat.getColor(getContext(), R.color.primary_purple)); nodeDayInitial.setTextColor(ContextCompat.getColor(getContext(), R.color.white)); if (rightConnector != null) rightConnector.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.border_color)); - } else if ("partial".equals(status)) { - nodeCircle.getBackground().setTint(android.graphics.Color.parseColor("#4FC3F7")); - nodeDayInitial.setTextColor(ContextCompat.getColor(getContext(), R.color.white)); - if (rightConnector != null) rightConnector.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.border_color)); } else { + // Estado Empty ou Incompleto (cinzento) nodeCircle.getBackground().setTint(android.graphics.Color.parseColor("#E0E0E0")); nodeDayInitial.setTextColor(ContextCompat.getColor(getContext(), R.color.text_primary)); if (rightConnector != null) rightConnector.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.border_color)); @@ -677,7 +678,11 @@ public class InicioFragment extends Fragment { nodeDayLabel.setVisibility(View.VISIBLE); nodeDayLabel.setTextColor(ContextCompat.getColor(getContext(), R.color.primary_purple)); nodeProgress.setVisibility(View.VISIBLE); - nodeProgress.setProgress(completedTasksForDay * 100 / dailyTaskGoal); + if (dailyTaskGoal > 0) { + nodeProgress.setProgress(completedTasksForDay * 100 / dailyTaskGoal); + } else { + nodeProgress.setProgress(0); + } } else { nodeDayLabel.setVisibility(View.GONE); nodeProgress.setVisibility(View.GONE); diff --git a/app/src/main/java/com/fluxup/app/LeagueHelper.java b/app/src/main/java/com/fluxup/app/LeagueHelper.java new file mode 100644 index 0000000..d84ebac --- /dev/null +++ b/app/src/main/java/com/fluxup/app/LeagueHelper.java @@ -0,0 +1,52 @@ +package com.fluxup.app; + +import android.graphics.Color; + +public class LeagueHelper { + + public static class LeagueInfo { + public String name; + public int minXp; + public int maxXp; + public int iconRes; + public String colorHex; + public String rewards; + + public LeagueInfo(String name, int minXp, int maxXp, int iconRes, String colorHex, String rewards) { + this.name = name; + this.minXp = minXp; + this.maxXp = maxXp; + this.iconRes = iconRes; + this.colorHex = colorHex; + this.rewards = rewards; + } + } + + public static final LeagueInfo[] LEAGUES = { + new LeagueInfo("Bronze", 0, 499, R.drawable.ic_trophy_bronze, "#8D6E63", "• Badge Bronze"), + new LeagueInfo("Prata", 500, 1499, R.drawable.ic_trophy_silver, "#B0BEC5", "• Badge Prata\n• Moldura Simples"), + new LeagueInfo("Ouro", 1500, 2999, R.drawable.ic_trophy_gold, "#FFD54F", "• Badge Ouro\n• Moldura Dourada"), + new LeagueInfo("Platina", 3000, 5999, R.drawable.ic_trophy_platinum, "#4FC3F7", "• Badge Platina\n• Tema Azul"), + new LeagueInfo("Diamante", 6000, 9999, R.drawable.ic_trophy_diamond, "#1E88E5", "• Badge Diamante\n• Moldura Diamante"), + new LeagueInfo("Mestre", 10000, 14999, R.drawable.ic_trophy_master, "#7C3AED", "• Badge Mestre\n• Tema Roxo Premium"), + new LeagueInfo("Lenda", 15000, Integer.MAX_VALUE, R.drawable.ic_trophy_legend, "#D81B60", "• Badge Lenda\n• Moldura Lendária") + }; + + public static LeagueInfo getCurrentLeague(int totalXp) { + for (int i = LEAGUES.length - 1; i >= 0; i--) { + if (totalXp >= LEAGUES[i].minXp) { + return LEAGUES[i]; + } + } + return LEAGUES[0]; + } + + public static LeagueInfo getNextLeague(int totalXp) { + for (int i = 0; i < LEAGUES.length - 1; i++) { + if (totalXp < LEAGUES[i + 1].minXp) { + return LEAGUES[i + 1]; + } + } + return null; + } +} diff --git a/app/src/main/res/drawable/button_secondary.xml b/app/src/main/res/drawable/button_secondary.xml new file mode 100644 index 0000000..1e303d9 --- /dev/null +++ b/app/src/main/res/drawable/button_secondary.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_arrow_right.xml b/app/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 0000000..1567ff4 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_trophy_diamond.xml b/app/src/main/res/drawable/ic_trophy_diamond.xml new file mode 100644 index 0000000..8ba1bfd --- /dev/null +++ b/app/src/main/res/drawable/ic_trophy_diamond.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_trophy_legend.xml b/app/src/main/res/drawable/ic_trophy_legend.xml new file mode 100644 index 0000000..e96137f --- /dev/null +++ b/app/src/main/res/drawable/ic_trophy_legend.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_trophy_master.xml b/app/src/main/res/drawable/ic_trophy_master.xml new file mode 100644 index 0000000..c443d5b --- /dev/null +++ b/app/src/main/res/drawable/ic_trophy_master.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_trophy_platinum.xml b/app/src/main/res/drawable/ic_trophy_platinum.xml new file mode 100644 index 0000000..5c68891 --- /dev/null +++ b/app/src/main/res/drawable/ic_trophy_platinum.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/item_division_card.xml b/app/src/main/res/layout/item_division_card.xml new file mode 100644 index 0000000..6e609ed --- /dev/null +++ b/app/src/main/res/layout/item_division_card.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + +