1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JetpackCompose簡単なロード中のグルグルサンプル

Posted at

JetpackComposeを触ろうと思ったので、簡単なサンプルを作ろうと思いました。
ロード中のグルグルを実装してみようと思います。

Progress.kt
@Composable
fun Progress() {
    Box(
        modifier = Modifier
            .fillMaxSize()
            // onClickの処理グルグル中に操作を受け付けるなら必要ない。
            .clickable(
                interactionSource = remember { MutableInteractionSource() },
                indication = null,
            ) {
                // 空にしておけばonClickの処理グルグル中に操作を受け付けない
            },
        contentAlignment = Alignment.Center
    ) {
        CircularProgressIndicator(color = Color.Blue)
    }
}

こちらので使用したい画面中央にグルグルが表示されます。

新規でプロジェクト作成する時など、事前にシンプルなサンプルを作っておくと便利ですね。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?