{"id":1555,"date":"2021-05-31T10:08:07","date_gmt":"2021-05-31T02:08:07","guid":{"rendered":"http:\/\/wthee.xyz\/?p=1555"},"modified":"2021-05-31T10:08:07","modified_gmt":"2021-05-31T02:08:07","slug":"jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/","title":{"rendered":"Jetpack Compose \u5165\u95e8\u5fc5\u770b\u7684\u6587\u6863\/\u9879\u76ee"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_38 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Jetpack-Compose-%E5%85%A5%E9%97%A8%E5%BF%85%E7%9C%8B%E7%9A%84%E6%96%87%E6%A1%A3%E9%A1%B9%E7%9B%AE\" title=\"Jetpack Compose \u5165\u95e8\u5fc5\u770b\u7684\u6587\u6863\/\u9879\u76ee\">Jetpack Compose \u5165\u95e8\u5fc5\u770b\u7684\u6587\u6863\/\u9879\u76ee<\/a><ul class='ez-toc-list-level-5'><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Get-started\" title=\"Get started\">Get started<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Jetpack-Compose-samples\" title=\"Jetpack Compose samples\">Jetpack Compose samples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Jetpack-Compose-Playground\" title=\"Jetpack Compose Playground\">Jetpack Compose Playground<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Accompanist\" title=\"Accompanist\">Accompanist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/wthee.xyz\/index.php\/2021\/05\/31\/jetpack-compose-%e5%85%a5%e9%97%a8%e5%bf%85%e7%9c%8b%e7%9a%84%e6%96%87%e6%a1%a3-%e9%a1%b9%e7%9b%ae\/#Icons-Google-Fonts\" title=\"Icons &#8211; Google Fonts\">Icons &#8211; Google Fonts<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"Jetpack-Compose-%E5%85%A5%E9%97%A8%E5%BF%85%E7%9C%8B%E7%9A%84%E6%96%87%E6%A1%A3%E9%A1%B9%E7%9B%AE\"><\/span>Jetpack Compose \u5165\u95e8\u5fc5\u770b\u7684\u6587\u6863\/\u9879\u76ee<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h5><span class=\"ez-toc-section\" id=\"Get-started\"><\/span><a href=\"https:\/\/developer.android.com\/jetpack\/compose\/documentation\">Get started<\/a><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ul>\n<li>\u5b98\u65b9\u6587\u6863\uff0c\u5fc5\u770b<\/li>\n<\/ul>\n<h5><span class=\"ez-toc-section\" id=\"Jetpack-Compose-samples\"><\/span><a href=\"https:\/\/github.com\/android\/compose-samples\">Jetpack Compose samples<\/a><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ul>\n<li>\u5b98\u65b9\u63d0\u4f9b\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u4e0e  Jetpack Compose \u7248\u672c\u540c\u6b65\u66f4\u65b0\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<h5><span class=\"ez-toc-section\" id=\"Jetpack-Compose-Playground\"><\/span><a href=\"https:\/\/github.com\/Foso\/Jetpack-Compose-Playground\/\">Jetpack Compose Playground<\/a><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ul>\n<li>Jetpack Compose \u76f8\u5173\u6587\u6863\/\u793a\u4f8b\/\u6559\u7a0b\u7684\u96c6\u5408\u3002<\/li>\n<\/ul>\n<h5><span class=\"ez-toc-section\" id=\"Accompanist\"><\/span><a href=\"https:\/\/github.com\/google\/accompanist\/\">Accompanist<\/a><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ul>\n<li>\n<p>\u8c37\u6b4c\u5b98\u65b9\u63d0\u4f9b\u7684\u529f\u80fd\u6269\u5c55\u6846\u67b6\uff0c\u5305\u542b\u4ee5\u4e0b\u7ec4\u4ef6\uff1a<\/p>\n<ul>\n<li>Coil\/Glide \u56fe\u7247\u52a0\u8f7d\u6846\u67b6<\/li>\n<\/ul>\n<pre><code class=\"\" data-line=\"\">\/\/Coil\nimplementation &quot;com.google.accompanist:accompanist-coil:&lt;version&gt;&quot;\n\/\/or Glide\nimplementation &quot;com.google.accompanist:accompanist-glide:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>Insets<\/li>\n<\/ul>\n<blockquote>\n<p>\u63d0\u4f9b\u4e86\u83b7\u53d6\u7cfb\u7edf UI \u5c3a\u5bf8\u3001\u8fb9\u8ddd\u7b49\u5c5e\u6027\u63a5\u53e3\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-insets:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>System UI Controller<\/li>\n<\/ul>\n<blockquote>\n<p>\u7528\u4e8e\u66f4\u65b0 Jetpack Compose \u4e2d\u7684\u7cfb\u7edf UI \u680f\u989c\u8272\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-systemuicontroller:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>AppCompat Compose Theme Adapter\u00b6<\/li>\n<\/ul>\n<blockquote>\n<p>\u5728 Jetpack Compose \u4e2d\u91cd\u7528 AppCompat XML \u4e3b\u9898\u8fdb\u884c\u4e3b\u9898\u5316\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-appcompat-theme:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>Pager<\/li>\n<\/ul>\n<blockquote>\n<p>\u4e3a Jetpack Compose \u63d0\u4f9b ViewPager \u5e03\u5c40\u7684\u5e93\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-pager:&lt;version&gt;&quot;\n\/\/ If using indicators, also depend on \nimplementation &quot;com.google.accompanist:accompanist-pager-indicators:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>Swipe Refresh<\/li>\n<\/ul>\n<blockquote>\n<p>\u6ed1\u52a8\u5237\u65b0\u5e03\u5c40\uff0c\u7c7b\u4f3c Android \u7684 SwipeRefreshLayout\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-swiperefresh:&lt;version&gt;&quot;<\/code><\/pre>\n<ul>\n<li>Flow Layouts<\/li>\n<\/ul>\n<blockquote>\n<p>\u4e0e\u6807\u51c6\u7684 Row \u548c Column \u7ec4\u5408\u4e0d\u540c\uff0c\u5982\u679c\u5b83\u4eec\u8d85\u8fc7\u53ef\u7528\u7a7a\u95f4\uff0c\u5e03\u5c40\u5b50\u9879\u5c06\u8de8\u8d8a\u884c\/\u5217\u663e\u793a\u3002 <\/p>\n<\/blockquote>\n<pre><code class=\"\" data-line=\"\">implementation &quot;com.google.accompanist:accompanist-flowlayout:&lt;version&gt;&quot;<\/code><\/pre>\n<\/li>\n<\/ul>\n<h5><a href=\"https:\/\/fonts.google.com\/icons\">Icons - Google Fonts<\/a><\/h5>\n<ul>\n<li>\n<p>\u8c37\u6b4c\u5b98\u65b9 Material Design \u56fe\u6807\u5e93<\/p>\n<pre><code class=\"\" data-line=\"\">\/\/ Material Design\nimplementation &#039;androidx.compose.material:material:&lt;version&gt;&#039;\n\/\/ Material design icons\nimplementation &#039;androidx.compose.material:material-icons-core:&lt;version&gt;&#039;\nimplementation &#039;androidx.compose.material:material-icons-extended:&lt;version&gt;&#039;<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Jetpack Compose \u76f8\u5173\u7684\u4e00\u4e9b\u6587\u6863\/\u9879\u76ee\u6c47\u603b<\/p>\n","protected":false},"author":1,"featured_media":1556,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_newsletter_access":""},"categories":[19],"tags":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/wthee.xyz\/wp-content\/uploads\/2021\/05\/jetpack_compose.png?fit=1600%2C900&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pcwHG0-p5","jetpack-related-posts":[{"id":1571,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/08\/jetpack-compose-%e4%bd%bf%e7%94%a8-coil-%e5%8a%a0%e8%bd%bd%e5%9b%be%e7%89%87\/","url_meta":{"origin":1555,"position":0},"title":"Jetpack Compose \u4f7f\u7528 Coil \u52a0\u8f7d\u56fe\u7247","author":"wthee","date":"2021\u5e746\u67088\u65e5","format":false,"excerpt":"Accompanist \u63d0\u4f9b\u4e86\u6613\u4e8e\u4f7f\u7528\u7684 Painter\uff0c\u5b83\u53ef\u4ee5\u4f7f\u7528 Coil \u56fe\u50cf\u52a0\u8f7d\u5e93\u4ece\u5916\u90e8\u6765\u6e90\u2026","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1569,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/08\/jetpack-compose-%e6%9d%83%e9%99%90%e7%94%b3%e8%af%b7\/","url_meta":{"origin":1555,"position":1},"title":"Jetpack Compose \u6743\u9650\u7533\u8bf7","author":"wthee","date":"2021\u5e746\u67088\u65e5","format":false,"excerpt":"\u5728 Jetpack Compose \u4e2d\uff0c\u7533\u8bf7\u6743\u9650\u7684\u4e00\u79cd\u65b9\u5f0f","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1579,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/09\/jetpack-compose-navigation-%e7%9a%84%e4%bd%bf%e7%94%a8\/","url_meta":{"origin":1555,"position":2},"title":"Jetpack Compose Navigation \u7684\u4f7f\u7528","author":"wthee","date":"2021\u5e746\u67089\u65e5","format":false,"excerpt":"Compose \u7248\u672c\uff1a1.0.0-beta08 Navigation \u7248\u672c\uff1a2.4.0-alpha0\u2026","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1563,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/08\/jetpack-compose-chipgroup\/","url_meta":{"origin":1555,"position":3},"title":"Jetpack Compose ChipGroup","author":"wthee","date":"2021\u5e746\u67088\u65e5","format":false,"excerpt":"\u5b9e\u73b0 ChipGroup \u7ec4\u4ef6","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1573,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/08\/jetpack-compose-%e5%ae%9e%e7%8e%b0%e6%bb%91%e5%8a%a8%e6%8a%98%e5%8f%a0%e6%95%88%e6%9e%9c\/","url_meta":{"origin":1555,"position":4},"title":"Jetpack Compose \u5b9e\u73b0\u6ed1\u52a8\u6298\u53e0\u6548\u679c","author":"wthee","date":"2021\u5e746\u67088\u65e5","format":false,"excerpt":"\u5229\u7528 rememberScrollState() \uff0c\u5b9e\u73b0\u6ed1\u52a8\u6298\u53e0\u7684\u6548\u679c","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1576,"url":"https:\/\/wthee.xyz\/index.php\/2021\/06\/09\/jetpack-compose-%e6%8b%96%e5%8a%a8%e6%95%88%e6%9e%9c\/","url_meta":{"origin":1555,"position":5},"title":"Jetpack Compose \u62d6\u52a8\u6548\u679c","author":"wthee","date":"2021\u5e746\u67089\u65e5","format":false,"excerpt":"\u5229\u7528 Modifier.draggable \u76d1\u542c\u62d6\u52a8\u8ddd\u79bb\uff0c\u5b9e\u73b0\u62d6\u52a8\u6548\u679c","rel":"","context":"\u5728\u201cAndroid \u5f00\u53d1\u201d\u4e2d","block_context":{"text":"Android \u5f00\u53d1","link":"https:\/\/wthee.xyz\/index.php\/category\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1555"}],"collection":[{"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=1555"}],"version-history":[{"count":1,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1555\/revisions"}],"predecessor-version":[{"id":1557,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/posts\/1555\/revisions\/1557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/media\/1556"}],"wp:attachment":[{"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=1555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=1555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wthee.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=1555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}