How to add more content in layout? is it possible to define more than 1 textview inside scrollView? - android-layout

This my code in this I have been using scrollView and inside it two textViews to add more content but it is working only when there is one textView please what changes i do to add more content?And here I want space between those textViews(content) but in my code i am trying for that but the content is overlapped and there is no proper space between contents.please help me..!
<?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"
tools:context="com.example.hp.kludge.AndroidActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:weightSum="1">
<TextView
android:id="#+id/tvA"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="ANDROID"
android:textColor="#f6080101"
android:textColorHighlight="#df1425"
android:textSize="35dp"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:background="#e62027"
android:layout_height="2dp"
android:layout_below="#+id/tvC" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:fillViewport="true"
android:orientation="vertical">
<TextView
android:id="#+id/tvWhat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tvC"
android:layout_marginTop="44dp"
android:text="What is Android?"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="22dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Content"
android:id="#+id/tvt" />
</ScrollView>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:id="#+id/butNext"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#abc3fb" />
</RelativeLayout>

Related

How to put NestedScrollView between LinearLayout and MaterialButton on ConstraintLayout?

This is the rough design of my activity:
On the top is a RelativeLayout which contains an ImageView and a TextView. On the middle is a NestedScrollView which contains a RecyclerView and a CardView below it. And finally a Button on the bottom. Previously it's implemented in RelativeLayout, and works OK.
Then I change it into ConstraintLayout, like this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="#color/myapp_main_bg"
tools:context=".activity.OrderConfirmationActivity">
<RelativeLayout
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:id="#+id/rlHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgForkDish"
android:src="#drawable/ic_fork_dish"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="10dp"
android:layout_toRightOf="#id/imgForkDish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Starbucks Senayan City" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
app:layout_constraintBottom_toTopOf="#id/btnOrderNow"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="#id/rlHeader"
android:id="#+id/ns_recview_orders"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/rlHeader"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recview_orders"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.cardview.widget.CardView
android:id="#+id/cvPay"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_below="#id/ns_recview_orders"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/row01"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Payment Method"
android:id="#+id/tvLblPaymentMethod"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="e-wallet"
android:textStyle="bold"
android:layout_alignParentRight="true" />
</RelativeLayout>
<View
android:id="#+id/v01"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/row01"
android:layout_marginTop="10dp"
android:background="#android:color/darker_gray" />
<RelativeLayout
android:id="#+id/row02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/v01"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/tvLblTotalOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total Order" />
<TextView
android:id="#+id/tvTotalOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:id="#+id/row03"
android:layout_below="#id/row02"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Service Fee"
android:id="#+id/tvLblServiceFee"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="10dp"
android:id="#+id/row04"
android:layout_below="#id/row03"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total"
android:id="#+id/tvLblTotal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/tvTotal"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_marginBottom="20dp"
android:layout_marginTop="2dp"
android:id="#+id/row05"
android:layout_below="#id/row04"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Include Tax"
android:layout_alignParentRight="true" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.button.MaterialButton
android:id="#+id/btnOrderNow"
android:text="Order Now"
app:layout_constraintBottom_toBottomOf="parent"
android:backgroundTint="#color/myapp_blue_btn"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
The result is:
As you can see, the NestedScrollView isn't positioned below RelativeLayout, but instead overlaps it. How to fix this?
Remove this tag from NestedScrollView:
app:layout_constraintTop_toTopOf="parent"
It is overlapping the app:layout_constraintTop_toBottomOf="#id/rlHeader" tag.

Nested LinearLayout does not align to parent ScrollView?

