softkeyboard pushing layout up

Asked

Viewed 260 times

1

Hey, guys, I got a problem, and I can’t fix it in any way. already tried adjustpan, resize.. anyway..

I have a layout with recycleview and edittext and a few more views.. when I click in edittext the keyboard is displayed but pushes up all the rest of the layout and still cuts half of edittext.

<layout 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">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="bottom"
                android:background="@drawable/telegramfundo_chat"
               >

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/rv_message"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_above="@+id/rv_message_container"
                    />

                <android.support.design.widget.FloatingActionButton
                    android:id="@+id/fab"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentEnd="true"
                    android:layout_marginBottom="80dp"
                    android:layout_marginRight="15dp"
                    android:backgroundTint="#FFFFFF"
                    android:src="@drawable/indicador_msg_whats"
                    android:visibility="visible"
                    app:borderWidth="0dp"
                    app:elevation="5dp"
                    app:fabSize="mini" />

                <RelativeLayout
                    android:id="@+id/rv_message_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_marginBottom="@dimen/edt_msg_content_margin"
                    android:layout_marginLeft="@dimen/edt_msg_content_margin"
                    android:layout_marginStart="@dimen/edt_msg_content_margin"
                    android:layout_toLeftOf="@+id/btn_send_message"
                    android:layout_toStartOf="@+id/btn_send_message"
                    android:background="@drawable/message_item_background"
                    android:elevation="4dp"
                    android:paddingBottom="@dimen/edt_msg_content_padding_v"
                    android:paddingLeft="@dimen/edt_msg_content_padding_h"
                    android:paddingRight="@dimen/edt_msg_content_padding_h"
                    android:paddingTop="@dimen/edt_msg_content_padding_v">


                    <ImageView
                        android:id="@+id/botao_emoji"
                        android:layout_width="@dimen/edt_ic_size"
                        android:layout_height="@dimen/edt_ic_size"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_centerVertical="true"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:padding="4dp"
                        app:srcCompat="@drawable/chat_emoticon"
                        android:tint="@color/orange_800"/>


                    <hani.momanii.supernova_emoji_library.Helper.EmojiconEditText
                        android:id="@+id/edt_message_content"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_toLeftOf="@+id/iv_camera"
                        android:layout_toStartOf="@+id/iv_camera"
                        android:background="#00ffffff"
                        android:hint="Digite sua mensagem!"
                        android:inputType="textMultiLine|textCapSentences"
                        android:lines="2"
                        android:maxLines="3"
                        android:layout_toRightOf="@+id/botao_emoji"
                        android:layout_toEndOf="@+id/botao_emoji"/>

                    <ImageView
                        android:id="@+id/iv_camera"
                        android:layout_width="@dimen/edt_ic_size"
                        android:layout_height="@dimen/edt_ic_size"
                        android:layout_alignParentEnd="true"
                        android:layout_alignParentRight="true"
                        android:layout_centerVertical="true"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:padding="4dp"
                        app:srcCompat="@drawable/ic_camera"
                        android:tint="@color/blue_800"/>

                </RelativeLayout>

                <android.support.design.widget.FloatingActionButton
                    android:id="@+id/btn_send_message"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:layout_gravity="bottom|end"
                    android:layout_margin="@dimen/fab_send_margin"
                    app:srcCompat="@drawable/ic_send"
                    android:text="@string/button_send"
                    app:pressedTranslationZ="10dp"/>


            </RelativeLayout>

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

                <LinearLayout
                    android:id="@+id/ln_menu_items"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#f0ffffff"
                    android:orientation="horizontal"
                    android:padding="14dp"
                    android:visibility="invisible"
                    >

                    <LinearLayout
                        android:id="@+id/ln_menu_item_camera"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/ic_camera"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Camera"/>
                    </LinearLayout>


                    <LinearLayout
                        android:id="@+id/ln_menu_item_gallery"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/ic_image_placeholder"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Galeria"/>
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/ln_menu_Audio"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/phone_mic_on"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Audio"/>
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/ln_menu_Ligacao"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/chat_call"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Ligar"/>
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/ln_menu_item_location"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/ic_location"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Local"/>
                    </LinearLayout>

                </LinearLayout>

                <FrameLayout
                    android:id="@+id/fl_container_to_hide"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>





            </LinearLayout>

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

                <LinearLayout
                    android:id="@+id/ln_menu_items_adicionais"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#f0ffffff"
                    android:orientation="horizontal"
                    android:padding="14dp"
                    android:visibility="invisible"
                    >

                    <LinearLayout
                        android:id="@+id/ln_menu_items_adicionais_listavideos"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/video_youtube_menu"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Procurar videos"/>
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/ln_menu_items_adicionais_estabelecimentos"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/ic_estabelecimentos"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Audio"/>
                    </LinearLayout>


                    <LinearLayout
                        android:id="@+id/ln_menu_items_adicionais_promocoes"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="@dimen/rounded_menu_icon"
                            android:layout_height="@dimen/rounded_menu_icon"
                            android:background="@drawable/bg_rounded_shape"
                            app:srcCompat="@drawable/ic_promocoes"
                            android:tint="@color/white"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="Promoções"/>
                    </LinearLayout>



                </LinearLayout>

                <FrameLayout
                    android:id="@+id/fl_container_to_hide_outro"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>

            </LinearLayout>

            <!-- YOU TUBE -->
            <RelativeLayout
                android:id="@+id/youtube_fragment_layout"
                android:layout_width="230dp"
                android:layout_height="135dp"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="200dp"
                android:background="@drawable/rounded_rect_bg_action_down"
                android:clickable="true"
                android:visibility="invisible">


                <FrameLayout
                    android:id="@+id/youtube_fragment"
                    android:layout_width="200dp"
                    android:layout_height="110dp"
                    android:layout_centerHorizontal="true"
                    android:layout_centerVertical="true"
                    android:background="@drawable/rounded_rect_bg_action_down"
                    android:clickable="true"
                    android:visibility="visible" />

                <!--<fragment-->
                <!--android:name="com.google.android.youtube.player.YouTubePlayerSupportFragment"-->
                <!--android:id="@+id/youtube_fragment"-->
                <!--android:layout_width="150dp"-->
                <!--android:layout_height="100dp"-->
                <!--android:layout_marginTop="100dp"-->
                <!--android:layout_centerHorizontal="true"-->
                <!--android:visibility="visible" />-->

                <ImageButton
                    android:id="@+id/btn_Grab"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:layout_above="@+id/youtube_fragment"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentTop="true"
                    android:layout_toEndOf="@+id/youtube_fragment"
                    android:layout_toRightOf="@+id/youtube_fragment"
                    android:background="@color/Transparent"
                    app:srcCompat="@drawable/chat_grabvideo" />

            </RelativeLayout>

        </FrameLayout>




</com.sothree.slidinguppanel.SlidingUpPanelLayout>

Someone can help me?

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.