Skip to content

Conversation

NBonaparte
Copy link
Contributor

This change allows Material dialogs to be used if available (running Lollipop or above), while maintaining support for API < 21. THEME_HOLO_LIGHT is also apparently deprecated, so it has been replaced.

Copy link
Owner

@jonan jonan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried this changes in API 19 and dialogs are not rendered properly.

Need to check with API >= 21 yet.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
return new LightAlertDialog(context, Theme_Material_Light_Dialog_Alert);
else
return new LightAlertDialog(context, Theme_Holo_Light_Dialog);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This two calls should be new LightAlertDialog.Builder(...)

import android.content.Context;
import android.os.Build;

import static android.R.style.Theme;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not needed

@saran2020
Copy link
Contributor

saran2020 commented Aug 21, 2017

@jonan Are you working on this? if not I can make the necessary changes suggested by you and raise a PR.

@NBonaparte
Copy link
Contributor Author

Sorry it's been a while, I just added the requested changes.

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

Successfully merging this pull request may close these issues.

3 participants