The Tab Layout is overlapping with the status bar, I found a couple of threads having the same thing, but the solution seems to be adding "fitsSystemWindows" and I've already set it in my XML layout, the strange thing is I have more tabs like this and they seem to work perfectly.
This is my XML layout, any inputs would be helpful.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="8dp"
android:fitsSystemWindows="true"
android:id="#id/root"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/linearLayout"
android:fitsSystemWindows="true"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="5dp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardCornerRadius="5dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/ic_dashboard_bg"
android:scaleType="fitXY"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="10dp"
android:layout_gravity="center">
<ImageView
android:id="#+id/btnfilter"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="330dp"
android:src="#drawable/ic_filter" />
<TextView
android:id="#+id/title_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:text="6000"
android:textColor="#color/colorToday"
android:textSize="39dp" />
<ImageView
android:layout_width="32dp"
android:layout_height="wrap_content"
android:layout_alignTop="#id/title_amount"
android:layout_alignBottom="#id/title_amount"
android:layout_toLeftOf="#id/title_amount"
android:scaleType="fitXY"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:src="#drawable/ic_orange_big"
android:id="#+id/imageView9" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btnfilter"
android:layout_gravity="center"
android:layout_toEndOf="#+id/imageView9"
android:drawableTint="#color/colorPrimaryLight"
android:text="TODAY"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:textColor="#color/colorToday"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/title_amount_yesterday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="#drawable/ic_rupee_white"
android:drawableTint="#color/colorPrimaryLight"
android:text="5000"
android:textColor="#color/colorPrimaryLight"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/colorPrimaryLight"
android:text="Yesterday"
android:textSize="12sp"
android:layout_gravity="center"
android:textAllCaps="true"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/colorPrimaryLight"
android:text="Yesterday"
android:visibility="invisible"
android:layout_gravity="center"
android:textAllCaps="true"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/title_amount_persent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="#drawable/ic_percentage"
android:text="20%"
android:textColor="#color/colorGreen"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="percentage"
android:textAllCaps="true"
android:textColor="#color/colorGreen"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:layout_height="wrap_content">
<TextView
android:id="#+id/center1"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="#color/colorDarkPink"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/center1"
android:orientation="vertical">
<TextView
android:id="#+id/week_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_rupee_black"
android:textSize="14sp"
android:textColor="#color/colorPrimaryText"
android:textStyle="bold"
android:paddingBottom="4dp"
android:text="25,000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="this week"
android:fontFamily="sans-serif-light"
android:textColor="#color/colorPrimaryText"
android:layout_gravity="center"
android:textAllCaps="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_toRightOf="#+id/center1"
android:orientation="vertical">
<TextView
android:id="#+id/mtd_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_rupee_black"
android:textSize="14sp"
android:textColor="#color/colorPrimaryText"
android:textStyle="bold"
android:paddingBottom="4dp"
android:text="2.5 L"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="MTD"
android:fontFamily="sans-serif-light"
android:textColor="#color/colorPrimaryText"
android:layout_gravity="center"
android:textAllCaps="true"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<ImageView
android:id="#+id/arrow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="0dp"
android:src="#drawable/ic_pink_transaction"/>
<TextView
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="#color/colorDarkPink"
/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_marginTop="8dp"
android:layout_height="wrap_content">
<TextView
android:id="#+id/center2"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="#color/colorGreen"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/center2"
android:orientation="vertical">
<TextView
android:id="#+id/month_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_rupee_black"
android:textSize="14sp"
android:textColor="#color/colorPrimaryText"
android:textStyle="bold"
android:paddingBottom="4dp"
android:text="25,000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="this week"
android:fontFamily="sans-serif-light"
android:textColor="#color/colorPrimaryText"
android:layout_gravity="center"
android:textAllCaps="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_toRightOf="#+id/center2"
android:orientation="vertical">
<TextView
android:id="#+id/avg_month_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_rupee_black"
android:textSize="14sp"
android:textColor="#color/colorPrimaryText"
android:textStyle="bold"
android:paddingBottom="4dp"
android:text="7,000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="Avg. Monthly"
android:fontFamily="sans-serif-light"
android:textColor="#color/colorPrimaryText"
android:layout_gravity="center"
android:textAllCaps="true"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<ImageView
android:id="#+id/arrow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:padding="0dp"
android:src="#drawable/ic_green_transaction"/>
<TextView
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="#color/colorGreen"
/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<include layout="#layout/barchart"></include>
<LinearLayout
android:id="#+id/performance_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:visibility="visible">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:layout_marginTop="16dp">
<include layout="#layout/performer_details"
android:fitsSystemWindows="true"></include>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:layout_marginTop="16dp">
<include layout="#layout/lest_performer_details"
android:fitsSystemWindows="true"></include>
</RelativeLayout>
</LinearLayout>
<include layout="#layout/piechart"></include>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Add android:fitsSystemWindows to your LinearLayout to adjust view layout based on system windows such as the status bar. If true, adjusts the padding of this view to leave space for the system windows.
Will only take effect if this view is in a non-embedded activity.
Also you could try update your v21/styles.xml
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#color/colorPrimaryDark</item>
and make sure
<item name="android:windowTranslucentStatus">false</item>
If this won't resolve your issue, apply next line to the application theme:
<item name="android:fitsSystemWindows">true</item>
That's not recommended approach, but it would help you investigate problem.
If it's not root view, make sure android:fitsSystemWindows is true for the view that's located higher in hierarchy.
Related
I have one fragment whose layout i want to show above keyboard when softkeyboard opens up. The layout is:
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="#drawable/ic_bg_splash"
android:fitsSystemWindows="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<ImageButton
android:id="#+id/previous"
android:layout_width="37.5dp"
android:layout_height="37.5dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="22dp"
android:background="#drawable/left"
android:padding="7dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="12dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="7dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="7dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="7dp"
android:orientation="vertical">
<ImageView
android:id="#+id/subCat"
android:layout_width="157.5dp"
android:layout_height="157.5dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="50dp"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="12dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito"
android:paddingLeft="20dp"
android:text="#string/enter_answer"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
<LinearLayout
android:layout_width="262.5dp"
android:layout_height="52.5dp"
android:layout_marginTop="7dp"
android:background="#drawable/answer_bg"
android:orientation="horizontal">
<EditText
android:id="#+id/answer"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="8"
android:background="#null"
android:fontFamily="#font/nunito"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:padding="7dp"
android:textColor="#android:color/white"
android:textSize="15sp" />
<ImageView
android:id="#+id/wrong_answer"
android:layout_width="27.5dp"
android:layout_height="28dp"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:src="#drawable/red_cross"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:layout_marginBottom="27dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito"
android:text="#string/reset"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="14.3sp" />
<TextView
android:id="#+id/submit_ans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:background="#drawable/white_rounded"
android:fontFamily="#font/nunito_semibold"
android:paddingLeft="17dp"
android:paddingTop="7dp"
android:paddingRight="17dp"
android:paddingBottom="7dp"
android:text="#string/submit"
android:textAllCaps="true"
android:textColor="#color/lineColor"
android:textSize="14.3sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<ImageButton
android:id="#+id/next"
android:layout_width="37.5dp"
android:layout_height="37.5dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="22dp"
android:background="#drawable/right" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/write_dark"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#70000000"
android:elevation="10dp"
android:visibility="gone">
<ImageView
android:id="#+id/write_success"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="10dp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
I have tried by setting windowssoftinputmode to adjustResize in manifest and also using fitsystemwindows to true in the fragment parent layout but still it is not working and using scrollview as parent layout instead of relativelayout. So please suggest me any workaround for this issue.
Edit: Added below activity.xml layout:
Below is the host activity layout:
<?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:background="#drawable/language_bg"
android:orientation="vertical"
tools:context=".home.HomeActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/bottom_rounded">
<RelativeLayout
android:id="#+id/taskBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_weight="1.7"
android:paddingLeft="30dp"
android:paddingTop="5dp">
<ImageView
android:layout_width="143dp"
android:layout_height="56dp"
android:layout_gravity="left|center_vertical"
android:src="#drawable/hello_logo" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_weight="3"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/learn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="33dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="#drawable/learn_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/learn"
android:textColor="#color/lineColor"
android:textSize="11sp" />
<View
android:id="#+id/learn_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#color/lineColor" />
</LinearLayout>
<LinearLayout
android:id="#+id/practice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="42dp"
android:layout_height="28dp"
android:src="#drawable/practice_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/practice"
android:textColor="#color/lineColor"
android:textSize="11sp" />
<View
android:id="#+id/practice_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#color/lineColor"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_marginRight="30dp"
android:layout_weight="1.3"
android:gravity="right"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/unlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="26.5dp"
android:layout_height="32dp"
android:src="#drawable/unlock_blue" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/unlock"
android:textColor="#color/lineColor"
android:textSize="11dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:gravity="center_horizontal|bottom"
android:orientation="vertical">
<ImageView
android:layout_width="33dp"
android:layout_height="30dp"
android:layout_marginTop="2dp"
android:src="#drawable/language" />
<TextView
android:id="#+id/language_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="#string/lang"
android:textAllCaps="true"
android:textColor="#color/lineColor"
android:textSize="11dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/appbar_practice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimaryDark"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="12dp"
android:visibility="gone">
<LinearLayout
android:id="#+id/read_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="23.5dp"
android:layout_height="17.5dp"
android:background="#drawable/icon_read" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/read"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/read_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/speak_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="16.5dp"
android:layout_height="21.5dp"
android:background="#drawable/icon_speak" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/speak"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/speak_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="#+id/listen_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="18.5dp"
android:layout_height="18.5dp"
android:background="#drawable/icon_listen" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/listen"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/listen_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="#+id/write_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="17dp"
android:layout_height="19dp"
android:background="#drawable/icon_write" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/write"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/write_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Try to put your scrollView into relative Layout.
After commenting this from my activity onCreate() it started working:
this.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
I'm using the com.sothree.slidinguppanel:library:3.3.1 library for my android slideupPanel but I don't know how to remove the shadow when the overlay layout is starting to show.
overlay shadow
Code Layout
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="0dp"
sothree:umanoShadowHeight="0dp"
sothree:umanoParallaxOffset="0dp"
sothree:umanoDragView="#+id/dragView"
sothree:umanoOverlay="true"
sothree:umanoScrollableView="#+id/main">
<!-- Main Layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cardview_light_background"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="440dp"
android:layout_weight="1.00"
android:background="#color/cardview_light_background"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#EBEBEB"
android:orientation="horizontal">
</LinearLayout>
<LinearLayout
android:id="#+id/wandurers_info"
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imgProfile"
android:layout_width="208dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorMenu"
android:orientation="vertical">
<TextView
android:id="#+id/first_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:text="MJ"
android:textColor="#android:color/white"
android:textSize="25sp" />
<TextView
android:id="#+id/last_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:text="TextView"
android:textColor="#android:color/white"
android:textSize="25sp" />
<TextView
android:id="#+id/txtWandurerDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.03"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:textColor="#android:color/white"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/surprise_me"
android:layout_width="208dp"
android:layout_height="match_parent"
android:background="#EBEBEB"
android:orientation="vertical">
<TextView
android:id="#+id/surprise"
android:layout_width="208dp"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="25dp"
android:text="Surprise"
android:textColor="#android:color/black"
android:textSize="30sp" />
<TextView
android:id="#+id/me"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="25dp"
android:text="Me_"
android:textColor="#android:color/black"
android:textSize="30sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/local_history"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.00"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/local"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="25dp"
android:text="Local"
android:textColor="#android:color/black"
android:textSize="30sp" />
<TextView
android:id="#+id/history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="25dp"
android:text="History_"
android:textColor="#android:color/black"
android:textSize="30sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/museums_shops"
android:layout_width="207dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/museums"
android:layout_width="208dp"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="25dp"
android:text="Museums"
android:textColor="#android:color/black"
android:textSize="30sp" />
<TextView
android:id="#+id/shops"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="25dp"
android:text="Shops_"
android:textColor="#android:color/black"
android:textSize="30sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/photowalk"
android:layout_width="205dp"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#EBEBEB"
android:orientation="vertical">
<TextView
android:id="#+id/photo_walk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="25dp"
android:text="Photowalk_"
android:textColor="#android:color/black"
android:textSize="30sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="62dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorMenu"
android:orientation="horizontal">
<TextView
android:id="#+id/book"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:paddingTop="15dp"
android:text="Book"
android:textAlignment="textEnd"
android:textColor="#color/cardview_light_background"
android:textSize="25sp" />
<TextView
android:id="#+id/txtHour"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="15dp"
android:textAlignment="center"
android:textColor="#color/cardview_light_background"
android:textSize="25sp" />
<TextView
android:id="#+id/hourWalking"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingTop="15dp"
android:text="Hour Walking..."
android:textColor="#color/cardview_light_background"
android:textSize="25sp" />
<TextView
android:id="#+id/orderTour"
android:layout_width="61dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingTop="22dp"
android:text="Order Tour"
android:textAlignment="textEnd"
android:textColor="#color/colorPrimary"
android:textSize="15sp" />
<TextView
android:id="#+id/textViewSelect"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="18dp"
android:paddingTop="15dp"
android:text=">"
android:textAlignment="center"
android:textColor="#color/colorPrimary"
android:textSize="25sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- End of Main Layout -->
<!-- SLIDING LAYOUT -->
<LinearLayout
android:id="#+id/dragView"
android:layout_width="match_parent"
android:layout_height="290dp"
android:layout_alignParentStart="true"
android:background="#color/colorMenu"
android:clickable="true"
android:focusable="false"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingTop="35dp">
<TextView
android:id="#+id/txtViewBook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.07"
android:text="Book"
android:textColor="#android:color/white"
android:textSize="24sp" />
<TextView
android:id="#+id/txtViewHour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_weight="0.08"
android:text="2"
android:textColor="#android:color/white"
android:textSize="24sp" />
<TextView
android:id="#+id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.08"
android:text="Hour"
android:textColor="#android:color/white"
android:textSize="24sp" />
<TextView
android:id="#+id/walkingTour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Walking Tour"
android:textColor="#android:color/white"
android:textSize="24sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/tour_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.07"
android:paddingLeft="20dp"
android:text="Surprise Me"
android:textAlignment="viewStart"
android:textColor="#android:color/white"
android:textSize="24sp" />
<TextView
android:id="#+id/total_amount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:paddingTop="30dp"
android:text="100.00 USD"
android:textColor="#android:color/white"
android:textSize="45sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorMenu"
android:orientation="horizontal"
android:paddingTop="25dp">
<TextView
android:id="#+id/orderTourtext"
android:layout_width="333dp"
android:layout_height="wrap_content"
android:paddingTop="22dp"
android:text="Confirm Booking"
android:textAlignment="textEnd"
android:textColor="#color/colorPrimary"
android:textSize="15sp"
android:layout_weight="0.13" />
<TextView
android:id="#+id/textViewSelected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="8dp"
android:layout_weight="0.24"
android:layout_marginTop="4dp"
android:text=">"
android:textAlignment="center"
android:textColor="#color/colorPrimary"
android:textSize="25sp" />
</LinearLayout>
</LinearLayout>
<!-- END of SLIDING LAYOUT -->
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
I don't know how to remove it, maybe there is a property for it. When I triggered the sliding Panel the overlay shadow started to show and covered the previous UI. What I want is just to remove the shadow of that overlay.
the library now allows you to remove the shadow effect by setting:
app:umanoFadeColor="#android:color/transparent"
in the XML
docs
By default, the main content is dimmed as the panel slides up. You can change the dim color by changing umanoFadeColor. Set it to "#android:color/transparent" to remove dimming completely.
sliding_layout.setShadowHeight(0);
I have a layout, I want to set Visibility Gone for any 2 items when I am setting visibility gone of Layout and floating action button then the floating action button is not arranging proper. Here is my xml file:
My design look like this
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#a62c23"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a62c23"
android:orientation="vertical">
<LinearLayout
android:id="#+id/viewA"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="1"
android:background="#a62c23"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="16dp"
android:textColor="#fff"
android:id="#+id/urintime"
android:gravity="center"
android:text="Your In Time"
android:layout_marginLeft="05dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="16dp"
android:textColor="#fff"
android:gravity="center"
android:id="#+id/intimeshow"
android:layout_marginLeft="05dp"
/>
</LinearLayout>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center"
android:text="In Time"
android:layout_marginRight="10dp"
android:textColor="#3645ab"
android:id="#+id/intime"
android:background="#drawable/buttonradius"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:text="Out Time"
android:textColor="#3645ab"
android:visibility="gone"
android:id="#+id/outime"
android:background="#drawable/buttonradius"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="16dp"
android:textColor="#fff"
android:id="#+id/urouttime"
android:gravity="center"
android:text="Your Out Time"
android:layout_marginLeft="05dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="current time"
android:textSize="16dp"
android:textColor="#fff"
android:layout_gravity="center"
android:gravity="center"
android:id="#+id/currenttime"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/viewB"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:layout_height="80dp"
android:gravity="center"
android:background="#dcba473e"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="00"
android:textColor="#e6e3e3"
android:id="#+id/complaincount"
android:gravity="end|bottom"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textSize="30dp"
android:layout_marginRight="10dp"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Complains"
android:gravity="end|bottom"
android:textColor="#dad8d8"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:textSize="15dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/viewc"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="80dp"
android:gravity="center"
android:layout_weight="1"
android:background="#dcba473e"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="00"
android:textColor="#e6e3e3"
android:id="#+id/filecount"
android:gravity="end|bottom"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textSize="30dp"
android:layout_marginRight="10dp"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Files"
android:gravity="end|bottom"
android:textColor="#dad8d8"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:textSize="15dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/viewd"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="80dp"
android:layout_weight="1"
android:background="#dcba473e"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="00"
android:textColor="#e6e3e3"
android:id="#+id/visitcount"
android:gravity="end|bottom"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textSize="30dp"
android:layout_marginRight="10dp"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Visit"
android:gravity="end|bottom"
android:textColor="#dad8d8"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:textSize="15dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/viewe"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_height="80dp"
android:layout_weight="1"
android:background="#dcba473e"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:text="00"
android:textColor="#e6e3e3"
android:id="#+id/ordercount"
android:gravity="end|bottom"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textSize="30dp"
android:layout_marginRight="10dp"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Order"
android:gravity="end|bottom"
android:textColor="#dad8d8"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:textSize="15dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:clickable="true"
app:backgroundTint="#ff6b7d"
app:fabSize="normal"
android:src="#drawable/complain"
app:layout_anchor="#id/viewA"
app:layout_anchorGravity="bottom|left"/>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25dp"
app:backgroundTint="#fbb570"
android:clickable="true"
app:fabSize="normal"
android:src="#drawable/fileicon"
app:layout_anchor="#id/viewB"
app:layout_anchorGravity="bottom|left"/>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:clickable="true"
app:fabSize="normal"
app:backgroundTint="#5d9d83"
android:src="#drawable/coms"
app:layout_anchor="#id/viewc"
app:layout_anchorGravity="bottom|left"/>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:clickable="true"
app:fabSize="normal"
app:backgroundTint="#4972a6"
android:src="#drawable/iconorder"
app:layout_anchor="#id/viewd"
app:layout_anchorGravity="bottom|left|end"/>
</android.support.design.widget.CoordinatorLayout>
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="#+id/longitude1"
/>
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="#+id/cops"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/latitude1"
/>
</LinearLayout>
</LinearLayout>
You can use RelativeLayout in LinearLayout and use invisible to hide .
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
</LinearLayout>
</RelativeLayout>
</LinearLayout?
You should set it to View.INVISIBLE instead of View.GONE
Try switching to using ConstraintLayout.
It gives you full control of what happens if a view in the middle "disappears".
I am working on android app where I want to design layout such that "Success" image (20%) - Linearlayout should be top layout and 60%(RelativeLayout) should be in center layout and 20%(LinearLayout) should be on bottom layout.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_background"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<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:layout_gravity="center"
android:background="#color/grey_background"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingTop="15dp">
<ImageView
android:id="#+id/trans_status_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/sucessfull" />
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/trans_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Transaction Successfull"
android:textColor="#color/black"
android:textSize="17sp" />
</LinearLayout>
<!--<android.support.v7.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#color/white"
android:elevation="4dp"
>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="#drawable/bill_top" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="-5dp"
android:background="#color/white"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/bene_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#color/black"
android:textSize="20sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:orientation="vertical"
android:visibility="gone">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/sender_mobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#color/black"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Mobile No."
android:textColor="#color/grey_text_color"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:orientation="vertical">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/bene_acc_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#color/black"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="A/C No."
android:textColor="#color/grey_text_color"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:orientation="vertical">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/trans_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#color/black"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Type"
android:textColor="#color/grey_text_color"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/bene_ifsc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#color/black"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="IFSC"
android:textColor="#color/grey_text_color"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#color/dark_grey"
android:padding="10dp">
<android.support.v7.widget.CardView
android:id="#+id/card_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#color/white"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="3dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/status_stamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:src="#drawable/success"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Transfer Amount:"
android:textColor="#color/grey_text_color"
android:textSize="11sp" />
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:background="#color/grey_background" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Transfer Charges:"
android:textColor="#color/grey_text_color"
android:textSize="11sp" />
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/charges"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center"
android:layout_marginLeft="10dp"
android:textColor="#color/black"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:orientation="vertical">
<in.xxx.utils.RobotoMediumTextView
android:id="#+id/amount_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:textColor="#color/black"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Total Amount"
android:textColor="#color/grey_text_color"
android:textSize="11sp" />
</LinearLayout>
</FrameLayout>
</FrameLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#fafafa"
android:orientation="vertical">
<in.xxx.utils.RobotoMediumTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="15dp"
android:text="Transaction details"
android:textColor="#color/black"
android:textSize="16sp" />
<ListView
android:id="#+id/trans_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000"
android:divider="#null"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="8dp"
android:scrollbars="vertical" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="#drawable/bill_bottom"
android:visibility="visible" />
</LinearLayout>
<!--
</android.support.v7.widget.CardView>
-->
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
If you want to divide the screen on the percentage basis, take LinearLayout as root and then use weight to divide the whole screen in the ratio as needed.
To bring the view on top, after your view is created and attached, add this line:
view.bringToFront();
The layout in red color Layout is not visible over the silver one. I would like to overlap the container and make visible the textview visible in above container.
Please suggest what should be the solution as marginTop=-30dp seems to work bad. Any help would be appriciated.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="#string/special_offer"
android:id="#+id/special_offer"
android:textStyle="bold"
android:textSize="25dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#f0eaea" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="#string/disney_less"
android:id="#+id/disney_less"
android:textStyle="bold"
android:textSize="20dp"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:textColor="#ef6e6e"
android:shadowColor="#ffffff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/choose_disney"
android:id="#+id/choose_disney"
android:textSize="15dp"
android:textColor="#eef7e3"
android:textStyle="bold"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/take_advantage"
android:id="#+id/take_advantage"
android:layout_gravity="center_horizontal"
android:textColor="#191717"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="bottom"
android:layout_alignParentEnd="false" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical"
android:background="#efefef"
>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="#string/disney_world"
android:id="#+id/disney_world"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textStyle="bold"
android:textSize="30dp"
android:fontFamily="#string/common_google_play_services_enable_text"
android:textColor="#0b125f" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:orientation="vertical"
android:background="#efefef"
>
<RelativeLayout
android:layout_height="320dp"
android:layout_width="match_parent">
<FrameLayout android:layout_height="160dp"
android:layout_width="match_parent"
android:background="#a9a9a9"
>
</FrameLayout>
<LinearLayout
android:layout_height="160dp"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="160dp"
android:background="#e4e4e4"
>
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:layout_marginTop="-30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/save_upto"
android:id="#+id/save_upto"
android:textStyle="bold"
android:textColor="#1c234a"
android:textSize="20dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/room_selected"
android:text="#string/room_selected"
android:textSize="12dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/great_rate"
android:text="#string/great_rate"
android:textSize="12dp"
android:paddingLeft="35dp"
android:paddingRight="35dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/more_information"
android:id="#+id/more_information"
android:textColor="#1c234a"
android:textSize="16dp"
android:layout_marginTop="5dp"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/special_saving"
android:id="#+id/special_saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:layout_gravity="center"
android:layout_marginBottom="5dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
So I went ahead and tried to view your code by putting it in Android Studio and I got this:
The red layout is under the silver layout, which makes the save up to textview not visible. And by your description -- I would like to overlap the container and make visible the textview visible in above container. -- you want the layout with silver background to be on top of the red layout, where it shows the TextView with Save Up to, and if what I imagine it would like is correct, it would be something like this:
Here is the modified code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="Special Offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="Disney Less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="Choose Disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:paddingStart="10dp"
android:text="Take Advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical"
>
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Disney World"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9" />
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="160dp"-->
<!--android:layout_marginTop="160dp"-->
<!--android:background="#e4e4e4"-->
<!--android:orientation="vertical">-->
<!--</LinearLayout>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="30dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="Save Up to"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="Room Selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="Great Rate"
android:textSize="12dp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="More Info"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="Special Saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Hope this helps, if ever this is not the full answer you are looking for, feel free to comment and I'll try to help as much as I can. :)
Akshat try this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="special_offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="disney_less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="choose_disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingStart="10dp"
android:text="ake_advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical"
>
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="asasdsa"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9">
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentBottom="true"
android:background="#e4e4e4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="ave_upto"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="room_selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="great_rate"
android:textSize="12dp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="safsadf"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="asdg"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Simply use RelativeLayout or FrameLayout. The last child view will overlay everything else.
FrameLayout is some kind of view stack. Made for special cases.
RelativeLayout is pretty powerful. You can define rules like View A has to align parent layout bottom, View B has to align A bottom to top, etc
As for your question.
In the LinearLayout that follows the FrameLayout remove the background attribute as its width is match_parent as it will cover the FrameLayout and also reduce the layout_marginTop to 130dp to get he desired effect of layout_marginTop=-30dp and remove the layout_marginTop=-30dp from the below LinearLayout.
which gives you the following
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#676363">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<TextView
android:id="#+id/special_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="#string/special_offer"
android:textColor="#f0eaea"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/disney_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/special_offer"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:shadowColor="#ffffff"
android:text="#string/disney_less"
android:textColor="#ef6e6e"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/choose_disney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/disney_less"
android:layout_centerHorizontal="true"
android:text="#string/choose_disney"
android:textColor="#eef7e3"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/take_advantage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_gravity="center_horizontal"
android:gravity="bottom"
android:paddingEnd="5dp"
android:paddingStart="10dp"
android:text="#string/take_advantage"
android:textColor="#191717" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#efefef"
android:orientation="vertical">
<TextView
android:id="#+id/disney_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:fontFamily="#string/common_google_play_services_enable_text"
android:text="#string/disney_world"
android:textColor="#0b125f"
android:textSize="30dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#efefef"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="320dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:background="#a9a9a9">
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginTop="130dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#a26262"
android:orientation="vertical">
<TextView
android:id="#+id/save_upto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/save_upto"
android:textColor="#1c234a"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/room_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/room_selected"
android:textSize="12dp" />
<TextView
android:id="#+id/great_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:text="#string/great_rate"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#a3d5d1ef"
android:backgroundTintMode="screen"
android:orientation="vertical">
<TextView
android:id="#+id/more_information"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/more_information"
android:textColor="#1c234a"
android:textSize="16dp" />
<TextView
android:id="#+id/special_saving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="#string/special_saving"
android:textColor="#040404"
android:textSize="16dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>