Created
August 17, 2020 12:27
-
-
Save Rokata9/197100002502a8490e2fe246811c6ec7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.example.secondtry | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.Text | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material.Divider | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.layout.layoutId | |
import androidx.compose.ui.res.vectorResource | |
import androidx.compose.ui.text.TextStyle | |
import androidx.compose.ui.text.font.FontWeight | |
import androidx.compose.ui.unit.dp | |
import androidx.compose.ui.unit.sp | |
import com.example.secondtry.components.WallpostButton | |
import kotlin.time.ExperimentalTime | |
// TODO: image loading | |
@ExperimentalTime | |
@Composable | |
fun WallpostView(wallpost: Wallpost) { | |
Row { | |
RoundedImage() | |
Column { | |
Text(text = wallpost.username, | |
modifier = Modifier.padding(5.dp, 0.dp, 0.dp, 0.dp), | |
style = TextStyle(fontWeight = FontWeight.Bold), | |
color = Color.Black, | |
fontSize = 16.sp) | |
Text(text = wallpost.timeEllapsed, | |
modifier = Modifier.padding(5.dp, 0.dp, 0.dp, 0.dp)) | |
} | |
} | |
Column() { | |
Text(text = wallpost.content, | |
modifier = Modifier.padding(5.dp, 5.dp, 0.dp, 5.dp), | |
color = Color.Black, | |
fontSize = 16.sp) | |
Image( | |
asset = vectorResource(id = R.drawable.user), | |
modifier = Modifier.padding(0.dp, 10.dp, 0.dp, 10.dp) | |
) | |
Divider(color = Color.Gray, | |
modifier = Modifier.height(1.dp)) | |
} | |
Row { | |
WallpostButton(imageId = R.drawable.like, | |
modifier = Modifier.layoutId("likeBtn"), | |
text = "Like") | |
// TODO: make vector image for comment | |
WallpostButton(imageId = R.drawable.share, | |
modifier = Modifier.layoutId("commentBtn"), | |
text = "Comment") | |
WallpostButton(imageId = R.drawable.share, | |
modifier = Modifier.layoutId("shareBtn"), | |
text = "Share") | |
} | |
Column { | |
Divider(color = Color.Gray, | |
modifier = Modifier.height(1.dp)) | |
Text(text = wallpost.linksText, | |
modifier = Modifier.padding(10.dp, 0.dp, 0.dp, 0.dp), | |
color = Color.Black) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment