<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/chat_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWhite"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_chat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v7.widget.RecyclerView>
<include layout="@layout/line_divider" />
<LinearLayout . . . >
</LinearLayout>
public class ChatBottomSheetDialog extends BottomSheetDialogFragment {
private ArrayList<SheetObject> cardList;
private RecyclerSheetAdapter mAdapter;
private RecyclerView recyclerView;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.sheet_chat, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view_chat);
cardList = new ArrayList<>();
mAdapter = new RecyclerSheetAdapter(this, cardList);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL, false);
recyclerView.setLayoutManager(layoutManager);
//recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
return view;
}
}