Skip to content

Commit

Permalink
updated your leaves panel and updated leaderboard text
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-cameron committed Mar 22, 2019
1 parent db1e987 commit dff9b8c
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class ProfileScreenActivity extends AppCompatActivity {
private TextView profileEmail;
private TextView profileOrganisation;
private TextView profileLeaves;
private TextView profilePlants;
private TextView loyaltyWeek;

@Override
Expand All @@ -40,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
profileName = (TextView) findViewById(R.id.users_name_display);
profileOrganisation = (TextView) findViewById(R.id.user_organisation_display);
profileLeaves = (TextView) findViewById(R.id.user_leaves_display);
profilePlants = (TextView) findViewById(R.id.user_plants_display);
loyaltyWeek = (TextView) findViewById(R.id.week_panel_date);

Button goToPreferences = (Button) findViewById(R.id.go_to_preferences);
Expand Down Expand Up @@ -125,10 +127,12 @@ public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
String userProfileEmail = (String) dataSnapshot.child("email").getValue();
String userProfileOrganisation = (String) dataSnapshot.child("organisation").getValue();
Long userProfileLeaves = (Long) dataSnapshot.child("currentNumberOfLeaves").getValue();
Long userPlantLeaves = (Long) dataSnapshot.child("plants").getValue();
profileName.setText("/ " + userProfileName + " " + userProfileLastName);
// profileEmail.setText("/ Email: " + userProfileEmail);
profileOrganisation.setText("/ " +userProfileOrganisation);
profileLeaves.setText(userProfileLeaves.toString());
profilePlants.setText(userPlantLeaves.toString());
}

@Override
Expand Down
110 changes: 69 additions & 41 deletions app/src/main/res/layout/activity_profile_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,63 +292,91 @@
android:orientation="horizontal"
android:padding="15dp">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/circle_fine"
android:src="@mipmap/green_leaf" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:text="x"
android:textSize="30dp"
android:textStyle="bold" />

<TextView
android:id="@+id/user_leaves_display"
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textSize="30sp"
android:textStyle="bold" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/circle_fine"
android:src="@mipmap/green_leaf" />

<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:text="x"
android:textSize="30dp"
android:textStyle="bold" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="13"
android:textSize="50sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/user_leaves_display"
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textSize="30sp"
android:textStyle="bold" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@mipmap/stampsheet_leaves20"
android:background="@drawable/circle_fine"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Your Ranking"
android:textSize="18sp"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:text="x"
android:textSize="30dp"
android:textStyle="bold" />

<TextView
android:id="@+id/user_plants_display"
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textSize="30sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/current_leaves"
android:textStyle="bold"
android:textSize="16sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/current_plants"
android:textStyle="bold"
android:textSize="16sp"/>
</LinearLayout>
<Button
android:id="@+id/go_to_leaderboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/content_panel_button"
android:text="Explore" />
android:text="Explore"
android:layout_marginTop="5dp"/>
</LinearLayout>

<LinearLayout
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/res/layout/fragment_leaderboard_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="25dp"
android:layout_marginTop="30dp">
android:layout_marginTop="20dp">

<TextView
android:layout_width="match_parent"
Expand Down Expand Up @@ -57,6 +57,13 @@
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/leaderboard_info"
android:paddingTop="10dp"
android:paddingBottom="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/recycler_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@
android:layout_height="50dp"
android:src="@mipmap/green_leaf"
android:background="@drawable/circle"
android:padding="5dp"/>
android:padding="5dp"
android:layout_gravity="center"/>
<TextView
android:id="@+id/mulitply_sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/multiply_sign"
android:textStyle="bold"
android:textSize="20sp"
Expand All @@ -65,6 +67,7 @@
android:id="@+id/number_leaves_display_card"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="452"
android:textSize="30sp"
android:textStyle="bold"/>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@
<string name="qr_code_title">Sign Yourself In</string>
<string name="qr_code_heading">Scan the QR code while having your Meal to gain bonus Leaves!</string>
<string name="scan_qr_code">Scan QR Code</string>
<string name="current_leaves">Current Leaves</string>
<string name="total_leaves">Total Leaves</string>
<string name="current_plants">Current Plants</string>
<string name="leaderboard_info">Want to know how you compare to others? Check out how many leaves you have collected overall and be the top of the leaderboard!</string>
</resources>

0 comments on commit dff9b8c

Please sign in to comment.