amigos melhora

This commit is contained in:
MeuNome
2026-04-30 10:38:13 +01:00
parent e38e791790
commit ba523f16ad
9 changed files with 667 additions and 324 deletions

View File

@@ -52,31 +52,33 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
android:layout_marginBottom="16dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/primary_purple"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp"
android:padding="24dp"
android:gravity="center">
<ImageView
android:id="@+id/ivLeagueBadge"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_trophy_bronze"
android:layout_marginBottom="12dp"/>
android:layout_marginBottom="12dp"
app:tint="@color/white" />
<TextView
android:id="@+id/tvLeagueName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Divisão Bronze"
android:textColor="@color/text_primary"
android:textSize="22sp"
android:textColor="@color/white"
android:textSize="26sp"
android:textStyle="bold" />
<TextView
@@ -85,18 +87,19 @@
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="2 dias 14h restantes"
android:textColor="@color/text_secondary"
android:textColor="#E0E0E0"
android:textSize="14sp" />
<ProgressBar
android:id="@+id/pbWeeklyProgress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_marginTop="16dp"
android:layout_height="12dp"
android:layout_marginTop="20dp"
android:max="100"
android:progress="60"
android:progressDrawable="@drawable/progress_bar_duo" />
android:progressTint="@color/reward_yellow"
android:progressBackgroundTint="#4DFFFFFF" />
</LinearLayout>
</androidx.cardview.widget.CardView>
@@ -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"/>
<!-- 8. 👥 FILTRO DE RANKING -->
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggleRankingFilter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dp"
app:singleSelection="true"
app:checkedButton="@+id/btnRankingGlobal">
<Button
android:id="@+id/btnRankingGlobal"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Global"
android:textSize="12sp"/>
<Button
android:id="@+id/btnRankingAmigos"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Amigos"
android:textSize="12sp"/>
</com.google.android.material.button.MaterialButtonToggleGroup>
<!-- 3. 📊 RANKING DA SEMANA -->
<LinearLayout
android:id="@+id/rankingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:textSize="18sp"
android:layout_marginBottom="24dp"/>
<!-- 5. ⚡ PROGRESSO DO UTILIZADOR -->
<androidx.cardview.widget.CardView
android:id="@+id/cardUserProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
app:cardElevation="2dp"
app:cardBackgroundColor="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:padding="20dp"
android:gravity="center">
<TextView
android:id="@+id/tvUserRankingStatus"
@@ -166,19 +139,59 @@
android:text="Faltam 120 XP para entrares no TOP 3"
android:textColor="@color/text_primary"
android:textStyle="bold"
android:textSize="14sp"/>
android:textAlignment="center"
android:textSize="16sp"/>
<TextView
android:id="@+id/tvXPToNextPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="8dp"
android:text="Diferença para o próximo: 45 XP"
android:textColor="@color/text_secondary"
android:textSize="12sp"/>
android:textAlignment="center"
android:textSize="14sp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- 8. 👥 FILTRO DE RANKING -->
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggleRankingFilter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="24dp"
app:singleSelection="true"
app:selectionRequired="true"
app:checkedButton="@+id/btnRankingGlobal">
<Button
android:id="@+id/btnRankingGlobal"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="120dp"
android:layout_height="50dp"
android:text="Global"
android:textStyle="bold"
android:textSize="14sp"/>
<Button
android:id="@+id/btnRankingAmigos"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="120dp"
android:layout_height="50dp"
android:text="Amigos"
android:textStyle="bold"
android:textSize="14sp"/>
</com.google.android.material.button.MaterialButtonToggleGroup>
<!-- 3. 📊 RANKING DA SEMANA -->
<LinearLayout
android:id="@+id/rankingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="32dp"/>
<!-- 6. 🎁 RECOMPENSAS DA SEMANA -->
<TextView
android:layout_width="wrap_content"
@@ -187,40 +200,78 @@
android:textStyle="bold"
android:textSize="18sp"
android:textColor="@color/text_primary"
android:layout_marginBottom="12dp"/>
android:layout_marginBottom="16dp"/>
<androidx.cardview.widget.CardView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
app:cardCornerRadius="16dp"
app:cardElevation="1dp">
android:orientation="horizontal"
android:weightSum="3"
android:layout_marginBottom="32dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp">
<TextView
<!-- 1º Lugar -->
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="4dp"
app:cardCornerRadius="16dp"
app:cardBackgroundColor="#FFF8E1"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🥇 1º lugar: +300 XP + Badge Exclusiva"
android:padding="8dp"
android:textColor="@color/text_primary"/>
<TextView
android:orientation="vertical"
android:padding="16dp"
android:gravity="center">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="🥇" android:textSize="32sp" android:layout_marginBottom="8dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1º Lugar" android:textStyle="bold" android:textSize="14sp" android:textColor="#FF8F00"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+300 XP\nBadge" android:textAlignment="center" android:textSize="12sp" android:textColor="#FF8F00"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- 2º Lugar -->
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginHorizontal="4dp"
app:cardCornerRadius="16dp"
app:cardBackgroundColor="#F5F5F5"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🥈 2º lugar: +200 XP"
android:padding="8dp"
android:textColor="@color/text_primary"/>
<TextView
android:orientation="vertical"
android:padding="16dp"
android:gravity="center">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="🥈" android:textSize="28sp" android:layout_marginBottom="8dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2º Lugar" android:textStyle="bold" android:textSize="14sp" android:textColor="#757575"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+200 XP" android:textAlignment="center" android:textSize="12sp" android:textColor="#757575"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- 3º Lugar -->
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginStart="4dp"
app:cardCornerRadius="16dp"
app:cardBackgroundColor="#EFEBE9"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="🥉 3º lugar: +100 XP"
android:padding="8dp"
android:textColor="@color/text_primary"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
android:orientation="vertical"
android:padding="16dp"
android:gravity="center">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="🥉" android:textSize="28sp" android:layout_marginBottom="8dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3º Lugar" android:textStyle="bold" android:textSize="14sp" android:textColor="#8D6E63"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+100 XP" android:textAlignment="center" android:textSize="12sp" android:textColor="#8D6E63"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<!-- 7. 📈 HISTÓRICO DE PERFORMANCE -->
<TextView
@@ -231,19 +282,21 @@
android:textAlignment="center"
android:textColor="@color/text_secondary"
android:textSize="14sp"
android:layout_marginBottom="32dp"/>
android:layout_marginBottom="32dp"
android:visibility="gone" />
<!-- 9. 🔘 BOTÃO DE ACÇÃO -->
<Button
android:id="@+id/btnEarnXpNow"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="Ganhar XP agora"
android:background="@drawable/button_primary"
android:layout_height="64dp"
android:text="Ganhar XP Agora"
android:backgroundTint="@color/primary_purple"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
android:textAllCaps="false"
app:backgroundTint="@null"
app:cornerRadius="16dp"
android:layout_marginBottom="40dp"/>
</LinearLayout>