Agentweb 视图构造
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <WebView
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- </WebView>
- <!--进度条-->
- <com.just.library.BaseIndicatorView
- android:layout_width="match_parent"
- android:layout_height="2dp"
- >
- </com.just.library.BaseIndicatorView>
- </FrameLayout>
AgentWeb 最外层是 FrameLayout , 所以在应用 AgentWeb 的时刻还须要给 FrameLayout 指定父控件(下面有应用方法) 。
AgentWeb 内部构造

- IndicatorController 进度条控制器
- WebCreator 创建 WebView 。
- WebSettings 同一设置 WebView 的 settings
- WebSecurityController 安然控制器
- JsEntraceAccess Js 方罪人口
惹人
Gradle
- compile 'com.just.agentweb:agentweb:1.1.0'
Maven
- <dependency>
- <groupId>com.just.agentweb</groupId>
- <artifactId>agentweb</artifactId>
- <version>1.1.0</version>
- <type>pom</type>
- </dependency>
用法
Activity 应用如下
- mAgentWeb = AgentWeb.with(this)//传入Activity
- .setAgentWebParent(mLinearLayout, new LinearLayout.LayoutParams(-1, -1))//传入AgentWeb 的父控件 ,如不雅父控件为 RelativeLayout , 那么第二参数须要传入 RelativeLayout.LayoutParams
- .useDefaultIndicator()// 应用默认进度条
- .defaultProgressBarColor() // 应用默认进度条色彩
- .setReceivedTitleCallback(mCallback) //设置 Web 页面的 title 回调
- .createAgentWeb()//
- .ready()
- .go(
推荐阅读
在描述Device Tree的构造之前,我们先问一个基本问题:是否Device Tree要描述体系中的所有硬件信息?谜底是否定的。根本上,那些可以动态探测到的设备是不须要描述的,例如USB device。不过对于SOC上的usb host con>>>详细阅读
本文标题:AgentWeb是基于Android WebView一个功能完善小型浏览器库
地址:http://www.17bianji.com/lsqh/36324.html
1/2 1

网友点评
精彩导读
科技快报
品牌展示