Code Monkey home page Code Monkey logo

hybridframework's Introduction

HybridFramework

引言

Hybrid也已经火了很长一段时间了,但是一直有人不知从何入手。 那么下面是我花了一段时间做的一个Hybrid框架,并基于这个框架和Django编写了一个Demo, 支持H5和Native的无缝调用,并支持自定义事件的扩展.


废话不多讲,先来看效果展示(其中除了页面是H5,其他View均是AndroidUI)

1. 启动Hybrid页面


2. 检测Hybrid默认支持的事件 (以Toast为例)


3. 隐藏TitleBar


4. 显示TitleBar



以上只是Demo的一部分效果,具体的可以见Demo-Android中.

技术点

  1. 通过注入 JSBridge 来无缝调用H5和Native
  2. 重构WebView和WebViewClient生命周期中的所有方法
  3. 依赖AppDynamicFramework,来动态加载Hybrid框架,即 jniLibs/armeabi/libh5core.so
  4. 通过注解自定义Hybrid扩展事件
  5. CreatePage()可将Hybrid页面嵌入到其他View
  6. 等等的

Contact me

Any further question?

Email me please!

License

    Copyright 2017 xiyouMc

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

hybridframework's People

Contributors

xiyoumc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hybridframework's Issues

Native的多个方法 是怎么管理的?

通过actionMap。 并在closeWebview的时候 clear掉。
那么会影响其他webview的事件吧。

不会的。

这是HybridFramework的窗口管理,通过 push 和 pop进行窗口管理。 类似于 数状数据结构 新push的window是拥有唯一的 且 独立的 pluginManager. 所以不会被影响到。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.