| ใฟใคใใซ | English | ๆฅๆฌ่ช | |
|---|---|---|---|
| Basics codelabs | May 23, 2022 | 2ๆ 9, 2022 | โ |
| Layouts codelabs | May 18, 2022 | 2ๆ 9, 2022 | โ |
| State codelab | May 16, 2022 | 2ๆ 24, 2022 | โ |
| Theming codelab | May 18, 2022 | 2ๆ 9, 2022 | โ |
| Migration codelab | Jun 7, 2022 | 4ๆ 27, 2022 | โ |
| Animation codelab | May 26, 2022 | 2ๆ 9, 2022 | โ |
| Navigation codelab | May 18, 2022 | 5ๆ 18, 2022 | โ |
| Testing codelab | May 18, 2022 | 5ๆ 18, 2022 | โ |
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
| val db = SQLiteDatabase.create(null) | |
| val query = "SELECT sqlite_version()" | |
| val sqlite = DatabaseUtils.stringForQuery(db, query, null) | |
| Timber.d("SDK: API-${Build.VERSION.SDK_INT}, SQLite: $sqlite") | |
| // 1658317908.842 D: SDK: API-31, SQLite: 3.32.2 |
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
| @Suppress("UNUSED_VARIABLE") | |
| val default = listOf( | |
| // https://android.benigumo.com/20220711/default-theme-color/ | |
| // material3 | |
| // light dark | |
| Color(0xff6750a4), Color(0xffd0bcff), // colorPrimary | |
| Color(0xffffffff), Color(0xff381e72), // colorOnPrimary | |
| Color(0xffeaddff), Color(0xff4f378b), // colorPrimaryContainer |
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
| // https://android.benigumo.com/20220703/navbackstackentry-lifecycle/ | |
| @Composable | |
| fun LocalLifecycleStateLogger( | |
| screenName: String, | |
| lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current | |
| ) { | |
| val ownerSimpleName = lifecycleOwner.nameHash() | |
| DisposableEffect(lifecycleOwner) { | |
| val observer = LifecycleEventObserver { _, event -> |
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
| // dp(Dp) โ px(Float) | |
| @Composable | |
| internal fun Dp.dpToPx(): Float { | |
| return this.value * LocalDensity.current.density | |
| } | |
| // dp(Dp) โ sp(TextUnit) | |
| @Composable | |
| internal fun Dp.dpToSp(): TextUnit { | |
| return (this.value * LocalDensity.current.density / LocalDensity.current.fontScale).sp |
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
| ~ find '/Applications/Android Studio.app/Contents/jre/Contents/Home' | |
| find: /Applications/Android Studio.app/Contents/jre/Contents/Home: No such file or directory | |
| ~ find "$HOME/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio" -path '*/Android Studio.app/Contents/jre/Contents/Home' | |
| /Users/maochanz/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8512546/Android Studio.app/Contents/jre/Contents/Home | |
| # plain android studio | |
| JAVA_HOME='/Applications/Android Studio.app/Contents/jre/Contents/Home' | |
| # jb toolbox android studio |
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
| Version: 14.0 โโโ | |
| ๐ซ melting face | |
| ๐ซข face with open eyes and hand over mouth | |
| ๐ซฃ face with peeking eye | |
| ๐ซก saluting face | |
| ๐ซฅ dotted line face | |
| ๐ซค face with diagonal mouth | |
| ๐ฅน face holding back tears | |
| ๐ซฑ rightwards hand | |
| ๐ซฑ๐ป rightwards hand: light skin tone |
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
| ๐ซ ๐ซฑ๐ผโ๐ซฒ๐ฟ ๐ซฐ๐ฝ14.0 | |
| ๐ถโ๐ซ๏ธ ๐ง๐ปโโ๏ธ ๐ง๐ฟโโค๏ธโ๐ง๐พ13.1 | |
| ๐ฅฒ ๐ฅท๐ฟ ๐ปโโ๏ธ13.0 | |
| ๐ง๐ปโ๐ฆฐ ๐ง๐ฟโ๐ฆฏ ๐ฉ๐ปโ๐คโ๐ฉ๐ผ12.1 | |
| ๐ฆฉ ๐ฆป๐ฟ ๐ฉ๐ผโ๐คโ๐ฉ๐ป12.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
| fun <T> Flow<T>.log(label: String, tag: String = "###"): Flow<T> { | |
| val prefix = "$tag [$label] ${this.javaClass.simpleName}" | |
| return this | |
| .onStart { | |
| Timber.d("$prefix onStart()") | |
| } | |
| .onEach { value -> | |
| Timber.d("$prefix onEach() value = $value") | |
| } | |
| .onCompletion { cause -> |
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
| val s = """ | |
| ๅใใ็ๅใ ใฃใใฎใ ใ | |
| ใใใคใใ ใ? | |
| ใใใใ | |
| ใsecretใ | |
| ใจใ | |
| ใใผใใณใฐใใใใใใใชใใ | |
| """.trimIndent() |