Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
embedCrosswalk
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
2018-11-29 07:54:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8fa1613466c53512816e722189d56101082dd8e8
8fa16134
1 parent
74c5e860
add the basic modifications for embeding crosswalk
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
48 行增加
和
9 行删除
.idea/caches/build_file_checksums.ser
app/build.gradle
app/src/main/AndroidManifest.xml
app/src/main/java/com/xuedianyun/embedcrosswalk/MainActivity.java
app/src/main/res/layout/activity_main.xml
build.gradle
.idea/caches/build_file_checksums.ser
查看文件 @
8fa1613
不能预览此文件类型
app/build.gradle
查看文件 @
8fa1613
...
...
@@ -25,4 +25,5 @@ dependencies {
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2'
implementation
'org.xwalk:xwalk_core_library:23.53.589.4'
}
...
...
app/src/main/AndroidManifest.xml
查看文件 @
8fa1613
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.xuedianyun.embedcrosswalk"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<uses-sdk
tools:overrideLibrary=
"org.xwalk.core"
/>
<application
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
...
...
app/src/main/java/com/xuedianyun/embedcrosswalk/MainActivity.java
查看文件 @
8fa1613
...
...
@@ -3,11 +3,44 @@ package com.xuedianyun.embedcrosswalk;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
org.xwalk.core.XWalkPreferences
;
import
org.xwalk.core.XWalkView
;
public
class
MainActivity
extends
AppCompatActivity
{
private
XWalkView
xWalkWebView
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
xWalkWebView
=
findViewById
(
R
.
id
.
webView
);
XWalkPreferences
.
setValue
(
XWalkPreferences
.
REMOTE_DEBUGGING
,
true
);
xWalkWebView
.
load
(
"http://www.xuedianyun.com"
,
null
);
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
if
(
xWalkWebView
!=
null
)
{
xWalkWebView
.
pauseTimers
();
xWalkWebView
.
onHide
();
}
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
if
(
xWalkWebView
!=
null
)
{
xWalkWebView
.
resumeTimers
();
xWalkWebView
.
onShow
();
}
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
if
(
xWalkWebView
!=
null
)
{
xWalkWebView
.
onDestroy
();
}
}
}
...
...
app/src/main/res/layout/activity_main.xml
查看文件 @
8fa1613
...
...
@@ -5,14 +5,10 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MainActivity"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Hello World!"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<org.xwalk.core.XWalkView
android:id=
"@+id/webView"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"vertical"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...
...
build.gradle
查看文件 @
8fa1613
...
...
@@ -19,6 +19,9 @@ allprojects {
repositories
{
google
()
jcenter
()
maven
{
url
'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
}
...
...
请
注册
或
登录
后发表评论