I'm Learner and designing an interface but there is little problem can some one help me out, attaching screen shot original and my design and also code.
I'm unable to adjust the button position in layout, and also if some one have links or stuff related beginners then also share
thanks.
Here is my XML code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_home__screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.sofagold.mrdeveloper.sofagold.Home_Screen"
android:background="#android:color/black">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.8">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/home_header"
android:layout_weight="1.3">
<Button
android:layout_width="62dp"
android:layout_height="wrap_content"
android:id="#+id/button3"
android:background="#drawable/home_home"
android:layout_gravity="start"
android:padding="5dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/home_small_logo"
android:id="#+id/imageView"
android:adjustViewBounds="true"
android:baselineAlignBottom="false"
android:layout_gravity="center"
android:layout_weight="5000" />
<Button
android:layout_width="59dp"
android:layout_height="wrap_content"
android:id="#+id/button8"
android:background="#drawable/home_back"
android:layout_gravity="start"
android:padding="5dp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.2">
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button24"
android:layout_toEndOf="#+id/button25"
android:layout_marginStart="64dp"
android:layout_marginTop="8dp"
android:id="#+id/button22"
android:layout_wieght="5"
android:background="#drawable/home_btn_bg" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="#+id/button22"
android:layout_marginBottom="48dp"
android:id="#+id/button24"
android:button_size="5dp"
android:background="#drawable/home_btn_bg" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button24"
android:id="#+id/button25"
android:button_size="5dp"
android:background="#drawable/home_btn_bg" />
RelativeLayout(end of)
</LinearLayout>
</LinearLayout>
Related
I watched this video of auto complete text. However, for this one he made an array with all but another video at 1:54 he shows off a text box that comes up that seems to be powered by Google. I am wondering how can I get this auto complete to come up for me? I know there is auto complete text you can get in Android Studio, but that is not what I want to use.
Here is my XML code:
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="onClick"
tools:context=".MainActivity">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:layout="#layout/activity_main" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="60dp"
android:orientation="horizontal"
android:layout_marginEnd="60dp">
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.01"
android:ems="10"
android:hint="Enter starting location" />
<Button
android:id="#+id/B_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Search" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="98dp"
android:orientation="horizontal">
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.01"
android:ems="10"
android:inputType="textPersonName" />
<Button
android:id="#+id/B_hospital"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Hospitals" />
<Button
android:id="#+id/B_restaurant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Restaurants" />
<Button
android:id="#+id/B_school"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Schools" />
<Button
android:id="#+id/B_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/map"
android:onClick="onClick"
android:text="To" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
no matter what I do in my design, I want to center what I wrote with the photographs, but I cannot do the design, I wonder where I am going wrong I'm learning new and tried to make a design like in the photo
I'll create the rest using the recycler view and card view
Enough explanation, I hope I don't want to confuse you
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView6"
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="TODO" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Date" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="text" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView7"
android:layout_width="60dp"
android:layout_height="60dp"" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
Splitted the center part to two linear layouts. Also added android:gravity="center|bottom" to the TextView which contains the date.
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView6"
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="TODO" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="text" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="text" />
</LinearLayout>
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|bottom"
android:text="Date" />
</LinearLayout>
<ImageView
android:id="#+id/imageView7"
android:layout_width="60dp"
android:layout_height="60dp" />
</LinearLayout> </androidx.cardview.widget.CardView>
Here's how it looks like. I added some colors so it's easier to see where layouts begin and end. The colors are not part of the xml.
Every layouts in project has include layout. I have designed well in iclude layout. But in main layout of include layout don't show same view. for example the buttons move to the right of screen. I did different screen designs for small, normal, large and xlarge. But that didn't solve problem.
activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="#+id/loginlayout"
android:layout_height="match_parent"
android:background="#drawable/login_arkaplan"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:layout_weight="90"
android:orientation="vertical"
>
<include layout="#layout/login_inner_part" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:orientation="horizontal"
android:layout_weight="10"
android:weightSum="2"
android:layout_gravity="center"
>
<TextView
android:id="#+id/textViewForgetPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="#string/lostpass"
android:textColor="#color/colorOrange"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewRegister"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="#string/register"
android:textColor="#color/colorWhite"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
activity_login_inner_part.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="20"
android:gravity="center"
android:background="#color/colorWhite"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="10"
android:gravity="center"
android:weightSum="3">
<ImageView
android:id="#+id/login_logo"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
app:srcCompat="#drawable/login_logo"
android:layout_gravity="center"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:orientation="vertical">
<EditText
android:id="#+id/login_username"
android:layout_width="185dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:backgroundTint="#color/colorGrey"
android:ems="10"
android:hint="Eposta"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="84dp"
tools:layout_editor_absoluteY="267dp" />
<EditText
android:id="#+id/login_userpass"
android:layout_width="185dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:backgroundTint="#color/colorGrey"
android:ems="10"
android:hint="#string/password"
android:inputType="textPassword"
tools:layout_editor_absoluteX="84dp"
tools:layout_editor_absoluteY="341dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="#+id/btn_login"
style="?android:attr/buttonStyleSmall"
android:layout_width="185dp"
android:layout_height="wrap_content"
android:layout_marginLeft="100dp"
android:layout_marginTop="20dp"
android:background="#color/colorPrimary"
android:clickable="true"
android:focusable="true"
android:text="GÖNDER"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
I don't know why this button move right of screen. I am doing this include layouts first time and I don't know reason of it. I can't solve it. Please help me.
Possible solution would be to use RelativeLayout to center the button with reference to it's parent instead of giving it a fixed left margin.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btn_login"
style="?android:attr/buttonStyleSmall"
android:layout_width="185dp"
android:layout_height="wrap_content"
<!-- IMPORTANT -->
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="#color/colorPrimary"
android:clickable="true"
android:focusable="true"
android:text="GÖNDER"
android:textColor="#android:color/white" />
</RelativeLayout >
When i preview with android emulator, the layout preview is ok. But when I install the app in my mobile the views overlaps. It may be because of lack of space in the mobile screen but I have no idea. Please help me out. And also help me with making this app to work with all screen sizes. Thanks in advance.
First image is emulator preview 2nd is mobile preview
Here is the xml code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:orientation="vertical"
android:background="#drawable/newbackground"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="300dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
app:srcCompat="#drawable/dicee_logo" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/dicee_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#drawable/dice1" />
<ImageView
android:id="#+id/dicee_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#drawable/dice2" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="#+id/roll_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="61dp"
android:background="#color/colorPrimary"
android:text="#string/button_text"
android:textColor="#android:color/white" />
<Button
android:id="#+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/roll_button"
android:layout_alignParentBottom="true"
android:layout_alignRight="#+id/roll_button"
android:layout_marginBottom="25dp"
android:background="#android:color/holo_blue_light"
android:text="Next page" />
</RelativeLayout>
</LinearLayout>
This will keep the 2 textview to bottom and will expand in whatever view you use
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="centerInside"
android:src="#drawable/ic_word" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/dicee_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#drawable/ic_word" />
<ImageView
android:id="#+id/dicee_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#drawable/ic_pdf" />
</LinearLayout>
<Button
android:id="#+id/roll_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:background="#color/colorPrimary"
android:text="text"
android:textColor="#android:color/white" />
<Button
android:id="#+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:background="#android:color/holo_blue_light"
android:text="Next page" />
</LinearLayout>
Try the below modified code. Since you want the buttons below each other. You cannot place one on right of other, so remove the alignRight.
<Button
android:id="#+id/roll_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
**android:layout_marginTop="21dp"**
android:background="#color/colorPrimary"
android:text="#string/button_text"
android:textColor="#android:color/white" />
<Button
android:id="#+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/roll_button"
android:layout_alignParentBottom="true"
**android:layout_alignRight="#+id/roll_button"**
android:layout_marginBottom="25dp"
android:background="#android:color/holo_blue_light"
android:text="Next page" />
I have two LinearLayouts in a RelativeLayout the problem is that the top linear layout is overlapping the bottom one a little bit.I tried everything. Please Somebody help me.Below is my XML File
Or tell me how to do it programmatically. Like subtracting height of one linear layout from another.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:id="#+id/page_fragment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#color/spinner_text_color" />
<FrameLayout
android:id="#+id/detail_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#color/white_bg"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/spinner_text_color">
<Button
android:id="#+id/filterResetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textColor="#color/white_bg"
android:textAllCaps="false"
android:background="#drawable/light_button_click"
android:text="Reset All" />
<Button
android:id="#+id/filterApplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textAllCaps="false"
android:background="#drawable/submit_order_click"
android:textColor="#color/white_bg"
android:text="Apply" />
</LinearLayout>
</RelativeLayout>
Try this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1"
android:layout_above="#+id/linearLayout">
<FrameLayout
android:id="#+id/page_fragment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#color/colorPrimary" />
<FrameLayout
android:id="#+id/detail_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#color/white"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/colorPrimary"
android:id="#+id/linearLayout">
<Button
android:id="#+id/filterResetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textColor="#color/white"
android:textAllCaps="false"
android:background="#drawable/ic_authy"
android:text="Reset All" />
<Button
android:id="#+id/filterApplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textAllCaps="false"
android:background="#drawable/ic_arrow_32"
android:textColor="#color/white"
android:text="Apply" />
</LinearLayout>
</RelativeLayout>
Use Relative Layout properties like
layout_below and layout_above
Try following code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/bottomLayout"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:id="#+id/page_fragment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#color/spinner_text_color" />
<FrameLayout
android:id="#+id/detail_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#color/white_bg"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/bottomLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/spinner_text_color">
<Button
android:id="#+id/filterResetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textColor="#color/white_bg"
android:textAllCaps="false"
android:background="#drawable/light_button_click"
android:text="Reset All" />
<Button
android:id="#+id/filterApplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textAllCaps="false"
android:background="#drawable/submit_order_click"
android:textColor="#color/white_bg"
android:text="Apply" />
</LinearLayout>
</RelativeLayout>
If the layouts are large and can't be accommodated in a single a screen then you should wrap both the linear layouts in a scrollView. Let me know if you face problem in using scrollView.
This is very easy you just have to set id to the Linear Layout at bottom like
**android:id="#+id/bottom_linearlayout"**
and set the upper Linear Layout "above" over the bottom ones "id", like this
**android:layout_above="#id/bottom_linearlayout"**
`<?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">
<LinearLayout
android:layout_above="#id/bottom_linearlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:id="#+id/page_fragment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#color/spinner_text_color" />
<FrameLayout
android:id="#+id/detail_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#color/white_bg"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/bottom_linearlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/spinner_text_color">
<Button
android:id="#+id/filterResetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textColor="#color/white_bg"
android:textAllCaps="false"
android:text="Reset All" />
<Button
android:id="#+id/filterApplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textAllCaps="false"
android:textColor="#color/white_bg"
android:text="Apply" />
</LinearLayout>
</RelativeLayout>`
you parent layout is linear layout so child is overlap each other
use my code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="90">
<FrameLayout
android:id="#+id/page_fragment"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#color/spinner_text_color" />
<FrameLayout
android:id="#+id/detail_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#color/white_bg"
android:layout_weight="1"></FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:layout_alignParentBottom="true"
android:background="#color/spinner_text_color">
<Button
android:id="#+id/filterResetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textColor="#color/white_bg"
android:textAllCaps="false"
android:background="#drawable/light_button_click"
android:text="Reset All" />
<Button
android:id="#+id/filterApplyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".50"
android:textAllCaps="false"
android:background="#drawable/submit_order_click"
android:textColor="#color/white_bg"
android:text="Apply" />
</LinearLayout>
</LinearLayout>