jeudi 14 mai 2015

android make editText floating when virtual keyboard shown, without resize background

I have a surfaceView in the background of my activity and edit text over it, i need to show edit text when virtual keyboard is shown withouth resizing surfaceView... At the end I need only edit text to move when virtual keyboard is shown

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_relative_layout">


<SurfaceView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/main_fragment_surfase_view"
    />

<LinearLayout
    android:id="@+id/main_fragment_bottom_menu_layout"
    android:layout_alignParentBottom="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="10dp"
    android:paddingTop="10dp">

    <View
        android:layout_weight="0.5"
        android:layout_width="0dp"
        android:layout_height="0dp" />

    <Button style="@style/RoundButtonMainScreenFragment" />

    <View
        android:layout_weight="0.5"
        android:layout_width="0dp"
        android:layout_height="0dp" />

    <Button style="@style/RoundButtonMainScreenFragment" />

    <View
        android:layout_weight="0.5"
        android:layout_width="0dp"
        android:layout_height="0dp" />

    <Button style="@style/RoundButtonMainScreenFragment" />

    <View
        android:layout_weight="0.5"
        android:layout_width="0dp"
        android:layout_height="0dp" />

    <ImageButton
        android:src="@android:drawable/ic_menu_camera"
        style="@style/RoundButtonMainScreenFragment"
        android:contentDescription="Delete" />

    <View
        android:layout_weight="0.5"
        android:layout_width="0dp"
        android:layout_height="0dp" />
</LinearLayout>
<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:id="@+id/list_view_container"
    android:layout_alignParentTop="true"
    android:isScrollContainer="true">

</FrameLayout>
    <EditText
        android:visibility="visible"
        android:id="@+id/main_screen_edit_text"
        android:alpha="0.5"
        android:layout_above="@id/main_fragment_bottom_menu_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:layout_gravity="bottom"/>
</RelativeLayout>

Aucun commentaire:

Enregistrer un commentaire