├── .gitignore ├── .idea ├── .gitignore ├── .name ├── compiler.xml ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml └── vcs.xml ├── README.md ├── build.gradle ├── config.gradle ├── eight ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── eight │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── eight │ │ │ ├── Flow.kt │ │ │ ├── MainActivity.kt │ │ │ ├── NavigationTest.kt │ │ │ ├── One.kt │ │ │ ├── OneActivity.kt │ │ │ ├── OneViewModel.kt │ │ │ ├── PagingTest.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_one.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── eight │ └── ExampleUnitTest.kt ├── five ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── five │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── five │ │ │ ├── BottomNavigation.kt │ │ │ ├── ComplexStickyHeaderTest.kt │ │ │ ├── LazyColumnTest.kt │ │ │ ├── LazyRowTest.kt │ │ │ ├── LazyVerticalGridTest.kt │ │ │ ├── MainActivity.kt │ │ │ ├── ProgressTest.kt │ │ │ ├── StickyHeaderTest.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxxhdpi │ │ ├── ic_nav_discover_normal.png │ │ ├── ic_nav_my_normal.png │ │ ├── ic_nav_news_normal.png │ │ └── ic_nav_tweet_normal.png │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── five │ └── ExampleUnitTest.kt ├── four ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── four │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── four │ │ │ ├── ButtonTest.kt │ │ │ ├── ImageTest.kt │ │ │ ├── MainActivity.kt │ │ │ ├── ProgressTest.kt │ │ │ ├── TextFieldTest.kt │ │ │ ├── TextTest.kt │ │ │ ├── Toast.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── four │ └── ExampleUnitTest.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── nine ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── nine │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── nine │ │ │ ├── AndroidViewBindingPage.kt │ │ │ ├── AndroidViewPage.kt │ │ │ ├── AndroidWebViewPage.kt │ │ │ ├── ComposeFragment.kt │ │ │ ├── MainActivity.kt │ │ │ ├── ScreenAdapter.kt │ │ │ ├── ShareWidgetActivity.kt │ │ │ ├── WebViewPage.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_share_widget.xml │ │ ├── compose_login.xml │ │ └── fragment_compose.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── ids.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── nine │ └── ExampleUnitTest.kt ├── one ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── one │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── one │ │ │ ├── DefaultParam.kt │ │ │ ├── HigherFunctions.kt │ │ │ ├── MainActivity.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── one │ └── ExampleUnitTest.kt ├── settings.gradle ├── seven ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── seven │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── seven │ │ │ ├── AnimatableTest.kt │ │ │ ├── AnimateAsState.kt │ │ │ ├── AnimationSpec.kt │ │ │ ├── AnimationVectorTest.kt │ │ │ ├── BottomNavigation.kt │ │ │ ├── EasyAnimation.kt │ │ │ ├── GesturesTest.kt │ │ │ ├── InfiniteTransitionTest.kt │ │ │ ├── MainActivity.kt │ │ │ ├── ScrollTest.kt │ │ │ ├── TransitionTest.kt │ │ │ ├── content │ │ │ └── AnimatedContent.kt │ │ │ ├── dynamic │ │ │ ├── BatteryReceiver.kt │ │ │ ├── BatteryScreen.kt │ │ │ └── CanvasDropWater.kt │ │ │ ├── spec │ │ │ └── Spec.kt │ │ │ ├── ui │ │ │ └── theme │ │ │ │ ├── Color.kt │ │ │ │ ├── Shape.kt │ │ │ │ ├── Theme.kt │ │ │ │ └── Type.kt │ │ │ └── visible │ │ │ └── VisibleAnimation.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxhdpi │ │ └── ic_head.jpeg │ │ ├── drawable-xxxhdpi │ │ ├── ic_nav_discover_normal.png │ │ ├── ic_nav_my_normal.png │ │ ├── ic_nav_news_normal.png │ │ └── ic_nav_tweet_normal.png │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── seven │ └── ExampleUnitTest.kt ├── six ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── six │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── six │ │ │ ├── CustomView.kt │ │ │ ├── CustomView1.kt │ │ │ ├── DrawArc.kt │ │ │ ├── DrawBlendMode.kt │ │ │ ├── DrawCircle.kt │ │ │ ├── DrawImage.kt │ │ │ ├── DrawLine.kt │ │ │ ├── DrawOval.kt │ │ │ ├── DrawPath.kt │ │ │ ├── DrawPoint.kt │ │ │ ├── DrawRect.kt │ │ │ ├── DrawRoundRect.kt │ │ │ ├── MainActivity.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxhdpi │ │ └── head.jpg │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── six │ └── ExampleUnitTest.kt ├── ten ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── play │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── play │ │ │ ├── App.kt │ │ │ ├── MainActivity.kt │ │ │ ├── Play.kt │ │ │ ├── logic │ │ │ ├── base │ │ │ │ ├── paging │ │ │ │ │ ├── BasePagingSource.kt │ │ │ │ │ ├── HomePagingSource.kt │ │ │ │ │ ├── OfficialPagingSource.kt │ │ │ │ │ └── ProjectPagingSource.kt │ │ │ │ ├── repository │ │ │ │ │ ├── BaseArticlePagingRepository.kt │ │ │ │ │ └── BaseArticleRepository.kt │ │ │ │ └── viewmodel │ │ │ │ │ ├── BaseAndroidViewModel.kt │ │ │ │ │ └── BaseArticleViewModel.kt │ │ │ ├── model │ │ │ │ ├── ArticleListModel.kt │ │ │ │ ├── ArticleModel.kt │ │ │ │ ├── BannerBean.kt │ │ │ │ ├── BaseModel.kt │ │ │ │ ├── ClassifyModel.kt │ │ │ │ ├── LoginModel.kt │ │ │ │ ├── PlayState.kt │ │ │ │ └── Query.kt │ │ │ ├── network │ │ │ │ ├── PlayAndroidNetwork.kt │ │ │ │ ├── ServiceCreator.kt │ │ │ │ └── service │ │ │ │ │ ├── HomePageService.kt │ │ │ │ │ ├── LoginService.kt │ │ │ │ │ ├── OfficialService.kt │ │ │ │ │ └── ProjectService.kt │ │ │ └── utils │ │ │ │ ├── BarUtils.kt │ │ │ │ ├── DataStoreUtils.kt │ │ │ │ ├── HtmlUtils.kt │ │ │ │ ├── Lerp.kt │ │ │ │ ├── NetworkUtils.kt │ │ │ │ └── Toast.kt │ │ │ └── ui │ │ │ ├── main │ │ │ ├── HomeViewModel.kt │ │ │ ├── MainPage.kt │ │ │ └── NavGraph.kt │ │ │ ├── page │ │ │ ├── article │ │ │ │ ├── ArticlePage.kt │ │ │ │ └── list │ │ │ │ │ ├── ArticleListItem.kt │ │ │ │ │ └── ArticleListPaging.kt │ │ │ ├── home │ │ │ │ ├── HomePage.kt │ │ │ │ ├── HomePageViewModel.kt │ │ │ │ └── HomeRepository.kt │ │ │ ├── login │ │ │ │ ├── AccountRepository.kt │ │ │ │ ├── LoginPage.kt │ │ │ │ └── LoginViewModel.kt │ │ │ ├── mine │ │ │ │ └── ProfilePage.kt │ │ │ ├── official │ │ │ │ ├── OfficialRepository.kt │ │ │ │ └── OfficialViewModel.kt │ │ │ └── project │ │ │ │ ├── ProjectPage.kt │ │ │ │ ├── ProjectRepository.kt │ │ │ │ └── ProjectViewModel.kt │ │ │ ├── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ │ │ └── view │ │ │ ├── ArticleTabRow.kt │ │ │ ├── PlayAppBar.kt │ │ │ ├── WebView.kt │ │ │ ├── edit │ │ │ ├── EmailState.kt │ │ │ ├── PasswordState.kt │ │ │ ├── SignInSignUp.kt │ │ │ └── TextFieldState.kt │ │ │ └── lce │ │ │ ├── ErrorContent.kt │ │ │ ├── LcePage.kt │ │ │ ├── LoadingContent.kt │ │ │ └── NoContent.kt │ └── res │ │ ├── anim │ │ ├── activity_push_in.xml │ │ ├── activity_push_out.xml │ │ ├── center_zoom_in.xml │ │ └── center_zoom_out.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxhdpi │ │ ├── img_default.png │ │ └── img_head.jpeg │ │ ├── drawable-xxxhdpi │ │ ├── ic_nav_discover_actived.png │ │ ├── ic_nav_discover_normal.png │ │ ├── ic_nav_my_normal.png │ │ ├── ic_nav_my_pressed.png │ │ ├── ic_nav_news_actived.png │ │ ├── ic_nav_news_normal.png │ │ ├── ic_nav_tweet_actived.png │ │ └── ic_nav_tweet_normal.png │ │ ├── drawable │ │ ├── bad_loading.xml │ │ ├── bad_network_image.xml │ │ ├── color_progressbar.xml │ │ ├── ic_baseline_bookmark_24.xml │ │ ├── ic_baseline_bookmark_border_24.xml │ │ ├── ic_baseline_visibility_24.xml │ │ ├── ic_baseline_visibility_off_24.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_text_settings.xml │ │ ├── img_to_top_nomal.xml │ │ ├── load_four.xml │ │ ├── load_three.xml │ │ ├── loading_animation.xml │ │ └── no_content_image.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ ├── colors.xml │ │ └── themes.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ └── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── play │ └── ExampleUnitTest.kt ├── three ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── zj │ │ └── three │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── zj │ │ │ └── three │ │ │ ├── CustomLayout.kt │ │ │ ├── MainActivity.kt │ │ │ ├── one │ │ │ ├── Box.kt │ │ │ ├── Column.kt │ │ │ ├── ConstraintLayoutTest.kt │ │ │ ├── ModifierText.kt │ │ │ ├── Row.kt │ │ │ └── ScaffoldTest.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── zj │ └── three │ └── ExampleUnitTest.kt └── two ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── zj │ └── two │ └── ExampleInstrumentedTest.kt ├── main ├── AndroidManifest.xml ├── java │ └── com │ │ └── zj │ │ └── two │ │ ├── Effect.kt │ │ ├── MainActivity.kt │ │ ├── Restructuring.kt │ │ └── ui │ │ └── theme │ │ ├── Color.kt │ │ ├── Shape.kt │ │ ├── Theme.kt │ │ └── Type.kt └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-mdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── values-night │ └── themes.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── themes.xml └── test └── java └── com └── zj └── two └── ExampleUnitTest.kt /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Compose -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ComposeBookSource 2 | 3 | 《Jetpack Compose:Android全新UI编程》全书源代码 4 | 本项目会跟随 `Compose` 官方版本进行升级,如有需要可以 fork。 5 | 如果大家想系统地学习 `Compose` 的话,可以购买我的新书[《Jetpack Compose:Android全新UI编程》](https://juejin.cn/post/7027020266312056840)进行阅读,里面有完整的 Compose 框架供大家学习。 6 | 7 |
8 | 9 |
10 | 11 | [京东购买地址](https://item.jd.com/10039809078875.html) 12 | 13 | [当当购买地址](http://product.dangdang.com/593507948.html) 14 | 15 | ## 实战项目 16 | 本书第十章中的实战项目在这里只是简单的基础版本,如果想继续学习完整版本的实战项目的话可以访问以下链接: 17 | 18 | - 玩安卓(compose或main分支):[https://github.com/zhujiang521/PlayAndroid](https://github.com/zhujiang521/PlayAndroid) 19 | - 玩天气:[https://github.com/zhujiang521/PlayWeather](https://github.com/zhujiang521/PlayWeather) 20 | 21 | ## 微信公众号 22 | 23 | 大家可以直接搜索:江江安卓 进行关注。 24 | 25 | ## 我的博客 26 | 27 | 大家也可以关注我的博客,定期会有文章进行更新。 28 | 29 | - [CSDN](https://zhujiang.blog.csdn.net/) 30 | - [掘金](https://juejin.cn/user/3913917127985240/posts) 31 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | apply from: "config.gradle" 3 | 4 | buildscript { 5 | ext { 6 | compose_version = '1.3.0-beta02' 7 | compose_compiler_version = '1.3.1' 8 | kotlin_version = '1.7.10' 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath "com.android.tools.build:gradle:7.2.2" 16 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } -------------------------------------------------------------------------------- /config.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | cfgs = [ 3 | compileSdkVersion: 33, 4 | minSdkVersion : 24, 5 | targetSdkVersion : 33, 6 | versionCode : 1, 7 | versionName : "1.0", 8 | ] 9 | 10 | des = [ 11 | kotlinVersion : "org.jetbrains.kotlin:kotlin-stdlib:1.7.0", 12 | coreKtx : 'androidx.core:core-ktx:1.8.0', 13 | appcompat : 'androidx.appcompat:appcompat:1.5.1', 14 | material : 'com.google.android.material:material:1.6.1', 15 | lifecycleRuntime: 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1', 16 | activityCompose : 'androidx.activity:activity-compose:1.5.1', 17 | junit : 'junit:junit:4.13.2', 18 | extJunit : 'androidx.test.ext:junit:1.1.3', 19 | espressoCore : 'androidx.test.espresso:espresso-core:3.4.0', 20 | ] 21 | 22 | } -------------------------------------------------------------------------------- /eight/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /eight/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /eight/src/androidTest/java/com/zj/eight/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.zj.eight", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/Flow.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight 2 | 3 | import androidx.compose.foundation.layout.width 4 | import androidx.compose.material.Text 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.runtime.collectAsState 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.text.style.TextAlign 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | import androidx.compose.ui.unit.sp 12 | import kotlinx.coroutines.delay 13 | import kotlinx.coroutines.flow.Flow 14 | import kotlinx.coroutines.flow.flow 15 | 16 | @Composable 17 | fun FlowTest() { 18 | 19 | fun flowTest(): Flow = flow { 20 | for (i in 1..10) { 21 | delay(1000) 22 | emit(i) 23 | } 24 | } 25 | // val ss = Completable() 26 | //.subscribeAsState() 27 | 28 | val flowCount = flowTest().collectAsState(0) 29 | Text( 30 | flowCount.value.toString(), 31 | modifier = Modifier.width(100.dp), 32 | fontSize = 30.sp, 33 | textAlign = TextAlign.Center 34 | ) 35 | } 36 | 37 | 38 | @Preview(showBackground = true) 39 | @Composable 40 | fun FlowTestPreview() { 41 | FlowTest() 42 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.compose.material.MaterialTheme 7 | import androidx.compose.material.Surface 8 | import androidx.compose.material.Text 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.ui.tooling.preview.Preview 11 | import com.zj.eight.ui.theme.EightTheme 12 | 13 | class MainActivity : ComponentActivity() { 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | setContent { 17 | EightTheme { 18 | // A surface container using the 'background' color from the theme 19 | // Surface(color = MaterialTheme.colors.background) { 20 | // Greeting("Android") 21 | // One() 22 | // FlowTest() 23 | NavigationTest() 24 | // } 25 | } 26 | } 27 | } 28 | } 29 | 30 | @Composable 31 | fun Greeting(name: String) { 32 | Text(text = "Hello $name!") 33 | } 34 | 35 | @Preview(showBackground = true) 36 | @Composable 37 | fun DefaultPreview() { 38 | EightTheme { 39 | Greeting("Android") 40 | } 41 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/OneActivity.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.activity.viewModels 6 | import com.zj.eight.databinding.ActivityOneBinding 7 | 8 | class OneActivity : AppCompatActivity() { 9 | 10 | private lateinit var binding: ActivityOneBinding 11 | private val viewModel by viewModels() 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | binding = ActivityOneBinding.inflate(layoutInflater) 16 | setContentView(binding.root) 17 | initView() 18 | } 19 | 20 | private fun initView() { 21 | viewModel.count.observe(this) { 22 | binding.oneTvCount.text = it.toString() 23 | } 24 | binding.oneBtnAdd.setOnClickListener { 25 | val count = viewModel.count.value ?: 0 26 | viewModel.onCountChanged(count + 2) 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/OneViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight 2 | 3 | import androidx.hilt.lifecycle.ViewModelInject 4 | import androidx.lifecycle.LiveData 5 | import androidx.lifecycle.MutableLiveData 6 | import androidx.lifecycle.ViewModel 7 | import androidx.lifecycle.ViewModelProvider 8 | import dagger.hilt.android.HiltAndroidApp 9 | import javax.inject.Inject 10 | 11 | class OneViewModel(defaultCount: Int) : ViewModel() { 12 | 13 | private val _count = MutableLiveData(defaultCount) 14 | 15 | val count: LiveData 16 | get() = _count 17 | 18 | fun onCountChanged(count: Int) { 19 | _count.postValue(count) 20 | } 21 | 22 | } 23 | 24 | @HiltAndroidApp 25 | class TwoViewModel @Inject constructor(defaultCount: Int) : ViewModel() { 26 | 27 | private val _count = MutableLiveData(defaultCount) 28 | 29 | val count: LiveData 30 | get() = _count 31 | 32 | fun onCountChanged(count: Int) { 33 | _count.postValue(count) 34 | } 35 | 36 | } 37 | 38 | class OneViewModelFactory(private val defaultCount: Int) : ViewModelProvider.Factory { 39 | 40 | override fun create(modelClass: Class): T { 41 | return OneViewModel(defaultCount) as T 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | val Purple200 = Color(0xFFBB86FC) 6 | val Purple500 = Color(0xFF6200EE) 7 | val Purple700 = Color(0xFF3700B3) 8 | val Teal200 = Color(0xFF03DAC5) -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight.ui.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material.MaterialTheme 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.runtime.Composable 8 | 9 | private val DarkColorPalette = darkColors( 10 | primary = Purple200, 11 | primaryVariant = Purple700, 12 | secondary = Teal200 13 | ) 14 | 15 | private val LightColorPalette = lightColors( 16 | primary = Purple500, 17 | primaryVariant = Purple700, 18 | secondary = Teal200 19 | 20 | /* Other default colors to override 21 | background = Color.White, 22 | surface = Color.White, 23 | onPrimary = Color.White, 24 | onSecondary = Color.Black, 25 | onBackground = Color.Black, 26 | onSurface = Color.Black, 27 | */ 28 | ) 29 | 30 | @Composable 31 | fun EightTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable() () -> Unit) { 32 | val colors = if (darkTheme) { 33 | DarkColorPalette 34 | } else { 35 | LightColorPalette 36 | } 37 | 38 | MaterialTheme( 39 | colors = colors, 40 | typography = Typography, 41 | shapes = Shapes, 42 | content = content 43 | ) 44 | } -------------------------------------------------------------------------------- /eight/src/main/java/com/zj/eight/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.zj.eight.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ) 16 | /* Other default text styles to override 17 | button = TextStyle( 18 | fontFamily = FontFamily.Default, 19 | fontWeight = FontWeight.W500, 20 | fontSize = 14.sp 21 | ), 22 | caption = TextStyle( 23 | fontFamily = FontFamily.Default, 24 | fontWeight = FontWeight.Normal, 25 | fontSize = 12.sp 26 | ) 27 | */ 28 | ) -------------------------------------------------------------------------------- /eight/src/main/res/layout/activity_one.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 |