I have created this layout. in which showing textview and below it , it has share buttons for insta, fb, copy,tweet.
content.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/Main"
android:layout_gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent">
<RelativeLayout
android:id="@+id/Sub_main"
android:layout_width="match_parent"
android:gravity="bottom"
android:background="@drawable/linerlayout_background"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:id="@+id/txt_hash"/>
<LinearLayout
android:id="@+id/sub"
android:layout_below="@+id/txt_hash"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button">
<Button android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="wrap_content"
android:background="@drawable/fb"
android:id="@+id/fb"/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:background="@drawable/insta"
android:id="@+id/insta"/>
<Button android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="wrap_content"
android:background="@drawable/tweet"
android:id="@+id/tweet"/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:background="@drawable/doc"
android:id="@+id/doc"/>
</LinearLayout>
</RelativeLayout>
I have recyclerview
which has this content to view. Now I want to fit these buttons properly according to every device screen size. I have no idea about layoutparams
, I have referred links but I need to understand how to calculate size of a particular button inside(Framelayout/RelativeLayout/LinearLayout/Buttons(4)).