Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated home screen #19

Merged
merged 4 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 118 additions & 54 deletions app/src/main/java/com/example/estiaseek/ui/HomeScreen.kt
Original file line number Diff line number Diff line change
@@ -1,90 +1,154 @@
package com.example.estiaseek.ui

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.estiaseek.R
import com.example.estiaseek.ui.theme.EstiaSeekTheme
import com.example.estiaseek.ui.theme.estiaSeekRed

@Composable
fun HomeScreen(
onSearchButtonClicked: () -> Unit,
onCreateApplicantButtonClicked: () -> Unit,
) {
EstiaSeekTheme { // Ensure the app's theme is applied
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background // Consistent background

Box(
modifier = Modifier.fillMaxSize()
) {
// Background image
Image(
painter = painterResource(id = R.drawable.background),
contentDescription = null,
contentScale = ContentScale.FillHeight,
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
)

// This might look stupid but it ensures its always 3/8 red with a sudden change!
Box(
modifier = Modifier
.fillMaxSize()
.background(
brush = Brush.verticalGradient(
colors = listOf(
Color.Transparent,
Color.Transparent,
Color.Transparent,
Color.Transparent,
Color.Transparent,

estiaSeekRed,
estiaSeekRed,
estiaSeekRed
)
)
)
)

Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.Top,
horizontalAlignment = Alignment.CenterHorizontally
) {
Box(
Image(
painter = painterResource(id = R.drawable.es),
contentDescription = null,
contentScale = ContentScale.FillHeight,
modifier = Modifier.height(80.dp).clip(RoundedCornerShape(16.dp))
)
}


// Box for welcome text and card, positioned from bottom
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.Bottom,
horizontalAlignment = Alignment.CenterHorizontally
) {
// Welcome text above the white box
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.safeDrawingPadding()
.padding(horizontal = 40.dp)
.padding(bottom = 24.dp)
) {
Text(
text = stringResource(R.string.welcome),
style = MaterialTheme.typography.headlineLarge.copy(
fontWeight = FontWeight.SemiBold
),
color = Color.White
)
}

Card(
modifier = Modifier
.fillMaxWidth(0.85f)
.wrapContentHeight()
.align(Alignment.CenterHorizontally)
.padding(bottom = 32.dp), // Add padding at bottom
colors = CardDefaults.cardColors(containerColor = Color.White),
shape = RoundedCornerShape(16.dp)
) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(10.dp),
verticalArrangement = Arrangement.Center,
.padding(24.dp),
verticalArrangement = Arrangement.spacedBy(10.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Spacer(modifier = Modifier.height(16.dp))
// Heading
Text(
text = "Welcome to EstiaSeek",
style = MaterialTheme.typography.headlineMedium.copy(
fontWeight = FontWeight.Bold // Make the text bold
),
modifier = Modifier.padding(bottom = 24.dp)
)

// Image
Image(
painter = painterResource(id = R.drawable.emp),
contentDescription = "Example Image",
modifier = Modifier
.size(300.dp)
.padding(bottom = 24.dp)
)

// First Button
// Call to action
Button(
onClick = {
onSearchButtonClicked()
},
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 32.dp)
onClick = onSearchButtonClicked,
modifier = Modifier.fillMaxWidth(),
colors = ButtonDefaults.buttonColors(
containerColor = estiaSeekRed
)
) {
Text(text = "Search for Candidates")
Text(
text = stringResource(R.string.search_button),
color = Color.White,
fontSize = 14.sp
)
}

Spacer(modifier = Modifier.height(16.dp))

// Second Button
Button(
onClick = {
onCreateApplicantButtonClicked()
},
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 32.dp)
// Secondary call to action
OutlinedButton(
onClick = onCreateApplicantButtonClicked,
modifier = Modifier.fillMaxWidth(),
border = BorderStroke(2.dp, estiaSeekRed),
colors = ButtonDefaults.outlinedButtonColors(
contentColor = estiaSeekRed
)
) {
Text(text = "Create Candidates")
Text(
text = stringResource(R.string.form_button),
fontSize = 14.sp
)
}
}
}
Expand Down
Binary file added app/src/main/res/drawable/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/dubai.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/es_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@drawable/es_large" />
<monochrome android:drawable="@drawable/es_large" />
</adaptive-icon>
5 changes: 2 additions & 3 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@drawable/es_large" />
<monochrome android:drawable="@drawable/es_large" />
</adaptive-icon>
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="estiaSeekRed">#FFF11C33</color>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<resources>
<string name="app_name">EstiaSeek</string>

<!-- Home screen Strings -->
<string name="welcome">Welcome to EstiaSeek</string>
<string name="search_button">Search for Candidates</string>
<string name="form_button">Create Candidates</string>

<!-- Create Applicants Strings -->
<string name="name">Name</string>
<string name="email">Email</string>
Expand Down
Loading