Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issue while implementing #18

Closed
mathuadi3 opened this issue Dec 9, 2019 · 8 comments
Closed

Some issue while implementing #18

mathuadi3 opened this issue Dec 9, 2019 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@mathuadi3
Copy link

I tried this, but i am facing some issue with this. I called it in the on click listener of my button, but it is not taking this, getApplicationContext etc in the builder argument. I have attached a screenshot of the same. I also tried to call in activity fragment but the same issue there. if i pass getApplicationContext, it shows the class has been called in Protected state. Please help!

BottomSheetMaterialDialog dialog=new BottomSheetMaterialDialog.Builder(getActivity().getApplicationContext());

Screenshot (8)

@PatilShreyas
Copy link
Owner

PatilShreyas commented Dec 9, 2019 via email

@mathuadi3
Copy link
Author

In constructor, we have to pass Activity, not Context. So just pass getActivity() in constructor. It'll solve problem.

On Mon 9 Dec, 2019, 2:27 PM mathuadi3, @.***> wrote: I tried this, but i am facing some issue with this. I called it in the on click listener of my button, but it is not taking this, getApplicationContext etc in the builder argument. I have attached a screenshot of the same. I also tried to call in activity fragment but the same issue there. if i pass getApplicationContext, it shows the class has been called in Protected state. Please help! BottomSheetMaterialDialog dialog=new BottomSheetMaterialDialog.Builder(getActivity().getApplicationContext()); [image: Screenshot (8)] https://user-images.githubusercontent.com/37552855/70421553-fddd3680-1a8f-11ea-98e1-ebf898541573.png — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#18?email_source=notifications&email_token=AEVWFOCNOTUAIWVOTHJCD3LQXYB77A5CNFSM4JYFRZX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7AEDQA>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVWFOH7DO7NPLQ3WU5TSKLQXYB77ANCNFSM4JYFRZXQ .

Doesnt solve. SAme issue. I am implementing it in a fragment of tab layout

Screenshot (9)

@PatilShreyas
Copy link
Owner

PatilShreyas commented Dec 9, 2019 via email

@PatilShreyas
Copy link
Owner

Hi, @mathuadi3 Thanks for reporting that. I just checked it and It'll be fixed in next version 2.0. BottomSheetMaterialDialog constructor accepts AppCompatActivity So we can't use it currently. But you can use MaterialDialog till next release.

@PatilShreyas PatilShreyas added the enhancement New feature or request label Dec 10, 2019
@PatilShreyas PatilShreyas added this to the v1.1.0 milestone Dec 10, 2019
@mathuadi3
Copy link
Author

mathuadi3 commented Dec 10, 2019 via email

@PatilShreyas
Copy link
Owner

This issue is fixed and implemented in v2.0. Thank you!

@mathuadi3
Copy link
Author

mathuadi3 commented Dec 10, 2019 via email

@PatilShreyas
Copy link
Owner

Yes, you can use it. Just ensure to pass Activity using getActivity().
Use dependency:

dependencies {
    // Material Dialog Library
    implementation 'com.shreyaspatil:MaterialDialog:2.0'
    // Material Design Library
    implementation 'com.google.android.material:material:1.0.0'
    // Lottie Animation Library
    implementation 'com.airbnb.android:lottie:3.3.6'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants