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

Add AndroidX support #87

Closed
systemallica opened this issue Aug 17, 2018 · 18 comments
Closed

Add AndroidX support #87

systemallica opened this issue Aug 17, 2018 · 18 comments

Comments

@systemallica
Copy link

systemallica commented Aug 17, 2018

The release of the new AndroidX packages is imminent, and this library cannot be used with AndroidX in its current state.

Given that all new development will be done in the AndroidX packages, I think that supporting it would be a good idea.

A refactoring guide can be found here. I don't know if further modifications would be necessary.

@daniel-stoneuk
Copy link
Owner

Good point. I'll update the support library versions and add AndroidX support.

@daniel-stoneuk
Copy link
Owner

Do you know if it works yet with jetifier?

@systemallica
Copy link
Author

Actually I'm not sure. I'm still using Android Studio 3.1.4

@eclectice
Copy link

eclectice commented Sep 17, 2018

jetifier

The latest AndroidX should be OK

gradle.properties

android.useAndroidX = true
android.enableJetifier = false

build gradle

implementation "com.google.android.material:material:$material_version"
implementation "androidx.appcompat:appcompat:$legacy_support_version"    
implementation "androidx.legacy:legacy-support-v4:$legacy_support_version"
implementation "androidx.legacy:legacy-support-v13:$legacy_support_version"

I really like to use your About library since there is a support for Licenses entry. But, I have just moved to AndroidX.

@eclectice
Copy link

eclectice commented Sep 17, 2018

OK, I try to refactor everything in your library codes to AndroidX but the example app uses LicenseAdapter from GITHUB yshrsmz/LicenseAdapter which currently doesn't support AndroidX.

{update redacted into a new post reply}

@daniel-stoneuk
Copy link
Owner

Thanks for taking a look into it. The example using License adapter as an example actually isn't in the latest release, I'm wondering if supporting custom adapters is a good feature.

So you can confirm jetifier does not work with material about library? If this is the case, I'll probably create a new branch and support both support library and AndroidX versions separately.

On another note, how many libraries have you encountered that don't play well with AndroidX, I'm looking to migrate soon.

@eclectice
Copy link

eclectice commented Sep 17, 2018

Thanks for taking a look into it. The example using License adapter as an example actually isn't in the latest release, I'm wondering if supporting custom adapters is a good feature.

So you can confirm jetifier does not work with material about library? If this is the case, I'll probably create a new branch and support both support library and AndroidX versions separately.

On another note, how many libraries have you encountered that don't play well with AndroidX, I'm looking to migrate soon.

I have tried set android.enableJetifier = true and it seems okay. But, I only change that part. So, obviously, I haven't done anything.

About custom adapter support, I think it is a choice and it looks fine to me.

On the other hand, the developer of LicenseAdapter seems inclined to support it yshrsmz/LicenseAdapter#53

@daniel-stoneuk
Copy link
Owner

Thanks. I would also like to add AndroidX support, however, I am more inclined to wait until AndroidX is more common because (correct me if I'm wrong) whilst a support library dep can be used with jetifier, an AndroidX dep can't be used in a support library project.

Would you agree here or do you think I should create two separate branches?

@eclectice
Copy link

eclectice commented Sep 17, 2018 via email

@bernaferrari
Copy link

Released now! Keep in mind all future updates to support library will only happen in androidx.

@leosarra
Copy link

leosarra commented Sep 24, 2018

I tried using AndroidX (with jetifier on) but the MaterialAboutActivity doesn't provide any getResources() or startActivity(). getString etc
It was fine before I did the refactoring

@DerTyp7214
Copy link

i compiled by myself without testapp.
if someone need it with androidx: https://github.com/DerTyp7214/material-about-library/releases/tag/2.3.0

@eclectice
Copy link

eclectice commented Oct 18, 2018

I tried implementation "com.github.daniel-stoneuk:material-about-library:2.3.0" but I think the MaterialAboutCard.Builder.customAdapter is broken.

Update: OK, I understand 2.3.0 tag is the old one. I should use the one from DerTyp7214

@daniel-stoneuk
Copy link
Owner

Hi guys, apologies for the delay.

Could you please test if 2.4.2 works?

Thanks

@DerTyp7214
Copy link

@daniel-stoneuk I will try when I'm back from work

@eclectice
Copy link

eclectice commented Oct 25, 2018 via email

@daniel-stoneuk
Copy link
Owner

Brilliant! Hopefully support for @yshrsmz 's LicenseAdapter should make life a bit easier! @eclectice

@systemallica
Copy link
Author

The new version is working great, thank you.

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

No branches or pull requests

6 participants