[ 
https://issues.apache.org/jira/browse/CB-8510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14327752#comment-14327752
 ] 

Andrew Grieve commented on CB-8510:
-----------------------------------

Pull requests:
https://github.com/apache/cordova-android/pull/158
https://github.com/MobileChromeApps/cordova-crosswalk-engine/pull/18

CordovaWebView:
        •       Main API for plugin devs and embedders.
CordovaWebViewEngine
        •       Main API that must be provided to be used as a WebView


Designs I tried:
CordovaWebView as a class that extends View
        •       Fixed almost all compile issues with third-party plugins
        •       Backwards-compatible with "pluginManager" field and no need for 
.getView()
        •       Works perfect in XML layouts (can still create a CordovaWebView 
in xml)
        •       But is maybe too subtle:
                ◦       May have perf issue (makes view hierarchy deeper)
                ◦       Makes setting background color more complicated
                ◦       View.getScrollY() exists on all views… *some* compile 
errors would have been nice!

CordovaWebView as a class that does *not* extend View
        •       Causes compile error on our reflection-code for (View)webView 
cast
                ◦       affects splashscreen, 
com.rjfun.cordova.ext.CordovaPluginExt
        ▪       fix via: (View)(Object) webView;

CordovaWebView as an interface
        •       Still get code sharing via CordovaWebViewImpl
        •       Fixes compile issue with cast-to-View
        •       Better for unit tests (more easily mocked)
        •       It's what we already have on 4.0.x
        •       This is what I settled on.


CordovaWebViewEngine as a base class
        •       Not really much you can add in terms of new methods that are 
meaningful.
        •       Allows sharing of a couple methods (e.g. getCordovaWebView)
        •       Prevents subclasses from extending other things (good for 
consistency?)

CordovaWebViewEngine as an interface
        •       Not able to add new methods without breaking compatibility
        •       Good for unit tests
        •       Consistent with CordovaWebView being an interface
        •       We could always create a CordovaWebViewEngineImpl if there was 
value.


> Delete copy&paste between AndroidWebView and XWalkWebView
> ---------------------------------------------------------
>
>                 Key: CB-8510
>                 URL: https://issues.apache.org/jira/browse/CB-8510
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>
> Right now there is a lot of copy & paste between the two, and bugs that have 
> been fixed on master have not all made it into XWalkWebView. Copy & paste was 
> a great way to get the concept off the ground, but it would be vastly more 
> maintainable to have it shared in some way.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to