2017-12-22 12 views
0

AndroidでBottomSheetを使用しました。その中にはMapViewが含まれていて、データを検索するためのEditTextが含まれています。BottomSheetフォーカスの問題

MapとBottomSheetの動作は、SoftKeyboardが開いていない限り、うまく動作します。つまり、charmのようなマップスクロールです。 SofKeyboardが開いていないときの場合ではありません

問題がSoftKeyboardが開いていると私はいくつかのハードスクロールして上から下に地図をスクロールしようとしていた場合、BottomSheetがクローズなっていることである(隠しへの状態)。

SofelKeyboardが開いている間に地図をスクロールダウンしてにするとき、BottomSheetを閉じるのを避けるための解決策は何でしょうか。

ありがとうございました。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/parentView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:clickable="true" 
    android:focusableInTouchMode="true" > 

    <RelativeLayout 
     android:id="@+id/rltBottomSheet" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:clipToPadding="true" 
     android:paddingTop="@dimen/size_10" 
     app:layout_behavior="@string/view_pager_bottom_sheet_behavior"> 

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

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

      <RelativeLayout 
       android:id="@+id/rltHeader" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <ImageView 
        android:id="@+id/imgBackAll" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerHorizontal="true" 
        android:layout_marginBottom="@dimen/size_10" 
        android:padding="@dimen/size_15" 
        android:src="@drawable/ic_back_all" /> 

       <ImageView 
        android:id="@+id/img" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentLeft="true" 
        android:layout_centerVertical="true" 
        android:layout_marginLeft="@dimen/size_10" 
        android:padding="@dimen/size_5" 
        android:src="@drawable/ic_add_gym" /> 

      </RelativeLayout> 

      <android.support.design.widget.TabLayout 
       android:id="@+id/tabLayout" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/imgLogo" 
       android:minHeight="?attr/actionBarSize" 
       app:tabGravity="fill" 
       app:tabIndicatorColor="@color/tab_indicator_color" 
       app:tabIndicatorHeight="@dimen/size_2" 
       app:tabMode="fixed" 
       app:tabSelectedTextColor="@color/explore_tab_text_color" 
       app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" 
       app:tabTextColor="@color/explore_tab_text_color" /> 

      <android.support.v4.view.ViewPager 
       android:id="@+id/vp" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_below="@+id/tabLayout" /> 

     </LinearLayout> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="200dp" 
      android:layout_alignParentBottom="true" 
      android:alpha="0.5" 
      android:background="@drawable/ic_bottom_overlay" 
      android:visibility="gone"/> 

    </RelativeLayout> 

</android.support.design.widget.CoordinatorLayout> 
+0

レイアウト – ADM

+0

を投稿OK私が編集してみましょう。.. –

+0

@ADMはviewpagerがマップを含むフラグメントを交換内、BottomSheetを持っている主なフラグメントを追加しました。 –

答えて

0

MapViewNestedScrollViewとしてのあなたのルートを作成します。

EDIT

BottomSheetが含まれていレイアウトがTabLayoutを持っており、それはそれで3つのフラグメントが含まれており、マップは最初のフラグメントにある以下の通りです。

<android.support.v4.widget.NestedScrollView 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent"> 

    // Your content goes here 
</android.support.v4.widget.NestedScrollView> 
+1

正解は@ADMのコメントに既にあります:) –

+1

受理した後、この質問はマーキング(重複)に使用することができます。それは私が尋ねた理由です。 – ADM

関連する問題