How can we know that android project builded from support or androidx library?

Viewed 47

As the title of this question, I'm going to import two difference maven library to my library poject,

At the same way,I'm going to provide two types dependencies, the one is android support, and the one is androidx

My Question is:

Is there any flags that let me know androidx or android support used? like bekow code snippet:

 if(isUsedAndroidx){
    implementation "library of androidx"
 } else {
    implementation "library of android support"
 }

The flag android.useAndroidX is work for this feature? like below:

if (android.useAndroidX !=null && android.useAndroidX.toBoolean()){
    print "xxxxxxxxxxxxxxxxxxx used useAndroidX"
} else {
    print "xxxxxxxxxxxxxxxxxxx used used android support "
}
0 Answers
Related