SoftKeyboard скрыть EditText и Pull ActionBar - PullRequest
0 голосов
/ 28 мая 2018

Когда я нажимаю EditText, появляется программная клавиатура, которая скрывает небольшую часть EditText и толкает actionBar вверх.

Пробовал эти вещи:

AdjustResize, Adjustpan, Adjustresize | Adjustpan, окно fitsystem в панели приложения set app: layout_collapseMode = "pin" в activity и ничего не работает.

Вот как это выглядит:

NormalState:

enter image description here

Ошибка

enter image description here

Работает при нажатии на смайлик

enter image description here

Макет находится внутри фрагмента, мне нужно изменить макет фрагмента или макет действия (контейнера)?

План мероприятий:

<android.support.design.widget.CoordinatorLayout
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:windowSoftInputMode="adjustResize"
android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:id="@+id/toolbar"
        android:layout_height="@dimen/abc_action_bar_default_height_material"
        app:layout_collapseMode="pin"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:titleTextAppearance="@style/ToolbarTitleAppearance"
        app:subtitleTextAppearance="@style/ToolbarSubtitleAppearance"
        android:background="#2d5d82"/>

     </android.support.design.widget.AppBarLayout>

<include layout="@layout/principal_chat_amigos_container_fragment"/>

1 Ответ

0 голосов
/ 28 мая 2018

Макет фрагмента

  <!--Layout Mensagens-->
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <!--Geral - Mensagens-->



            <RelativeLayout
                android:id="@+id/relativelayout_chat"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:layout_gravity="top">

                <!--RecycleView Messages-->
                <android.support.v7.widget.RecyclerView
                    android:id="@+id/rv_message"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_above="@+id/typing_Digitando" />

                <!--Indicador Novas Mensagens-->
                <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" />

                <FrameLayout
                    android:id="@+id/typing_Digitando"
                    android:layout_width="200dp"
                    android:layout_height="17dp"
                    android:layout_marginStart="10dp"
                    android:layout_marginLeft="10dp"
                    android:layout_above="@+id/typing_frame"
                    android:layout_marginBottom="5dp"
                    android:textAlignment="center"
                    android:visibility="visible">

                    <TextView
                        android:id="@+id/Indicador_acao_amigo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textStyle="italic"
                        android:singleLine="true"
                        android:text="..."
                        android:textColor="@color/Padrao" />
                </FrameLayout>

                <FrameLayout
                    android:id="@+id/typing_frame"
                    android:layout_width="80dp"
                    android:layout_height="17dp"
                    android:layout_marginStart="10dp"
                    android:layout_marginLeft="10dp"
                    android:layout_above="@+id/bottom_container"
                    android:layout_marginBottom="10dp"
                    android:textAlignment="center"
                    android:visibility="visible">

                    <com.udevel.widgetlab.TypingIndicatorView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:padding="8dp"
                        app:animateFrequency="700"
                        app:animationOrder="lastOneFirst"
                        app:backgroundColor="#eaeaea"
                        app:backgroundType="rounded"
                        app:dotAnimationDuration="600"
                        app:dotAnimationType="Sliding"
                        app:dotColor="#4f7abc"
                        app:dotCount="5"
                        app:dotHorizontalSpacing="4dp"
                        app:dotMaxCompressRatio="70%"
                        app:dotSecondColor="#6b4f7abc"
                        app:dotSize="10dp"
                        app:showBackground="true"/>

                </FrameLayout>

                <!--Container FrameLayout-->
                <FrameLayout
                    android:id="@+id/keyboard_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"/>

                <!--android:layout_alignParentBottom="true"-->
                <!--Container Emoticon Edittext-->
                <RelativeLayout
                    android:id="@+id/bottom_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    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:layout_above="@id/keyboard_container"
                    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_emotions"
                        android:tint="@color/green_600"
                         />

                    <!--<hani.momanii.supernova_emoji_library.Helper.EmojiconEditText-->
                    <com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonEditText
                        android:id="@+id/edt_message_content"
                        style="@style/Base.TextAppearance.AppCompat.Medium"
                        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|textNoSuggestions"
                        android:lines="2"
                        android:maxLines="40"
                        android:imeOptions="flagNoFullscreen"
                        android:layout_toRightOf="@+id/botao_emoji"
                        android:layout_toEndOf="@+id/botao_emoji"/>

                    <ImageButton
                        android:id="@+id/message_love_button"
                        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_love_animation"
                        android:tint="@color/red_400"/>

                </RelativeLayout>


                <!--android:layout_alignParentBottom="true"-->
                <!--Enviar mensagem floatingbutton-->
                <android.support.design.widget.FloatingActionButton
                    android:id="@+id/btn_send_message"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"

                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:layout_above="@id/keyboard_container"
                    app:backgroundTint="@color/Padrao"
                    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>



            </FrameLayout>
...