|
|
@ -108,9 +108,11 @@ fun QuotePage(
|
|
|
|
// --/!\-- a modifier --/!\--
|
|
|
|
// --/!\-- a modifier --/!\--
|
|
|
|
// isFavorite = service.isFavorite(id)
|
|
|
|
// isFavorite = service.isFavorite(id)
|
|
|
|
// --------------------------
|
|
|
|
// --------------------------
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
|
|
|
|
userId = index,
|
|
|
|
id = quoteId,
|
|
|
|
id = quoteId,
|
|
|
|
context = context
|
|
|
|
context = context,
|
|
|
|
|
|
|
|
service = service
|
|
|
|
)
|
|
|
|
)
|
|
|
|
QuoteText(
|
|
|
|
QuoteText(
|
|
|
|
text = '"' + quote.content + '"'
|
|
|
|
text = '"' + quote.content + '"'
|
|
|
@ -154,14 +156,11 @@ fun QuotePage(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Box(modifier = Modifier.fillMaxWidth().background(gradienBox).fillMaxSize()){
|
|
|
|
Box(modifier = Modifier.fillMaxWidth().background(gradienBox).fillMaxSize()){
|
|
|
|
Column {
|
|
|
|
Column {
|
|
|
|
AddComment(index)
|
|
|
|
AddComment(index, service)
|
|
|
|
LstComment(service.getComment(quoteId))
|
|
|
|
LstComment(service.getComment(quoteId))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(isCommentVisible){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -190,7 +189,7 @@ fun ImageQuote(imageUrl : String){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun FunctionalIcon(isFavorite: Boolean, id : Int, context : Context){
|
|
|
|
fun FunctionalIcon(isFavorite: Boolean, userId : Int, id : Int, context : Context, service: IServices){
|
|
|
|
Row(modifier = Modifier
|
|
|
|
Row(modifier = Modifier
|
|
|
|
.fillMaxWidth()
|
|
|
|
.fillMaxWidth()
|
|
|
|
) {
|
|
|
|
) {
|
|
|
@ -233,7 +232,7 @@ fun FunctionalIcon(isFavorite: Boolean, id : Int, context : Context){
|
|
|
|
|
|
|
|
|
|
|
|
if(isFavorite){
|
|
|
|
if(isFavorite){
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onClick = { }, //sup fav
|
|
|
|
onClick = { service.SupFav(userId = userId, QuoteId = id)}, //sup fav
|
|
|
|
modifier = Modifier.padding(start = 20.dp)
|
|
|
|
modifier = Modifier.padding(start = 20.dp)
|
|
|
|
){
|
|
|
|
){
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
@ -246,7 +245,7 @@ fun FunctionalIcon(isFavorite: Boolean, id : Int, context : Context){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onClick = { }, //add fav
|
|
|
|
onClick = { service.AddFav(userId = userId, QuoteId = id)}, //add fav
|
|
|
|
modifier = Modifier.padding(start = 50.dp)
|
|
|
|
modifier = Modifier.padding(start = 50.dp)
|
|
|
|
){
|
|
|
|
){
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
@ -300,9 +299,9 @@ fun LikeInfo(likes : Int){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddComment(userId : Int){
|
|
|
|
fun AddComment(userId : Int, service: IServices){
|
|
|
|
var text by remember { mutableStateOf("") }
|
|
|
|
var text by remember { mutableStateOf("") }
|
|
|
|
Row{
|
|
|
|
Row(modifier = Modifier.padding(bottom = 15.dp, top = 15.dp)){
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onClick = { isCommentVisible = !isCommentVisible},
|
|
|
|
onClick = { isCommentVisible = !isCommentVisible},
|
|
|
|
){
|
|
|
|
){
|
|
|
@ -325,7 +324,7 @@ fun AddComment(userId : Int){
|
|
|
|
.width(300.dp)
|
|
|
|
.width(300.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onClick = { }, //send comment
|
|
|
|
onClick = { service.AddComment(text)}, //send comment
|
|
|
|
){
|
|
|
|
){
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
Icons.AutoMirrored.Filled.Send,
|
|
|
|
Icons.AutoMirrored.Filled.Send,
|
|
|
|