{"id":10013,"date":"2024-06-30T11:41:40","date_gmt":"2024-06-30T09:41:40","guid":{"rendered":"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/"},"modified":"2024-07-02T10:24:38","modified_gmt":"2024-07-02T08:24:38","slug":"creating-a-wrapper","status":"publish","type":"docs","link":"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/","title":{"rendered":"Creating a Wrapper"},"content":{"rendered":"<p data-renderer-start-pos=\"1\">You can choose to create a view inside the layout or create the view programmatically and add it to the layout later.<\/p>\n<h3 id=\"View-in-Layout-File\" data-renderer-start-pos=\"120\">View in Layout File<\/h3>\n<p data-renderer-start-pos=\"141\">This code goes inside the root of your layout file.<\/p>\n<div class=\"code-block\">\n<pre>      # activity_main.xml\r\n      ...\r\n      &lt;LinearLayout\r\n          android:id=\"@+id\/wrapper\"\r\n          android:layout_width=\"wrap_content\"\r\n          android:layout_height=\"wrap_content\"\r\n          android:orientation=\"horizontal\"\r\n          android:layout_centerHorizontal=\"true\"\r\n          android:layout_alignParentBottom=\"true\"&gt;\r\n      &lt;\/LinearLayout&gt;\r\n      ...\r\n<\/pre>\n<\/div>\n<p data-renderer-start-pos=\"489\">Get this view from an activity or fragment, a way to do it could be:<\/p>\n<div class=\"code-block\">\n<pre>      # MainActivity.kt\r\n      val wrapper = findViewById(R.id.wrapper)\r\n<\/pre>\n<\/div>\n<h3 id=\"View-Programmatically\" data-renderer-start-pos=\"620\">View Programmatically<\/h3>\n<div class=\"code-block\">\n<pre>      # MainActivity.kt\r\n      \/\/ Get the root layout of the activity\r\n      val parent = findViewById&lt;ViewGroup&gt;(R.id.main_layout) as RelativeLayout\r\n      \/\/ Create your custom layout\r\n      val wrapper = LinearLayout(this)\r\n      wrapper.orientation = LinearLayout.HORIZONTAL\r\n      \/\/ Parameters for the wrapper inside a RelativeLayout\r\n      val params = RelativeLayout.LayoutParams(\r\n          LinearLayout.LayoutParams.WRAP_CONTENT,\r\n          LinearLayout.LayoutParams.WRAP_CONTENT\r\n      )\r\n      params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM)\r\n      params.addRule(RelativeLayout.CENTER_HORIZONTAL)\r\n      wrapper.layoutParams = params\r\n      \/\/ Add the wrapper to the main layout\r\n      parent.addView(wrapper)\r\n<\/pre>\n<\/div>","protected":false},"featured_media":0,"parent":10006,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-10013","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a Wrapper | Refinery89<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/\" \/>\n<meta property=\"og:locale\" content=\"sv_SE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Wrapper | Refinery89\" \/>\n<meta property=\"og:description\" content=\"You can choose to create a view inside the layout or create the view programmatically and add it to the layout later. View in Layout File This code goes inside the root of your layout file. # activity_main.xml ... &lt;LinearLayout android:id=&quot;@+id\/wrapper&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:orientation=&quot;horizontal&quot; android:layout_centerHorizontal=&quot;true&quot; android:layout_alignParentBottom=&quot;true&quot;&gt; &lt;\/LinearLayout&gt; ... Get this view from an activity or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/\" \/>\n<meta property=\"og:site_name\" content=\"Refinery89\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Refinery89\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-02T08:24:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@refinery89\" \/>\n<meta name=\"twitter:label1\" content=\"Ber\u00e4knad l\u00e4stid\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minut\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/\",\"url\":\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/\",\"name\":\"Creating a Wrapper | Refinery89\",\"isPartOf\":{\"@id\":\"https:\/\/refinery89.com\/#website\"},\"datePublished\":\"2024-06-30T09:41:40+00:00\",\"dateModified\":\"2024-07-02T08:24:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/#breadcrumb\"},\"inLanguage\":\"sv-SE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/refinery89.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android &#8211; Monetize App SDK Documentation\",\"item\":\"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Private: Use Manual\",\"item\":\"https:\/\/refinery89.com\/?post_type=docs&p=10006\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Creating a Wrapper\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refinery89.com\/#website\",\"url\":\"https:\/\/refinery89.com\/\",\"name\":\"Refinery89\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/refinery89.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refinery89.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"sv-SE\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/refinery89.com\/#organization\",\"name\":\"Refinery89\",\"alternateName\":\"R89\",\"url\":\"https:\/\/refinery89.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"sv-SE\",\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"contentUrl\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"width\":200,\"height\":200,\"caption\":\"Refinery89\"},\"image\":{\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Refinery89\/\",\"https:\/\/x.com\/refinery89\",\"https:\/\/www.linkedin.com\/company\/refinery89\/\",\"https:\/\/www.youtube.com\/@refinery89\",\"https:\/\/www.instagram.com\/refinery_89\/\",\"https:\/\/www.reddit.com\/user\/Refinery89\/\",\"https:\/\/share.google\/K8hFf3ktmUrTi1XCa\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a Wrapper | Refinery89","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/","og_locale":"sv_SE","og_type":"article","og_title":"Creating a Wrapper | Refinery89","og_description":"You can choose to create a view inside the layout or create the view programmatically and add it to the layout later. View in Layout File This code goes inside the root of your layout file. # activity_main.xml ... &lt;LinearLayout android:id=\"@+id\/wrapper\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:orientation=\"horizontal\" android:layout_centerHorizontal=\"true\" android:layout_alignParentBottom=\"true\"&gt; &lt;\/LinearLayout&gt; ... Get this view from an activity or [&hellip;]","og_url":"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/","og_site_name":"Refinery89","article_publisher":"https:\/\/www.facebook.com\/Refinery89\/","article_modified_time":"2024-07-02T08:24:38+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@refinery89","twitter_misc":{"Ber\u00e4knad l\u00e4stid":"1 minut"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/","url":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/","name":"Creating a Wrapper | Refinery89","isPartOf":{"@id":"https:\/\/refinery89.com\/#website"},"datePublished":"2024-06-30T09:41:40+00:00","dateModified":"2024-07-02T08:24:38+00:00","breadcrumb":{"@id":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/#breadcrumb"},"inLanguage":"sv-SE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/creating-a-wrapper\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/refinery89.com\/"},{"@type":"ListItem","position":2,"name":"Android &#8211; Monetize App SDK Documentation","item":"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/"},{"@type":"ListItem","position":3,"name":"Private: Use Manual","item":"https:\/\/refinery89.com\/?post_type=docs&p=10006"},{"@type":"ListItem","position":4,"name":"Creating a Wrapper"}]},{"@type":"WebSite","@id":"https:\/\/refinery89.com\/#website","url":"https:\/\/refinery89.com\/","name":"Refinery89","description":"","publisher":{"@id":"https:\/\/refinery89.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refinery89.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"sv-SE"},{"@type":"Organization","@id":"https:\/\/refinery89.com\/#organization","name":"Refinery89","alternateName":"R89","url":"https:\/\/refinery89.com\/","logo":{"@type":"ImageObject","inLanguage":"sv-SE","@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/","url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","contentUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","width":200,"height":200,"caption":"Refinery89"},"image":{"@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Refinery89\/","https:\/\/x.com\/refinery89","https:\/\/www.linkedin.com\/company\/refinery89\/","https:\/\/www.youtube.com\/@refinery89","https:\/\/www.instagram.com\/refinery_89\/","https:\/\/www.reddit.com\/user\/Refinery89\/","https:\/\/share.google\/K8hFf3ktmUrTi1XCa"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs\/10013","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/comments?post=10013"}],"version-history":[{"count":0,"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs\/10013\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs\/10006"}],"next":[{"title":"Enabling Minify","link":"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/enabling-minify\/","href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs\/10014"}],"prev":[{"title":"Initialization Types","link":"https:\/\/refinery89.com\/sv\/docs\/monetize-app-sdk-documentation\/use-manual\/initialization-types\/","href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/docs\/10012"}],"wp:attachment":[{"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/media?parent=10013"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/refinery89.com\/sv\/wp-json\/wp\/v2\/doc_tag?post=10013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}