dependencies {
implementation("io.coil-kt:coil-compose:2.0.0")
}
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.bagus2x.mymovies.ui.detail.movie | |
import androidx.lifecycle.* | |
import com.bagus2x.mymovies.data.Movie | |
import com.bagus2x.mymovies.data.Result | |
import com.bagus2x.mymovies.data.source.MovieRepository | |
import dagger.hilt.android.lifecycle.HiltViewModel | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.launch | |
import javax.inject.Inject |
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
sealed class StackOrientation { | |
object Horizontal : StackOrientation() | |
object Vertical : StackOrientation() | |
} | |
@Composable | |
fun Stack( | |
modifier: Modifier = Modifier, | |
orientation: StackOrientation = StackOrientation.Vertical, | |
gap: Dp = 0.dp, |
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.bagus2x.indicator | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.util.AttributeSet | |
import android.view.View | |
class Indicator : View { |
This file has been truncated, but you can view the full file.
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
[ | |
"{\"structValue\":{\"fields\":{\"raw_detection_scores\":{\"listValue\":{\"values\":[{\"listValue\":{\"values\":[{\"numberValue\":0.000935435295,\"kind\":\"numberValue\"},{\"numberValue\":0.00124356151,\"kind\":\"numberValue\"},{\"numberValue\":0.00174513459,\"kind\":\"numberValue\"},{\"numberValue\":0.00128659606,\"kind\":\"numberValue\"},{\"numberValue\":0.000911355,\"kind\":\"numberValue\"},{\"numberValue\":0.00494873524,\"kind\":\"numberValue\"},{\"numberValue\":0.000826954842,\"kind\":\"numberValue\"},{\"numberValue\":0.00328528881,\"kind\":\"numberValue\"},{\"numberValue\":0.0019146204,\"kind\":\"numberValue\"}]},\"kind\":\"listValue\"},{\"listValue\":{\"values\":[{\"numberValue\":0.00135439634,\"kind\":\"numberValue\"},{\"numberValue\":0.000440776348,\"kind\":\"numberValue\"},{\"numberValue\":0.000671267509,\"kind\":\"numberValue\"},{\"numberValue\":0.000405371189,\"kind\":\"numberValue\"},{\"numberValue\":0.000530421734,\"kind\":\"numberValue\"},{\"numberValue\":0.00103834271,\"kind\":\"numberVal |
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
private val DaysInMonthCell = GridCells.Fixed(count = 7) | |
@Composable | |
fun Calendar( | |
modifier: Modifier = Modifier, | |
localDateTime: LocalDateTime | |
) { | |
val firstDate = remember(localDateTime) { | |
with(localDateTime) { | |
val firstOfMonth = withDayOfMonth(1) |
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
@Composable | |
fun RatingBar( | |
rating: Float, | |
onChange: (Int, Float) -> Unit, | |
max: Int | |
) { | |
Row { | |
val value = rating * max | |
val fullStar = value.toInt() | |
var fractionStar = value - fullStar |
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
create or replace function create_path(parent_id_param bigint) returns ltree | |
language plpgsql | |
as | |
$$ | |
declare parent_path ltree; | |
declare current_id BIGINT; | |
BEGIN | |
SELECT currval('"comment_id_seq"') into current_id; | |
IF parent_id_param is NOT NULL THEN |
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
Show hidden characters
fun CommentListScreen() { | |
val comments by produceDummyComments(10000) | |
Box { | |
LazyColumn( | |
modifier = Modifier | |
.systemBarsPadding() | |
.fillMaxSize(), | |
) { | |
commentList(comments) | |
} |
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
@Composable | |
fun NotificationScreen( | |
navController: NavController, | |
viewModel: NotificationViewModel = hiltViewModel() | |
) { | |
val videos by viewModel.videos.collectAsStateWithLifecycle() | |
val listState = rememberLazyListState() | |
BoxWithConstraints { | |
val density = LocalDensity.current |