Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

Doesn't work in BottomSheetDialogFragment #57

Open
bytesizedwizard opened this issue Jan 23, 2020 · 0 comments
Open

Doesn't work in BottomSheetDialogFragment #57

bytesizedwizard opened this issue Jan 23, 2020 · 0 comments

Comments

@bytesizedwizard
Copy link

bytesizedwizard commented Jan 23, 2020

Tried to make it work inside a BottomSheetDialogFragment. But nothing happens when the bottom sheet is displayed.

Here is my code -

public class CountActionListDialogFragment extends BottomSheetDialogFragment {

    @SuppressLint("RestrictedApi")
    @Override
    public void setupDialog(@NonNull final Dialog dialog, int style) {
        super.setupDialog(dialog, style);
        View contentView = View.inflate(getContext(), R.layout.count_bottom_sheet, null);
        dialog.setContentView(contentView);
        try {
            final RippleBackground rippleBackground= Objects.requireNonNull(getActivity()).findViewById(R.id.rippleAnimation);
            rippleBackground.startRippleAnimation();
            ImageView imageView=Objects.requireNonNull(getActivity()).findViewById(R.id.centerImage);
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    rippleBackground.startRippleAnimation();
                }
            });
        } catch (NullPointerException ignored) { }
    }

}

And bottom_sheet.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    <com.skyfishjy.library.RippleBackground
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:id="@+id/rippleAnimation"
        app:rb_color="@color/colorAccent"
        app:rb_radius="32dp"
        app:rb_rippleAmount="4"
        app:rb_duration="3000"
        app:rb_scale="6">
        <ImageView
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:layout_centerInParent="true"
            android:id="@+id/centerImage"
            android:src="@drawable/ic_check_circle_green_24dp" />
    </com.skyfishjy.library.RippleBackground>

</LinearLayout>

Might be similar to #32

Thanks in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant