michaelye/EasyDialog

recyclerview with wrap content as height covers full height

NayanaRBhoj opened this issue · 1 comments

when added recyclerview in view of easydialog wrap content doest not work and scroller is also not visible for recyclerview.

rl_bysource.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {

            View view = getActivity().getLayoutInflater().inflate(R.layout.popup_listitem, null);
            new EasyDialog(getActivity())
                    // .setLayoutResourceId(R.layout.layout_tip_content_horizontal)//layout resource id
                    .setLayout(view)
                    .setBackgroundColor(getActivity().getResources().getColor(android.R.color.white))
                            // .setLocation(new location[])//point in screen
                    .setLocationByAttachedView(rl_bysource)
                    .setGravity(EasyDialog.GRAVITY_BOTTOM)
                    .setAnimationTranslationShow(EasyDialog.DIRECTION_X, 1000, -600, 100, -50, 50, 0)
                    .setAnimationAlphaShow(1000, 0.3f, 1.0f)
                    .setAnimationTranslationDismiss(EasyDialog.DIRECTION_X, 500, -50, 800)
                    .setAnimationAlphaDismiss(500, 1.0f, 0.0f)
                    .setTouchOutsideDismiss(true)
                    .setMatchParent(false)
                    .setMarginLeftAndRight(24, 24)
                    .setOutsideColor(getActivity().getResources().getColor(android.R.color.transparent))
                    .show();
            recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
            setRecyclerViewSource();

        }
    });

popup_listitem xml is

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

@nayana123 Hi, Thanks for this issue.I don't think it's a good choice to using EasyDialog with ListView, but if you really need to use it,my advice is set a dp value for the layout_width and layout_height.Just like this:

<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="200dip"
android:layout_height="300dip" />