0

I currently have the problem, when i mark the text, and the keyboard is hidden, the contextual menu is showing and going up, to make a "area" for the keyboard. It looks like this, you can see a bit from the contextual menu on the top below at status bar:

enter image description here

My layout to this activity:

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<LinearLayout
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="wrap_content">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"
        />

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="10dp"
        android:padding="10dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            >

            <EditText
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textStyle="bold"
                android:nextFocusForward="@id/text"
                android:imeOptions="actionNext"
                android:singleLine="true"
                android:ems="16"
                android:hint="@string/title"
                android:textColor="#212121"
                android:textColorHint="#757575"
                android:background="@null"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"
                android:scrollbars="horizontal"

                android:transitionName="title"
                />

            <EditText
                android:id="@+id/text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/text"
                android:textColor="#212121"
                android:textColorHint="#757575"
                android:background="@null"
                android:layout_marginLeft="2dp"
                />

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginTop="15dp"
                android:layout_marginBottom="15dp"
                android:elevation="0dp"
                android:background="@color/grey"
                />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                >

                <ImageButton
                    android:id="@+id/fav"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_star_black_24dp"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:padding="5dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:tint="#9E9E9E"
                    />


            </RelativeLayout>


        </LinearLayout>

    </android.support.v4.widget.NestedScrollView>
</LinearLayout>


<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:gravity="top"
    android:id="@+id/snackbar">
</android.support.design.widget.CoordinatorLayout>

Any suggestions?

2 Answers2

0

In the manifest configuration of your activity use android:windowSoftInputMode="adjustResize" or android:windowSoftInputMode="adjustNothing"

Leo
  • 1,433
  • 23
  • 40
0

What I would suggest is to create a ScrollView and to put your text and other elements in it. That will leave your toolbar or actionbar alone.

Nactus
  • 702
  • 2
  • 13
  • 35
  • Currently i have it like you say, watch at the code above :D –  Sep 01 '15 at 10:10
  • 1
    Actually you don't. :) You're using an android.support.v4.NestedScrollView version and not a regular ScrollView. App Support libs. are meant to be backward compatible, but they often don't work as expected. Yes, in theory they should work the same. Please try to change the app-support version with a regular ScrollView and see if that makes a difference (or at least try an android.support.v7 version). Thanks. – Nactus Sep 01 '15 at 15:35
  • 1
    Also, try to change your first LinearLayout : from using a layout_height="wrap_content" to "match_parent" – Nactus Sep 01 '15 at 15:46
  • Alright, that sounds logically, i will try it later, thanks in advance :) –  Sep 01 '15 at 15:48