Skip to content

Commit 992d8b0

Browse files
Merge pull request #320 from LookUpGroup27/feature/enhance-overall-ui
Enhance overall UI
2 parents 1a7abfb + cceb17b commit 992d8b0

File tree

20 files changed

+377
-197
lines changed

20 files changed

+377
-197
lines changed

app/src/androidTest/java/com/github/lookupgroup27/lookup/ui/authentication/SignInKtTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SignInKtTest : TestCase() {
4040

4141
// Scroll to make sure components are visible on smaller screens
4242
composeTestRule.onNodeWithTag("loginTitle").performScrollTo().assertIsDisplayed()
43-
composeTestRule.onNodeWithTag("loginTitle").assertTextEquals("Welcome to the Cosmos")
43+
composeTestRule.onNodeWithTag("loginTitle").assertTextEquals("Explore the Cosmos")
4444

4545
composeTestRule.onNodeWithTag("loginButton").performScrollTo().assertIsDisplayed()
4646
composeTestRule.onNodeWithTag("loginButton").assertHasClickAction()

app/src/androidTest/java/com/github/lookupgroup27/lookup/ui/profile/ProfileInformationKtTest.kt

Lines changed: 63 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,30 +122,78 @@ class ProfileInformationScreenTest {
122122
}
123123

124124
@Test
125-
fun deleteButtonWorks() {
125+
fun deleteButtonShowsConfirmationDialog() {
126126
composeTestRule.setContent { ProfileInformationScreen(profileViewModel, navigationActions) }
127127

128-
// Assert: Save button is initially disabled
129-
composeTestRule.onNodeWithTag("profileSaveButton").assertIsNotEnabled()
128+
// Fill in the fields to enable the delete button
129+
composeTestRule.onNodeWithTag("editProfileUsername").performTextInput("JohnDoe")
130+
composeTestRule.onNodeWithTag("editProfileEmail").performTextInput("john.doe@example.com")
131+
composeTestRule.onNodeWithTag("editProfileBio").performTextInput("This is a bio")
130132

131-
// Act: Fill in only the username
133+
// Click delete button
134+
composeTestRule.onNodeWithTag("profileDelete").performScrollTo().performClick()
135+
136+
// Verify dialog appears
137+
composeTestRule.onNodeWithTag("deleteConfirmationDialog").assertExists()
138+
}
139+
140+
@Test
141+
fun deleteConfirmationDialogCancelWorks() {
142+
composeTestRule.setContent { ProfileInformationScreen(profileViewModel, navigationActions) }
143+
144+
// Fill in the fields to enable the delete button
132145
composeTestRule.onNodeWithTag("editProfileUsername").performTextInput("JohnDoe")
133-
// Assert: Save button is still disabled
134-
composeTestRule.onNodeWithTag("profileSaveButton").assertIsNotEnabled()
146+
composeTestRule.onNodeWithTag("editProfileEmail").performTextInput("john.doe@example.com")
147+
composeTestRule.onNodeWithTag("editProfileBio").performTextInput("This is a bio")
135148

136-
// Act: Fill in email
149+
// Click delete button
150+
composeTestRule.onNodeWithTag("profileDelete").performScrollTo().performClick()
151+
152+
// Click cancel button
153+
composeTestRule.onNodeWithTag("cancelDeleteButton").performClick()
154+
155+
// Verify dialog disappears
156+
composeTestRule.onNodeWithTag("deleteConfirmationDialog").assertDoesNotExist()
157+
}
158+
159+
@Test
160+
fun deleteConfirmationDialogConfirmWorks() {
161+
composeTestRule.setContent { ProfileInformationScreen(profileViewModel, navigationActions) }
162+
163+
// Fill in the fields to enable the delete button
164+
composeTestRule.onNodeWithTag("editProfileUsername").performTextInput("JohnDoe")
137165
composeTestRule.onNodeWithTag("editProfileEmail").performTextInput("john.doe@example.com")
138-
// Assert: Save button is still disabled because bio is empty
139-
composeTestRule.onNodeWithTag("profileSaveButton").assertIsNotEnabled()
166+
composeTestRule.onNodeWithTag("editProfileBio").performTextInput("This is a bio")
140167

141-
// Act: Fill in the bio
168+
// Click delete button
169+
composeTestRule.onNodeWithTag("profileDelete").performScrollTo().performClick()
170+
171+
// Click confirm button
172+
composeTestRule.onNodeWithTag("confirmDeleteButton").performClick()
173+
174+
// Verify navigation to menu screen
175+
verify(navigationActions).navigateTo(Screen.MENU)
176+
}
177+
178+
@Test
179+
fun deleteButtonWorks() {
180+
composeTestRule.setContent { ProfileInformationScreen(profileViewModel, navigationActions) }
181+
182+
// Fill in the fields
183+
composeTestRule.onNodeWithTag("editProfileUsername").performTextInput("JohnDoe")
184+
composeTestRule.onNodeWithTag("editProfileEmail").performTextInput("john.doe@example.com")
142185
composeTestRule.onNodeWithTag("editProfileBio").performTextInput("This is a bio")
143-
composeTestRule.onNodeWithTag("profileSaveButton").performClick()
144-
verify(navigationActions).navigateTo(Screen.PROFILE)
145-
// Assert: Save button should now be enabled
146-
composeTestRule.onNodeWithTag("profileDelete").assertIsEnabled()
147-
// Scroll to the delete button if it's off-screen, then click it
186+
187+
// Click delete button
148188
composeTestRule.onNodeWithTag("profileDelete").performScrollTo().performClick()
189+
190+
// Verify dialog appears
191+
composeTestRule.onNodeWithTag("deleteConfirmationDialog").assertExists()
192+
193+
// Click confirm button
194+
composeTestRule.onNodeWithTag("confirmDeleteButton").performClick()
195+
196+
// Verify navigation to menu screen
149197
verify(navigationActions).navigateTo(Screen.MENU)
150198
}
151199
}

app/src/main/java/com/github/lookupgroup27/lookup/ui/authentication/SignIn.kt

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ import androidx.compose.ui.unit.sp
4444
import com.github.lookupgroup27.lookup.R
4545
import com.github.lookupgroup27.lookup.ui.navigation.NavigationActions
4646
import com.github.lookupgroup27.lookup.ui.navigation.Screen
47+
import com.github.lookupgroup27.lookup.ui.theme.CosmosPurple
48+
import com.github.lookupgroup27.lookup.ui.theme.LightPurple
49+
import com.github.lookupgroup27.lookup.ui.theme.PurpleBlue
50+
import com.github.lookupgroup27.lookup.ui.theme.StarLightWhite
4751
import com.google.android.gms.auth.api.signin.GoogleSignIn
4852
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
4953
import com.google.android.gms.common.api.ApiException
@@ -80,7 +84,7 @@ fun SignInScreen(navigationActions: NavigationActions) {
8084

8185
Scaffold(
8286
modifier = Modifier.fillMaxSize().testTag("auth_screen"),
83-
containerColor = Color.Black,
87+
containerColor = PurpleBlue,
8488
topBar = {
8589
TopAppBar(
8690
title = {},
@@ -94,7 +98,7 @@ fun SignInScreen(navigationActions: NavigationActions) {
9498
tint = Color.White)
9599
}
96100
},
97-
colors = TopAppBarDefaults.topAppBarColors(containerColor = Color.Black))
101+
colors = TopAppBarDefaults.topAppBarColors(containerColor = PurpleBlue))
98102
},
99103
content = { padding ->
100104
Column(
@@ -104,27 +108,25 @@ fun SignInScreen(navigationActions: NavigationActions) {
104108
.verticalScroll(
105109
rememberScrollState()), // Enable vertical scrolling in all orientations
106110
horizontalAlignment = Alignment.CenterHorizontally,
107-
verticalArrangement = Arrangement.Center) {
108-
Spacer(modifier = Modifier.height(16.dp))
111+
verticalArrangement = Arrangement.Top) {
112+
Spacer(modifier = Modifier.height(70.dp))
109113

110114
Image(
111115
painter = painterResource(id = R.drawable.app_logo),
112116
contentDescription = "App Logo",
113-
modifier = Modifier.size(250.dp))
117+
modifier = Modifier.size(200.dp))
114118

115-
Spacer(modifier = Modifier.height(16.dp))
119+
Spacer(modifier = Modifier.height(30.dp))
116120

117121
Text(
118122
modifier = Modifier.testTag("loginTitle"),
119-
text = "Welcome to the Cosmos",
120-
style =
121-
MaterialTheme.typography.headlineMedium.copy(
122-
fontSize = 42.sp, lineHeight = 50.sp, letterSpacing = 1.5.sp),
123+
text = "Explore the Cosmos",
124+
style = MaterialTheme.typography.displaySmall,
123125
fontWeight = FontWeight.SemiBold,
124126
textAlign = TextAlign.Center,
125-
color = Color(0xFF8A9BB7))
127+
color = StarLightWhite)
126128

127-
Spacer(modifier = Modifier.height(48.dp))
129+
Spacer(modifier = Modifier.height(38.dp))
128130

129131
GoogleSignInButton(
130132
onSignInClick = {
@@ -137,13 +139,14 @@ fun SignInScreen(navigationActions: NavigationActions) {
137139
launcher.launch(googleSignInClient.signInIntent)
138140
})
139141

140-
Spacer(modifier = Modifier.height(16.dp))
142+
Spacer(modifier = Modifier.height(30.dp))
141143

142144
// Register Button
143145
Button(
144146
onClick = { navigationActions.navigateTo(Screen.REGISTER) },
145147
modifier = Modifier.fillMaxWidth(0.8f).height(44.dp),
146-
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFF1A1A2E))) {
148+
colors = ButtonDefaults.buttonColors(containerColor = LightPurple),
149+
border = BorderStroke(1.dp, StarLightWhite)) {
147150
Text("Register", color = Color.White)
148151
}
149152

