generated from android/android-dev-challenge-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
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
MohammedYakub
committed
Mar 14, 2021
1 parent
d3944e6
commit 665896c
Showing
6 changed files
with
272 additions
and
33 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/example/androiddevchallenge/BottomNavType.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,7 @@ | ||
package com.example.androiddevchallenge | ||
|
||
enum class BottomNavType { | ||
HOME, | ||
PLAY, | ||
PROFILE, | ||
} |
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
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
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/example/androiddevchallenge/ui/PlayScreen.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,60 @@ | ||
package com.example.androiddevchallenge.ui | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Scaffold | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import com.example.androiddevchallenge.R | ||
import com.example.androiddevchallenge.ui.theme.AppThemeState | ||
|
||
|
||
@Composable | ||
fun PlayScreen(value: AppThemeState) { | ||
Scaffold { | ||
Box(modifier = Modifier.fillMaxHeight(), content = { | ||
Image( | ||
imageVector = ImageVector.vectorResource(id = if (value.darkTheme) R.drawable.dark_welcome else R.drawable.light_welcome), | ||
contentDescription = "background", | ||
modifier = Modifier.fillMaxSize(), | ||
contentScale = ContentScale.FillBounds | ||
) | ||
LazyColumn( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.fillMaxHeight() | ||
.padding(horizontal = 16.dp), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
|
||
) { | ||
item { | ||
Text( | ||
text = stringResource(id = R.string.play).toUpperCase(), | ||
style = MaterialTheme.typography.h1, | ||
textAlign = TextAlign.Center, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 16.dp) | ||
) | ||
} | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.