0

私はEdittextと送信ボタンが下部にあるチャットアプリケーションに取り組んでいます。 アクティビティは、フルスクリーンの非表示のナビゲーションとステータスバーです。 キーボードにフォーカスが入ったら、edittextを押してボタンを送る必要があります。キーボードオーバーラップEdittext - アクティビティフルスクリーン

  • 私はandroid:windowSoftInputMode = "adjustResize"を設定しようとしましたが、うまく機能しませんでした。
  • https://github.com/madebycm/AndroidBug5497Workaroundから参照されているAndroidBug5497Workaround.assistActivity(this)クラスを使用してみましたが、動作しませんでした。以下は

バーを非表示と全画面表示を行うための活動の私の活動のテーマとコードです:

decorView = getWindow().getDecorView(); 
    uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY 
      | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; 

テーマ:

<style name="AppTheme_DarkStatus" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryveryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
    <item name="android:windowContentTransitions">true</item> 
    <item name="android:windowDrawsSystemBarBackgrounds">true</item> 

XML:

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/include_view" 
    android:isScrollContainer="true" 
    android:background="@android:color/white"> 

    <com.handmark.pulltorefresh.library.PullToRefreshListView 
     xmlns:ptr="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/lv_chat" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_above="@+id/rl_send" 
     android:divider="@null" 
     android:fadeScrollbars="false" 
     android:fadingEdge="none" 
     android:overScrollMode="never" 
     android:scrollbars="none" 
     ptr:ptrHeaderSubTextColor="@color/c_input_text_color" 
     ptr:ptrHeaderTextColor="@color/c_input_text_color" 
     ptr:ptrOverScroll="false" 
     ptr:ptrPullLabel="Pull to refresh" 
     ptr:ptrRefreshLabel="Loading..." 
     ptr:ptrReleaseLabel="Release to refresh" 
     ptr:ptrRotateDrawableWhilePulling="true" 
     ptr:ptrShowIndicator="false" > 
    </com.handmark.pulltorefresh.library.PullToRefreshListView> 

    <RelativeLayout 
     android:id="@+id/rl_send" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:background="@color/c_white" 
     android:gravity="center" > 

     <View 
      android:id="@+id/view_dummy" 
      android:layout_width="match_parent" 
      android:layout_height="@dimen/d_diff_p5dp" 
      android:background="@color/c_text_light_color" /> 

     <RelativeLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/view_dummy" 
      android:layout_toLeftOf="@+id/btn_send" 
      android:layout_marginRight="@dimen/d_diff_5dp" 
      android:layout_marginLeft="@dimen/d_diff_10dp" 
      android:layout_marginTop="@dimen/s_diff_7sp" 
      android:layout_marginBottom="@dimen/s_diff_7sp" 
      android:background="@drawable/opawhite_rectcorner_all" android:id="@+id/relativeLayout"> 

      <EditText 
       android:id="@+id/et_message" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_margin="@dimen/d_diff_1dp" 
       android:background="@null" 
       android:focusableInTouchMode="true" 
       android:maxHeight="100dp" 
       android:hint="Type here..." 
       android:maxLength="150" 
       android:textSize="@dimen/s_diff_16sp" 
       android:padding="@dimen/s_diff_6sp" 
       android:textColorHint="@color/c_input_text_color" 
       android:textColor="@color/c_black" /> 
     </RelativeLayout> 

     <Textview 
      android:id="@+id/btn_send" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@color/c_white" 
      android:text="Send" 
      android:padding="@dimen/d_diff_5dp" 
      android:layout_marginRight="@dimen/d_diff_5dp" 
      android:gravity="center" 
      android:textColor="@color/c_orange_main" 
      android:textSize="@dimen/s_diff_16sp" 
      android:layout_centerVertical="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentEnd="true"/> 
    </RelativeLayout> 
</RelativeLayout> 

私が欲しいですedittextを表示し、キーボードの上にボタンを送信しますが、edittextと重複します。

ありがとうございます!

+0

誰でも確認できますか? –

答えて