Some simple uses of WebView in Android

Some simple uses of WebView in Android

I always wanted to write a simple application of WebView control, but I didn't have much time. This time, I also squeezed out time to write it. Some basic knowledge in it will be updated and explained when I have time. Today, I'll give a brief introduction to the project. Too much content can be seen from my source code and transmitted to GitHub.

The following is the rendering of the project:

The application uses MVP design pattern. Those who don't know much about this pattern can Google first, otherwise the project will be dizzy, although my code is very concise.

For MVP, you can look at the source code with an idea, that is, the activity (or other components) can get the data through the xxpresenter, get the data, and update the data in the xxpresenter with the xxiview (this is an interface). Then the activity (or other components) can inherit the xxiview interface to update the UI

In fact, WebView only needs some simple, in-depth application. This article will be updated in the future!

Of which:

Interact with native:

Here, set the night mode for WebView:

That is, write the HTML tag "< div class =" night ">" to the HTML page

The project still needs to be improved. After this period of time, it will be updated!!!!

Project source code GitHub

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>