I have a fragment with two horizontal Buttons (yellow = fragment_test_button_container) at the bottom of my fragment. I would like to use the remaining area (red = fragment_test_scrollview) for a ScrollView It is reuiqred that my ScrollView consist of one layout (turquoise = fragment_test_check) only . This can then in turn have further layouts, as you can see in the attached fragment_test.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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"
tools:context=".ui.TestFragment">
<ScrollView
android:id="#+id/fragment_test_scrollview"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="#id/fragment_test_button_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent=".84"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="#+id/fragment_test_check"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/fragment_test_front_photo_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".28"
android:orientation="horizontal">
<TextView
android:id="#+id/fragment_test_front_photo_title"
style="#style/myapp_MediumTextStyle"
android:layout_width="#dimen/myapp_test_fragment_textview_width"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
android:text="#string/fragment_test_front_photo_title_text" />
<ImageView
android:id="#+id/fragment_test_front_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="#+id/fragment_test_back_photo_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".28"
android:orientation="horizontal">
<TextView
android:id="#+id/fragment_test_back_photo_title"
style="#style/myapp_MediumTextStyle"
android:layout_width="#dimen/myapp_test_fragment_textview_width"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
android:text="#string/fragment_test_back_photo_title_text" />
<ImageView
android:id="#+id/fragment_test_back_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
</LinearLayout>
<!-- ADDITIONAL DATA -->
<LinearLayout
android:id="#+id/fragment_test_data_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".34"
android:orientation="vertical"
android:paddingStart="24dp"
android:paddingEnd="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/fragment_test_value1_label"
style="#style/myapp_MediumTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text=„Value1^“ />
<TextView
android:id="#+id/fragment_test_value1_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/fragment_test_value2_label"
style="#style/myapp_MediumTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text=„Value2“ />
<TextView
android:id="#+id/fragment_test_value2_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/fragment_test_value3_label"
style="#style/myapp_MediumTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Ausstellungsdatum" />
<TextView
android:id="#+id/fragment_test_value3_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="#+id/fragment_test_button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="24dp"
android:paddingEnd="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/fragment_test_scrollview">
<Button
android:id="#+id/fragment_test_back_button"
style="#style/myapp_ContinueBackButtonStyle"
android:layout_width="0dp"
android:layout_height="#dimen/myapp_continueBackButton_height"
android:layout_weight="1"
android:background="#color/myapp_colorPrimary"
android:text=„back“
android:textColor="#FFFFFF" />
<Button
android:id="#+id/fragment_test_next_button"
style="#style/myapp_ContinueBackButtonStyle"
android:layout_width="0dp"
android:layout_height="#dimen/myapp_continueBackButton_height"
android:layout_marginStart="24dpVerySmall"
android:layout_weight="1"
android:background="#color/myapp_colorPrimary"
android:text="continue"
android:textColor="#FFFFFF" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
But my turqoise (fragment_test_check) area is not aligned fully with the blue area (fragment_test_scrollview), altough I wrote match_parent. I would like the heigth of turqoise area as the blue area.
Why is my turqoise area dangling in half the blue area?
Set android:fillViewport="true" in your ScrollView.
fillViewport stretches the content's height to the viewport's boundaries, when set true. In simple words, fillViewport decides whether the nested contents of the layout should match the parent's boundaries or not. Thus, to make the nested layout match the parent's boundary, set fillViewport to true
Moreover, the layout_gravity for nested components should be 1 or whatsoever you define in weight_sum of parent layout, whereas in your case it is 0.90 .

marginRight not working in RelativeLayout

I have the following code but somehow the button I have on the right is stuck to the edge instead of having a margin of 41dp to the left of imageView. Is there anyway I can have have a working marginRight of 41dp (similar to the left button I have)
Have been stuck at this simple problem for a ridiculous amount of time, help is appreciated!
<?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:gravity="center_vertical"
android:layout_marginBottom="50dp">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:padding="5dp"
app:cardCornerRadius="20dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="500dp">
<ImageView
android:id="#+id/image"
android:layout_width="338dp"
android:layout_height="338dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:srcCompat="#drawable/formal" />
<ImageButton
android:id="#+id/dislike"
android:layout_width="75dp"
android:layout_height="72dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="41dp"
android:layout_marginBottom="26dp"
app:srcCompat="#drawable/ic_thumbs_down_white" />
<ImageButton
android:id="#+id/like"
android:layout_width="75dp"
android:layout_height="72dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="41dp"
android:layout_marginBottom="26dp"
app:srcCompat="#drawable/ic_thumbs_up_white" />
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/image"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:layout_marginBottom="94dp"
android:text="WEAR THIS" />
</RelativeLayout>
</android.support.v7.widget.CardView>
Try this
<?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:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:padding="5dp"
app:cardCornerRadius="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:orientation="vertical">
<ImageView
android:id="#+id/image"
android:layout_width="338dp"
android:layout_height="338dp"
android:src="#mipmap/ic_launcher"
android:layout_margin="10dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="WEAR THIS"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="41dp"
android:layout_marginBottom="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:src="#mipmap/ic_launcher"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="41dp"
android:layout_marginBottom="26dp"
android:src="#mipmap/ic_launcher"/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
The result is

Android Portrait to Landcape Slider & ImageView not responsive