@@ -153,7 +156,8 @@ fun SignInScreen(navigationActions: NavigationActions) {
153156
Button(
154157
onClick = { navigationActions.navigateTo(Screen.LOGIN) },
155158
modifier = Modifier.fillMaxWidth(0.8f).height(44.dp),
156-
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFF1A1A2E))) {
159+
colors = ButtonDefaults.buttonColors(containerColor = LightPurple),
160+
border = BorderStroke(1.dp, StarLightWhite)) {
157161
Text("Login", color = Color.White)
158162
}
159163
}
@@ -168,11 +172,11 @@ fun GoogleSignInButton(onSignInClick: () -> Unit) {
168172
// Set dimensions based on orientation
169173
val buttonHeight = if (isLandscape) 40.dp else 48.dp
170174
val buttonWidthModifier =
171-
if (isLandscape) Modifier.fillMaxWidth(0.7f) else Modifier.fillMaxWidth()
175+
if (isLandscape) Modifier.fillMaxWidth(0.7f) else Modifier.fillMaxWidth(0.5f)
172176

173177
Button(
174178
onClick = onSignInClick,
175-
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFF1A1A2E)),
179+
colors = ButtonDefaults.buttonColors(containerColor = CosmosPurple),
176180
shape = RoundedCornerShape(50),
177181
border = BorderStroke(1.dp, Color(0xFF9DACE6)),
178182
modifier =
@@ -193,7 +197,7 @@ fun GoogleSignInButton(onSignInClick: () -> Unit) {
193197

194198
Text(
195199
text = "Sign in with Google",
196-
color = Color.White,
200+
color = StarLightWhite,
197201
fontSize = 14.sp, // Slightly smaller font in landscape
198202
fontWeight = FontWeight.Medium)
199203
}

