Justson

Agentweb

AgentWeb is a powerful library based on Android WebView.
Under Apache License 2.0
By Justson

cookie webview hybrid wechat-pay agentweb-android-webview webview-agentweb-web android-webview


AgentWeb 介绍

AgentWeb 是一个基于的 Android WebView ,极度容易使用以及功能强大的库,提供了 Android WebView 一系列的问题解决方案 ,并且轻量和极度灵活,详细使用请参照上面的 Sample 。


Gradle 引入

groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}



groovy
implementation 'com.github.Justson.AgentWeb:agentweb-core:v4.1.9' // (必选)
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v4.1.9' // (可选)
implementation 'com.github.Justson:Downloader:v4.1.9' // (可选)



```groovy
implementation 'com.github.Justson.AgentWeb:agentweb-core:v4.1.9-androidx' // (必选)
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:v4.1.9-androidx' // (可选)
implementation 'com.github.Justson:Downloader:v4.1.9-androidx' // (可选)


```


相关

使用
基础用法

```java
mAgentWeb = AgentWeb.with(this)
.setAgentWebParent((LinearLayout) view, new LinearLayout.LayoutParams(-1, -1))
.useDefaultIndicator()
.createAgentWeb()
.ready()
.go("http://www.jd.com");


```


效果图





android:hardwareAccelerated="true"
android:configChanges="orientation|screenSize"
```


```



混淆

如果你的项目需要加入混淆 , 请加入如下配置


```java
-keep class com.just.agentweb. {
*;
}
-dontwarn com.just.agentweb.


```
Java 注入类不要混淆 , 例如 sample 里面的 AndroidInterface 类 , 需要 Keep 。


java
-keepclassmembers class com.just.agentweb.sample.common.AndroidInterface{ *; }


注意事项

常见问题
修改 AgentWeb 默认的背景色

java
FrameLayout frameLayout = mAgentWeb.getWebCreator().getWebParentLayout();
frameLayout.setBackgroundColor(Color.BLACK);


文档帮助

更新日志
致谢

有问题或者有更好的建议

关于我

一个位于深圳的 Android 开发者 , 如果你有问题 , 请联系 Email : [email protected]


赞赏

如果你喜欢了 AgentWeb 的设计 , 你也可以请作者喝一杯咖啡。



AgentWeb


License

```
Copyright (C) Justson(https://github.com/Justson/AgentWeb)


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.
```