You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Hans Krywalsky <te...@simplify-solutions.de> on 2020/08/11 19:41:57 UTC

DualSupport AndroidX for FramnetSupport

Hey everybody,

i'm currently developing a new maintained Braintree Plugin. As the latest mobile SDK of them requires AndroidX, i searched for Issues and found this one: https://github.com/apache/cordova-android/issues/841

As it is mentioned correctly it is nearly enough to change the base class of the CordovaActivity from android.app.Activity to androidx.appcompat.app.AppCompatActivity. 

I forked cordova-android and tested it out. Changing three Java Classes, the AndroidManifest.xml and adjust the  build.gradle Script and it works 😃 

Like i comment in the Ticket i thing make the changes based on the AndroidXEnabled Preference should be a good solution, but the question how. 

Adjusting the Gradle File is easy:dependencies {
    if (project.hasProperty('android.useAndroidX')) {
        implementation 'androidx.appcompat:appcompat:1.2.0'
    }
}

But how to continue with the other Files? Also the Change in the AndroidManifest.xml is just on Line:
Change the android:theme to @style/Theme.AppCompat.NoActionBar - this can be easy performed in the prepare Script?

But what about the Changes in the Java Files? What is the best way to make this possible? I think changing the single Lines in the prepare Script is not the best solution?

Please give me some hints, so i can create the PR.

Greetings,
Hans

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org