作家
登录

AgentWeb是基于Android WebView一个功能完善小型浏览器库

作者: 来源: 2017-07-21 09:11:27 阅读 我要评论

Agentweb 视图构造

  1. <FrameLayout 
  2.         android:layout_width="match_parent" 
  3.         android:layout_height="match_parent"
  4.  
  5.         <WebView 
  6.             android:layout_width="match_parent" 
  7.             android:layout_height="match_parent"
  8.  
  9.         </WebView> 
  10.          <!--进度条--> 
  11.         <com.just.library.BaseIndicatorView 
  12.             android:layout_width="match_parent" 
  13.             android:layout_height="2dp" 
  14.             > 
  15.  
  16.         </com.just.library.BaseIndicatorView> 
  17.     </FrameLayout>  

AgentWeb 最外层是 FrameLayout , 所以在应用 AgentWeb 的时刻还须要给 FrameLayout 指定父控件(下面有应用方法) 。

AgentWeb 内部构造

  • IndicatorController 进度条控制器
  • WebCreator 创建 WebView 。
  • WebSettings 同一设置 WebView 的 settings
  • WebSecurityController 安然控制器
  • JsEntraceAccess Js 方罪人口

惹人

Gradle

  1. compile 'com.just.agentweb:agentweb:1.1.0' 

Maven

  1. <dependency> 
  2.    <groupId>com.just.agentweb</groupId> 
  3.    <artifactId>agentweb</artifactId> 
  4.    <version>1.1.0</version> 
  5.    <type>pom</type> 
  6.  </dependency>  

用法

Activity 应用如下

  1. mAgentWeb = AgentWeb.with(this)//传入Activity 
  2.                 .setAgentWebParent(mLinearLayout, new LinearLayout.LayoutParams(-1, -1))//传入AgentWeb 的父控件 ,如不雅父控件为 RelativeLayout , 那么第二参数须要传入 RelativeLayout.LayoutParams 
  3.                 .useDefaultIndicator()// 应用默认进度条 
  4.                 .defaultProgressBarColor() // 应用默认进度条色彩 
  5.                 .setReceivedTitleCallback(mCallback) //设置 Web 页面的 title 回调 
  6.                 .createAgentWeb()// 
  7.                 .ready() 
  8.                 .go(

      推荐阅读

      Linux Device Tree(二):基本概念

    在描述Device Tree的构造之前,我们先问一个基本问题:是否Device Tree要描述体系中的所有硬件信息?谜底是否定的。根本上,那些可以动态探测到的设备是不须要描述的,例如USB device。不过对于SOC上的usb host con>>>详细阅读


    本文标题:AgentWeb是基于Android WebView一个功能完善小型浏览器库

    地址:http://www.17bianji.com/lsqh/36324.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)