Jetpack Compose 入门必看的文档/项目

Jetpack Compose 入门必看的文档/项目

Get started
  • 官方文档,必看
Jetpack Compose samples
  • 官方提供的代码示例,与 Jetpack Compose 版本同步更新代码。
Jetpack Compose Playground
  • Jetpack Compose 相关文档/示例/教程的集合。
Accompanist
  • 谷歌官方提供的功能扩展框架,包含以下组件:

    • Coil/Glide 图片加载框架
    //Coil
    implementation "com.google.accompanist:accompanist-coil:<version>"
    //or Glide
    implementation "com.google.accompanist:accompanist-glide:<version>"
    • Insets

    提供了获取系统 UI 尺寸、边距等属性接口。

    implementation "com.google.accompanist:accompanist-insets:<version>"
    • System UI Controller

    用于更新 Jetpack Compose 中的系统 UI 栏颜色。

    implementation "com.google.accompanist:accompanist-systemuicontroller:<version>"
    • AppCompat Compose Theme Adapter¶

    在 Jetpack Compose 中重用 AppCompat XML 主题进行主题化。

    implementation "com.google.accompanist:accompanist-appcompat-theme:<version>"
    • Pager

    为 Jetpack Compose 提供 ViewPager 布局的库。

    implementation "com.google.accompanist:accompanist-pager:<version>"
    // If using indicators, also depend on 
    implementation "com.google.accompanist:accompanist-pager-indicators:<version>"
    • Swipe Refresh

    滑动刷新布局,类似 Android 的 SwipeRefreshLayout。

    implementation "com.google.accompanist:accompanist-swiperefresh:<version>"
    • Flow Layouts

    与标准的 Row 和 Column 组合不同,如果它们超过可用空间,布局子项将跨越行/列显示。

    implementation "com.google.accompanist:accompanist-flowlayout:<version>"
Icons - Google Fonts
  • 谷歌官方 Material Design 图标库

    // Material Design
    implementation 'androidx.compose.material:material:<version>'
    // Material design icons
    implementation 'androidx.compose.material:material-icons-core:<version>'
    implementation 'androidx.compose.material:material-icons-extended:<version>'