{"id":2190,"date":"2022-11-25T18:01:15","date_gmt":"2022-11-25T10:01:15","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/2190.html"},"modified":"2022-11-25T18:01:15","modified_gmt":"2022-11-25T10:01:15","slug":"vivo-%e6%8a%98%e5%8f%a0%e5%b1%8f%e4%b8%89%e6%96%b9%e5%ba%94%e7%94%a8%e5%bc%80%e5%8f%91%e9%80%82%e9%85%8d%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/2190.html","title":{"rendered":"vivo \u6298\u53e0\u5c4f\u4e09\u65b9\u5e94\u7528\u5f00\u53d1\u9002\u914d\u6307\u5357"},"content":{"rendered":"<h1><strong>\u4e00\u3001vivo \u591a\u7a97\u53e3(\u5206\u5c4f\u5c0f\u7a97)\u529f\u80fd\u9002\u914d\u6307\u5357<\/strong><\/h1>\n<h2><strong>1.1 \u9002\u914d\u80cc\u666f<\/strong><\/h2>\n<p>\u968f\u7740\u5927\u5c4f\u624b\u673a\u7684\u666e\u53ca\uff0c\u7528\u6237\u5bf9\u4e8e\u591a\u7a97\u53e3\u529f\u80fd\u7684\u4f7f\u7528\u8d8a\u6765\u8d8a\u9891\u7e41\uff0c\u5c3d\u7ba1google \u5df2\u7ecf\u63a8\u51fa\u4e86\u591a\u7a97\u53e3\u529f\u80fd\uff0c\u4f46\u662f\u5f88\u591a\u5e94\u7528\u8fd8\u6ca1\u6709\u9002\u914d\u591a\u7a97\u53e3\u529f\u80fd\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u8f93\u51fa\u300avivo \u591a\u7a97\u53e3\uff08\u5206\u5c4f\u5c0f\u7a97\uff09\u529f\u80fd\u9002\u914d\u6307\u5357\u300b\u63d0\u4f9b\u7ed9\u5e94\u7528\u4fa7\u8fdb\u884c\u9002\u914d\uff0c\u8ba9\u4e09\u65b9\u5e94\u7528\u5f00\u53d1\u8005\u80fd\u591f\u66f4\u6e05\u695a\u591a\u7a97\u53e3\u529f\u80fd\u7684\u9002\u914d\u5f00\u53d1\u6d41\u7a0b\u3002<\/p>\n<h2><strong>1.2 \u9002\u914d\u6307\u5bfc<\/strong><\/h2>\n<p><strong>1.2.1 \u914d\u7f6e\u652f\u6301\u591a\u7a97\u53e3\u529f\u80fd<\/strong><\/p>\n<p>\u5e94\u7528AndroidManifest.xml \u4e2d\u53ef\u4ee5\u9488\u5bf9 <span class=\"wpcom_keyword_link\">app<\/span> \u6216 activity \u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u4ee3\u7801\u5b9e\u4f8b\uff1a<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">&lt;application\n&nbsp;&nbsp;android:resizeableActivity=\"true\"&gt;\n&nbsp;&nbsp;&lt;activity\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:resizeableActivity=\"true\"&nbsp;\/&gt;\n&lt;\/application&gt;<\/pre>\n<p>\u5f53\u5e94\u7528 targetSdkVersion &gt;=24 \u65f6\uff0candroid \u7cfb\u7edf\u9ed8\u8ba4\u8bbe\u7f6e android:resizeableActivity=&#8221;true&#8221;\uff0c\u4e0d\u9700\u8981\u5e94\u7528\u58f0\u660e\u5373\u53ef\u652f\u6301\u5e94\u7528\u4f7f\u7528\u591a\u7a97\u53e3\u529f\u80fd\u3002\u5f53\u5e94\u7528 targetSdkVersion &lt; 24 \u65f6\uff0c\u9700\u8981\u5e94\u7528\u9488\u5bf9 application \u6216 activity \u8bbe\u7f6e android:resizeableActivity=&#8221;true&#8221;\u3002<\/p>\n<p><strong>1.2.2 \u83b7\u53d6Activity \u5b9e\u9645\u663e\u793a\u7684\u7a97\u53e3\u5927\u5c0f\u548c\u4f4d\u7f6e<\/strong><\/p>\n<p>Android11 \u53ca\u4ee5\u4e0a\uff08API \u7ea7\u522b\u4e3a30 \u53ca\u4ee5\u4e0a\uff09\u63a8\u8350\u4f7f\u7528\uff1a<\/p>\n<p>WindowManager#getCurrentWindowMetrics()&nbsp;\uff1a \u9488\u5bf9\u7cfb\u7edf\u7684\u5f53\u524d\u7a97\u53e3\u72b6\u6001\uff0c \u8fd4\u56deWindowMetrics \u5bf9\u8c61<\/p>\n<p>WindowManager#getMaximumWindowMetrics()\uff1a\u9488\u5bf9\u7cfb\u7edf\u53ef\u80fd\u7684\u6700\u5927\u7a97\u53e3\u72b6\u6001\uff0c\u8fd4\u56de WindowMetrics<\/p>\n<p><strong>\u4ee3\u7801\u5b9e\u4f8b\uff1a<\/strong><\/p>\n<p>\u83b7\u53d6\u5f53\u524dactivity \u7684\u7a97\u53e3\u6307\u6807<\/p>\n<pre class=\"wp-block-preformatted\">WindowMetrics&nbsp;windowMetrics&nbsp;=&nbsp;activity.getWindowManager().getCurrentWindowMetrics();<\/pre>\n<p>Android10\uff08API \u7ea7\u522b\u4e3a29\uff09\u63a8\u8350\u4f7f\u7528\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">context.getResources().getDisplayMetrics()<\/pre>\n<p>\u4e0d\u63a8\u8350\u4f7f\u7528\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">context.getWindowManager().getDefaultDisplay().getMetrics(outMetrics)<\/pre>\n<p>\u4e0a\u8ff0\u63a5\u53e3\u4e2d\uff0ccontext \u4e3a Activity \u5bf9\u5e94\u7684\u4e0a\u4e0b\u6587\u53e5\u67c4\uff0c\u6bcf\u4e2a Activity \u5e94\u8be5\u4e25\u683c\u4f7f\u7528\u81ea\u5df1\u7684context \u6765\u8fdb\u884c\u5e03\u5c40\uff0c\u800c\u4e0d\u662f\u4f7f\u7528 application \u7684 context\u3002<\/p>\n<p><strong>\u5907\u6ce8\uff1a<\/strong><\/p>\n<p>Display \u65b9\u6cd5 getSize() \u548c getMetrics() \u5728 API \u7ea7\u522b 30 \u4e2d\u5df2\u88ab\u5f03\u7528\uff0c\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u65b0\u7684 WindowManager# getCurrentWindowMetrics() \u65b9\u6cd5\u3002<\/p>\n<p>Android 12\uff08API \u7ea7\u522b 31\uff09\u5f03\u7528\u4e86 Display \u65b9\u6cd5 getRealSize() \u548c getRealMetrics()\uff0c\u5e76\u66f4\u65b0\u4e86\u5b83\u4eec\u7684\u884c\u4e3a\u4ee5\u4f7f\u5176\u66f4\u63a5\u8fd1 getMaximumWindowMetrics() \u7684\u884c\u4e3a\u3002<\/p>\n<p>getSize()\uff1a\u83b7\u53d6context \u663e\u793a\u7684\u5c3a\u5bf8\uff0c\u4e0d\u5305\u62ec\u72b6\u6001\u680f\u7b49\u7cfb\u7edf\u663e\u793a\u533a\u57df\u7684\u5c3a\u5bf8<\/p>\n<p>getRealSize()\uff1a\u83b7\u53d6\u624b\u673a\u5c4f\u5e55\u7684\u771f\u5b9e\u5c3a\u5bf8\uff0c\u5305\u62ec\u72b6\u6001\u680f\u7b49\u7cfb\u7edf\u663e\u793a\u533a\u57df\u7684\u5c3a\u5bf8<\/p>\n<p>getMetrics()\uff1a\u83b7\u53d6context \u663e\u793a\u533a\u57df\u7684\u5c4f\u5e55\u5143\u7d20\uff0c\u4f8b\u5982\u5c4f\u5e55\u5c3a\u5bf8\u3001\u5c4f\u5e55\u5bc6\u5ea6\u7b49\u5c4f\u5e55\u5143\u7d20\u4fe1\u606f\uff0c\u4e0d\u5305\u62ec\u72b6\u6001\u680f\u7b49\u7cfb\u7edf\u663e\u793a\u533a\u57df\u7684\u5c4f\u5e55\u5143\u7d20\u4fe1\u606f<\/p>\n<p>getRealMetrics()\uff1a\u83b7\u53d6context \u663e\u793a\u533a\u57df\u7684\u5c4f\u5e55\u5143\u7d20\u4fe1\u606f\uff0c\u4f8b\u5982\u5c4f\u5e55\u5c3a\u5bf8\u3001\u5c4f\u5e55\u5bc6\u5ea6\u7b49\u5c4f\u5e55\u5143\u7d20\u4fe1\u606f\uff0c\u5305\u62ec\u72b6\u6001\u680f\u7b49\u7cfb\u7edf\u663e\u793a\u533a\u57df\u7684\u5c4f\u5e55\u5143\u7d20\u4fe1\u606f<\/p>\n<p>Android10 \u4e0a\uff0c\u6211\u4eec\u63a8\u8350\u4f7f\u7528getSize \u548cgetMetrics \u6765\u83b7\u53d6\u663e\u793a\u533a\u57df\u7684\u5927\u5c0f\u3002\u5728\u591a\u7a97\u53e3\uff08\u5206\u5c4f\u5c0f\u7a97\uff09\u6a21\u5f0f\u4e0b\uff0cgetSize \u548cgetMetrics \u83b7\u53d6\u51fa\u6765\u7684\u662fcontext \u663e\u793a\u533a\u57df\u7684\u5927\u5c0f\uff0cgetRealSize\u548cgetRealMetrics \u83b7\u53d6\u51fa\u6765\u7684\u662f\u624b\u673a\u5c4f\u5e55\u7684\u771f\u5b9e\u5927\u5c0f\uff0cgetSize \u548cgetMetrics \u83b7\u53d6\u51fa\u6765\u7684\u5c3a\u5bf8\u503c\u8981\u5c0f\u4e8egetRealSize \u548cgetRealMetrics \u7684\u5c3a\u5bf8\u503c\u3002<\/p>\n<p><strong>1.2.3 \u83b7\u53d6Activity \u7684\u7a97\u53e3\u5e03\u5c40\u65b9\u5411<\/strong><\/p>\n<p>\u83b7\u53d6Activity \u7a97\u53e3\u65b9\u5411\u7684\u7684\u65b9\u6cd5\u4e3a\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">context.getResources().getConfiguration().orientation<\/pre>\n<p>\u6ce8\uff1a\u4e0d\u8981\u4f7f\u7528width \/height \u7684\u65b9\u6cd5\u6765\u5224Activity \u4e3a\u6a2a\u7ad6\u5c4f\u5e03\u5c40\uff0c\u56e0\u4e3a\u5728\u591a\u7a97\u72b6\u6001\u4e0b\uff0c\u652f\u6301\u5e94\u7528\u7684\u62d6\u52a8\uff0c\u4f1a\u6539\u53d8\u5bbd\u9ad8\u3002<\/p>\n<p>\u83b7\u53d6\u8bbe\u5907\u65b9\u5411\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">context.getWindowManager().getDefaultDisplay().getRotation()\u3002<\/pre>\n<p><strong>1.2.4 Activity \u5927\u5c0f\u5207\u6362\u65f6\u4e0d\u91cd\u542f\u9002\u914d<\/strong><\/p>\n<p>1. \u5e94\u7528\u5728Activity \u7a97\u53e3\u5927\u5c0f\u5207\u6362\u65f6\u4e0d\u91cd\u542f\u9002\u914d\uff0c\u5728android:configChanges \u5c5e\u6027\u589e\u52a0&nbsp;screenSize|screenLayout| orientation|smallestScreenSize<\/p>\n<p><strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">&lt;activity\n&nbsp;android:name=\".MyActivity\"\n&nbsp;android:configChanges=\"screenSize&nbsp;|&nbsp;smallestScreenSize&nbsp;|&nbsp;screenLayout&nbsp;|&nbsp;orientation\"&nbsp;\/&gt;<\/pre>\n<p>2. \u5728Activity \u7684onConfigurationChanged \u56de\u8c03\u4e2d\u66f4\u65b0\u5bbd\u9ad8\u5237\u65b0\u5b50\u5e03\u5c40\u3002<\/p>\n<p><strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">@Override\npublic&nbsp;void&nbsp;onConfigurationChanged(Configuration&nbsp;newConfig)&nbsp;{\n&nbsp;&nbsp;&nbsp;super.onConfigurationChanged(newConfig);\n&nbsp;&nbsp;&nbsp;\u2026\u2026\n}<\/pre>\n<p>\u5e94\u7528\u590d\u5199 onConfigurationChanged() \u65b9\u6cd5\uff0c\u901a\u8fc7\u8be5\u65b9\u6cd5\u7684 Configuration \u53c2\u6570\u83b7\u5f97\u7a97\u53e3\u9ad8\u5ea6\u7b49\u4fe1\u606f\uff0c\u5e76\u5bf9\u754c\u9762\u5e03\u5c40\u505a\u76f8\u5e94\u8c03\u6574\uff0c\u5982\u5207\u6362\u5e03\u5c40\u3001\u8c03\u6574\u63a7\u4ef6\u4f4d\u7f6e\u548c\u95f4\u8ddd\u7b49\u3002<\/p>\n<p><strong>1.2.5 \u72b6\u6001\u680f\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5f53\u5904\u4e8e\u5206\u5c4f\u4e0b\u5c4f\uff0c\u548c\u5c0f\u7a97\u6a21\u5f0f\u65f6\uff0c\u5e94\u7528\u6ca1\u6709\u72b6\u6001\u680f\uff0c\u6b64\u65f6\u4e0d\u5e94\u8be5\u7559\u51fa\u72b6\u6001\u680f\u9ad8\u5ea6\uff0c\u9700\u8981\u4ece\u9876\u90e8\u5f00\u59cb\u5e03\u5c40\u3002<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7configuration \u4e2dwindowingmode \u5224\u65ad\u5f53\u524d\u5904\u4e8e\u7684\u6a21\u5f0f\uff0cWINDOWING_MODE_FREEFORM \u548cWINDOWING_MODE_SPLIT_SCREEN<a href=\"https:\/\/app.applebyme.cn\/shengcheng-103.html\">\u751f\u6210web app<\/a>_SECONDARY \u4e0d\u9700\u8981\u7a7a\u51fa\u72b6\u6001\u680f\u3002<\/p>\n<p><strong>1.2.6 \u5206\u5c4f\u4e0bActivityRecord \u52a8\u753b\u95ee\u9898<\/strong><\/p>\n<p>\u5f88\u591a\u5e94\u7528\u4f1a\u91cd\u5199<\/p>\n<pre class=\"wp-block-preformatted\">&lt;item&nbsp;name=\"android:activityOpenEnterAnimation\"&gt;@null&lt;\/item&gt;\n&lt;item&nbsp;name=\"android:activityOpenExitAnimation\"&gt;@null&lt;\/item&gt;\n&lt;item&nbsp;name=\"android:activityCloseEnterAnimation\"&gt;@null&lt;\/item&gt;\n&lt;item&nbsp;name=\"android:activityCloseExitAnimation\"&gt;@null&lt;\/item&gt;<\/pre>\n<p>\u5206\u5c4f\u4e0bcontainingWidth\/containingHeight \u4e3a\u5206\u5c4f\u7a97\u53e3\u7684\u5c3a\u5bf8\uff0c width\/height \u4e3adisplaycontent \u5c3a\u5bf8\uff08\u5168\u5c4f\uff09<\/p>\n<p>initialize(containingWidth, containingHeight, width, height);<\/p>\n<p>\u5bf9\u4e8e\u52a8\u753b\u7c7b\u578b\u6709&nbsp;<strong>ABSOLUTE\/RELATIVE_TO_SELF\/RELATIVE_TO_PARENT<\/strong><\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160515368.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160515368.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>\u5982\u679c\u5e94\u7528\u914d\u7f6e\u7684xml \u4e2d\u5e26\u4e86p,\u4f7f\u7528\u7684displaycontent \u5c3a\u5bf8\uff0c\u4f1a\u5bfc\u81f4\u5206\u5c4f\u4e0b\u4f4d\u79fb\u52a8\u753b\u95ee\u9898\u3002\u6ca1\u6709p \u4e3a<strong>&nbsp;RELATIVE_TO_SELF<\/strong>&nbsp;\u7c7b\u578b<\/p>\n<p><strong>1.2.7 \u6b63\u786e\u5904\u7406\u5206\u5c4f\u5c0f\u7a97\u7684\u6c89\u6d78\u5f0f<\/strong><\/p>\n<p>\u5206\u5c4f\u6216\u5c0f\u7a97\u6a21\u5f0f\u4e0b\uff0c\u5e94\u7528\u9876\u90e8\u6709\u4e2a\u529f\u80fdbar\uff0c\u5e94\u7528\u5728\u6c89\u6d78\u5f0f\u9002\u914d\u65f6\u9700\u4e3a\u6b64\u529f\u80fdbar \u9884\u7559\u4e00\u5b9a\u7a7a\u95f4\u3002\u56e0\u6b64\u5e94\u7528\u5728\u5e03\u5c40\u65f6\uff0c\u9700\u8981\u76d1\u542c\u5b89\u5353\u539f\u751f\u7684WindowInsetsListener \u63a5\u53e3\u56de\u8c03\uff0c\u9488\u5bf9captionBarInsets \u53d8\u5316\u6765\u5904\u7406view \u9ad8\u5ea6\uff0c\u6ce8\u610f\u4e0d\u8981\u4f7f\u7528\u56fa\u5b9a\u9ad8\u5ea6\uff01\uff01\uff01<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160518696.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160518696.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p><strong>\u53c2\u8003\u4ee3\u7801\uff1a<\/strong><\/p>\n<p>java\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">getWindow().getDecorView().setOnApplyWindowInsetsListener((v,&nbsp;insets)&nbsp;-&gt;&nbsp;{\n&nbsp;&nbsp;\/\/\u5e94\u7528\u5728\u56de\u8c03\u4e2d\u8ba1\u7b97view&nbsp;\u9ad8\u5ea6\n&nbsp;&nbsp;return&nbsp;insets;\n});<\/pre>\n<p>kotlin\uff1a<\/p>\n<pre class=\"wp-block-preformatted\">window.decorView.setOnApplyWindowInsetsListener&nbsp;{&nbsp;v:&nbsp;View?,&nbsp;insets:&nbsp;WindowInsets&nbsp;-&gt;\n&nbsp;&nbsp;\/\/\u5e94\u7528\u5728\u56de\u8c03\u4e2d\u8ba1\u7b97view&nbsp;\u9ad8\u5ea6\n&nbsp;&nbsp;insets\n}<\/pre>\n<p><strong>1.2.8 \u5176\u4ed6\u5e03\u5c40\u5efa\u8bae<\/strong><\/p>\n<p>\u2022&nbsp; \u5e03\u5c40\u53c2\u6570\u5c3d\u91cf\u4f7f\u7528\u76f8\u5bf9\u7684\u5e03\u5c40\u53c2\u6570\uff0c\u4e0d\u8981\u4f7f\u7528\u56fa\u5b9a\u5c3a\u5bf8<\/p>\n<p>\u2022&nbsp; \u907f\u514d\u6839\u636e\u5c4f\u5e55\u5927\u5c0f\uff0c\u8f93\u5165\u6cd5\u9ad8\u5ea6\u7b49\u8ba1\u7b97view \u7684\u5e03\u5c40\u53c2\u6570\uff0c\u5982\u8bbe\u7f6epopwindow\u3001dialog \u7b49\u5b50\u7a97\u53e3\u7684\u4f4d\u7f6e\u65f6\uff0c\u907f\u514d\u4f7f\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u76f8\u5bf9\u4f4d\u7f6e<\/p>\n<p>\u2022&nbsp; \u907f\u514d\u5bf9DecorView\uff0ccontent \u7b49\u6839\u5e03\u5c40\u8fdb\u884c\u5b9a\u5236\uff0c\u6bd4\u5982\u8bbe\u7f6eDecorView \u7684\u80cc\u666f\u3001\u5728DecorView \u6dfb\u52a0\u5b50\u5e03\u5c40\u7b49<\/p>\n<p>\u2022&nbsp; \u6ce8\u610f\u751f\u547d\u5468\u671f\u5904\u7406\uff0c\u5982\u5c0f\u7a97\u6a21\u5f0f\u4e0b\u51fa\u73b0\u9875\u9762\u70b9\u51fb\u3001\u62d6\u52a8\u65e0\u54cd\u5e94\u95ee\u9898\uff0c\u53ef\u80fd\u8ddf\u5e03\u5c40\u6216\u751f\u547d\u5468\u671f\u6709\u5173<\/p>\n<p>\u2022&nbsp; \u907f\u514d\u6839\u636e\u7269\u7406\u5c4f\u5e55\u65b9\u5411\u8bbe\u7f6e\u5f53\u524d\u529f\u80fd\u6216\u5e03\u5c40<\/p>\n<h1><strong>\u4e8c\u3001<span class=\"wpcom_tag_link\">\u6298\u53e0\u5c4f<\/span>\u524d\u540e\u5c4f\u5207\u6362\u9002\u914d\u6307\u5357<\/strong><\/h1>\n<h2><strong>2.1 \u5c4f\u5e55\u517c\u5bb9\u6027<\/strong><\/h2>\n<p><strong>2.1.1 \u5e94\u7528\u5e03\u5c40\u4f18\u5316<\/strong><\/p>\n<p>\u6298\u53e0\u5c4f\u6709\u4e3b\u5c4f\uff08\u5c55\u5f00\u6001\uff09\u548c\u526f\u5c4f\uff08\u6298\u53e0\u6001\uff09\u4e24\u79cd\u5f62\u6001\uff0c\u4ee5X Fold \u4e3a\u4f8b\uff0c\u4e3b\u5c4f\u548c\u526f\u5c4f\u7684\u5206\u8fa8\u7387\u5206\u522b\u662f1916&#215;2160 \u548c1080&#215;2520\uff0cdensityDpi \u662f480\uff0c\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u9488\u5bf9\u4e0d\u540c\u7684\u5c4f\u5e55\u5c3a\u5bf8\u8fdb\u884c\u5e03\u5c40\u9002\u914d\u548c\u4f18\u5316\u3002<\/p>\n<p><strong>2.1.1.1 \u5c4f\u5e55\u517c\u5bb9\u663e\u793a<\/strong><\/p>\n<p>\u5728\u5bf9\u4e0d\u540c\u5c3a\u5bf8\u5c4f\u5e55\u9002\u914d\u8fc7\u7a0b\u4e2d\uff0c\u4e3a\u4e86\u786e\u4fdd\u5728\u6298\u53e0\u5c4f\u5404\u4e2a\u5c4f\u5e55\u5f62\u6001\u4e0b\u83b7\u53d6\u6700\u4f73\u7684\u5e03\u5c40\u663e\u793a\u6548\u679c\uff0c\u4f8b\u5982\u9875\u9762\u65e0\u660e\u663e\u7684\u62c9\u4f38\u653e\u5927\u3001\u5e03\u5c40\u9519\u4f4d\u3001\u91cd\u53e0\u548c\u663e\u793a\u66f4\u591a\u66f4\u6e05\u6670\u7684\u5185\u5bb9\uff0c\u5efa\u8bae\u60a8\u5bf9\u5e03\u5c40\u8fdb\u884c\u4f18\u5316\u3002\u5e94\u7528\u754c\u9762\u6b63\u786e\u3001\u7f8e\u89c2\u7684\u5e03\u5c40\u548c\u663e\u793a\uff0c\u5305\u542b\u5982\u4e0b\uff1a<\/p>\n<p>\u2022&nbsp;&nbsp;\u786e\u4fdd\u60a8\u7684\u5e03\u5c40\u80fd\u591f\u6839\u636e\u5c4f\u5e55\u9002\u5f53\u5730\u8c03\u6574\u5927\u5c0f<\/p>\n<p>\u2022&nbsp;&nbsp;\u6839\u636e\u5c4f\u5e55\u914d\u7f6e\u63d0\u4f9b\u5408\u9002\u7684 UI \u5e03\u5c40<\/p>\n<p>\u2022&nbsp;&nbsp;\u786e\u4fdd\u5bf9\u6b63\u786e\u7684\u5c4f\u5e55\u5e94\u7528\u6b63\u786e\u7684\u5e03\u5c40<\/p>\n<p>\u2022&nbsp;&nbsp;\u63d0\u4f9b\u53ef\u6b63\u5e38\u7f29\u653e\u7684\u4f4d\u56fe<\/p>\n<p>&nbsp; &nbsp; \u8be6\u7ec6\u9002\u914d\u65b9\u6cd5\u8bf7\u53c2\u8003Android \u5f00\u53d1\u8005\u9002\u914d\u6307\u5bfc\uff1ahttps:\/\/developer.android.com\/training\/multiscreen\/screensizes?hl=zh-cn<\/p>\n<p>&nbsp; &nbsp; \u57fa\u4e8e\u6298\u53e0\u5c4f\u7684\u7279\u6027\uff0c\u7528\u6237\u7ecf\u5e38\u4f1a\u5728\u4e3b\u5c4f\uff08\u5927\u5c4f\uff09\u73a9\u6e38\u620f\u6216\u5168\u5c4f\u770b\u89c6\u9891\uff0c\u4ee5X Fold \u4e3a\u4f8b\uff0c\u4e3b\u5c4f\u6709\u524d\u7f6e\u6444\u50cf\u5934\uff0c\u56e0\u6b64\u5e94\u7528\u7a0b\u5e8f\u9875\u9762\u9700\u8981\u9488\u5bf9\u6253\u5b54\u5c4f\u505a\u9002\u914d\uff0c\u907f\u514d\u9875\u9762\u663e\u793a\u65f6\u6444\u50cf\u5934\u533a\u57df\u51fa\u73b0\u767d\u8fb9\u6216\u9ed1\u8fb9\uff0c\u5f71\u54cd\u663e\u793a\u6548\u679c\u3002\u53c2\u8003vivo \u624b\u673a\u5168\u5c4f\u9002\u914d\u5f00\u53d1\u6307\u5bfc\uff1ahttps:\/\/developers.vivo.com\/doc\/d\/52a902cf33fa72efeeeaf5197d60efa5<\/p>\n<p><strong>2.1.1.2 \u652f\u6301\u6a2a\u7ad6\u5c4f\u5207\u6362<\/strong><\/p>\n<p>\u4ee5X Fold \u4e3a\u4f8b\uff0c\u4e3b\u5c4f\uff08\u5c55\u5f00\u6001\uff09\u5c4f\u5e55\u5c3a\u5bf8\u63a5\u8fd14:3\uff0c\u684c\u9762\u5e94\u7528\u652f\u6301\u6a2a\u7ad6\u5c4f\u663e\u793a\uff0c\u56e0\u6b64\u7528\u6237\u4f1a\u5728\u4efb\u4f55\u5f62\u6001\u4e0b\u6253\u5f00\u5e94\u7528\u3002\u56e0\u6b64\u6211\u4eec\u5efa\u8bae\u5e94\u7528\u7a0b\u5e8f\u652f\u6301\u6a2a\u7ad6\u5c4f\u5207\u6362\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002\u6a2a\u7ad6\u5c4f\u5207\u6362\u9002\u914d\u5efa\u8bae\u5982\u4e0b\uff1a<\/p>\n<p>1\u3001 \u6a2a\u7ad6\u5c4f\u5207\u6362\u6d89\u53ca\u5230\u65b9\u5411\u3001\u5c3a\u5bf8\u548c\u952e\u76d8\u9690\u85cf\/ \u663e\u793a\uff0c \u56e0\u6b64\u9700\u8981\u5728Activity \u914d\u7f6e<\/p>\n<p>android:configChanges=&#8221;orientation|screenSize|screenLayout|smallestScreenSize|keyboard|keyboardHidden&#8221;<\/p>\n<p>2\u3001 \u5728onConfigurationChanged \u51fd\u6570\u6536\u5230config \u53d8\u5316\u540e\uff0c\u52a8\u6001\u52a0\u8f7d\u6a2a\u7ad6\u5c4f\u5e03\u5c40\u4ee5\u53ca\u5b8c\u6210\u5176\u4ed6\u4efb\u52a1<\/p>\n<pre class=\"wp-block-preformatted\">public&nbsp;void&nbsp;onConfigurationChanged(Configuration&nbsp;newConfig)&nbsp;{\n&nbsp;&nbsp;&nbsp;super.onConfigurationChanged(newConfig);\n&nbsp;&nbsp;&nbsp;if(newConfig.orientation&nbsp;==&nbsp;ActivityInfo.SCREEN_ORIENTATION_PORTRAIT){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/switch&nbsp;to&nbsp;port&nbsp;and&nbsp;load&nbsp;layout\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/TODO&nbsp;something\n&nbsp;&nbsp;&nbsp;}else{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/switch&nbsp;to&nbsp;land&nbsp;and&nbsp;load&nbsp;layout\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main_land);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/TODO&nbsp;something\n&nbsp;&nbsp;&nbsp;}\n}<\/pre>\n<p><strong>2.1.2 \u5e94\u7528resizeable \u80fd\u529b\u652f\u6301<\/strong><\/p>\n<p>\u6298\u53e0\u5c4f\u72b6\u6001\u5207\u6362\u65f6\uff0c\u6d89\u53ca\u5230\u5206\u8fa8\u7387\u548c\u50cf\u7d20\u5bc6\u5ea6\u7684\u52a8\u6001\u53d8\u5316\u3002\u82e5\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\u4e0d\u652f\u6301resizeable \u80fd\u529b\uff0c\u5728\u5207\u5c4f\u65f6\u4f1a\u5b58\u5728\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\u672a\u5168\u5c4f\u663e\u793a\u7684\u95ee\u9898\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p>\u5c55\u5f00\u6001<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160557543.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160557543.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>\u6298\u53e0\u6001<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160558443.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160558443.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>\u56e0\u6b64\u6211\u4eec\u671f\u671b\u5e94\u7528\u7a0b\u5e8f\u754c\u9762\u5728\u5207\u5c4f\u540e\u53ef\u4ee5\u5168\u5c4f\u663e\u793a\uff0c\u5e94\u7528\u7a0b\u5e8f\u652f\u6301resiszeable \u9700\u8981\u5728&nbsp;AndroidManifest.xml \u9488\u5bf9Application \u6216Activity \u8bbe\u7f6eandroid:resizeableActivity\u3002<\/p>\n<pre class=\"wp-block-preformatted\">&lt;application\n&nbsp;&nbsp;android:resizeableActivity=\"true\"&gt;&nbsp;-&gt;\u5bf9\u5e94\u7528\u5185\u6240\u6709activity&nbsp;\u751f\u6548\n&nbsp;&nbsp;&lt;activity\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:resizeableActivity=\"true\"&nbsp;\/&gt;&nbsp;-&gt;\u4ec5\u5bf9\u6b64activity&nbsp;\u751f\u6548\n&lt;\/application&gt;<\/pre>\n<p>\u5f00\u53d1\u8005\u9700\u8981\u6839\u636e\u5e94\u7528\u9762\u5411\u7684API Level \uff08targetSdkVersion\uff09\u8fdb\u884c\u652f\u6301resizeable \u80fd\u529b\u7684\u7533\u660e\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u9762\u5411API Level 24 \u4ee5\u4e0a\uff08targetSdkVersion&gt;=24\uff09\uff0c\u7cfb\u7edf\u5c06\u9ed8\u8ba4\u5e94\u7528\u652f\u6301resizeable \u80fd\u529b\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u9762\u5411API Level 24 \u4ee5\u4e0b\uff08targetSdkVersion&lt; 24\uff09\uff0c\u9700\u8981\u5e94\u7528\u5728manifest \u4e2d\u663e\u5f0f\u7684\u58f0\u660eandroid:resizeableActivity=true\uff0c \u624d\u53ef\u4ee5\u652f\u6301resizeable \u80fd\u529b\u3002<\/p>\n<p>&nbsp; &nbsp; \u5907\u6ce8\uff1a\u867d\u7136\u5b89\u5353\u63d0\u4f9b\u4e86\u7533\u8bf7\u53d7\u9650\u5c4f\u5e55\u80fd\u529b\uff0c\u4f46\u5f3a\u70c8\u5efa\u8bae\u60a8\u4e3a\u5e94\u7528\u8bbe\u8ba1resizeable \u80fd\u529b\uff0c\u56e0\u4e3a\u4e00\u65e6\u60a8\u58f0\u660e\u4e86\u53d7\u9650\u5c4f\u5e55\u6bd4\u4f8b\uff08\u6700\u5927\u6216\u6700\u5c0f\uff09\u8fd9\u610f\u5473\u7740\uff0c\u5f53\u60a8\u7684app \u8fd0\u884c\u5728\u4e00\u4e2a\u5c4f\u5e55\u6bd4\u4f8b\u8d85\u51fa\u4e86\u60a8\u58f0\u660e\u7684\u8303\u56f4\uff0c\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u5728\u5c4f\u5e55\u4e0a\u5c06\u51fa\u73b0\u9ed1\u8fb9\u7b49\u73b0\u8c61\u3002<\/p>\n<p>&nbsp; &nbsp; \u53d7\u9650\u5c4f\u5e55\u652f\u6301\u5f00\u53d1\u8005\u9002\u914d\u6307\u5bfc\uff1ahttps:\/\/developer.android.com\/guide\/practices\/screens-distribution?hl=zh-cn<\/p>\n<h2><strong>2.2 \u5e94\u7528\u8fde\u7eed\u6027<\/strong><\/h2>\n<p>\u4e3a\u4e86\u4fdd\u8bc1\u5e94\u7528\u7a0b\u5e8f\u5728\u6298\u53e0\u5c4f\u5c55\u5f00\/\u6298\u53e0\u8fc7\u7a0b\u65e0\u7f1d\u5207\u6362\uff0c\u5f00\u53d1\u8005\u9700\u8981\u505a\u5e94\u7528\u8fde\u7eed\u6027\u7684\u8bbe\u8ba1\uff0c\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u4efb\u52a1\u4e0d\u4e2d\u65ad\u3002\u4ee5X Flod \u4e3a\u4f8b\uff0c\u6700\u4f73\u7684\u4f53\u9a8c\u4e3a\uff0c\u5e94\u7528\u5728\u5c55\u5f00\u5207\u6362\u8fc7\u7a0b\u4e2d\uff0c\u4e0d\u53d1\u751f\u5e94\u7528\u7684\u91cd\u542f\uff0c\u4e14\u5207\u6362\u4e4b\u524d\u7684\u4efb\u52a1\u548c\u5e94\u7528\u76f8\u5173\u72b6\u6001\u5f97\u4ee5\u4fdd\u5b58\u548c\u5ef6\u7eed\u3002<\/p>\n<p>\u6298\u53e0\u5c4f\u5207\u5c4f\u65f6\u4f1a\u89e6\u53d1\u5bf9smallestscreensize\u3001screensize \u548cscreenlayout \u7684\u914d\u7f6e\u66f4\u6539\u3002\u6bcf\u5f53\u53d1\u751f\u914d\u7f6e\u66f4\u6539\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u9500\u6bc1\u5e76\u91cd\u65b0\u521b\u5efa\u6574\u4e2aactivity\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u6ce8\u518c\u76d1\u542c\u7cfb\u7edfconfigchanges \u6d88\u606f\uff0c\u4e0d\u91cd\u542f\u5e94\u7528\u7684\u60c5\u51b5\u4e0b\u5904\u7406\u914d\u7f6e\u66f4\u6539\uff0c\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u5411manifest \u4e2d\u6dfb\u52a0android:configchanges \u5c5e\u6027\uff0c\u5176\u4e2d\u81f3\u5c11\u5305\u542b\u4ee5\u4e0b\u503c\uff1a<\/p>\n<p>android: configChanges = &#8220;screenSize|smallestScreenSize|screenLayout&#8221; \u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u590d<\/p>\n<p>\u5199 onConfigurationChanged() \u65b9\u6cd5\uff0c\u901a\u8fc7\u8be5\u65b9\u6cd5\u7684Configuration \u53c2\u6570\u83b7\u5f97\u5c4f\u5e55\u7684\u5206\u8fa8\u7387\u7b49\u4fe1\u606f\uff0c\u5c31\u53ef\u4ee5\u9488\u5bf9\u4e0d\u540c\u6bd4\u4f8b\u5c4f\u5e55\u4e0b\u7684\u5e94\u7528\u754c\u9762\u5e03\u5c40\u505a\u76f8\u5e94\u8c03\u6574\uff0c\u5982\u5207\u6362\u5e03\u5c40\u3001\u8c03\u6574\u63a7\u4ef6\u4f4d\u7f6e\u548c\u95f4\u8ddd\u7b49\u3002<\/p>\n<pre class=\"wp-block-preformatted\">public&nbsp;void&nbsp;onConfigurationChanged(Configuration&nbsp;newConfig)&nbsp;{\n&nbsp;&nbsp;&nbsp;super.onConfigurationChanged(newConfig);\nif(newConfig.screenWidthDp&nbsp;&gt;&nbsp;xxx)&nbsp;\/\/\u5224\u5b9a\u5c4f\u5e55\u5c3a\u5bf8\n&nbsp;&nbsp;\/\/load&nbsp;layout\n&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main);\n&nbsp;&nbsp;&nbsp;&nbsp;...\n}<\/pre>\n<p>\u5982\u679c\u60a8\u7684\u5e94\u7528\u5fc5\u987b\u8fdb\u884c\u91cd\u65b0\u8d70\u751f\u547d\u5468\u671f\u6765\u4ee5\u54cd\u5e94\u5c4f\u5e55\u5207\u6362\uff0c\u9700\u8981\u8fdb\u884c\u72b6\u6001\u7684\u4fdd\u5b58\u548c\u6062\u590d\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7OnSaveInstanceState\uff08\uff09\u548cViewModel \u5bf9\u8c61\u6765\u8fdb\u884c\u4e4b\u524d\u72b6\u6001\u4fdd\u5b58\u548c\u540e\u7eed\u7684\u6062\u590d\u3002\u5373\uff0c\u5728\u9500\u6bc1activity \u4e4b\u524d\uff0c\u901a\u8fc7onSaveInstancesState()\u5b58\u50a8\u72b6\u6001\uff0c \u5728onCreate() or&nbsp;onRestoreInstanceState()\u8fdb\u884c\u72b6\u6001\u7684\u6062\u590d\u3002<\/p>\n<p>Note\uff1a\u4e0d\u8981\u5728OnDestroy\uff08\uff09\u4e2d\u8c03\u7528finish\uff08\uff09\u6216\u5176\u4ed6\u81ea\u884c\u7ec8\u6b62\u8fdb\u7a0b\u3002\u8fd9\u5c06\u5bfc\u81f4\u5e94\u7528\u7a0b\u5e8f\u5728\u8bbe\u5907\u6298\u53e0\u6216\u5c55\u5f00\u65f6\u5173\u95ed\u3001\u95ea\u9000\u7b49\u95ee\u9898\u3002<\/p>\n<p>\u5176\u4ed6\u9002\u914d\u4e8b\u9879\u53ef\u4ee5\u53c2\u8003Android \u5f00\u53d1\u8005\u9002\u914d\u6307\u5bfc(\u4f8b\u5982\u94fe\u63a5\u4e2d\u63d0\u5230\u7684 \u4fdd\u5b58\u754c\u9762\u72b6\u6001\u548c\u652f\u6301\u914d\u7f6e\u53d8\u66f4 \u90e8\u5206)\uff1a<\/p>\n<figure class=\"wp-block-embed\">\nhttps:\/\/developer.android.com\/guide\/topics\/ui\/foldables?hl=zhcn#%E5%BA%94%E7%94%A8%E8%BF%9E%E7%BB%AD%E6%80%A7<br \/>\n<\/figure>\n<h2><strong>2.3.\u5224\u5b9a\u6298\u53e0\u5c4f\u8bbe\u5907\u65b9\u6cd5<\/strong><\/h2>\n<p>\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u5224\u5b9a\u6298\u53e0\u5c4f\u8bbe\u5907\u7684\u9700\u6c42\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u5224\u5b9a\u6298\u53e0\u5c4f\u8bbe\u5907\u7684\u65b9\u6cd5\u3002<\/p>\n<p><strong>2.3.1 \u6839\u636emodel \u673a\u578b\u5224\u5b9a<\/strong><\/p>\n<p>\u6b64\u65b9\u6cd5\u9002\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u5df2\u7ecf\u9488\u5bf9\u90e8\u5206\u6298\u53e0\u5c4f\u8bbe\u5907\u9002\u914d\u4e14\u652f\u6301\u65b0\u6298\u53e0\u5c4f\u8bbe\u5907\u5728\u7ebf\u914d\u7f6e\u751f\u6548\u573a\u666f\uff0c\u5426\u5219\u5f3a\u70c8\u5efa\u8bae\u5f00\u53d1\u8005\u901a\u8fc7\u65b9\u6cd52 \u5224\u5b9a\u6298\u53e0\u5c4f\u8bbe\u5907\u3002<\/p>\n<p>\u4ee5X Fold \u4e3a\u4f8b\uff0c\u53ef\u4ee5\u83b7\u53d6\u5982\u4e0b\u5c5e\u6027\u83b7\u53d6model \u540d<\/p>\n<p>\u03bb adb shell getprop ro.product.model<\/p>\n<p>V2178A<\/p>\n<p><strong>2.3.2 \u901a\u8fc7\u63a5\u53e3\u5224\u5b9a<\/strong><\/p>\n<p>\u5efa\u8bae\u5f00\u53d1\u8005\u4f7f\u7528\u6b64\u65b9\u6cd5\u5224\u5b9a\u8bbe\u5907\u7c7b\u578b\uff0c\u63a5\u53e3\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n<p>\u7c7b :android.util.FtDeviceInfo<\/p>\n<p>public static String getDeviceType<\/p>\n<p>\u8fd4\u56de\u76ee\u524d\u662f\u4e09\u79cd\u7c7b\u578b\uff1aphone\u3001tablet \u548cfoldable<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u53cd\u5c04\u7684\u65b9\u5f0f\u83b7\u53d6\u8bbe\u5907\u7c7b\u578b\uff0c\u8fd4\u56de\u503cfoldable \u8868\u793a\u6298\u53e0\u5c4f\u8bbe\u5907\u3002<\/p>\n<p><strong>\u53cd\u5c04\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">private&nbsp;static&nbsp;boolean&nbsp;isVivoFoldableDevice(){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class&lt;?&gt;&nbsp;c=&nbsp;Class.forName(\"android.util.FtDeviceInfo\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method&nbsp;m&nbsp;=&nbsp;c.getMethod(\"getDeviceType\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;dType&nbsp;=&nbsp;m.invoke(c);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(\"fold\",\"getDeviceType=\"+dType);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;\"foldable\".equals(dType);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}catch(Exception&nbsp;e){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;\n}<\/pre>\n<p><strong>2.4.\u8c03\u8bd5\u548c\u9a8c\u8bc1<\/strong><\/p>\n<p><strong>2.4.1 \u901a\u8fc7\u547d\u4ee4\u6a21\u62df\u8c03\u8bd5<\/strong><\/p>\n<p>\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u975e\u6298\u53e0\u5c4f\u624b\u673a\u4e0a\u9762\u901a\u8fc7\u547d\u4ee4\u4fee\u6539\u624b\u673a\u7684\u5c4f\u5e55\u5206\u8fa8\u7387\u548cdensityDpi \u6765\u8fdb\u884c\u6a21\u62df\u8c03\u8bd5\uff0c\u5982\u4e0b\u4ee5X Fold \u5c4f\u5e55\u914d\u7f6e\u4e3a\u4f8b\u6a21\u62df\u5207\u5c4f\uff08\u4e3b\u5c4f-&gt;\u5c55\u5f00\u6001\uff0c\u526f\u5c4f-&gt;\u6298\u53e0\u6001\uff09\uff1a<\/p>\n<p>\u526f\u5c4f\u5207\u4e3b\u5c4f\u6a21\u62df\u65b9\u6cd5\uff1a<\/p>\n<p>\uff081\uff09\u9884\u5148\u5728\u624b\u673a\u8bbe\u7f6e\u5982\u4e0b\u5c4f\u5e55\u914d\u7f6e\uff1a<\/p>\n<p>&nbsp; adb shell wm size 1080&#215;2520<\/p>\n<p>&nbsp; adb shell wm density 480<\/p>\n<p>\uff082\uff09adb shell wm size 1916&#215;2160<\/p>\n<p>\u4e3b\u5c4f\u5207\u526f\u5c4f\u6a21\u62df\u65b9\u6cd5\uff1a<\/p>\n<p>\uff081\uff09\u9884\u5148\u5728\u624b\u673a\u8bbe\u7f6e\u5982\u4e0b\u5c4f\u5e55\u914d\u7f6e\uff1a<\/p>\n<p>&nbsp; adb shell wm size 1916&#215;2160<\/p>\n<p>&nbsp; adb shell wm density 480<\/p>\n<p>\uff082\uff09adb shell wm size 1080&#215;2520<\/p>\n<p>\u914d\u7f6e\u6062\u590d\u65b9\u6cd5\uff1a<\/p>\n<p>adb shell wm size reset<\/p>\n<p>adb shell wm density reset<\/p>\n<p><strong>2.4.2 \u901a\u8fc7\u6a21\u62df\u5668\u8c03\u8bd5<\/strong><\/p>\n<p><strong>2.4.2.1 Android \u6298\u53e0\u5c4f\u6a21\u62df\u5668<\/strong><\/p>\n<p>\u9664\u4e86\u901a\u8fc7\u624b\u673a\u52a8\u6001\u5207\u6362\u5206\u8fa8\u7387\u7684\u65b9\u5f0f\u6765\u8fdb\u884c\u8c03\u8bd5\u5916\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u5668\u7684\u65b9\u5f0f\u8fdb\u884c\u8c03\u8bd5\u548c\u9a8c\u8bc1\uff0cAndroid Studio \u6a21\u62df\u5668Phone \u5206\u7c7b\u652f\u63018 \u82f1\u5bf8\u548c7.3 \u82f1\u5bf8\u7684\u6298\u53e0\u5c4f\u8c03\u8bd5\uff0c\u4f46\u662f\u65e0\u6cd5\u514b\u9686\uff0c\u5373\u65e0\u6cd5\u4fee\u6539\u6a21\u62df\u5668\u7684\u7269\u7406\u5c3a\u5bf8\u548c\u5206\u8fa8\u7387\uff0c\u4e14\u6a21\u62df\u5668System image \u5982\u679c\u662fx86 \u7684\u7cfb\u7edf\uff0c\u53ea\u652f\u630132 \u4f4d\u5e94\u7528\u7684\u5b89\u88c5\u548c\u8fd0\u884c\uff0c\u5982\u679c\u662f\u7eaf64 \u4f4d\u7684\u5e94\u7528\uff0c\u6a21\u62df\u5668\u9700\u8981\u9009\u62e9arm64-v8a\uff0c\u5426\u5219\u65e0\u6cd5\u5b89\u88c5\u548c\u8fd0\u884c\u5e94\u7528\u3002<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160600863.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160600863.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>Note\uff1a<\/p>\n<p>1. Android Studio Foldable \u6a21\u62df\u5668\u65e0\u6cd5\u4fee\u6539\u7269\u7406\u5c3a\u5bf8\u3001\u5206\u8fa8\u7387\u548cdensityDpi\uff0c\u56e0\u6b64\u5728\u9002\u914d\u65f6\uff0c\u65e0\u6cd5\u5b8c\u5168\u6a21\u62dfvivo \u6298\u53e0\u5c4f\u624b\u673a\uff0c\u5728app \u6216activity resizeableActivity = true \u65f6\uff0c\u4e3a\u4e86\u9a8c\u8bc1\u5207\u5c4f\u662f\u5426\u6709\u9ed1\u8fb9\u53ef\u4ee5\u5728Android \u539f\u751f\u6a21\u62df\u5668\u67e5\u770b\u6548\u679c\u3002<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160613722.png\" alt=\"image.png\"><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160613722.png\" alt=\"image.png\">\u5c55\u5f00\u6001<\/td>\n<td><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160624984.png\" alt=\"image.png\"><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160624984.png\" alt=\"image.png\"><br \/>\u6298\u53e0\u6001<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>2. 64 \u4f4d\u6a21\u62df\u5668\u9700\u8981PC \u4e3b\u673a\u652f\u6301\uff0c\u90e8\u5206PC \u65e0\u6cd5\u6b63\u5e38\u542f\u52a864 \u4f4d\u6a21\u62df\u5668\u3002<\/p>\n<p><strong>2.4.2.2 \u6298\u53e0\u5c4f\u5c55\u5f00\u6001\u6a21\u62df\u5668<\/strong><\/p>\n<p>Android \u6298\u53e0\u5c4f\u6a21\u62df\u5668\u65e0\u6cd5\u4fee\u6539\u7269\u7406\u5c3a\u5bf8\u3001\u5206\u8fa8\u7387\u548cdensityDpi\uff0c\u82e5\u5e94\u7528\u5728\u8fdb\u884c\u300a2.2 \u4e0d\u540c\u5206\u8fa8\u7387\u5e03\u5c40\u9002\u914d\u300b\u65f6\uff0c\u9700\u8981100%\u6a21\u62df\u6298\u53e0\u5c4f\u5c55\u5f00\u6001\u7684\u5c4f\u5e55\u8fdb\u884c\u8c03\u8bd5\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u514b\u9686Tablet\u5206\u7c7b\u7684Nexus 10\uff0c\u7136\u540e\u4fee\u6539vivo \u6298\u53e0\u5c4f\u624b\u673a\u5bf9\u5e94\u7684\u7269\u7406\u5c3a\u5bf8\u3001\u5206\u8fa8\u7387\u548cDPI \u8fdb\u884c\u8c03\u8bd5\u548c\u9a8c\u8bc1\u3002<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160701101.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160701101.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>Note\uff1a<\/p>\n<p>1. \u5e94\u7528UI \u517c\u5bb9\u6027\u9002\u914d\u5bf9\u7269\u7406\u5c3a\u5bf8\u6709\u5f3a\u5173\u8054\u65f6\uff0c\u8bf7\u52a1\u5fc5\u4fee\u6539Screen size \u4e3a8.03\uff0c\u5206\u8fa8\u7387\u662f\u5c55\u5f00\u6001\u5206\u8fa8\u7387<\/p>\n<p>2. 64 \u4f4d\u6a21\u62df\u5668\u662f\u5426\u53ef\u4ee5\u8fd0\u884c\u9700\u8981PC \u4e3b\u673a\u652f\u6301<\/p>\n<p>3. \u82e5\u624b\u673a\u6a21\u62dfdensityDpi \u548c\u5206\u8fa8\u7387\u8c03\u8bd5\u65e0\u95ee\u9898\u540e\uff0c\u65e0\u6cd5\u5728\u6a21\u62df\u5668\u8fd0\u884c\uff0c\u53ef\u4ee5\u53d1\u5305\u7ed9vivo \u63a5\u53e3\u4eba\uff0c\u5728vivo \u6298\u53e0\u5c4f\u771f\u673a\u8fd0\u884c\u70b9\u68c0\u3002<\/p>\n<p>4. \u6a21\u62df\u5668\u65e0\u6cd5\u4fee\u6539densityDpi\uff0c\u9700\u8981\u542f\u52a8\u6a21\u62df\u5668\u540e\uff0c\u901a\u8fc7adb shell \u547d\u4ee4\u8bbe\u7f6e\u3002<\/p>\n<p>\u6b64\u65f6\u6253\u5f00\u7ec8\u7aef\uff0c\u53ef\u4ee5\u770b\u5230\u6a21\u62df\u5668\u8bbe\u5907\u5df2\u7ecf\u6302\u8f7d\u548c\u8fde\u63a5\uff0c\u53ef\u4ee5\u8fdb\u884cadb \u64cd\u4f5c\u3002<\/p>\n<p>\u03bb adb devices<\/p>\n<p>List of devices attached<\/p>\n<p>emulator-5554 device<\/p>\n<p>\u6a21\u62df\u5668\u65e0\u6cd5\u76f4\u63a5\u4fee\u6539densityDpi\uff0c\u9700\u8981\u542f\u52a8\u6a21\u62df\u5668\u540e\u5355\u72ec\u8bbe\u7f6e\u3002<\/p>\n<p>adb shell wm density 480<\/p>\n<p><strong>2.4.3 \u8fdc\u7a0b\u771f\u673a\u8c03\u8bd5<\/strong><\/p>\n<p>\u76ee\u524dvivo \u5df2\u7ecf\u652f\u6301X Fold \u8fdc\u7a0b\u771f\u673a\u8c03\u8bd5\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8bbf\u95ee\u5982\u4e0b\u94fe\u63a5\u4f7f\u7528\u8fdc\u7a0b\u771f\u673a<\/p>\n<figure class=\"wp-block-embed\">\nhttps:\/\/vcl.vivo.com.cn\/#\/machine\/picking<br \/>\n<\/figure>\n<p>\u8fdc\u7a0b\u771f\u673a\u4e3b\u5c4f\u6548\u679c\u56fe<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160708130.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160708130.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p>\u8fdc\u7a0b\u771f\u673a\u526f\u5c4f\u6548\u679c\u56fe<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160806778.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121160806778.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p><strong>2.4.4 \u6d4b\u8bd5\u7528\u4f8b\u5efa\u8bae<\/strong><\/p>\n<p><strong>2.4.4.1 \u7528\u4f8b1<\/strong><\/p>\n<p>\u5e94\u7528\u5728\u5c55\u5f00\u6001\u4e0b\u9875\u9762\u663e\u793a\u6b63\u5e38<\/p>\n<p>\u6d4b\u8bd5\u6b65\u9aa4\uff1a<\/p>\n<p>\uff081\uff09\u5728\u5c4f\u5e55\u5c55\u5f00\u7684\u72b6\u6001\u4e0b\uff0c\u6253\u5f00\u5e94\u7528\uff0c\u67e5\u770b\u5e94\u7528\u5404\u4e2a\u9875\u9762\u663e\u793a\u6548\u679c\uff1b<\/p>\n<p>\u9884\u671f\u7ed3\u679c\uff1a<\/p>\n<p>\uff081\uff09\u5e94\u7528\u7684\u6240\u6709\u9875\u9762\u53ef\u4ee5\u5168\u5c4f\u663e\u793a\uff0c\u9875\u9762\u6ca1\u6709\u53d1\u751f\u622a\u65ad\u3001\u62c9\u4f38\u53d8\u5f62\u3001\u653e\u5927\u6a21\u7cca\uff0c\u6309\u94ae\u7f3a\u5931\u7b49\u95ee\u9898\uff1b<\/p>\n<p><strong>2.4.4.2 \u7528\u4f8b2<\/strong><\/p>\n<p>\u5e94\u7528\u5728\u5c55\u5f00\u6001\u4e0b\u6838\u5fc3\u9875\u9762\u529f\u80fd\u6b63\u5e38<\/p>\n<p>\u6d4b\u8bd5\u6b65\u9aa4\uff1a<\/p>\n<p>\uff081\uff09\u5728\u5c4f\u5e55\u5c55\u5f00\u7684\u72b6\u6001\u4e0b\uff0c\u6253\u5f00\u5e94\u7528\uff1b<\/p>\n<p>\uff082\uff09\u904d\u5386\u5e94\u7528\u6838\u5fc3\u9875\u9762\u7684\u63a7\u4ef6\u6309\u94ae\uff0c\u6240\u6709\u529f\u80fd\u6309\u94ae\u53ef\u7528\uff0c\u65e0\u5931\u6548\/crash\/anr \u7b49\u95ee\u9898\uff1b<\/p>\n<p>\u9884\u671f\u7ed3\u679c\uff1a<\/p>\n<p>\uff081\uff09\u5e94\u7528\u5728\u6298\u53e0\u5c4f\u5c55\u5f00\u540e\uff0c\u6838\u5fc3\u9875\u9762\u529f\u80fd\u53ef\u7528<\/p>\n<p><strong>2.4.4.3 \u7528\u4f8b3<\/strong><\/p>\n<p>\u5e94\u7528\u5728\u6298\u53e0\u548c\u5c55\u5f00\u72b6\u6001\u5207\u6362\u65f6\u4e1a\u52a1\u4e0d\u4e2d\u65ad\uff0c\u5e94\u7528\u9875\u9762\u663e\u793a\u548c\u63a7\u4ef6\u70b9\u51fb\u6b63\u5e38\u3002<\/p>\n<p>\u6d4b\u8bd5\u6b65\u9aa4\uff1a<\/p>\n<p>\uff081\uff09\u5728\u5c55\u5f00\u6001\u4e0b\uff0c\u6253\u5f00\u5e94\u7528\u7684\u6d4b\u8bd5\u9875\u9762\uff1b<\/p>\n<p>\uff082\uff09\u5728\u5e94\u7528\u7684\u6d4b\u8bd5\u9875\u9762\u5207\u6362\u5230\u6298\u53e0\u6001\uff0c\u89c2\u5bdf\u9875\u9762\u663e\u793a\uff1b<\/p>\n<p>\uff083\uff09\u70b9\u51fb\u6d4b\u8bd5\u9875\u9762\u7684\u6240\u6709\u63a7\u4ef6\u548c\u6309\u94ae\uff1b<\/p>\n<p>\uff084\uff09\u5728\u6298\u53e0\u6001\u4e0b\uff0c\u6253\u5f00\u5e94\u7528\u7684\u6d4b\u8bd5\u9875\u9762\uff1b<\/p>\n<p>\uff085\uff09\u5728\u5e94\u7528\u7684\u6d4b\u8bd5\u9875\u9762\u5207\u6362\u5230\u5c55\u5f00\u6001\uff0c\u89c2\u5bdf\u9875\u9762\u663e\u793a\uff1b<\/p>\n<p>\uff086\uff09\u70b9\u51fb\u6d4b\u8bd5\u9875\u9762\u7684\u6240\u6709\u63a7\u4ef6\u548c\u6309\u94ae\u3002<\/p>\n<p>\u9884\u671f\u7ed3\u679c\uff1a<\/p>\n<p>\uff081\uff09\u5e94\u7528\u9875\u9762\u5728\u72b6\u6001\u5207\u6362\u8fc7\u7a0b\u4e2d\uff0c\u4e0d\u8981\u51fa\u73b0\u9875\u9762\u91cd\u542f\u3001\u95ea\u9000\uff1b\u9875\u9762\u663e\u793a\u6b63\u5e38\uff0c\u4e0d\u8981\u51fa<\/p>\n<p>\u73b0\u9875\u9762\u622a\u65ad\u3001\u62c9\u4f38\u53d8\u5f62\u3001\u653e\u5927\u6a21\u7cca\uff0c\u6309\u94ae\u7f3a\u5931\u7b49\u95ee\u9898\uff1b<\/p>\n<p>\uff082\uff09\u6d4b\u8bd5\u9875\u9762\u6309\u94ae\u548c\u63a7\u4ef6\u70b9\u51fb\u90fd\u80fd\u6b63\u5e38\u54cd\u5e94\uff1b<\/p>\n<p>\uff083\uff09\u5e94\u7528\u9875\u9762\u5728\u72b6\u6001\u5207\u6362\u8fc7\u7a0b\u4e2d\uff0c\u4e0d\u8981\u51fa\u73b0\u9875\u9762\u91cd\u542f\u3001\u95ea\u9000\uff1b\u9875\u9762\u663e\u793a\u6b63\u5e38\uff0c\u4e0d\u8981\u51fa<\/p>\n<p>\u73b0\u9875\u9762\u622a\u65ad\u3001\u62c9\u4f38\u53d8\u5f62\u3001\u653e\u5927\u6a21\u7cca\uff0c\u6309\u94ae\u7f3a\u5931\u7b49\u95ee\u9898\uff1b<\/p>\n<p>\uff084\uff09\u6d4b\u8bd5\u9875\u9762\u6309\u94ae\u548c\u63a7\u4ef6\u70b9\u51fb\u90fd\u80fd\u6b63\u5e38\u54cd\u5e94\u3002<\/p>\n<h1><strong>\u4e09\u3001vivo \u591a\u7a97\u6a21\u5f0f\u9002\u914d\u6307\u5357<\/strong><\/h1>\n<h2><strong>3.1 \u9002\u914d\u89c4\u5219<\/strong><\/h2>\n<p>\u7a97\u53e3\u5728\u5de6\u53f3\u4e24\u8fb9\u62c6\u5206\u663e\u793a\u4ee5Activity \u4e3a\u57fa\u672c\u5355\u4f4d\uff0c\u5982\u679c\u8981\u5b9e\u73b0\u62c6\u5206\uff0c\u5e94\u7528\u7a97\u53e3\u9700\u8981\u7528Activity \u5b9e\u73b0\u548c\u542f\u52a8\uff0c\u5b50\u5e03\u5c40\u6216\u8005\u975eActivity \u5b9e\u73b0\u7684\u7a97\u53e3\uff0c\u65e0\u6cd5\u62c6\u5206\u3002\u4ee5\u4e0b\u63d0\u4f9bPad \u8bbe\u5907\u4e0a\u5728\u6a2a\u5c4f\u65f6\u5e94\u7528\u4e0d\u540c\u754c\u9762\u5206\u5c4f\u663e\u793a\u7684\u9002\u914d\u65b9\u6cd5\u548c\u89c4\u5219<\/p>\n<p><strong>3.1.1 AndroidManifest \u589e\u52a0meta-data<\/strong><\/p>\n<p>\u5728app \u7684AndroidManifest.xml \u6587\u4ef6\u4e2d &lt;application&gt;\u6807\u7b7e\u5185\u65b0\u589e<\/p>\n<p>&lt;meta-data android:name=&#8221;VivoMultiWindow&#8221; android:value=&#8221;true&#8221; \/&gt;<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121161020713.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121161020713.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p><strong>3.1.2 Assert \u76ee\u5f55\u65b0\u589evivo_multiwindow.json \u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p>\u201cvivo_multiwindow.json\u201d\u6a21\u677f<\/p>\n<p>\u5728 assert \u76ee\u5f55\u4e0b\u65b0\u5efa\u914d\u7f6e\u6587\u4ef6 \u201cvivo_multiwindow.json\u201d\uff0c\u6a21\u677f\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;funtouchPlugVersion&#8221;: &#8220;1.1&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&#8220;package&#8221;: &nbsp; &#8220;com.vivo.test&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&#8220;elements&#8221;: &nbsp; [&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#8220;fun&#8221;: {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&#8220;name&#8221;: &#8220;multi-landscape&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&#8220;enable&#8221;: &#8220;true&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;config&#8221;: {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;mode&#8221;: 1,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&#8220;action&#8221;: [&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;pages&#8221;: &#8220;com.vivo.test.MainActivity&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;attachedPage&#8221;: &#8220;com.vivo.test.primaryActivity1&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;from&#8221;: &#8220;com.vivo.test.FromActivity1&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;to&#8221;: &#8220;com.vivo.test.ToActivity&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&#8220;from&#8221;: &nbsp; &#8220;com.vivo.test.FromActivity2&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;to&#8221;: &#8220;*&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;}&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;],&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&#8220;Activities&#8221;: &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;fullscreenActivities&#8221;: [&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;com.vivo.test.fullScreenActivity1&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;com.vivo.test.fullScreenActivity2&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;],&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;transitActivities&#8221;: [&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;com.vivo.test.transitionActivity1&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;com.vivo.test.transitionActivity2&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;com.vivo.test.transitionActivity3&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;],&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&#8220;EX&#8221;: &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;draggable&#8221;: &nbsp; &#8220;true&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;statusBarVisible&#8221;: &nbsp; &#8220;true&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;videoAutoFullscreen&#8221;: &nbsp; &#8220;true&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;isRelaunchForResizing&#8221;: &nbsp; &#8220;false&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;supportDoubleResume&#8221;: &nbsp; &#8220;true&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&#8220;windowsGravity&#8221;: [&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;deviceType&#8221;: &#8220;FOLD&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;gravity&#8221;: &#8220;1|2&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;deviceType&#8221;: &#8220;PAD&#8221;,&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8220;gravity&#8221;: &#8220;900|1654&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;],&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&#8220;splitBarColor&#8221;: &nbsp; &#8220;0xffe5e5e5&#8221;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;}&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;]}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u201cvivo_multiwindow.json\u201d\u5b57\u6bb5\u63cf\u8ff0<\/p>\n<p>\u201cvivo_multiwindow.json\u201d\u5177\u4f53\u5b57\u6bb5\u63cf\u8ff0\u5982\u4e0b\uff1a<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>\u53c2\u6570<\/strong><\/td>\n<td><strong>\u503c<\/strong><\/td>\n<td><strong>\u63cf\u8ff0<\/strong><\/td>\n<\/tr>\n<tr>\n<td>funtouchPlugVersion<\/td>\n<td>1.0<\/td>\n<td>vivo \u591a\u7a97\u53e3\u529f\u80fd\u7248\u672c\uff0c\u76ee\u524d\u56fa\u5b9a1.0<\/td>\n<\/tr>\n<tr>\n<td>package<\/td>\n<td><\/td>\n<td>\u5e94\u7528\u5305\u540d<\/td>\n<\/tr>\n<tr>\n<td>fun.name<\/td>\n<td>multilandscape<\/td>\n<td>vivo \u591a\u7a97\u53e3\u529f\u80fd\u540d\u79f0\uff0c\u56fa\u5b9a\u4e3amulti-landscape<\/td>\n<\/tr>\n<tr>\n<td>fun.enable<\/td>\n<td>false\/<\/td>\n<td>\u662f\u5426\u542f\u7528\u8be5\u914d\u7f6e<br \/>false \u5173\u95ed<br \/>true \u542f\u7528<\/td>\n<\/tr>\n<tr>\n<td>config.mode<\/td>\n<td>0\/1<\/td>\n<td>\u9ed8\u8ba4\u6a21\u5f0f<br \/>0 \u8d2d\u7269\u6a21\u5f0f<br \/>1 \u81ea\u5b9a\u4e49\u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>config.action<\/td>\n<td><\/td>\n<td>\u5e94\u7528\u51b7\u542f\u52a8\u65f6\u9ed8\u8ba4\u6253\u5f00\u7684\u53cc\u754c\u9762\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>config.action.pages<\/td>\n<td><\/td>\n<td>\u9ed8\u8ba4\u53cc\u5c4f\u4e3b\u9875\u9762\u5217\u8868<br \/>\u6ce8\uff1a\u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\uff0c\u5206\u53f7\u9694\u5f00\uff0c\u5e94\u7528\u51b7\u8d77\u52a8\u542f\u52a8\u8be5\u9875\u9762\uff0c\u81ea\u52a8\u5728\u526f\u9875\u9762\u4f4d\u7f6e\u542f\u52a8attachedPage\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td>config.action.attachedPage<\/td>\n<td><\/td>\n<td>\u9ed8\u8ba4\u53cc\u5c4f\u526f\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td>config.action.from\uff08\u81ea\u5b9a\u4e49\u6a21\u5f0f\u751f\u6548\uff09<\/td>\n<td><\/td>\n<td>\u89e6\u53d1\u591a\u7a97\u53e3\u7684\u6e90activity<\/td>\n<\/tr>\n<tr>\n<td>config.action.to\uff08\u81ea\u5b9a\u4e49\u6a21\u5f0f\u751f\u6548\uff09<\/td>\n<td><\/td>\n<td>\u89e6\u53d1\u591a\u7a97\u53e3\u7684\u76ee\u6807activity<br \/>\u201c*\u201d\u8868\u793a\u4efb\u610factivity<br \/>\u6ce8\uff1a\u5f53\u4ece\u6e90Activity\u542f\u52a8\u76ee\u6807Activity,\u81ea\u52a8\u5728\u4e3b\u526f\u4f4d\u7f6e\u6253\u5f00\u5bf9\u5e94Activity<\/td>\n<\/tr>\n<tr>\n<td>config.Activities.fullscreenActivities<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u9700\u8981\u5168\u5c4f\u542f\u52a8<br \/>0 \u975e\u5168\u5c4f<br \/>1 \u5168\u5c4f<\/td>\n<\/tr>\n<tr>\n<td>config.Activities.transitActivities<\/td>\n<td><\/td>\n<td>\u8fc7\u6e21\u9875\u9762\u5217\u8868<br \/>\u6ce8\uff1a\u65e0\u56fa\u5b9a\u7a97\u53e3\u4f4d\u7f6e\uff0c\u8ddf\u968f\u542f\u52a8\u65f6\u4e0a\u4e00\u7ea7\u9875\u9762\u7a97\u53e3\u4f4d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>config.EX<\/td>\n<td><\/td>\n<td>\u7279\u6b8a\u5c5e\u6027\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>config.EX.draggable<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u652f\u6301\u7a97\u53e3\u62d6\u52a8<br \/>0 \u4e0d\u652f\u6301<br \/>1 \u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>config.EX.statusBarVisible<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u652f\u6301\u72b6\u6001\u680f\u53ef\u89c1<br \/>0 \u4e0d\u652f\u6301<br \/>1 \u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>config.EX.videoAutoFullscreen<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u652f\u6301\u9ed8\u8ba4\u89c6\u9891\u5168\u5c4f\u64ad\u653e<br \/>0 \u4e0d\u652f\u6301<br \/>1 \u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>config.EX.isRelaunchForResizing<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u652f\u6301\u91cd\u542f<br \/>0 \u4e0d\u652f\u6301<br \/>1 \u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>config.EX.windowsGravity<\/td>\n<td><\/td>\n<td>\u7a97\u53e3\u6bd4\u4f8b<\/td>\n<\/tr>\n<tr>\n<td>config.EX.windowsGravity.deviceType<\/td>\n<td>FOLD\/PAD<\/td>\n<td>\u8bbe\u5907\u7c7b\u578b<br \/>FOLD \u6298\u53e0\u5c4f<br \/>PAD \u5e73\u677f<\/td>\n<\/tr>\n<tr>\n<td>config.EX.windowsGravity.gravity<\/td>\n<td>1|2 \/<br \/>900|1654<\/td>\n<td>\u7a97\u53e3\u6bd4\u4f8b<br \/>FOLD \u9ed8\u8ba41|2<br \/>PAD \u9ed8\u8ba4900|1654<\/td>\n<\/tr>\n<tr>\n<td>config.EX.supportDoubleResume<\/td>\n<td>0\/1<\/td>\n<td>\u662f\u5426\u652f\u6301\u4e24\u4e2a\u754c\u9762\u540c\u65f6resume<\/td>\n<\/tr>\n<tr>\n<td>config.EX.splitBarColor<\/td>\n<td><\/td>\n<td>\u5206\u9694\u6761\u7684\u989c\u8272<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2><strong>3.2 \u9002\u914d\u5efa\u8bae<\/strong><\/h2>\n<p><strong>3.2.1 \u72b6\u6001\u5224\u65ad<\/strong><\/p>\n<p>\u83b7\u53d6Activity \u662f\u5426\u8fd0\u884c\u5728\u6a21\u5f0f\u4e0b\uff1a<\/p>\n<p>String config = context.getResources().getConfiguration().toString();<\/p>\n<p>boolean isInMagicWindow = config.contains(&#8220;multi-landscape&#8221;);<\/p>\n<p>context \u4e3aActivity \u7684context<\/p>\n<p>\u914d\u7f6e\u4e86Fullscreen \u7684\u9875\u9762\uff0c\u663e\u793a\u4e3a\u5168\u5c4f\uff0c\u4f46\u4e5f\u8fd0\u884c\u5728\u6a21\u5f0f\u4e0b<\/p>\n<p><strong>3.2.2 \u83b7\u53d6Activity \u663e\u793a\u5927\u5c0f<\/strong><\/p>\n<p>\u63a8\u8350\u4f7f\u7528\uff1acontext.getResources().getDisplayMetrics()<\/p>\n<p>\u4e0d\u63a8\u8350\u4f7f\u7528\uff1acontext.getWindowManager().getDefaultDisplay().getMetrics(outMetrics)<\/p>\n<p>co<a href=\"https:\/\/app.applebyme.cn\/shengcheng-51.html\">app\u751f\u6210\u5668\u624b\u673a\u7248<\/a>ntext \u4e3aActivity \u5bf9\u5e94\u7684\u4e0a\u4e0b\u6587\u53e5\u67c4\uff0c\u6bcf\u4e2aActivity \u5e94\u8be5\u4e25\u683c\u4f7f\u7528\u81ea\u5df1\u7684context \u6765\u8fdb\u884c\u5e03\u5c40\uff0c\u800c\u4e0d\u662f\u4f7f\u7528application \u7684context\u3002<\/p>\n<p><strong>3.2.3 \u83b7\u53d6Activity \u7a97\u53e3\u5e03\u5c40\u65b9\u5411<\/strong><\/p>\n<p>\u83b7\u53d6Activity \u7a97\u53e3\u65b9\u5411\u7684\u65b9\u6cd5\u4e3a\uff1acontext.getResources().getConfiguration().orientation<\/p>\n<p>\u5f53Activity \u5904\u4e8e\u6a2a\u5c4f\u5e94\u7528\u663e\u793a\u72b6\u6001\u4e0b\u65f6\uff0c\u83b7\u53d6\u7684orientation \u7edf\u4e00\u4e3a\u7ad6\u5c4f\uff1b\u5982\u679cActivity\u662f\u5728\u72b6\u6001\u4e0b\u5168\u5c4f\u663e\u793a\uff0c\u5176orientation \u4e3a\u503c\u4e3a\u6a2a\u5c4f\u3002<\/p>\n<p>\u83b7\u53d6\u8bbe\u5907\u7684\u65b9\u5411context.getWindowManager().getDefaultDisplay().getRotation()\u3002<\/p>\n<p><strong>3.2.4 \u6307\u5b9aActivity \u5168\u5c4f\u663e\u793a<\/strong><\/p>\n<p>\u6a2a\u5c4f\u5e94\u7528\u663e\u793a\u72b6\u6001\u4e0b\uff0cActivity \u5e0c\u671b\u4ee5\u5168\u5c4f\u5c55\u793a\uff0c\u6709\u4e09\u79cd\u65b9\u6cd5\uff1a<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a\u52a8\u6001\u5168\u5c4f\u663e\u793a\uff0cActivity \u9996\u5148\u4ee5\u6a2a\u5c4f\u5e94\u7528\u663e\u793a\u975e\u5168\u5c4f\u663e\u793a\uff0c\u8c03\u7528Activity \u7c7b\u7684\u5982\u4e0b\u63a5\u53e3\u7533\u8bf7\u6a2a\u5c4f\u65b9\u5411\u53ef\u8fdb\u5165\u5168\u5c4f\u663e\u793a\u72b6\u6001\uff1a<\/p>\n<p>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)<\/p>\n<p>\u5728\u6b64\u72b6\u6001\u4e0b\uff0c\u8c03\u7528Activity \u7c7b\u7533\u8bf7\u7ad6\u5c4f\u65b9\u5411\u5373\u53ef\u9000\u51fa\u5168\u5c4f\u72b6\u6001\uff1a<\/p>\n<p>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)<\/p>\n<p>\u6b64\u573a\u666f\u5e7f\u6cdb\u5e94\u7528\u4e8e\u89c6\u9891\u5168\u5c4f\u64ad\u653e\u573a\u666f\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u5728\u914d\u7f6e\u6587\u4ef6fullscreenActivities \u4e2d\u6dfb\u52a0\u60f3\u8981\u5168\u5c4f\u7684Activity\uff0c\u5373\u53ef\u5b9e\u73b0Activity\u9ed8\u8ba4\u4ee5\u5168\u5c4f\u542f\u52a8\uff0c\u6b64\u65b9\u6cd5\u4e2d\uff0cActivity \u4f1a\u4e00\u76f4\u4ee5\u5168\u5c4f\u72b6\u6001\u663e\u793a<\/p>\n<p>\u65b9\u6cd5\u4e09\uff1a\u5728\u201cAndroidManifest.xml\u201d\u6587\u4ef6\u4e2d\u5c06Activity \u7684\u65b9\u5411\u914d\u7f6e\u4e3a\u6a2a\u5c4f\uff0c\u6b64\u65b9\u6cd5\u4e2d\uff0cActivity \u4f1a\u4e00\u76f4\u4ee5\u5168\u5c4f\u72b6\u6001\u663e\u793a<\/p>\n<p>android:screenOrientation = \u201clandscape\u201d<\/p>\n<p>\u6216android:screenOrientation = \u201csensorLandscape\u201d<\/p>\n<p><strong>3.2.5 \u5f00\u53d1\u5efa\u8bae<\/strong><\/p>\n<p>\u2022&nbsp;&nbsp;\u5e94\u7528\u4e3b\u754c\u9762Activity \u7684\u542f\u52a8\u4ee5singleTask \u7684\u6a21\u5f0f\u6765\u542f\u52a8\uff0c\u4fdd\u8bc1\u5176\u5728\u6808\u5185\u7684\u552f\u4e00\u6027\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;\u5e94\u7528\u5185\u4e0d\u8981\u5b58\u5728\u4e24\u4e2a\u53ca\u4ee5\u4e0a\u7ec4\u4ef6\u540d\u4e0d\u4e00\u6837\u7684\u4e3b\u754c\u9762Activity\uff0c\u4f8b\u5982\u67d0\u4e2a\u5e94\u7528\u5728\u767b\u5f55\u524d\u7684\u4e3b\u754c\u9762Activity \u7ec4\u4ef6\u540d\u4e0e\u767b\u5f55\u540e\u7684Activity \u7ec4\u4ef6\u540d\u4e0d\u540c\uff0c\u4f1a\u5bfc\u81f4\u65b0\u7684\u4e3b\u754c\u9762Activity\u663e\u793a\u5728\u53f3\u534a\u8fb9<\/p>\n<p>\u2022&nbsp;&nbsp;\u5c3d\u91cf\u907f\u514d\u6216\u51cf\u5c11\u8fc7\u6e21Activity \u7684\u4f7f\u7528\uff0c\u5c3d\u91cf\u907f\u514d\u6216\u8005\u51cf\u5c11\u4f7f\u7528\u8fc7\u6e21Activity \u6765\u5b9e\u73b0Activity \u7684\u542f\u52a8\uff0c\u5982\u679c\u4e00\u5b9a\u8981\u4f7f\u7528\uff0c\u5efa\u8bae\u4f7f\u7528ActivityA-&gt;ActivityB-&gt;ActivityC \u7684\u542f\u52a8\u65b9\u5f0f\uff0c\u800c\u4e0d\u662f(ActivityA-&gt;ActivityB) + (ActivityA-&gt;ActivityC)\u7684\u65b9\u5f0f\uff08\u793a\u4f8b\u4e2d\uff0cActivityB \u4e3a\u8fc7\u6e21Activity \uff09 \u3002\u8fc7\u6e21Activity \u7684\u6570\u91cf\u4e0d\u80fd\u8d85\u8fc71 \u4e2a\uff0c \u4f8b\u5982ActivityA-&gt;ActivityB-&gt;ActivityC-&gt;ActivityD\uff0c\u5176\u4e2dActivityB \u548cActivityC \u662f\u8fc7\u6e21\u7a97\u53e3\uff0c\u5efa\u8bae\u4eceActivityA \u76f4\u63a5\u542f\u52a8ActivityC\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;Activity \u5927\u5c0f\u5207\u6362\u65f6\u4e0d\u91cd\u542f\u9002\u914d\uff0c\u5efa\u8bae\u5e94\u7528\u5728Activity \u7a97\u53e3\u5927\u5c0f\u5207\u6362\u65f6\u4e0d\u91cd\u542f\u9002\u914d\uff0c\u5728android:configChanges \u5c5e\u6027\u589e\u52a0screenSize|screenLayout|orientation|<\/p>\n<p>smallestScreenSize\uff0c\u5e76\u5728Activity \u7684onConfigurationChanged \u56de\u8c03\u4e2d\u66f4\u65b0\u5bbd\u9ad8\u5237\u65b0\u5b50\u5e03\u5c40\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;\u907f\u514dActivity \u5b50\u5e03\u5c40\u7684\u7f3a\u7701\u91cd\u7528\uff0c\u7531\u4e8e\u5de6\u53f3Activity \u540c\u65f6\u663e\u793a\uff0c\u5de6\u53f3\u663e\u793a\u7684\u4e24\u4e2aActivity\u4e2d\u4e0d\u80fd\u540c\u65f6\u5b58\u5728\u5355\u5b9e\u4f8b\u7684\u516c\u5171\u5e03\u5c40\u6a21\u5757<\/p>\n<p>\u2022&nbsp;&nbsp;\u907f\u514d\u5de6\u53f3\u4e24\u4e2aActivity \u5171\u7528\u4e00\u4e2a\u64ad\u653e\u5668\uff0c\u5de6\u53f3\u4e24\u4e2aActivity \u540c\u65f6\u663e\u793a\uff0c\u5efa\u8bae\u4e24\u8fb9\u4f7f\u7528\u7684\u64ad\u653e\u5668\u8d44\u6e90\u76f8\u4e92\u72ec\u7acb\uff0c\u4e92\u4e0d\u5f71\u54cd\u3002<\/p>\n<p>\u2022&nbsp;&nbsp;\u5efa\u8baeCamera \u76f8\u5173\u7684Activity \u754c\u9762\u914d\u7f6e\u4e3a\u5168\u5c4f\u663e\u793a<\/p>\n<p><strong>3.3 \u542f\u52a8\u8fd4\u56de\u663e\u793a\u903b\u8f91<\/strong><\/p>\n<p>\u57fa\u4e8e\u76ee\u524d\u6a2a\u5c4f\u5e94\u7528\u663e\u793a\u6a21\u5f0f\uff0c\u5728\u6a21\u5f0f\u4e2d\u542f\u52a8\u6216\u8005\u56de\u9000\u94fe\u6761\u5c55\u793a\u3002<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121161033694.png\" alt=\"image.png\" title=\"image.png\" \/><img decoding=\"async\" class=\"j-lazy\" src=\"https:\/\/www.yimenapp.com\/kb-yimen\/wp-content\/themes\/justnews\/themer\/assets\/images\/lazy.png\" data-original=\"https:\/\/kb.cdn.yimenapp.com\/yimen\/2022\/11\/20221121161033694.png\" alt=\"image.png\" title=\"image.png\" \/><\/figure>\n<p><strong>3.4 \u4e09\u65b9\u9002\u914d\u591a\u7a97\u6a21\u5f0f\u8fc7\u7a0b\u4e2d\u9700\u8981\u6ce8\u610f\uff1a<\/strong><\/p>\n<p>\u5e94\u7528\u66f4\u65b0json \u6587\u4ef6\u540e\u5b89\u88c5\u4e0d\u751f\u6548\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u4e24\u79cd\u65b9\u5f0f\u66f4\u65b0\uff1a<\/p>\n<p>1. \u4fee\u6539\u5b8c\u4e4b\u540e\uff0c\u5347\u7ea7\u5e94\u7528\u7248\u672c\u53f7\uff0c\u91cd\u65b0\u5b89\u88c5\u5e94\u7528<\/p>\n<p>2. \u628a\u6570\u636e\u5e93\u90fd\u5220\u9664\uff0c\u91cd\u65b0\u521b\u5efa\uff0c\u9700\u8981root \u6743\u9650\u5220\u9664\u6570\u636e\u5e93\u4e4b\u540e\u91cd\u542f\u3002<\/p>\n<p>adb vivoroot<\/p>\n<p>adb shell rm -rf data\/data\/com.vivo.smartmultiwindow\/*<\/p>\n<p>adb shell rm -rf data\/user_de\/0\/com.vivo.smartmultiwindow\/*<\/p>\n<p>\u5efa\u8bae\u4f7f\u7528\u7b2c\u4e00\u79cd\u3002<\/p>\n<p>\u7f16\u8f91\uff1ayimen\uff0c\u5982\u82e5\u8f6c\u8f7d\uff0c\u8bf7\u6ce8\u660e\u51fa\u5904\uff1ahttps:\/\/www.yimenapp.com\/kb-yimen\/11309\/<\/p>\n<p>\u90e8\u5206\u5185\u5bb9\u6765\u81ea\u7f51\u7edc\u6295\u7a3f\uff0c\u5982\u6709\u4fb5\u6743\u8054\u7cfb\u7acb\u5220<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001vivo \u591a\u7a97\u53e3(\u5206\u5c4f\u5c0f\u7a97)\u529f\u80fd\u9002\u914d\u6307\u53571.1 \u9002\u914d\u80cc\u666f\u968f\u7740\u5927\u5c4f\u624b\u673a\u7684\u666e\u53ca\uff0c\u7528\u6237\u5bf9\u4e8e\u591a\u7a97\u53e3\u529f\u80fd\u7684\u4f7f\u7528\u8d8a\u6765\u8d8a\u9891\u7e41\uff0c\u5c3d\u7ba1google \u5df2\u7ecf\u63a8\u51fa\u4e86\u591a\u7a97\u53e3\u529f\u80fd\uff0c\u4f46\u662f\u5f88\u591a\u5e94\u7528\u8fd8\u6ca1\u6709\u9002\u914d\u591a\u7a97\u53e3\u529f\u80fd\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u8f93\u51fa\u300avivo \u591a\u7a97\u53e3\uff08\u5206\u5c4f\u5c0f\u7a97\uff09\u529f\u80fd\u9002\u914d\u6307\u5357\u300b\u63d0\u4f9b\u7ed9\u5e94\u7528\u4fa7\u8fdb\u884c\u9002\u914d\uff0c\u8ba9\u4e09\u65b9\u5e94\u7528\u5f00\u53d1\u8005\u80fd\u591f\u66f4\u6e05\u695a\u591a\u7a97<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[521,1089,1125],"class_list":["post-2190","post","type-post","status-publish","format-standard","hentry","category-appshangjia","tag-vivo","tag-1089","tag-1125"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/2190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=2190"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/2190\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=2190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=2190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=2190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}