android - Adding fab Button at the junction of two ViewPager widgets -


i have implemented navigation drawer. in framelayout of navigation drawer have added fragment contains 2 viewpagers taking half screen each. want add fab button @ junction of these 2 viewpagers shown here.

enter image description here

in case both viewpagers occupy half screen different shown in image. can me in getting fab @ junction.

the code fragment containing 2 viewpagers below:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:orientation="vertical"               android:layout_width="match_parent"               android:layout_height="match_parent">      <android.support.v4.view.viewpager         xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/shirt_section"         android:layout_weight="1"         android:layout_width="match_parent"         android:layout_height="0dp" />      <android.support.v4.view.viewpager         xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/pant_section"         android:layout_weight="1"         android:layout_width="match_parent"         android:layout_height="0dp" /> </linearlayout>   

you enclose linear layout framelayout , add button this:

<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android"           android:layout_width="match_parent"           android:layout_height="match_parent">     <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"           android:orientation="vertical"           android:layout_width="match_parent"           android:layout_height="match_parent">            ...     </linearlayout>       <imagebutton         android:layout_gravity="center_vertical|right"         ...     /> </framelayout> 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -