Android Weekly Notes #487

Android Weekly Issue #487

Jetpack Compose with Robot Testing Pattern

Jake Wharton早年关于robot testing的文章. https://jakewharton.com/testing-robots/

感觉这篇文章主要讲的内容是对测试工具的封装.

Synchronize RecyclerView with TabLayout

RecyclerView和Tab结合, 例子是表情包选择器.

每次选tab都切换到对应的section.

Library: https://github.com/Ahmad-Hamwi/TabSync

How to create a truly custom theme in Jetpack Compose

Compose Theme的官方文档: https://developer.android.com/jetpack/compose/themes

还有一个codelab:
https://developer.android.com/codelabs/jetpack-compose-theming#0

但是一般app会有自己的design system, 所以还是需要自己的theme.

object AppTheme {

    val colors: AppColors
        @Composable
        @ReadOnlyComposable
        get() = LocalColors.current

    val typography: AppTypography
        @Composable
        @ReadOnlyComposable
        get() = LocalTypography.current

    val dimensions: AppDimensions
        @Composable
        @ReadOnlyComposable
        get() = LocalDimensions.current
}

字体也是一样, 最后用了:

internal val LocalTypography = staticCompositionLocalOf { AppTypography() }

Apply special effects to images with the CameraX Extensions API

camera-extensions API的特效.

callback-ktx

这个库: https://github.com/sagar-viradiya/callback-ktx

变callback为suspend扩展方法.

目前cover了:

  • Animation
  • Location
  • RecyclerView
  • Sensor
  • View
  • Widget(TextView)

How to use an in-memory database for testing on Ktor

ktor的in memory database.

测试.

25 Best Android Libraries, Projects, and Tools You Won’t Want to Miss Out in 2021

之前的同系列文章:

  • 20 dev tools
  • 25 libraries

这种盘点还挺有意思的.

Rx to Coroutines Concepts, Part 2.1: Exceptions

相关的系列文章还有:
https://code.cash.app/rx-to-coroutines-concepts-await-and-channels

Coroutine scope functions

这个得好好看一下.

7 things you should know before using Jetpack Compose

都是简单问题.

Code

  • https://github.com/xmartlabs/TypedNavigation
  • https://github.com/sagar-viradiya/callback-ktx

你可能感兴趣的:(Android Weekly Notes #487)