I have a recyclerview. I want to adjust it according to different screenshots. I have an xml that I inflate into adapter. How can ı do ?
i am using guideline for regular pages but ı didnt this
This is the order I want
But this is what comes out in different screenshots
Example 1
Other one
Example 2
My xml codes
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:backgroundTint="#E1E1E1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="#+id/resimAlici"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/img"
android:layout_width="match_parent"
android:layout_height="93sp"
android:scaleType="fitCenter"
android:src="#drawable/imageshape" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nereden Nereye"
android:textStyle="bold"
android:gravity="center"
android:textColor="#353434"
android:textSize="10sp"
android:id="#+id/t1"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
Related
why my last row is hidden in listview?
Hello, why my last row is hidden in listview?
Hello, why my last row is hidden in listview?
I have changed the xml code 1000 times already and still can't fix it.
SwipeRefreshLayout work good.
enter image description here
fragment_list.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="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="#+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp">
<ListView
android:id="#+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#android:color/transparent"
android:listSelector="#android:color/transparent"
android:divider="#null"
android:dividerHeight="0dp">
</ListView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
<com.google.android.material.textview.MaterialTextView
android:id="#+id/empty"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="#string/empty_list_text" />
</RelativeLayout>
`
list_row.xml
`
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="#+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:rippleColor="#android:color/transparent"
card_view:cardElevation="0dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:strokeWidth="0dp"
app:cardElevation="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:id="#+id/image"
android:layout_width="match_parent"
android:layout_height="194dp"
app:srcCompat="#drawable/image_list"
app:shapeAppearanceOverlay="#style/ShapeAppearanceOverlay.App.SelectedCornerRadius"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="#+id/city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceHeadline6" />
<com.google.android.material.textview.MaterialTextView
android:id="#+id/region"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="?attr/textAppearanceBody2" />
<com.google.android.material.textview.MaterialTextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:layout_marginTop="12dp"
android:textAppearance="?attr/textAppearanceBody2" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:layout_gravity="center"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="#+id/btn_check_region"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:text="#string/check_list" />
<com.google.android.material.button.MaterialButton
android:id="#+id/btn_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/check_delete" />
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</RelativeLayout>
`
I have no idea how to fix it -.-
The ListView's height is MATCH_PARENT which constrains it to the height of its parent ViewGroup. You should always define the height of scrollable views like ListView as WRAP_CONTENT so that it can freely expand according to the number of children.
Also it might be a good idea for the parent LinearLayout to be anchored to the top of the RelativeLayout:
android:layout_alignParentTop="true".
Leaving views floating freely in RelativeLayouts may have surprising consequences.
I am developing an activity that searches for users in my Firebase realtime DB and I am using a cradview as a layout to inflate:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="90dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:backgroundTint="#FFFFFF"
android:elevation="0dp"
android:layout_marginBottom="20dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.cardview.widget.CardView
android:id="#+id/crdProfileImage"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
app:cardBackgroundColor="#color/textC"
app:cardCornerRadius="30dp">
<ImageView
android:id="#+id/imgHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/user_default"
android:scaleType="centerCrop"/>
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/txtUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="#color/black"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:layout_toEndOf="#+id/crdProfileImage"
android:layout_marginLeft="25dp"
android:textSize="25dp"/>
<TextView
android:id="#+id/txtBio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:layout_alignStart="#+id/txtUsername"
android:layout_marginTop="35dp"
android:text="Hi, this is my biography."/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
However, I noticed that when the recyclerview outputs the items, the items appear with an outline:
I thought it was the elevation, so I set it to 0, both on the recyclerview and on the layout in the cardview, but the result didn't change. Would anyone know how to solve?
EDIT:
I tried to remove the margin bottom but it still shows the elevation:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="90dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:backgroundTint="#FFFFFF"
card_view:cardElevation="0dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.cardview.widget.CardView
android:id="#+id/crdProfileImage"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
app:cardElevation="0dp"
app:cardBackgroundColor="#color/textC"
app:cardCornerRadius="30dp">
<ImageView
android:id="#+id/imgHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/user_default"
android:scaleType="centerCrop"/>
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/txtUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="#color/black"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:layout_toEndOf="#+id/crdProfileImage"
android:layout_marginLeft="25dp"
android:textSize="25dp"/>
<TextView
android:id="#+id/txtBio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:layout_alignStart="#+id/txtUsername"
android:layout_marginTop="35dp"
android:text="Hi, this is my biography."/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
Use
card_view:cardElevation="0dp"
Instead of
android:elevation="0dp"
Add the following line of code to disable the outlineProvider:
android:outlineProvider="none"
in addition to the android:elevation being 0dp just remove the android:layout_marginBottom="20dp" from your <com.google.android.material.card.MaterialCardView /> and then add android:padding for your children view in it to make the spacing
In the XML layout, everything seems perfect. When I used the emulator or real device, the adView is not visible. I tried to give height to adView like 200 dp. Then the adView is visible. But, when I gave the value of wrap_content for the height of the adView, there is a problem. I used LinearLayout and RelativeLayout but the problem is the same. What should I do for this?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:padding="30dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:text="#string/nav_contact_us_content_explanation" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="email"
android:gravity="center"
android:selectAllOnFocus="false"
android:text="#string/nav_contact_us_content_mail" />
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="#+id/adview_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"></com.google.android.gms.ads.AdView>
</LinearLayout>
Try to put AdView in FrameLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:padding="30dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:text="#string/nav_contact_us_content_explanation" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="email"
android:gravity="center"
android:selectAllOnFocus="false"
android:text="#string/nav_contact_us_content_mail" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.gms.ads.AdView
android:id="#+id/adview_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"/>
</FrameLayout>
</LinearLayout>
In the case of LinearLayout, as the weight was set to 1, it took the whole screen when the ad was not yet loaded. However, you should see a warning like the following in your logcat here.
W/Ads: Not enough space to show ad. Needs 320x50 dp, but only has 288x495 dp.
In order to fix the problem, you might consider using a RelativeLayout instead of a LinearLayout like the following.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/adview"
android:orientation="vertical"
android:padding="30dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:text="Contact us" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="email"
android:gravity="center"
android:selectAllOnFocus="false"
android:text="Email" />
</LinearLayout>
<LinearLayout
android:id="#+id/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<com.google.android.gms.ads.AdView
android:id="#+id/adview_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111" />
</LinearLayout>
</RelativeLayout>
On the other hand, you might also consider setting up a fixed size for the AdView so that it does not hide when the content is not yet loaded. You can get the sizes of different types of ads for different screen sizes here.
I want to design xml page this type. I tried many of the code. Every time new problems are come. I need bottom navigation bar is fixed. In grid view ,i want android:numColums=3, android:verticalSpacing and android:horizontalSpacing Same(Look like instagram profile view grid images ).
XMl Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainSettingClass">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="175dp"
android:background="#dadada"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="#drawable/com_facebook_button_background"/>
<TextView
android:id="#+id/amsc_txt_fbusername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="TextView"
android:layout_marginTop="2dp" />
</LinearLayout>
<GridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/grid_test"
android:verticalSpacing="2dp"
android:horizontalSpacing="2dp"
android:background="#FFFFFF"
android:stretchMode="columnWidth"
android:columnWidth="85dp"
android:numColumns="3"/>
<android.support.design.widget.BottomNavigationView
android:id="#+id/bottom_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#ffffff"
app:menu="#menu/bottom_navigation_gallery"/>
</FrameLayout>
As per your design you need scrollview for 2 above components and your BottomNavigationView is fix (not movable).
In your code you are not using scrollview first and second i'm not sure why you're using framelayout!
Here's my code which is exactly as per your given design try this if any concern you can ask! :)
Here's my code:
<?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="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/bottom_gallery">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/rel_titleHolder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#dadada"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/amsc_txt_fbusername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:gravity="center"
android:text="TextView" />
</LinearLayout>
<GridView
android:id="#+id/grid_test"
android:layout_width="match_parent"
android:layout_height="400dp"
android:columnWidth="85dp"
android:horizontalSpacing="2dp"
android:numColumns="3"/>
</LinearLayout>
</ScrollView>
<android.support.design.widget.BottomNavigationView
android:id="#+id/bottom_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:layout_alignParentBottom="true" />
</RelativeLayout>
I have a fab and would like to have it during the passage between two tabs, tried to put the transparent background in fragment_main.xml but without success. The problem is really how do I put the background of the two fragments appearing while allowing this gray stripe cutting because of FAB. Very grateful to those who help me.
fragment_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0000"
android:orientation="vertical">
<br.com.test.common.view.SlidingTabLayout
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="#0000"/>
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="#+id/pink_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_icon="#drawable/ic_add"
fab:fab_colorNormal="#color/material_orange_500"
fab:fab_colorPressed="#color/material_orange_a200"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"/>
</LinearLayout>
fragment_profile.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="?android:attr/colorBackground"
android:layout_weight="1"
android:gravity="center_horizontal">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageView
android:id="#+id/profileImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="#drawable/ic_launcher"
android:padding="10dp"
android:scaleType="centerInside"/>
<TextView
android:id="#+id/profileName"
android:layout_below="#id/profileImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="teste"
android:textSize="22sp"/>
<LinearLayout
android:id="#+id/ll_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/profileName"
android:padding="10dp">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="150dp"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/info_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="teste"/>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/ll_1"
android:padding="10dp">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view_2"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="150dp"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/info_text2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="teste"/>
</android.support.v7.widget.CardView>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
fragment_service.xml
<?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:gravity="center_horizontal">
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical">
<TableRow>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgDP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="#drawable/logo_dp"/>
<TextView
android:layout_below="#id/imgDP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DP"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp">
<ImageView
android:id="#+id/imgNA1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="#drawable/logo_na"/>
<TextView
android:layout_below="#id/imgNA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NA"/>
</RelativeLayout>
</TableRow>
</TableLayout>
</LinearLayout>
Eihschnaehkeee is right -- you just need a layout that allows overlapping. Here is XML to try (also adding right margin for your button):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0000">
<br.com.test.common.view.SlidingTabLayout
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/sliding_tabs"
android:layout_alignParentBottom="true"
android:background="#0000"/>
<com.getbase.floatingactionbutton.FloatingActionButton
android:id="#+id/pink_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_icon="#drawable/ic_add"
fab:fab_colorNormal="#color/material_orange_500"
fab:fab_colorPressed="#color/material_orange_a200"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"/>
</RelativeLayout >
Eihschnaehkeee and Bruce.
I tried to put as relative layout and swipe funcinou not more, I tried using SlidingTabLayout the android code https://github.com/googlesamples/android-SlidingTabsBasic/