-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,438 additions
and
4 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeHeader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.pwhs.quickmem.presentation.homescreen.components | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Notifications | ||
import androidx.compose.material.icons.filled.Search | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TextField | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.pwhs.quickmem.presentation.app.home.component.home.SearchTextField | ||
|
||
@Composable | ||
fun HomeHeader( | ||
Onclick: () -> Unit | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.background( | ||
Color(0xFF5E8DF5), | ||
shape = RoundedCornerShape(bottomStart = 32.dp, bottomEnd = 32.dp) | ||
) | ||
.padding(16.dp) | ||
) { | ||
Column( | ||
verticalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.SpaceBetween | ||
) { | ||
Text( | ||
text = "QuickMem", | ||
color = Color.White, | ||
fontWeight = FontWeight.Bold, | ||
fontSize = 32.sp | ||
) | ||
|
||
Row( | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Button( | ||
onClick = Onclick, | ||
modifier = Modifier.padding(end = 8.dp), | ||
shape = RoundedCornerShape(8.dp), | ||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFFCBB237)) | ||
) { | ||
Text("Free trial") | ||
} | ||
|
||
IconButton( | ||
onClick = { | ||
|
||
} | ||
) { | ||
Icon( | ||
imageVector = Icons.Default.Notifications, | ||
contentDescription = "Notifications", | ||
tint = Color.White | ||
) | ||
} | ||
} | ||
} | ||
SearchTextField() | ||
} | ||
} | ||
} |
45 changes: 41 additions & 4 deletions
45
app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,59 @@ | ||
package com.pwhs.quickmem.presentation.app.home | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import androidx.compose.foundation.rememberScrollState | ||
import com.pwhs.quickmem.presentation.app.home.component.achiverment.AchievementsSection | ||
import com.pwhs.quickmem.presentation.app.home.component.categories.CategoriesSection | ||
import com.pwhs.quickmem.presentation.app.home.component.classes.ClassesSection | ||
import com.pwhs.quickmem.presentation.app.home.component.folder.FoldersSections | ||
import com.pwhs.quickmem.presentation.app.home.component.sets.SetsSections | ||
import com.pwhs.quickmem.presentation.homescreen.components.HomeHeader | ||
import com.ramcosta.composedestinations.annotation.Destination | ||
import com.ramcosta.composedestinations.annotation.RootGraph | ||
import com.ramcosta.composedestinations.generated.destinations.SearchScreenDestination | ||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator | ||
|
||
@Composable | ||
@Destination<RootGraph> | ||
fun HomeScreen(modifier: Modifier = Modifier) { | ||
fun HomeScreen( | ||
modifier: Modifier = Modifier, | ||
navigator: DestinationsNavigator, | ||
viewModel: HomeViewModel = hiltViewModel() | ||
) { | ||
Scaffold { innerPadding -> | ||
Column( | ||
modifier = modifier.padding(innerPadding), | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(Color.White) | ||
.verticalScroll(rememberScrollState()) | ||
.padding(innerPadding), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
Text("Home Screen") | ||
HomeHeader( | ||
Onclick = { | ||
navigator.navigate(SearchScreenDestination) | ||
} | ||
) | ||
SetsSections() | ||
FoldersSections() | ||
ClassesSection() | ||
AchievementsSection() | ||
CategoriesSection() | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreenViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.pwhs.quickmem.presentation.app.home | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class HomeViewModel @Inject constructor( | ||
|
||
) : ViewModel() { | ||
|
||
} |
99 changes: 99 additions & 0 deletions
99
app/src/main/java/com/pwhs/quickmem/presentation/app/home/component/StartForBegin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package com.pwhs.quickmem.presentation.app.home.component | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.MaterialTheme.typography | ||
import androidx.compose.material3.Surface | ||
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.Color | ||
import androidx.compose.ui.graphics.painter.Painter | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.pwhs.quickmem.R | ||
|
||
@Composable | ||
fun StartForBegin() { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(16.dp), | ||
) { | ||
Text( | ||
text = "Start for begin", | ||
style = typography.titleMedium.copy( | ||
fontWeight = FontWeight.Bold, | ||
fontSize = 20.sp | ||
), | ||
modifier = Modifier.padding(bottom = 24.dp), | ||
textAlign = TextAlign.Start | ||
) | ||
|
||
ActionButton( | ||
title = "Create a flashcard for yourself", | ||
iconResId = R.drawable.onboarding1, | ||
onClick = { } | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
ActionButton( | ||
title = "Find a topic, class", | ||
iconResId = R.drawable.ic_launcher_foreground, | ||
onClick = { } | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
fun ActionButton( | ||
title: String, | ||
@DrawableRes iconResId: Int, | ||
onClick: () -> Unit | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.height(60.dp) | ||
.clip(RoundedCornerShape(8.dp)) | ||
.background(Color(0xFFF0F0F0)) | ||
.clickable(onClick = onClick) | ||
.padding(horizontal = 16.dp) | ||
) { | ||
Image( | ||
painter = painterResource(id = iconResId), | ||
contentDescription = null, | ||
contentScale = ContentScale.Fit, | ||
modifier = Modifier.size(40.dp) | ||
) | ||
Spacer(modifier = Modifier.width(16.dp)) | ||
Text( | ||
text = title, | ||
style = typography.bodyMedium.copy( | ||
fontWeight = FontWeight.Medium, | ||
fontSize = 16.sp | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.