Skip to content

Commit

Permalink
Changed Color of leaderboard cards from white to orange and minor cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
PrathameshJadhav33 committed Sep 24, 2022
1 parent 291f298 commit b853f28
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public void onBindViewHolder(@NonNull viewh holder, int position) {
holder.tv_name.setText(String.valueOf((leaderBoard_scores.get(position)).getUsername()));
holder.tv_score.setText(String.valueOf((leaderBoard_scores.get(position)).getScore()));
String accuracy = String.valueOf((leaderBoard_scores.get(position)).getAccuracy());
holder.tv_accuracy.setText(accuracy);

holder.tv_accuracy.setText(accuracy.substring(0,5));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void onComplete(@NonNull Task<Void> task) {
boolean res = leaderboard_check(game_name,ld_score);
Log.d("Leaderboard","got the data successfully");

Toast.makeText(context, "Data Inserted", Toast.LENGTH_LONG).show();
//Toast.makeText(context, "Data Inserted", Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(context, "failed", Toast.LENGTH_LONG).show();
Expand Down
16 changes: 12 additions & 4 deletions app/src/main/res/layout/fragment_leaderboards.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,28 @@
android:layout_height="50dp"
app:cardUseCompatPadding="true"
app:cardElevation="4dp"
android:backgroundTint="@color/orange"
app:cardCornerRadius="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="20dp"
android:paddingStart="0dp"
android:paddingEnd="5dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Username"
android:layout_marginStart="20dp"
android:textColor="@color/white"
android:layout_marginStart="10dp"
android:layout_weight="1"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Score"
android:textColor="@color/white"
android:gravity="center"
android:layout_weight="1"/>

Expand All @@ -52,6 +55,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Accuracy"
android:textColor="@color/white"
android:gravity="end"
android:layout_weight="1"/>

Expand Down Expand Up @@ -81,26 +85,29 @@
android:layout_width="match_parent"
android:layout_height="50dp"
app:cardUseCompatPadding="true"
android:backgroundTint="@color/orange"
app:cardElevation="4dp"
app:cardCornerRadius="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="20dp"
android:paddingStart="0dp"
android:paddingEnd="5dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Username"
android:layout_marginStart="20dp"
android:layout_marginStart="10dp"
android:textColor="@color/white"
android:layout_weight="1"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Score"
android:textColor="@color/white"
android:gravity="center"
android:layout_weight="1"/>

Expand All @@ -109,6 +116,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Accuracy"
android:textColor="@color/white"
android:gravity="end"
android:layout_weight="1"/>

Expand Down
11 changes: 3 additions & 8 deletions app/src/main/res/layout/layout_rv_card_leaderboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,19 @@

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:paddingEnd="10dp"
android:orientation="horizontal">

<ImageView
android:id="@+id/imageView"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentStart="true" />

<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/imageView"
android:layout_alignParentStart="true"
android:text="Username" />

<TextView
Expand Down

0 comments on commit b853f28

Please sign in to comment.