-jio-start-block-type-3
¶ Instream Video Ads-jio-style-title ¶ IntroductionInstream video ads seamlessly integrate within your app's video content, offering various formats like pre-roll, mid-roll, and post-roll. |
![]() |
-jio-end-block-type-3
Complete GETTING STARTED section and INITIALIZE SDK section before starting this section.
-jio-start-block-type-2
-jio-style-title
Cache instream video ads by initializing a JioAdView, setting up an ad listener, creating an ad container, adding the ad view, and initiating the caching process with a single call to jioAdViewInstreamVideo.cacheAd()
var jioAdViewInstreamVideo: JioAdView
jioAdViewInstreamVideo = JioAdView (this,”<ADSPOT_KEY_GOES_HERE>“,
JioAdView.AD_TYPE.INSTREAM_VIDEO)
// context pass here should be Activity context.
jioAdViewInstreamVideo!!.setAdListener(object: JioAdListener() {
override fun onAdFailedToLoad(jioAdView: JioAdView?, jioAdError: JioAdError?) {
// Error Callback
}
override fun onAdPrepared(jioAdView: JioAdView?) {
// Success callback
}
override fun onAdClosed( jioAdView: JioAdView?,isVideoCompleted: Boolean,
isEligibleForReward: Boolean) {
// When Ad is closed
}
override fun onAdRender(jioAdView: JioAdView?){
// When ad is rendered on screen
}
override fun onAdMediaEnd(jioAdView: JioAdView?) {
// When media ended
}
})
val instreamAdContainer = findViewById<FrameLayout>(R.id.instreamAdContainer)
jioAdViewInstreamVideo.cacheAd()
-jio-style-title
Load the instream video ad when it's in the prepared state, utilizing jioAdViewInstreamVideo.loadAd()
for rendering
if(jioAdViewInstreamVideo!!.getAdState() == JioAdView.AdState.PREPARED){
jioAdViewInstreamVideo.addView(jioAdViewInstreamVideo?.getAdView())
jioAdViewInstreamVideo?.loadAd()
}
-jio-end-block-type-2
-jio-start-block-type-2
-jio-style-title
Destroy the instream video ad object by calling jioAdViewInstreamVideo.onDestroy()
in onDestroy()
method of your activity to ensure proper cleanup during the activity lifecycle.
override fun onDestroy() {
if (jioAdViewInstreamVideo!= null) {
jioAdViewInstreamVideo.onDestroy()
}
super.onDestroy()
}
-jio-style-title
Pause and resume video controls using jioAdViewInstreamVideo.pauseAd()
and jioAdViewInstreamVideo.resumeAd()
APIs.
//to hide all the video controls
jioAdViewInstreamVideo.pauseAd()
//to show all the video controls
jioAdViewInstreamVideo.resumeAd()
-jio-style-title
Hide/Show Overlay Controls
//to hide all the video controls
jioAdViewInstreamVideo.hideControls()
//to show all the video controls
jioAdViewInstreamVideo.showControls()
-jio-style-title
//to expand the video ad
jioAdViewInstreamVideo.expandAd()
//to collapse the video ad
jioAdViewInstreamVideo.collapseAd()
-jio-style-title
override fun onConfigurationChanged(Configuration newConfig) {
if(jioAdViewInstreamVideo!=null && jioAdViewInstreamVideo.isMediaInProgress()) {
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
jioAdViewInstreamVideo.expandAd();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
jioAdViewInstreamVideo.collapseAd();
}
}
super.onConfigurationChanged(newConfig);
}
-jio-style-title
jioAdViewInstreamVideo.setAdpodVariant(Constants.AdPodVariant. DEFAULT_ADPOD)
jioAdViewInstreamVideo.setRequestedAdDuration(“PASS_AD_DURATION_IN_SECONDS”)
setRequestedAdDuration() API is only available for in-stream video. Any input less than 2 seconds will be ignored.
-jio-end-block-type-2
-jio-start-block-type-2
Customize video ads by defining elements and tags, including controls for Mute/Unmute, Play/Pause, numerical progress, progress bar, Minimize/Maximize, Skip Ad label, CTA button, and ad badge in a specified XML layout using
jioadView.setCustomInstreamAdContainer(R.layout.custom_instream_layout);
-jio-style-title
Add Title for Ad.
android:tag=”@string/jio_video_title”
detects the title of the Ad.
<TextView android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:tag="@string/jio_video_title"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
-jio-style-title
Add Description for Ad.
android:tag=”@string/jio_video_desc”
detects the description of the Ad.
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="3dp"
android:layout_marginTop="2dp"
android:tag="@string/jio_video_desc"
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="visible"
app:layout_constraintSta rt_toEndOf="@+id/text_ad"
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
-jio-style-title
Add an Image View for controlling the Mute/Unmute functionality.
android:tag=”@string/jio_video_volume_icon”
detects the ImageView
is used for displaying and controlling the Mute / unmute state.
In case Application wants to update the drawable icons for both UnMute and Mute, they can pass their drawable within src and background attribute.
<ImageView
android:id=”@+id/iv_sound_unmute_button”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_marginLeft=”10dp”
android:layout_marginTop=”10dp”
android:tag=”@string/jio_video_volume_icon”
android:src=”@drawable/jio_unmute”
android:background=”@drawable/jio_mute” />
-jio-style-title
Create a Relative Layout to serve as the video player container.
android:tag="@string/jio_video_player_container”
detects player position.
Relative Layout can be positioned as per application need.
<RelativeLayout
android:id=”@+id/fl_video_container”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:layout_centerInParent=”true”
android:tag=”@string/jio_video_player_container”
android:layout_gravity=”center_vertical” >
-jio-style-title
Include an Image View for Play/Pause functionality in the video player.
android:tag=”@string/jio_video_playback_icon”
detects the ImageView
is used for displaying and controlling the Play / Pause state. In case app wants to update the drawable icons for both Pause and Play, they can pass their drawable within src
and background
attribute
<ImageView
android:id=”@+id/adPlayback ”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_centerVertical=”true”
android:layout_margin=”5dp”
android:contentDescription=”@string/playpause”
android:src=”@drawable/jio_vast_pause”
android:background=”@drawable/jio_vast_play”
android:tag=”@string/jio_video_playback_icon”
android:visibility=”gone” />
-jio-style-title
Add a Text View for displaying the numerical progress of the video ad.
android:tag=”@string/jio_video_progresscount”
indicates this view will be used for showing progress count of video ad.
<TextView
android:id=”@+id/progressCount”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_toRightOf=”@+id/adText”
android:padding=”5dp”
android:tag=”@string/jio_video_progresscount”
android:text=”00:00”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android: color/white”
android:textSize=”12sp”
android:visibility=”gone” />
-jio-style-title
Include a Progress Bar for visual representation of the video ad progress.
android:tag=”@string/jio_video_progressbar”
indicates this view will be used for showing progress of video ad.
<TextView
android:id=”@+id/progressCount”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_toRightOf=”@+id/adText”
android:padding=”5dp”
android:tag=”@string/jio_video_progresscount”
android:text=”00:00”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android: color/white”
android:textSize=”12sp”
android:visibility=”gone” />
-jio-style-title
Add an Image View for controlling the Minimize/Maximize state of the video.
android:tag=”@string/jio_minimize_icon”
detects the ImageView
that is used for displaying and controlling the Maximize / Minimize state.
In case app wants to update the drawable icons for both maximize and minimize, they can pass their drawable within src
and background
attribute.
<ImageView
android:id=”@+id/adSizeToggle”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_alignParentEnd=”true”
android:layout_alignParentRight=”true”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_marginRight=”5dp”
android:padding=”5dp”
android:visibility=”gone”
android:src=”@drawable/jio_fullscreen_icon”
android:tag=”@string/jio_video_resize_icon”
android:background=”@drawable/jio_minimize_icon” />
-jio-style-title
Include a Text View for managing the Skip Ad label.
android:tag=”@string/jio_video_skip_element”
detects the TextView
that is used to manage the Skip labels. Android:contentDescription
attribute contains the Skip label which User should see once the ad is skippable. Android:drawableRight
attribute contains the skip drawable used along with Skip Ad text. Publisher can pass their own drawable if needed. Andoird:text
attribute contains the text label used for showing text before the Ad is skippable. i.e. You can skip ad in X secs. SKIP_COUNTER
is a macro which SDK will replace with skip duration and gradually decrease as media plays.
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_above=”@+id/adDetailsLayout”
android:layout_alignParentRight=”true”
android:layout_marginRight=”5dp”
android:layout_marginBottom=”3dp”
android:background=”#55000000”
android:contentDescription=”Skip Ad”
android:drawableRight=”@drawable/jio_pre_roll_skip”
android:drawablePadding=”3dp”
android:gravity=”center_vertical”
android:padding=”8dp”
android:tag=”@string/jio_video_skip_element”
android:text=”You can skip ad in SKIP_COUNTER”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:visibility=”gone” />
-jio-style-title
Include a Text View for managing the Focussed Skip Ad label.
android:tag=”@string/jio_video_skip_element_focused”
detects the TextView that is used to manage the Focussed Skip Ad label. “android:contentDescription”
attribute contains the Skip label which User should see once the ad is skippable. “android:drawableRight”
attribute contains the skip drawable used along with Skip Ad text. Publisher can pass their own drawable if needed. “android:text”
attribute contains the text label used for showing text before the Ad is skippable. i.e. You can skip ad in X secs. SKIP_COUNTER is a macro which SDK will replace with skip duration and gradually decrease as media plays. Publisher can customize the Left focus by using “android:nextFocusLeft”
attribute and customize the Right focus by using “android:nextFocusRight”
<TextView
android:id="@+id/btn_close_focused"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="500dp"
android:background="@drawable/custom_ad_button_selector_demo" android:contentDescription="Skip Ad"
android:drawablePadding="6dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:nextFocusLeft="@id/btn_cta"
android:nextFocusRight="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_skip_element_focused"
android:text="SkipAd!!!"
android:textColor="@color/white"
android:textSize="16dp"
android:visibility="gone" />
-jio-style-title
Add a Text View for the Call-to-Action (CTA) button.
android:tag=”@string/jio_video_cta”
is used to place the CTA label for Ad.
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentRight=”true”
android:layout_margin=”10dp”
android:padding=”3dp”
android:tag=”@string/jio_video_cta”
android:text=”Visit Advertiser”
android:textColor=”@color/jio_white”
android:textStyle=”bold” />
-jio-style-title
Add a Text View for the Call-to-Action (CTA) button, only for TV with focus.
android:tag=”@string/jio_video_cta_btn_focused”
is used to place the focused CTA for Ad.
<TextView
android:id="@+id/btn_cta1"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="0dp"
android:layout_toRightOf="@+id/btn_cta"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Visit Advertiser"
android:drawableRight="@drawable/forward"
android:drawablePadding="8dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusedByDefault="true"
android:gravity="center"
android:nextFocusLeft="@id/rlVideoContainer"
android:nextFocusRight="@id/btn_reward_close"
android:nextFocusDown="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_cta_btn_focused"
android:text="Visit Advertiser"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="16dp"
android:visibility="gone" tools:visibility="gone">
-jio-style-title
Include a Text View for displaying information about the ad.
<TextView
android:id=”@+id/adText”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_toRightOf=”@id/adPlayback”
android:maxLength=”15”
android:padding=”5dp”
android:text=”Ad :”
android:textAppearance=”?android:attr/textAppearanceSmall” android:textColor=”@android: color/white”
android:textSize=”12sp”
android:visibility=”gone” />
-jio-style-title
Video instream ads also support companion ads to show display ads along with video ads for an extended user experience. Refer Companion section for more details.
-jio-end-block-type-2
-jio-start-block-type-2
Provides the entire XML layout for reference in Video Ads customization.
<RelativeLayout
xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”@android:color/black”>
<RelativeLayout
android:id=”@+id/adLayout”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:layout_centerInParent=”true”
android:layout_gravity=”center”/>
<RelativeLayout
android:id=”@+id/adDetailsLayout”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:tag="@string/jio_video_player_container"
android:layout_alignBottom=”@id/adLayout”
android:background=”#55000000”
android:orientation=”horizontal”>
<ImageView
android:id=”@+id/adPlayback”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_centerVertical=”true”
android:layout_margin=”5dp”
android:background=”@drawable/jio_vast_play”
android:contentDescription=”@string/playpause”
android:src=”@drawable/jio_vast_pause”
android:tag=”@string/jio_video_playback_icon”
android:visibility=”gone” />
<TextView
android:id=”@+id/adText”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_toRightOf=”@id/adPlayback”
android:maxLength=”15”
android:padding=”5dp”
android:tag=”VastAdProgressLabel”
android:text=”Ad :”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:textSize=”12sp”
android:visibility=”gone” />
<TextView
android:id=”@+id/progressCount”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_toRightOf=”@+id/adText”
android:padding=”5dp”
android:tag=”@string/jio_video_progresscount”
android:text=”00:00”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:textSize=”12sp”
android:visibility=”gone” />
<ProgressBar
android:padding=”5dp”
android:layout_centerVertical=”true”
android:tag=”@string/jio_video_progressbar”
android:style=”@style/Widget.AppCompat.ProgressBar.Horizontal”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_toStartOf=”@+id/adSizeToggle”
android:layout_toEndOf=”@+id/progressCount” />
<ImageView
android:id=”@+id/adSizeToggle”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_alignParentEnd=”true”
android:layout_alignParentRight=”true”
android:layout_centerVertical=”true”
android:layout_gravity=”center”
android:layout_marginRight=”5dp”
android:background=”@drawable/jio_minimize_icon”
android:padding=”5dp”
android:src=”@drawable/jio_fullscreen_icon”
android:tag=”@string/jio_video_resize_icon”
android:visibility=”gone” />
</RelativeLayout>
<ImageView
android:id=”@+id/iv_sound_unmute_button”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_marginLeft=”10dp”
android:layout_marginTop=”10dp”
android:tag=”@string/jio_video_volume_icon”
android:layout_alignParentLeft=”true”
android:src=”@drawable/jio_unmute”
android:background=”@drawable/jio_mute”/>
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_above=”@+id/adDetailsLayout”
android:layout_alignParentRight=”true”
android:layout_marginRight=”5dp”
android:layout_marginBottom=”3dp”
android:background=”#55000000”
android:contentDescription=”Skip Ad”
android:drawableRight=”@drawable/jio_pre_roll_skip”
android:drawablePadding=”3dp”
android:gravity=”center_vertical”
android:padding=”8dp”
android:tag=”@string/jio_video_skip_element”
android:text=”You can skip ad in SKIP_COUNTER”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:visibility=”gone” />
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_above=”@+id/adDetailsLayout”
android:layout_alignParentLeft=”true”
android:layout_marginRight=”5dp”
android:layout_marginBottom=”3dp”
android:background=”#55000000”
android:contentDescription=”Ad Counter”
android:drawablePadding=”3dp”
android:gravity=”center_vertical”
android:padding=”8dp”
android:textSize=”14dp”
android:tag=”@string/jio_video_ad_counter”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”/>
</RelativeLayout>
-jio-end-block-type-2
-jio-start-block-type-2
Provides the entire XML layout for reference in Video Ads customization.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rlVideoContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="Main Container"
android:focusable="true"
android:focusableInTouchMode="true"
android:nextFocusRight="@id/btn_reward_close"
android:nextFocusDown="@id/btn_cta"
android:nextFocusUp="@id/btn_close"
android:tag="@string/jio_video_player_container" />
<TextView
android:id="@+id/btn_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="500dp"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Skip Ad"
android:drawablePadding="6dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:nextFocusLeft="@id/btn_cta"
android:nextFocusRight="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_skip_element"
android:text="Skip Ad in SKIP_COUNTER"
android:textColor="@color/white"
android:textSize="16dp"
android:visibility="gone" />
<TextView
android:id="@+id/btn_close_focused"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="500dp"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Skip Ad"
android:drawablePadding="6dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:nextFocusLeft="@id/btn_cta"
android:nextFocusRight="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_skip_element_focused"
android:text="Skip Ad!!!"
android:textColor="@color/white"
android:textSize="16dp"
android:visibility="gone" />
<ProgressBar
android:id="@+id/pb"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_above="@+id/button_layout"
android:layout_marginBottom="33dp"
android:max="100"
android:progress="0"
android:progressDrawable="@drawable/custom_abs_progressbar_color"
android:tag="@string/jio_video_progressbar" />
<TextView
android:id="@+id/txt_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="48dp"
android:layout_marginTop="50dp"
android:background="@drawable/adtextbg"
android:padding="5dp"
android:text="Ad"
android:textColor="@color/white"
android:textSize="16dp" />
<TextView
android:id="@+id/ad_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="50dp"
android:layout_toRightOf="@+id/txt_ad"
android:padding="5dp"
android:tag="@string/jio_video_progresscount"
android:textSize="16dp" />
<LinearLayout
android:id="@+id/ll_ad_param"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="48dp"
android:layout_marginBottom="15dp"
android:orientation="horizontal"
android:tag="@string/jio_ad_params_dynamic_cta_container"
android:visibility="visible">
<LinearLayout
android:id="@+id/icon"
android:layout_width="74dp"
android:layout_height="74dp"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginRight="20dp"
android:orientation="horizontal"
android:scaleType="fitXY"
android:tag="@string/jio_video_ad_icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="end"
android:maxLines="1"
android:tag="@string/jio_video_title"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="end"
android:maxLines="1"
android:tag="@string/jio_video_desc"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/button_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_gravity="center_vertical"
android:layout_marginBottom="30dp"
android:gravity="right">
<TextView
android:id="@+id/btn_cta"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="0dp"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Visit Advertiser"
android:drawableRight="@drawable/close_icon"
android:drawablePadding="8dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusedByDefault="true"
android:gravity="center"
android:nextFocusLeft="@id/rlVideoContainer"
android:nextFocusRight="@id/btn_reward_close"
android:nextFocusDown="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_cta"
android:text="Visit Advertiser"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="16dp"
android:visibility="gone"
tools:visibility="visible">
</TextView>
<TextView
android:id="@+id/btn_cta1"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="0dp"
android:layout_toRightOf="@+id/btn_cta"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Visit Advertiser"
android:drawableRight="@drawable/forward"
android:drawablePadding="8dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusedByDefault="true"
android:gravity="center"
android:nextFocusLeft="@id/rlVideoContainer"
android:nextFocusRight="@id/btn_reward_close"
android:nextFocusDown="@id/btn_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_video_cta_btn_focused"
android:text="Visit Advertiser"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="16dp"
android:visibility="gone"
tools:visibility="gone">
<requestFocus />
</TextView>
<TextView
android:id="@+id/btn_reward_close"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_toRightOf="@id/btn_cta1"
android:background="@drawable/custom_ad_button_selector_demo"
android:contentDescription="Reward Granted"
android:drawableLeft="@drawable/ads_reward_drawableleft_selector"
android:drawableRight="@drawable/ads_reward_drawable_right_selector"
android:drawablePadding="6dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:nextFocusLeft="@id/btn_cta"
android:nextFocusRight="@id/btn_reward_close"
android:paddingLeft="20dp"
android:paddingTop="@dimen/margin_10dp"
android:paddingRight="20dp"
android:paddingBottom="@dimen/margin_10dp"
android:tag="@string/jio_reward_timer"
android:text="@string/reward_in_skip_counter"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@drawable/custom_ad_button_selector_text"
android:textSize="16dp"
android:visibility="gone"
tools:visibility="visible" />
</RelativeLayout>
</RelativeLayout>
-jio-end-block-type-2