Showing posts with label Xml layouts Design with Adview and Recyclerview. Show all posts
Showing posts with label Xml layouts Design with Adview and Recyclerview. Show all posts

Friday, 21 June 2019

How to display AdView in Bottom with RecyclerView in Xml

Here we design a Layout to display Adview  with RecyclerView 



Select  layouts right click on it Select New and Create Layout resource file. give file name like as you wish here i m giving home.xml and here i share xml  Layout  file code to set Adview at bottom with Recyclerview. here you can take any control as you wish.

home.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adbhome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/ads_banner">
</com.google.android.gms.ads.AdView>
<android.support.v7.widget.RecyclerView
android:id="@+id/mrecycle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/adbhome"
android:layout_alignParentTop="true" />
</RelativeLayout>

Snackbar in Kotlin

How to show snackbar in place of toast message , below is the code for showing snackbar in kotlin. Below code is put in Utils.kt  (common fi...