Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
Add the dependency
dependencies {
compile 'com.github.iamlocky:X5Browser:1.0.1'
}
<!--权限复制开始-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<!--复制结束-->
<!--activity复制开始-->
<activity
android:name="lockyluo.x5corelibrary.FullScreenActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name"></activity>
<activity
android:name="lockyluo.x5corelibrary.FilechooserActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name"></activity>
<activity
android:name="lockyluo.x5corelibrary.BrowserActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/app_name"
android:launchMode="standard"></activity>
<!--复制结束-->
{
//带网址夜间
BrowserActivity.init(this, "https://x5.tencent.com/tbs/guide/sdkInit.html", false, ResourcesCompat.getColor(getResources(), R.color.colorBlueDark, getTheme()));
//不带网址白天
BrowserActivity.init(this, true, ResourcesCompat.getColor(getResources(), R.color.colorPrimary, getTheme()));
}