{"id":595,"date":"2023-04-25T13:54:54","date_gmt":"2023-04-25T05:54:54","guid":{"rendered":"https:\/\/doc.orionstar.com\/en\/?post_type=lsvr_kba&#038;p=595"},"modified":"2024-09-24T15:51:33","modified_gmt":"2024-09-24T07:51:33","slug":"bigscreenbot-development","status":"publish","type":"lsvr_kba","link":"https:\/\/doc.orionstar.com\/en\/knowledge-base\/bigscreenbot-development\/","title":{"rendered":"BigScreenBot Development"},"content":{"rendered":"\n<h2 id=\"api-reference-big-screen-bot-development-introduction\">Introduction<a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development#api-reference-big-screen-bot-development-introduction\"><\/a><\/h2>\n\n\n\n<p>BigScreenBot is a large-screen version of GreetBot, which supports large-screen display content.<\/p>\n\n\n\n<h2 id=\"api-reference-big-screen-bot-development-1-permission-issues\">1. Permission issues<a href=\"https:\/\/ainirobot.gatsbyjs.io\/docs\/apk\/apk-development#api-reference-big-screen-bot-development-1-permission-issues\"><\/a><\/h2>\n\n\n\n<p>BigScreenBot display content must apply for the SYSTEM_ALERT_WINDOW permission of the global pop-up dialog box.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" \/&gt;<\/pre>\n\n\n\n<h2 id=\"api-reference-big-screen-bot-development-2-the-picture-is-not-full-screen-problem\">2. Issues with large screens<\/h2>\n\n\n\n<p>Due to the screen adaptation from landscape to portrait mode, the system cannot correctly read the screen information after rotation. Therefore, a coordinate transformation is implemented here to ensure the aspect ratio of the screen is correct. Please refer to the demo code for details.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">private int screenWidth = 0;\nprivate float scaleX = 0;\npublic BSImageDisplay(Context outerContext, Display display) {\n    super(outerContext, display);\n    Point pt = new Point();\n    display.getSize(pt);\n    screenWidth = pt.y * pt.y \/ pt.x;\n    scaleX = pt.x * 1.0f * pt.x \/ pt.y \/ pt.y;\n}\n@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.bs_image_layout);\n    \/\/The screen resolution requires a conversion due to the orientation (landscape or portrait) issue, hence the following conversion code is provided. Without this conversion, there would be an aspect ratio mismatch.\n    \/\/Because there is a problem, we have to rotate the screen, so we have the code below\n    findViewById(R.id.bg_image_main).getLayoutParams().width = screenWidth;\n    findViewById(R.id.bg_image_main).setScaleX(scaleX);\n   ........\n}<\/pre>\n\n\n\n<p><a href=\"https:\/\/orion-base-test-1256573505.cos.ap-beijing.myqcloud.com\/cn_docs_file\/2022-01-13_17%3A53%3A33_DoubleScreen.zip\" target=\"_blank\" rel=\"noreferrer noopener\">Sample code<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction BigScreenBot is a large-screen version of GreetBot, which supports large-screen display content. 1. Permission issues BigScreenBot display content must apply for the SYSTEM_ALERT_WINDOW permission of the global pop-up dialog box. 2. Issues with large screens Due to the screen adaptation from landscape to portrait mode, the system cannot correctly read the screen information after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"lsvr_kba_cat":[6],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/595"}],"collection":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/comments?post=595"}],"version-history":[{"count":3,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/595\/revisions"}],"predecessor-version":[{"id":777,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/595\/revisions\/777"}],"wp:attachment":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/media?parent=595"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_cat?post=595"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_tag?post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}