{"id":3385,"date":"2023-09-08T11:25:14","date_gmt":"2023-09-08T02:25:14","guid":{"rendered":"https:\/\/e-sys.denshin.org\/blog\/?p=3385"},"modified":"2023-09-10T23:20:11","modified_gmt":"2023-09-10T14:20:11","slug":"example-of-using-parts-to-configure-a-simple-screen","status":"publish","type":"post","link":"https:\/\/e-sys.ntsl.net\/?p=3385","title":{"rendered":"Example of using parts to configure a simple screen"},"content":{"rendered":"<p>Let&#8217;s try writing to strings.xml and activity_main.xml to make the parts that make up the view work.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3388\" src=\"https:\/\/e-sys.denshin.org\/blog\/wp-content\/uploads\/2023\/09\/2023-09-08_11h26_55.jpg\" alt=\"\" width=\"404\" height=\"535\" srcset=\"https:\/\/e-sys.ntsl.net\/wp-content\/uploads\/2023\/09\/2023-09-08_11h26_55.jpg 404w, https:\/\/e-sys.ntsl.net\/wp-content\/uploads\/2023\/09\/2023-09-08_11h26_55-227x300.jpg 227w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/p>\n<p>The screen view is realized by the description in these two xml files.<\/p>\n<p>&nbsp;<\/p>\n<p>One is below.<\/p>\n<p style=\"padding-left: 40px;\">Wrap it between the tags &lt;resources&gt;~&lt;\/resources&gt;.<br \/>\n&lt;string name=&#8221;app_name&#8221;&gt;string A&lt;\/string&gt;<br \/>\n&lt;string name=&#8221;tv_msg&#8221;&gt;String B&lt;\/string&gt;<\/p>\n<p>Another is to write:<\/p>\n<p style=\"padding-left: 40px;\">Use a view group with an attribute called linear layout.<br \/>\nSandwich it between the tags &lt;LinearLayout&gt;~&lt;\/LinearLayout&gt;.<br \/>\nThis group specifies the following attributes.<br \/>\nxmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;<br \/>\nandroid:layout_width=&#8221;match_parent&#8221;<br \/>\nandroid:layout_height=&#8221;match_parent&#8221;<br \/>\nandroid:background=&#8221;#A1A9BA&#8221;<br \/>\nandroid:orientation=&#8221;vertical&#8221;<\/p>\n<p>Place child views nested inside this view group.<\/p>\n<p>In addition to placing group views in child views, you can configure the screen by placing TextView, EditText, CheckBox, RadioGroup, RadioButton, Spinner, Button and ListView.<\/p>\n<p>Below is an example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3390\" src=\"https:\/\/e-sys.denshin.org\/blog\/wp-content\/uploads\/2023\/09\/2023-09-08_10h45_17.jpg\" alt=\"\" width=\"447\" height=\"927\" srcset=\"https:\/\/e-sys.ntsl.net\/wp-content\/uploads\/2023\/09\/2023-09-08_10h45_17.jpg 447w, https:\/\/e-sys.ntsl.net\/wp-content\/uploads\/2023\/09\/2023-09-08_10h45_17-145x300.jpg 145w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s try writing to strings.xml a &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,38],"tags":[],"class_list":["post-3385","post","type-post","status-publish","format-standard","hentry","category-android-studio","category-giraffe"],"_links":{"self":[{"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/posts\/3385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3385"}],"version-history":[{"count":4,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/posts\/3385\/revisions"}],"predecessor-version":[{"id":3391,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=\/wp\/v2\/posts\/3385\/revisions\/3391"}],"wp:attachment":[{"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/e-sys.ntsl.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}