{"id":11062,"date":"2021-12-15T21:19:56","date_gmt":"2021-12-15T13:19:56","guid":{"rendered":"https:\/\/www.bookcard.net\/wordpress\/?p=11062"},"modified":"2021-12-15T21:27:45","modified_gmt":"2021-12-15T13:27:45","slug":"android_studio_fullscreen_cutout_mode","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/android_studio_fullscreen_cutout_mode\/","title":{"rendered":"Android Studio \u5168\u5c4fCUTOUT MODE"},"content":{"rendered":"<figure id=\"attachment_11065\" aria-describedby=\"caption-attachment-11065\" style=\"width: 1280px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_FULLSCREEN_CUTOUT_MODE.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-11065\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_FULLSCREEN_CUTOUT_MODE.jpg\" alt=\"Android Studio \u5168\u5c4fCUTOUT MODE\" width=\"1280\" height=\"800\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_FULLSCREEN_CUTOUT_MODE.jpg 1280w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_FULLSCREEN_CUTOUT_MODE-300x188.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/12\/Android_Studio_FULLSCREEN_CUTOUT_MODE-768x480.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><figcaption id=\"caption-attachment-11065\" class=\"wp-caption-text\">Android Studio \u5168\u5c4fCUTOUT MODE<\/figcaption><\/figure>\n<p>\u5168\u5c4f\u4ee4\u4eba\u6c89\u6d78\u6e38\u6232\u514d\u53d7\u5e72\u64fe. \u6536\u57cb\u9802\u300e\u72c0\u614b\u300f\u300e\u6a19\u984c\u300f\u5e95\u300e\u5c0e\u822a\u300f.<\/p>\n<ol>\n<li>\u820a\u6642\u5168\u5c4f\u4fc2\u300eActivity:onCreate()\u300f\u98db\u300e\u6a19\u984c\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">\u00a0requestWindowFeature(Window.FEATURE_NO_TITLE);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"2\">\n<li>\u98db\u300e\u72c0\u614b\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">Window window =\u00a0 getWindow();<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"3\">\n<li>\u4e0a\u8ff0\u4ee3\u78bc\u9700\u4fc2\u300e\u586b\u5145\u5e03\u5c40\u300f\u524d\u57f7\u884c<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">setContentView(R.layout.activity_main);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"4\">\n<li>\u4ea6\u53ef\u7528\u300e\u5168\u5c4f\u6837\u5f0f\u300f\u4fc2\u300exml\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">&lt;style\u00a0 name=&#8221;Theme.Fullscreen&#8221;\u00a0 parent=&#8221;android:Theme.NoTitleBar.Fullscreen&#8221; \/&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"5\">\n<li>\u4fc2&lt;application&gt;\u6216&lt;activity&gt;\u52a0\u300e\u5168\u5c4f\u6837\u5f0f\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">&lt;application android:theme=&#8221;@style\/Theme.Fullscreen&#8221; &gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"6\">\n<li>\u56e0Android\u300e\u5c0e\u822a\u300f\u7531\u786c\u4ef6\u9375\u8b8a\u6210\u300e\u89f8\u6478\u5c4f\u300f\u8edf\u4ef6\u9375, \u8981\u98db\u5e95\u300e\u5c0e\u822a\u300f\u98db\u9802\u300e\u72c0\u614b\u300f. \u5373\u300e\u6c89\u34ce\u6a21\u5f0f\u300f\u8981\u4fc24 Kit Kat(API 19).<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">\u00a0\u00a0\u00a0 if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"7\">\n<li>\u4fc2\u300eActivity:onCreate()\u300f\u57f7\u884c\u300esetSystemUiVisibility()\u300f\u8a2d\u7f6e\u6c89\u6d78\u6a21\u5f0f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">View decorView = window.getDecorView();<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |<\/p>\n<p>View.SYSTEM_UI_FLAG_LAYOUT_STABLE |<\/p>\n<p>View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |<\/p>\n<p>View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |<\/p>\n<p>View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |<\/p>\n<p>View.SYSTEM_UI_FLAG_FULLSCREEN);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"8\">\n<li>\u8a2d\u7f6e\u6c89\u6d78\u6a21\u5f0f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"288\">setSystemUiVisibility()<\/td>\n<td width=\"288\">\u7c21\u8ff0<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">View.SYSTEM_UI_FLAG_HIDE_NAVIGATION<\/td>\n<td width=\"288\">\u98db\u5e95\u300e\u5c0e\u822a\u300f<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">View.SYSTEM_UI_FLAG_FULLSCREEN<\/td>\n<td width=\"288\">\u98db\u9802\u300e\u72c0\u614b\u300f<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY<\/td>\n<td width=\"288\">\u81ea\u52d5\u6062\u5fa9\u300e\u6c89\u34ce\u6a21\u5f0f\u300f<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">View.SYSTEM_UI_FLAG_IMMERSIVE<\/td>\n<td width=\"288\">\u300e\u6c89\u34ce\u6a21\u5f0f\u300f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"9\">\n<li>\u96a8\u300e\u5168\u9762\u5c4f\u300f\u8ffd\u6c42\u4fc2\u624b\u6a5f\u982d\u300e\u947f\u7abf\u300f\u88dd\u300e\u76f8\u6a5f\u300f. \u5c0e\u7f6e\u300e\u5168\u9762\u5c4f\u300f\u8b8a\u300e\u5154\u5507\u5c4f \u300f.\u5373\u300eCUTOUT MODE\u300f\u8981\u4fc2Androd 9.0 Pie(API 28) \u53d7\u652f\u6301.<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.P) {<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"10\">\n<li>\u540c\u4fc2\u8a2d\u5e03\u5c40\u300eLAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">WindowManager.LayoutParams param = window.getAttributes();<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">param.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">window.setAttributes(param);}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"288\">layoutInDisplayCutoutMode<\/td>\n<td width=\"288\">\u7c21\u8ff0<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT<\/td>\n<td width=\"288\">\u5168\u5c4f\u5514\u5ef6\u4f38\u81f3\u300e\u5154\u5507 \u300f, \u975e\u5168\u5c4f\u5ef6\u4f38\u81f3\u300e\u5154\u5507 \u300f<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER<\/td>\n<td width=\"288\">WINDOW\u5514\u5ef6\u4f38\u81f3\u300e\u5154\u5507 \u300f<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES<\/td>\n<td width=\"288\">\u7abb\u53e3\u5ef6\u4f38\u81f3\u300e\u5154\u5507 \u300f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5168\u5c4f\u4ee4\u4eba\u6c89\u6d78\u6e38\u6232\u514d\u53d7\u5e72\u64fe. \u6536\u57cb\u9802\u300e\u72c0\u614b\u300f\u300e\u6a19\u984c\u300f\u5e95\u300e\u5c0e\u822a\u300f. \u820a\u6642\u5168\u5c4f\u4fc2\u300eActivity:onCreate &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/android_studio_fullscreen_cutout_mode\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">Android Studio \u5168\u5c4fCUTOUT MODE<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[2],"class_list":["post-11062","post","type-post","status-publish","format-standard","hentry","category-android","tag-android","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/comments?post=11062"}],"version-history":[{"count":3,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11062\/revisions"}],"predecessor-version":[{"id":11067,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/11062\/revisions\/11067"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=11062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=11062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=11062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}