app/src/main/java/com/github/lookupgroup27/lookup/ui/feed/Feed.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import androidx.compose.material3.*
1717
import androidx.compose.runtime.*
1818
import androidx.compose.ui.Alignment
1919
import androidx.compose.ui.Modifier
20+
import androidx.compose.ui.draw.blur
2021
import androidx.compose.ui.draw.drawBehind
2122
import androidx.compose.ui.graphics.Brush
2223
import androidx.compose.ui.graphics.Color
@@ -164,10 +165,10 @@ fun FeedScreen(
164165
Color.Black.copy(alpha = 0.6f))))
165166
}) {
166167
Image(
167-
painter = painterResource(R.drawable.background_blurred),
168+
painter = painterResource(R.drawable.landscape_background),
168169
contentDescription = null,
169170
contentScale = ContentScale.Crop,
170-
modifier = Modifier.fillMaxSize())
171+
modifier = Modifier.fillMaxSize().blur(20.dp))
171172

172173
Scaffold(
173174
containerColor = Color.Transparent,

app/src/main/java/com/github/lookupgroup27/lookup/ui/map/Map.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import android.content.pm.PackageManager
88
import android.util.Log
99
import android.widget.Toast
1010
import androidx.activity.ComponentActivity
11+
import androidx.compose.foundation.BorderStroke
12+
import androidx.compose.foundation.Image
1113
import androidx.compose.foundation.background
1214
import androidx.compose.foundation.layout.Arrangement
1315
import androidx.compose.foundation.layout.Box
@@ -32,9 +34,12 @@ import androidx.compose.runtime.remember
3234
import androidx.compose.runtime.setValue
3335
import androidx.compose.ui.Alignment
3436
import androidx.compose.ui.Modifier
37+
import androidx.compose.ui.draw.blur
3538
import androidx.compose.ui.graphics.Color
39+
import androidx.compose.ui.layout.ContentScale
3640
import androidx.compose.ui.platform.LocalContext
3741
import androidx.compose.ui.platform.testTag
42+
import androidx.compose.ui.res.painterResource
3843
import androidx.compose.ui.res.stringResource
3944
import androidx.compose.ui.text.font.FontWeight
4045
import androidx.compose.ui.unit.dp
@@ -49,9 +54,9 @@ import com.github.lookupgroup27.lookup.ui.navigation.BottomNavigationMenu
4954
import com.github.lookupgroup27.lookup.ui.navigation.LIST_TOP_LEVEL_DESTINATION
5055
import com.github.lookupgroup27.lookup.ui.navigation.NavigationActions
5156
import com.github.lookupgroup27.lookup.ui.navigation.Route
52-
import com.github.lookupgroup27.lookup.ui.theme.DarkPurple
57+
import com.github.lookupgroup27.lookup.ui.theme.LightPurple
58+
import com.github.lookupgroup27.lookup.ui.theme.StarLightWhite
5359
import com.google.firebase.auth.FirebaseAuth
54-
import components.BackgroundImage
5560

5661
private const val LOCATION_PERMISSION_REQUEST_CODE: Int = 1001
5762

@@ -164,10 +169,11 @@ fun MapScreen(navigationActions: NavigationActions, mapViewModel: MapViewModel)
164169
Box(
165170
modifier = Modifier.fillMaxSize().padding(innerPadding).testTag("map_screen"),
166171
contentAlignment = Alignment.Center) {
167-
BackgroundImage(
168-
painterResId = R.drawable.background_blurred,
172+
Image(
173+
painter = painterResource(R.drawable.landscape_background),
169174
contentDescription = stringResource(R.string.background_description),
170-
testTag = "background_test_tag")
175+
modifier = Modifier.fillMaxSize().testTag("background_test_tag").blur(20.dp),
176+
contentScale = ContentScale.Crop)
171177

172178
Column(
173179
horizontalAlignment = Alignment.CenterHorizontally,
@@ -183,7 +189,8 @@ fun MapScreen(navigationActions: NavigationActions, mapViewModel: MapViewModel)
183189
onClick = { refreshKey++ },
184190
colors =
185191
androidx.compose.material3.ButtonDefaults.buttonColors(
186-
containerColor = DarkPurple, contentColor = Color.White),
192+
containerColor = LightPurple, contentColor = StarLightWhite),
193+
border = BorderStroke(0.7.dp, StarLightWhite),
187194
modifier = Modifier.testTag("refresh_button")) {
188195
Text("Refresh")
189196
}

app/src/main/java/com/github/lookupgroup27/lookup/ui/navigation/BottomNavigationMenu.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fun BottomNavigationMenu(
3535
val context = LocalContext.current
3636
val isOnline = remember { mutableStateOf(NetworkUtils.isNetworkAvailable(context)) }
3737
NavigationBar(
38-
modifier = Modifier.fillMaxWidth().height(60.dp).testTag("bottomNavigationMenu"),
38+
modifier = Modifier.fillMaxWidth().height(80.dp).testTag("bottomNavigationMenu"),
3939
containerColor = Color(0xFF0D1023),
4040
content = {
4141
tabList.forEach { tab ->

app/src/main/java/com/github/lookupgroup27/lookup/ui/overview/Landing.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.navigation.compose.rememberNavController
3333
import com.github.lookupgroup27.lookup.R
3434
import com.github.lookupgroup27.lookup.ui.navigation.NavigationActions
3535
import com.github.lookupgroup27.lookup.ui.navigation.Screen
36+
import com.github.lookupgroup27.lookup.ui.theme.StarLightWhite
3637
import com.github.lookupgroup27.lookup.util.NetworkUtils
3738
import com.github.lookupgroup27.lookup.util.ToastHelper
3839
import components.BackgroundImage
@@ -64,7 +65,7 @@ fun LandingScreen(
6465
}) {
6566
// Background Image
6667
BackgroundImage(
67-
painterResId = R.drawable.landing_screen_bckgrnd,
68+
painterResId = R.drawable.landscape_background,
6869
contentDescription = stringResource(R.string.background_description),
6970
)
7071

@@ -77,19 +78,20 @@ fun LandingScreen(
7778
.padding(16.dp),
7879
verticalArrangement = Arrangement.SpaceBetween,
7980
horizontalAlignment = Alignment.CenterHorizontally) {
81+
Spacer(modifier = Modifier.height(25.dp))
8082
// Top Prompt Text
8183
Text(
8284
text = "Click for full map view",
8385
fontSize = 18.sp,
84-
fontWeight = FontWeight.Bold,
85-
color = Color.White,
86+
fontWeight = FontWeight.Normal,
87+
color = StarLightWhite,
8688
modifier = Modifier.padding(top = 32.dp))
8789

8890
// Centered Logo Image
8991
Image(
9092
painter = painterResource(id = R.drawable.app_logo),
9193
contentDescription = "Look Up Logo",
92-
modifier = Modifier.size(250.dp).align(Alignment.CenterHorizontally),
94+
modifier = Modifier.size(250.dp),
9395
contentScale = ContentScale.Fit)
9496

9597
// Bottom Home Button

0 commit comments

Comments
 (0)