0

here is my Dialog layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
android:isScrollContainer="false"
android:orientation="vertical" >

<RelativeLayout
    android:id="@+id/topbar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_gravity="top"
    android:background="@drawable/android_add_note"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/cancelNoteButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:background="@drawable/android_back" />

    <ImageView
        android:id="@+id/saveNoteButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:background="@drawable/android_done" />
</RelativeLayout>

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@+id/topbar"
    android:fadingEdge="none"
    android:padding="10dp"
    android:scrollbars="none" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/top"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/addNoteTextView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/android_contentbg"
            android:ellipsize="end"
            android:gravity="top"
            android:maxLines="4"
            android:padding="15dp"
            android:textColor="@android:color/black"
            android:textSize="@dimen/text_size_small" />

        <EditText
            android:id="@+id/addNoteEditText"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:background="@android:color/transparent"
            android:ellipsize="start"
            android:gravity="top"
            android:isScrollContainer="false"
            android:minLines="5"
            android:textColor="@color/light_blue"
            android:textSize="@dimen/text_size" />
    </LinearLayout>
</ScrollView>
</RelativeLayout>

now when i enter the long text in my editText it will led my topbar Relative Layout which is like an actionbar up out of the screen. please help me with the another alternative of this or any solution..

Here is my source code..

final Dialog addNoteDialog;
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
            EReaderConstants.FULL_SCREEN_ON_OFF, true) == false) {
        addNoteDialog = new Dialog(this,
                android.R.style.Theme_Translucent_NoTitleBar);
    } else {
        addNoteDialog = new Dialog(this,
                android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
    }
    addNoteDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    Window window = addNoteDialog.getWindow();
    window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
    window.setGravity(Gravity.CENTER);
    addNoteDialog.setContentView(R.layout.dialog_add_note);
    addNoteDialog.setCancelable(false);
Arpit Patel
  • 1,561
  • 13
  • 23
  • I have already added this in my activity but i have opened this as dialog and in dialog i want to have that upper view fix on the top of the layout.... other layout can slide that will not an issue – Arpit Patel Jun 13 '14 at 09:51

1 Answers1

0

Try this in the Manifest file

 android:windowSoftInputMode="adjustResize"
Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
Saraschandraa
  • 478
  • 1
  • 10
  • 28