Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit 61e98d5

Browse files
Welcome Page
1 parent 92df1df commit 61e98d5

28 files changed

+190
-99
lines changed

android/canonical/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<application
1414
android:allowBackup="true"
15-
android:icon="@mipmap/ic_launcher"
15+
android:icon="@mipmap/ic_werun_launcher"
1616
android:label="@string/app_name"
17-
android:roundIcon="@mipmap/ic_launcher_round"
17+
android:roundIcon="@mipmap/ic_werun_launcher_round"
1818
android:supportsRtl="true"
1919
android:theme="@style/AppTheme">
2020

Loading

android/canonical/app/src/main/java/com/google/samples/quickstart/canonical/ProfileFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
77
import android.view.View
88
import android.view.ViewGroup
99
import android.widget.Button
10+
import android.widget.ImageButton
1011
import android.widget.ListView
1112
import androidx.fragment.app.Fragment
1213
import androidx.fragment.app.activityViewModels
@@ -75,7 +76,7 @@ class ProfileFragment : Fragment() {
7576

7677
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
7778
super.onViewCreated(view, savedInstanceState)
78-
val logoutButton : Button = view.findViewById(R.id.logout_button)
79+
val logoutButton : ImageButton = view.findViewById(R.id.logout_button)
7980
logoutButton.setOnClickListener {
8081
// Sign out both Google account and Firebase
8182
signInVM.signOut()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="?attr/colorControlNormal">
7+
<path
8+
android:fillColor="@android:color/white"
9+
android:pathData="M10.09,15.59L11.5,17l5,-5 -5,-5 -1.41,1.41L12.67,11H3v2h9.67l-2.58,2.59zM19,3H5c-1.11,0 -2,0.9 -2,2v4h2V5h14v14H5v-4H3v4c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z"/>
10+
</vector>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="210dp"
4+
android:height="297dp"
5+
android:viewportWidth="210"
6+
android:viewportHeight="297">
7+
<path
8+
android:pathData="M148.684,163.831 L133.383,194.588h-10.355l15.301,-30.912zM37.867,133.229 L62.596,133.383 78.979,172.641 95.826,133.692 112.054,172.641 129.983,133.692 159.967,133.538c0,0 17.238,3.039 17.62,18.238 0.457,18.211 -12.828,20.865 -12.828,20.865l12.674,21.793h-11.437l-17.31,-30.602h12.055c0,0 6.9,-2.737 7.11,-10.355 0.207,-7.52 -8.192,-9.737 -8.192,-9.737L136.783,143.584 112.054,194.588 95.98,156.412 78.979,194.588Z"
9+
android:strokeLineJoin="miter"
10+
android:strokeWidth="2"
11+
android:strokeColor="#FFFFFF"
12+
android:strokeLineCap="butt"
13+
android:fillColor="#FFFFFF">
14+
</path>
15+
</vector>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="210dp"
4+
android:height="297dp"
5+
android:viewportWidth="210"
6+
android:viewportHeight="297">
7+
<path
8+
android:pathData="M148.684,163.831 L133.383,194.588h-10.355l15.301,-30.912zM37.867,133.229 L62.596,133.383 78.979,172.641 95.826,133.692 112.054,172.641 129.983,133.692 159.967,133.538c0,0 17.238,3.039 17.62,18.238 0.457,18.211 -12.828,20.865 -12.828,20.865l12.674,21.793h-11.437l-17.31,-30.602h12.055c0,0 6.9,-2.737 7.11,-10.355 0.207,-7.52 -8.192,-9.737 -8.192,-9.737L136.783,143.584 112.054,194.588 95.98,156.412 78.979,194.588Z"
9+
android:strokeLineJoin="miter"
10+
android:strokeWidth="1"
11+
android:strokeColor="#FFFFFF"
12+
android:strokeLineCap="butt">
13+
</path>
14+
</vector>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<group android:scaleX="0.3490909"
8+
android:scaleY="0.3490909"
9+
android:translateX="17.345455"
10+
android:translateY="2.16">
11+
<path
12+
android:pathData="M148.684,163.831 L133.383,194.588h-10.355l15.301,-30.912zM37.867,133.229 L62.596,133.383 78.979,172.641 95.826,133.692 112.054,172.641 129.983,133.692 159.967,133.538c0,0 17.238,3.039 17.62,18.238 0.457,18.211 -12.828,20.865 -12.828,20.865l12.674,21.793h-11.437l-17.31,-30.602h12.055c0,0 6.9,-2.737 7.11,-10.355 0.207,-7.52 -8.192,-9.737 -8.192,-9.737L136.783,143.584 112.054,194.588 95.98,156.412 78.979,194.588Z"
13+
android:strokeLineJoin="miter"
14+
android:strokeWidth="2"
15+
android:strokeColor="#FFFFFF"
16+
android:strokeLineCap="butt"
17+
android:fillColor="#FFFFFF">
18+
</path>
19+
</group>
20+
</vector>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
5+
</selector>

android/canonical/app/src/main/res/layout/fragment_login.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,31 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:background="@android:color/white"
7+
android:background="@drawable/profile_bg"
88
tools:context=".ProfileFragment">
99

1010
<!-- TODO: Update blank fragment layout -->
11+
<ImageView
12+
android:id="@+id/imageView"
13+
android:layout_width="match_parent"
14+
android:layout_height="0dp"
15+
android:src="@drawable/ic_login_page"
16+
app:layout_constraintBottom_toTopOf="@+id/textView2"
17+
app:layout_constraintEnd_toEndOf="parent"
18+
app:layout_constraintStart_toStartOf="parent"
19+
app:layout_constraintTop_toTopOf="parent" />
20+
1121
<TextView
1222
android:id="@+id/textView2"
1323
android:layout_width="match_parent"
1424
android:layout_height="wrap_content"
1525
android:gravity="center"
16-
android:text="This is Login Page"
17-
android:textSize="30sp"
18-
app:layout_constraintBottom_toBottomOf="parent"
19-
app:layout_constraintTop_toTopOf="parent" />
26+
android:layout_marginBottom="100dp"
27+
android:fontFamily="sans-serif-light"
28+
android:text="@string/welcome"
29+
android:textSize="35sp"
30+
app:layout_constraintBottom_toTopOf="@+id/sign_in_button"
31+
/>
2032

2133
<com.google.android.gms.common.SignInButton
2234
android:id="@+id/sign_in_button"

android/canonical/app/src/main/res/layout/fragment_profile.xml

Lines changed: 93 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -64,107 +64,110 @@
6464
android:textColor="@android:color/black"
6565
android:textSize="14sp" />
6666

67-
<Button
68-
android:id="@+id/logout_button"
69-
android:layout_width="wrap_content"
70-
android:layout_height="wrap_content"
71-
android:layout_marginBottom="16dp"
72-
android:text="@string/logout_button_text" />
73-
7467
</RelativeLayout>
7568

76-
<LinearLayout
77-
android:id="@+id/usr_statistic_bar"
78-
android:layout_width="match_parent"
79-
android:layout_height="wrap_content"
80-
android:orientation="horizontal"
81-
android:background="@drawable/profile_statistic_bar_bg"
82-
app:layout_constraintTop_toBottomOf="@id/usr_img_and_name">
83-
84-
<RelativeLayout
69+
<LinearLayout
70+
android:id="@+id/usr_statistic_bar"
8571
android:layout_width="match_parent"
8672
android:layout_height="wrap_content"
87-
android:layout_weight="1"
88-
android:gravity="center"
89-
android:paddingBottom="5dp"
90-
android:paddingTop="5dp">
73+
android:orientation="horizontal"
74+
android:background="@drawable/profile_statistic_bar_bg"
75+
app:layout_constraintTop_toBottomOf="@id/usr_img_and_name">
9176

92-
<LinearLayout
93-
android:layout_width="wrap_content"
77+
<RelativeLayout
78+
android:layout_width="match_parent"
9479
android:layout_height="wrap_content"
95-
android:orientation="vertical">
80+
android:layout_weight="1"
81+
android:gravity="center"
82+
android:paddingBottom="5dp"
83+
android:paddingTop="5dp">
9684

97-
<TextView
98-
android:id="@+id/usr_run_time"
99-
android:layout_width="match_parent"
100-
android:layout_height="wrap_content"
101-
android:layout_marginBottom="5dp"
102-
android:fontFamily="sans-serif-light"
103-
android:text="@{profileViewModel.getTimeHMSString()}"
104-
android:textColor="@android:color/white"
105-
android:textSize="30sp" />
106-
107-
<TextView
108-
android:gravity="center"
109-
android:layout_width="match_parent"
85+
<LinearLayout
86+
android:layout_width="wrap_content"
11087
android:layout_height="wrap_content"
111-
android:layout_marginBottom="5dp"
112-
android:fontFamily="sans-serif-light"
113-
android:text="@string/total_time"
114-
android:textColor="@android:color/white"
115-
android:textSize="12sp" />
116-
117-
</LinearLayout>
118-
119-
</RelativeLayout>
120-
121-
<RelativeLayout
122-
android:layout_width="match_parent"
123-
android:layout_height="wrap_content"
124-
android:gravity="center"
125-
android:paddingBottom="5dp"
126-
android:paddingTop="5dp"
127-
android:layout_weight="1">
128-
129-
<LinearLayout
130-
android:layout_width="wrap_content"
88+
android:orientation="vertical">
89+
90+
<TextView
91+
android:id="@+id/usr_run_time"
92+
android:layout_width="match_parent"
93+
android:layout_height="wrap_content"
94+
android:layout_marginBottom="5dp"
95+
android:fontFamily="sans-serif-light"
96+
android:text="@{profileViewModel.getTimeHMSString()}"
97+
android:textColor="@android:color/white"
98+
android:textSize="30sp" />
99+
100+
<TextView
101+
android:gravity="center"
102+
android:layout_width="match_parent"
103+
android:layout_height="wrap_content"
104+
android:layout_marginBottom="5dp"
105+
android:fontFamily="sans-serif-light"
106+
android:text="@string/total_time"
107+
android:textColor="@android:color/white"
108+
android:textSize="12sp" />
109+
110+
</LinearLayout>
111+
112+
</RelativeLayout>
113+
114+
<RelativeLayout
115+
android:layout_width="match_parent"
131116
android:layout_height="wrap_content"
132-
android:orientation="vertical">
117+
android:gravity="center"
118+
android:paddingBottom="5dp"
119+
android:paddingTop="5dp"
120+
android:layout_weight="1">
133121

134-
<TextView
135-
android:id="@+id/usr_run_energy"
136-
android:layout_width="match_parent"
137-
android:layout_height="wrap_content"
138-
android:layout_gravity="center"
139-
android:layout_marginBottom="5dp"
140-
android:gravity="center"
141-
android:fontFamily="sans-serif-light"
142-
android:text="@{profileViewModel.getTotalEnergyCaloriesString()}"
143-
android:textColor="@android:color/white"
144-
android:textSize="30sp" />
145-
146-
<TextView
147-
android:gravity="center"
148-
android:layout_width="match_parent"
122+
<LinearLayout
123+
android:layout_width="wrap_content"
149124
android:layout_height="wrap_content"
150-
android:layout_marginBottom="5dp"
151-
android:layout_gravity="center"
152-
android:fontFamily="sans-serif-light"
153-
android:text="@string/total_energy"
154-
android:textColor="@android:color/white"
155-
android:textSize="12sp" />
156-
</LinearLayout>
157-
158-
</RelativeLayout>
159-
160-
</LinearLayout>
161-
162-
<ListView
163-
android:id="@+id/run_history_list_view"
164-
android:layout_width="match_parent"
165-
android:layout_height="0dp"
166-
app:layout_constraintVertical_weight="1"
167-
app:layout_constraintTop_toBottomOf="@+id/usr_statistic_bar"/>
125+
android:orientation="vertical">
126+
127+
<TextView
128+
android:id="@+id/usr_run_energy"
129+
android:layout_width="match_parent"
130+
android:layout_height="wrap_content"
131+
android:layout_gravity="center"
132+
android:layout_marginBottom="5dp"
133+
android:gravity="center"
134+
android:fontFamily="sans-serif-light"
135+
android:text="@{profileViewModel.getTotalEnergyCaloriesString()}"
136+
android:textColor="@android:color/white"
137+
android:textSize="30sp" />
138+
139+
<TextView
140+
android:gravity="center"
141+
android:layout_width="match_parent"
142+
android:layout_height="wrap_content"
143+
android:layout_marginBottom="5dp"
144+
android:layout_gravity="center"
145+
android:fontFamily="sans-serif-light"
146+
android:text="@string/total_energy"
147+
android:textColor="@android:color/white"
148+
android:textSize="12sp" />
149+
</LinearLayout>
150+
151+
</RelativeLayout>
152+
153+
</LinearLayout>
154+
155+
<ImageButton
156+
android:id="@+id/logout_button"
157+
android:layout_width="40dp"
158+
android:layout_height="40dp"
159+
android:layout_margin="15dp"
160+
android:background="@android:color/transparent"
161+
android:src="@drawable/ic_baseline_exit_to_app_24"
162+
app:layout_constraintEnd_toEndOf="parent"
163+
app:layout_constraintTop_toTopOf="parent" />
164+
165+
<ListView
166+
android:id="@+id/run_history_list_view"
167+
android:layout_width="match_parent"
168+
android:layout_height="0dp"
169+
app:layout_constraintVertical_weight="1"
170+
app:layout_constraintTop_toBottomOf="@+id/usr_statistic_bar"/>
168171

169172
</androidx.constraintlayout.widget.ConstraintLayout>
170173
</layout>

0 commit comments

Comments
 (0)