My Portrait View is looks Fine
My Landscape View alignment is collapsed
this is my code of activity_main.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:id="#+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/img_slideshow_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="#+id/img_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/indicator"
android:background="#color/PrimaryColor"
android:gravity="center"
android:ellipsize="end"
android:paddingBottom="2dp"
android:paddingLeft="5dp"
android:paddingRight="2dp"
android:paddingTop="2dp"
android:singleLine="true"
android:textColor="#ededed" />
</RelativeLayout>
<View android:id="#+id/div_a"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_below="#+id/img_slideshow_layout"
android:background="#color/view_divider_color" />
<View android:id="#+id/div_b"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_below="#+id/div_a"
android:background="#color/view_divider_color_2" />
<com.studiobluelime.utils.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view_pager"
android:layout_marginBottom="4dp" />
</RelativeLayout>
<!--<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
style="#style/Base.Widget.AppCompat.ProgressBar"
android:id="#+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminate="true" />
<android.support.v7.widget.RecyclerView
android:id="#+id/card_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>-->
<!-- <android.support.v7.widget.RecyclerView
android:id="#+id/card_recycler_view_new"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"/>-->
</LinearLayout>
</ScrollView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="100dp"
app:srcCompat="#drawable/shop_online"
android:layout_marginLeft="140dp"
android:id="#+id/shop_online"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:layout_marginTop="200dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/nandme"
android:adjustViewBounds="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="320dp"
android:scaleType="fitXY"
android:id="#+id/nandme"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="#drawable/storelocation"
android:adjustViewBounds="true"
android:layout_marginLeft="258dp"
android:id="#+id/storelocation"
android:scaleType="fitXY"
android:layout_marginTop="250dp"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="#drawable/promotins"
android:adjustViewBounds="true"
android:layout_marginLeft="20dp"
android:id="#+id/promotins"
android:scaleType="fitXY"
android:layout_marginTop="240dp"/>
<android.support.v4.view.ViewPager
android:id="#+id/view_pager"
android:layout_width="fill_parent"
android:layout_height="157dp" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:itemIconTint="#color/PrimaryDarkColor"
app:itemTextColor="#color/colorAccent"
app:itemBackground="#drawable/ripple"
app:menu="#menu/navigation_items" />
</android.support.v4.widget.DrawerLayout>
I wrote this code in four layouts: layout/activity_main.xml,layout-small/ activity_main.xml, layout-large/activity_main.xml, layout-xlarge/activity_main.xml but it did not change. I have attached a screen shot here. Please click the above name "My Portrait View is looks Fine My Landscape View alignment is collapsed"

keyboard overlap custom edittext

Greetings to all. What time I struggle with the problem. By clicking
on the EditText my keyboard covers half EditText. Tried to put in
Manifest adjustSpan - keyboard covers half EditTekst and adjustResize
- displays the top panel also RelativeLayout. Help solve the problem.
main activity layout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/color_background_1">
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/linear_bottom_panel" >
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5c4768" >
</FrameLayout>
<ListView
android:id="#+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/darker_gray"
android:dividerHeight="0.1dp"/>
<ListView
android:id="#+id/new_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:choiceMode="singleChoice"
android:divider="#android:color/darker_gray"
android:background="#5c4768"
android:dividerHeight="0.1dp"/>
</android.support.v4.widget.DrawerLayout>
<LinearLayout
android:id="#+id/linear_bottom_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#color/color_bottom_panel"
android:orientation="horizontal" >
<ImageView
android:id="#+id/image_main_news"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_news_selector" />
<ImageView
android:id="#+id/image_main_chat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_chat_selector" />
<ImageView
android:id="#+id/image_main_add_mp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_add_mp_selector" />
<ImageView
android:id="#+id/image_main_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:src="#drawable/ic_main_map_selector" />
<ImageView
android:id="#+id/image_main_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_user_selector" />
</LinearLayout>
<ProgressBar
android:id="#+id/progress_load"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="invisible"
android:indeterminateDrawable="#drawable/load_progress" />
</RelativeLayout>
this fragment layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/color_background_1" >
<include
android:id="#+id/discus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="#layout/layout_discus_view"
/>
<ListView
android:id="#+id/list_chat"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/discus"
android:layout_above="#+id/add_message"
android:listSelector="#drawable/listview_item_selector"
>
</ListView>
<include
android:id="#+id/add_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="#layout/layout_add_new_message"
/>
</RelativeLayout>
where adjustSpan layout #+id/add_message keyboard overlap

Resources