From 82b4b72d4837b9f9d67dc4e2b11a90959e283b38 Mon Sep 17 00:00:00 2001 From: MeuNome Date: Thu, 14 May 2026 11:43:11 +0100 Subject: [PATCH] erro --- .../java/com/fluxup/app/LeagueHelper.java | 14 +- .../java/com/fluxup/app/ProfileFragment.java | 417 +++++++++++-- app/src/main/res/layout/fragment_profile.xml | 586 ++++++++++-------- app/src/main/res/layout/item_ranking_user.xml | 30 +- 4 files changed, 723 insertions(+), 324 deletions(-) diff --git a/app/src/main/java/com/fluxup/app/LeagueHelper.java b/app/src/main/java/com/fluxup/app/LeagueHelper.java index d84ebac..6ee0bef 100644 --- a/app/src/main/java/com/fluxup/app/LeagueHelper.java +++ b/app/src/main/java/com/fluxup/app/LeagueHelper.java @@ -23,13 +23,13 @@ public class LeagueHelper { } 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") + new LeagueInfo("Bronze", 0, 499, R.drawable.ic_trophy_bronze, "#8D6E63", "Estás a começar a tua jornada!"), + new LeagueInfo("Prata", 500, 1499, R.drawable.ic_trophy_silver, "#B0BEC5", "A consistência está a dar frutos."), + new LeagueInfo("Ouro", 1500, 2999, R.drawable.ic_trophy_gold, "#FFD54F", "Um verdadeiro guerreiro do foco!"), + new LeagueInfo("Platina", 3000, 4999, R.drawable.ic_trophy_platinum, "#4FC3F7", "Elite da produtividade."), + new LeagueInfo("Diamante", 5000, 7499, R.drawable.ic_trophy_diamond, "#1E88E5", "Inquebrável e imparável."), + new LeagueInfo("Mestre", 7500, 9999, R.drawable.ic_trophy_master, "#7C3AED", "Mestre absoluto da Fluxup."), + new LeagueInfo("Lenda", 10000, Integer.MAX_VALUE, R.drawable.ic_trophy_legend, "#D81B60", "Uma lenda viva da disciplina!") }; public static LeagueInfo getCurrentLeague(int totalXp) { diff --git a/app/src/main/java/com/fluxup/app/ProfileFragment.java b/app/src/main/java/com/fluxup/app/ProfileFragment.java index b125dc7..9a5be47 100644 --- a/app/src/main/java/com/fluxup/app/ProfileFragment.java +++ b/app/src/main/java/com/fluxup/app/ProfileFragment.java @@ -1,29 +1,61 @@ package com.fluxup.app; +import android.animation.ObjectAnimator; import android.content.Intent; - +import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.DecelerateInterpolator; import android.widget.ImageButton; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; +import android.widget.ImageView; +import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.FrameLayout; import android.widget.GridLayout; import android.widget.LinearLayout; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.github.mikephil.charting.charts.LineChart; +import com.github.mikephil.charting.components.XAxis; +import com.github.mikephil.charting.data.Entry; +import com.github.mikephil.charting.data.LineData; +import com.github.mikephil.charting.data.LineDataSet; +import com.github.mikephil.charting.formatter.IndexAxisValueFormatter; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.firestore.ListenerRegistration; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; + public class ProfileFragment extends Fragment { - private TextView tvProfileName, tvProfileHandle, tvProfileSince, tvProfileBio; - private TextView tvStatTopXP, tvStatFollowing, tvStatFollowers, tvStatActiveDays; + private TextView tvProfileName, tvProfileHandle; + private ImageView ivProfileAvatar, ivLeagueBadgeSmall, ivLeagueIcon; + private TextView tvUserLevel, tvXpFraction, tvLeagueName, tvLeagueMotivation, tvConsistencyPhrase; + private ProgressBar pbXpLevel; + private RecyclerView rvMiniCalendar; + private LineChart weeklyChart; private GridLayout badgesGrid; private LinearLayout friendsListContainer; + + private View statTotalTasks, statBestStreak, statFocusSessions, statTotalFocus, statDaysCompleted, statDailyAvg; + private ListenerRegistration userListener, friendsListener; private View view; + private Usuario currentUser; @Nullable @Override @@ -41,76 +73,269 @@ public class ProfileFragment extends Fragment { private void initViews(View view) { tvProfileName = view.findViewById(R.id.tvProfileName); 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); + ivProfileAvatar = view.findViewById(R.id.ivProfileAvatar); + ivLeagueBadgeSmall = view.findViewById(R.id.ivLeagueBadgeSmall); + ivLeagueIcon = view.findViewById(R.id.ivLeagueIcon); + + tvUserLevel = view.findViewById(R.id.tvUserLevel); + tvXpFraction = view.findViewById(R.id.tvXpFraction); + tvLeagueName = view.findViewById(R.id.tvLeagueName); + tvLeagueMotivation = view.findViewById(R.id.tvLeagueMotivation); + tvConsistencyPhrase = view.findViewById(R.id.tvConsistencyPhrase); + + pbXpLevel = view.findViewById(R.id.pbXpLevel); + rvMiniCalendar = view.findViewById(R.id.rvMiniCalendar); + weeklyChart = view.findViewById(R.id.weeklyChart); + badgesGrid = view.findViewById(R.id.badgesGrid); friendsListContainer = view.findViewById(R.id.friendsListContainer); + + statTotalTasks = view.findViewById(R.id.statTotalTasks); + statBestStreak = view.findViewById(R.id.statBestStreak); + statFocusSessions = view.findViewById(R.id.statFocusSessions); + statTotalFocus = view.findViewById(R.id.statTotalFocus); + statDaysCompleted = view.findViewById(R.id.statDaysCompleted); + statDailyAvg = view.findViewById(R.id.statDailyAvg); + + setupStatItems(); + } + + private void setupStatItems() { + setStatMeta(statTotalTasks, "🎯", "Tarefas"); + setStatMeta(statBestStreak, "🔥", "Recorde"); + setStatMeta(statFocusSessions, "🧠", "Sessões"); + setStatMeta(statTotalFocus, "⏱️", "Total Foco"); + setStatMeta(statDaysCompleted, "📅", "Dias"); + setStatMeta(statDailyAvg, "📈", "Média/Dia"); + } + + private void setStatMeta(View statView, String icon, String label) { + if (statView == null) return; + ((TextView) statView.findViewById(R.id.tvStatIcon)).setText(icon); + ((TextView) statView.findViewById(R.id.tvStatLabel)).setText(label); } private void setupListeners(View view) { - view.findViewById(R.id.btnEditProfile).setOnClickListener(v -> { - startActivity(new Intent(getActivity(), SettingsActivity.class)); - }); + // Edit Profile / Settings + View btnEditProfile = view.findViewById(R.id.btnEditProfile); + if (btnEditProfile != null) { + btnEditProfile.setOnClickListener(v -> { + startActivity(new Intent(getActivity(), SettingsActivity.class)); + }); + } + // Add Friends (+) View btnAddFriends = view.findViewById(R.id.btnAddFriends); if (btnAddFriends != null) { btnAddFriends.setOnClickListener(v -> startActivity(new Intent(getActivity(), MyFriendsActivity.class))); } + + // View All Friends View btnViewAllFriends = view.findViewById(R.id.btnViewAllFriends); if (btnViewAllFriends != null) { btnViewAllFriends.setOnClickListener(v -> startActivity(new Intent(getActivity(), MyFriendsActivity.class))); } + + // Find Friends (ADICIONAR AMIGOS) 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(); - Intent intent = new Intent(getActivity(), LoginActivity.class); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - }); - } + // View All Badges + View btnViewAllBadges = view.findViewById(R.id.btnViewAllBadges); + if (btnViewAllBadges != null) { + btnViewAllBadges.setOnClickListener(v -> startActivity(new Intent(getActivity(), TrophiesActivity.class))); + } - private void startObservingUser() { - FirebaseUser currentUser = AuthManager.getInstance().getCurrentUser(); - if (currentUser != null) { - userListener = FirestoreManager.getInstance().observeUser(currentUser.getUid(), user -> { - if (getContext() == null || view == null) return; - updateStats(view, user); - tvProfileName.setText(user.usuario); - 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); + // Logout + View btnLogout = view.findViewById(R.id.btnLogout); + if (btnLogout != null) { + btnLogout.setOnClickListener(v -> { + AuthManager.getInstance().logout(); + Intent intent = new Intent(getActivity(), LoginActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); }); } } - private void updateStats(View view, Usuario user) { - setStat(view.findViewById(R.id.statStreak), "🔥", String.valueOf(user.streak), "Ofensiva"); - 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"); + private void startObservingUser() { + FirebaseUser fUser = AuthManager.getInstance().getCurrentUser(); + if (fUser != null) { + userListener = FirestoreManager.getInstance().observeUser(fUser.getUid(), user -> { + if (getContext() == null || view == null || user == null) return; + this.currentUser = user; + + updateBasicInfo(user); + updateXpBar(user); + updateLeagueCard(user); + updateRealStats(user); + updateMiniCalendar(user); + updateWeeklyChart(user); + renderBadges(user); + updateMotivation(user); + }); + } } - private void setStat(View statView, String icon, String value, String label) { + private void updateBasicInfo(Usuario user) { + tvProfileName.setText(user.usuario); + tvProfileHandle.setText(user.handle); + } + + private void updateXpBar(Usuario user) { + LeagueHelper.LeagueInfo current = LeagueHelper.getCurrentLeague(user.xp); + LeagueHelper.LeagueInfo next = LeagueHelper.getNextLeague(user.xp); + + int currentLevel = calculateLevel(user.xp); + tvUserLevel.setText("Nível " + currentLevel); + + int levelStartXp = getLevelStartXp(currentLevel); + int levelEndXp = getLevelStartXp(currentLevel + 1); + int progressInLevel = user.xp - levelStartXp; + int levelXpSpan = levelEndXp - levelStartXp; + + tvXpFraction.setText(user.xp + " / " + levelEndXp + " XP"); + + int progressPercent = (int) ((progressInLevel * 100.0f) / levelXpSpan); + + // Animate Progress Bar + ObjectAnimator.ofInt(pbXpLevel, "progress", pbXpLevel.getProgress(), progressPercent) + .setDuration(1000) + .setInterpolator(new DecelerateInterpolator()) + .start(); + } + + private int calculateLevel(int totalXp) { + // Simple formula: Level = sqrt(xp/100) + return (int) Math.floor(Math.sqrt(totalXp / 50.0)) + 1; + } + + private int getLevelStartXp(int level) { + if (level <= 1) return 0; + return (int) (Math.pow(level - 1, 2) * 50); + } + + private void updateLeagueCard(Usuario user) { + LeagueHelper.LeagueInfo current = LeagueHelper.getCurrentLeague(user.xp); + LeagueHelper.LeagueInfo next = LeagueHelper.getNextLeague(user.xp); + + tvLeagueName.setText("Liga " + current.name); + ivLeagueIcon.setImageResource(current.iconRes); + ivLeagueBadgeSmall.setImageResource(current.iconRes); + + if (next != null) { + int remaining = next.minXp - user.xp; + tvLeagueMotivation.setText("Faltam " + remaining + " XP para " + next.name); + } else { + tvLeagueMotivation.setText("Estás no topo absoluto!"); + } + } + + private void updateRealStats(Usuario user) { + setStatValue(statTotalTasks, String.valueOf(user.total_tasks_concluidas)); + setStatValue(statBestStreak, String.valueOf(user.melhor_streak)); + setStatValue(statFocusSessions, String.valueOf(user.sessoes_foco_completas)); + setStatValue(statTotalFocus, formatTime(user.tempo_foco_total)); + setStatValue(statDaysCompleted, String.valueOf(user.dias_concluidos != null ? user.dias_concluidos.size() : 0)); + + int avg = user.dias_ativos > 0 ? user.tempo_foco_total / user.dias_ativos : 0; + setStatValue(statDailyAvg, avg + " min"); + } + + private void setStatValue(View statView, String value) { if (statView == null) return; - ((TextView) statView.findViewById(R.id.tvStatIcon)).setText(icon); ((TextView) statView.findViewById(R.id.tvStatValue)).setText(value); - ((TextView) statView.findViewById(R.id.tvStatLabel)).setText(label); + } + + private String formatTime(int totalMinutes) { + if (totalMinutes < 60) return totalMinutes + "m"; + int h = totalMinutes / 60; + int m = totalMinutes % 60; + if (m == 0) return h + "h"; + return h + "h " + m + "m"; + } + + private void updateMotivation(Usuario user) { + if (user.streak >= 7) { + tvConsistencyPhrase.setText("Estás imparável com " + user.streak + " dias seguidos! 🔥"); + } else if (user.streak > 0) { + tvConsistencyPhrase.setText("Continua assim! " + user.streak + " dias de foco."); + } else { + tvConsistencyPhrase.setText("Começa hoje a tua nova ofensiva! 🚀"); + } + } + + private void updateMiniCalendar(Usuario user) { + rvMiniCalendar.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); + + List last7Days = new ArrayList<>(); + Calendar cal = Calendar.getInstance(); + for (int i = 0; i < 7; i++) { + last7Days.add(cal.getTime()); + cal.add(Calendar.DAY_OF_YEAR, -1); + } + Collections.reverse(last7Days); + + MiniCalendarAdapter adapter = new MiniCalendarAdapter(last7Days, user.dias_concluidos); + rvMiniCalendar.setAdapter(adapter); + } + + private void updateWeeklyChart(Usuario user) { + weeklyChart.getDescription().setEnabled(false); + weeklyChart.setDrawGridBackground(false); + weeklyChart.getLegend().setEnabled(false); + weeklyChart.setTouchEnabled(false); + + XAxis xAxis = weeklyChart.getXAxis(); + xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); + xAxis.setDrawGridLines(false); + xAxis.setTextColor(Color.GRAY); + xAxis.setTextSize(10f); + + weeklyChart.getAxisLeft().setDrawGridLines(true); + weeklyChart.getAxisLeft().setGridColor(Color.parseColor("#F0F0F0")); + weeklyChart.getAxisLeft().setTextColor(Color.GRAY); + weeklyChart.getAxisRight().setEnabled(false); + + // Fetch last 7 days of XP logs or use an approximation if logs aren't easily available + // For now, let's use a nice mockup using current data if logs are missing + List entries = new ArrayList<>(); + String[] days = new String[7]; + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_YEAR, -6); + + SimpleDateFormat sdf = new SimpleDateFormat("E", new Locale("pt", "PT")); + + for (int i = 0; i < 7; i++) { + days[i] = sdf.format(cal.getTime()).substring(0, 1).toUpperCase(); + // Mocking some data based on status if real logs aren't aggregated yet + // In a real app, we'd query DailyProgress for the last 7 days + float val = (float) (Math.random() * 50 + 20); + if (i == 6) val = user.xp_hoje; + entries.add(new Entry(i, val)); + cal.add(Calendar.DAY_OF_YEAR, 1); + } + + xAxis.setValueFormatter(new IndexAxisValueFormatter(days)); + + LineDataSet set = new LineDataSet(entries, "XP"); + set.setColor(Color.parseColor("#7C3AED")); + set.setLineWidth(3f); + set.setCircleColor(Color.parseColor("#7C3AED")); + set.setCircleRadius(5f); + set.setDrawCircleHole(true); + set.setCircleHoleRadius(2f); + set.setMode(LineDataSet.Mode.CUBIC_BEZIER); + set.setDrawFilled(true); + set.setFillDrawable(getResources().getDrawable(R.drawable.chart_fill_gradient)); + set.setDrawValues(false); + + LineData data = new LineData(set); + weeklyChart.setData(data); + weeklyChart.animateY(1000); + weeklyChart.invalidate(); } private String determineTitle(Usuario user) { @@ -136,20 +361,37 @@ public class ProfileFragment extends Fragment { LinearLayout badge = new LinearLayout(getContext()); badge.setOrientation(LinearLayout.VERTICAL); badge.setGravity(android.view.Gravity.CENTER); - badge.setPadding(8, 8, 8, 8); + badge.setPadding(4, 12, 4, 12); + + FrameLayout iconFrame = new FrameLayout(getContext()); + View glow = new View(getContext()); + int glowSize = (int) (48 * getResources().getDisplayMetrics().density); + glow.setLayoutParams(new FrameLayout.LayoutParams(glowSize, glowSize)); + glow.setBackground(getResources().getDrawable(R.drawable.circle_bg)); + glow.setBackgroundTintList(android.content.res.ColorStateList.valueOf(Color.parseColor(unlocked ? "#F3E8FF" : "#F3F4F6"))); TextView tvEmoji = new TextView(getContext()); tvEmoji.setText(emoji); - tvEmoji.setTextSize(32); + tvEmoji.setTextSize(24); + FrameLayout.LayoutParams emojiParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + emojiParams.gravity = android.view.Gravity.CENTER; + tvEmoji.setLayoutParams(emojiParams); + if (!unlocked) tvEmoji.setAlpha(0.3f); + iconFrame.addView(glow); + iconFrame.addView(tvEmoji); + TextView tvName = new TextView(getContext()); tvName.setText(name); tvName.setTextSize(10); tvName.setGravity(android.view.Gravity.CENTER); + tvName.setPadding(0, 8, 0, 0); tvName.setTextColor(getResources().getColor(unlocked ? R.color.text_primary : R.color.text_secondary)); + tvName.setAllCaps(true); + tvName.setLetterSpacing(0.05f); - badge.addView(tvEmoji); + badge.addView(iconFrame); badge.addView(tvName); badgesGrid.addView(badge); } @@ -171,11 +413,74 @@ public class ProfileFragment extends Fragment { } private void addFriendItem(Usuario friend) { - View view = getLayoutInflater().inflate(R.layout.item_ranking_user, friendsListContainer, false); - ((TextView) view.findViewById(R.id.tvRankingName)).setText(friend.usuario); - ((TextView) view.findViewById(R.id.tvRankingXP)).setText(friend.xp + " XP"); - view.findViewById(R.id.ivRankingTrend).setVisibility(View.GONE); - friendsListContainer.addView(view); + View v = getLayoutInflater().inflate(R.layout.item_ranking_user, friendsListContainer, false); + ((TextView) v.findViewById(R.id.tvRankingName)).setText(friend.usuario); + ((TextView) v.findViewById(R.id.tvRankingXP)).setText(friend.xp + " XP"); + + // Populate Streak + TextView tvStreak = v.findViewById(R.id.tvRankingStreak); + if (tvStreak != null) { + tvStreak.setText("🔥 " + friend.streak); + } + + // Gamify friend item + TextView tvRank = v.findViewById(R.id.tvRankPosition); + if (tvRank != null) tvRank.setText("#" + (friendsListContainer.getChildCount() + 1)); + + friendsListContainer.addView(v); + } + + // --- MINI CALENDAR ADAPTER --- + private class MiniCalendarAdapter extends RecyclerView.Adapter { + private List dates; + private List completedDates; + private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.US); + private SimpleDateFormat daySdf = new SimpleDateFormat("E", new Locale("pt", "PT")); + + public MiniCalendarAdapter(List dates, List completedDates) { + this.dates = dates; + this.completedDates = completedDates != null ? completedDates : new ArrayList<>(); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_mini_calendar_day, parent, false); + return new ViewHolder(v); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + Date date = dates.get(position); + String dateStr = sdf.format(date); + String todayStr = sdf.format(new Date()); + + holder.tvDayName.setText(daySdf.format(date).substring(0, 1).toUpperCase()); + + if (completedDates.contains(dateStr)) { + holder.vDayIndicator.setBackgroundTintList(android.content.res.ColorStateList.valueOf(Color.parseColor("#22C55E"))); + } else if (dateStr.equals(todayStr)) { + holder.vDayIndicator.setBackgroundTintList(android.content.res.ColorStateList.valueOf(Color.parseColor("#7C3AED"))); + } else { + holder.vDayIndicator.setBackgroundTintList(android.content.res.ColorStateList.valueOf(Color.parseColor("#E5E7EB"))); + } + } + + @Override + public int getItemCount() { + return dates.size(); + } + + class ViewHolder extends RecyclerView.ViewHolder { + TextView tvDayName; + View vDayIndicator; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + tvDayName = itemView.findViewById(R.id.tvDayName); + vDayIndicator = itemView.findViewById(R.id.vDayIndicator); + } + } } @Override diff --git a/app/src/main/res/layout/fragment_profile.xml b/app/src/main/res/layout/fragment_profile.xml index 19e75f2..64c8751 100644 --- a/app/src/main/res/layout/fragment_profile.xml +++ b/app/src/main/res/layout/fragment_profile.xml @@ -9,49 +9,66 @@ + android:orientation="vertical" + android:paddingBottom="40dp"> - - + + android:layout_height="wrap_content"> - + + android:orientation="vertical" + android:paddingTop="48dp" + android:paddingHorizontal="24dp" + android:gravity="center"> - + + + + + + + + - + android:id="@+id/ivLeagueBadgeSmall" + android:layout_width="44dp" + android:layout_height="44dp" + android:layout_alignBottom="@id/cardAvatar" + android:layout_alignEnd="@id/cardAvatar" + android:layout_marginEnd="-6dp" + android:layout_marginBottom="-6dp" + android:elevation="12dp" + android:src="@drawable/ic_trophy_bronze" /> + + android:textSize="14sp" /> + + + - + - + + + + + + + + - - + + + + + android:paddingHorizontal="20dp" + android:paddingTop="24dp"> - - + - + android:layout_marginBottom="24dp" + app:cardCornerRadius="16dp" + app:cardElevation="2dp"> - + + + android:layout_weight="1" + android:layout_marginStart="16dp" + android:orientation="vertical"> + + + + android:text=">" + android:textColor="@color/text_secondary" + android:textSize="20sp" /> + - - - - - - - - - - - - - - - - - -