Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
f82a88c5
Commit
f82a88c5
authored
Jul 31, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitee.com/bdnh/hippo
parents
352c051d
ca76bcc9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
142 additions
and
113 deletions
+142
-113
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/core/java/cn/garymb/ygomobile/ui/plus/X5WebView.java
.../src/core/java/cn/garymb/ygomobile/ui/plus/X5WebView.java
+99
-0
mobile/src/core/java/cn/garymb/ygomobile/ui/plus/XWebView.java
...e/src/core/java/cn/garymb/ygomobile/ui/plus/XWebView.java
+0
-105
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
.../main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
+9
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
.../main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
+28
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+5
-3
No files found.
mobile/build.gradle
View file @
f82a88c5
...
...
@@ -83,7 +83,7 @@ dependencies {
implementation
'com.tubb.smrv:swipemenu-recyclerview:5.4.0'
//
implementation
(
name:
'libWindbot'
,
ext:
'aar'
)
//mycardImplementation(name: 'xwalk_core_library-22.52.561.4', ext: 'aar')
implementation
'com.nightonke:boommenu:2.1.0'
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
...
...
mobile/src/core/java/cn/garymb/ygomobile/ui/plus/X5WebView.java
0 → 100644
View file @
f82a88c5
package
cn.garymb.ygomobile.ui.plus
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.graphics.Canvas
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
com.tencent.smtt.sdk.WebSettings
;
import
com.tencent.smtt.sdk.WebView
;
import
com.tencent.smtt.sdk.WebViewClient
;
public
class
X5WebView
extends
WebView
{
private
WebViewClient
client
=
new
WebViewClient
()
{
/**
* 防止加载网页时调起系统浏览器
*/
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
view
.
loadUrl
(
url
);
return
true
;
}
};
@SuppressLint
(
"SetJavaScriptEnabled"
)
public
X5WebView
(
Context
arg0
,
AttributeSet
arg1
)
{
super
(
arg0
,
arg1
);
this
.
setWebViewClient
(
client
);
// this.setWebChromeClient(chromeClient);
// WebStorage webStorage = WebStorage.getInstance();
initWebViewSettings
();
this
.
getView
().
setClickable
(
true
);
}
private
void
initWebViewSettings
()
{
WebSettings
webSetting
=
this
.
getSettings
();
webSetting
.
setJavaScriptEnabled
(
true
);
webSetting
.
setJavaScriptCanOpenWindowsAutomatically
(
true
);
webSetting
.
setAllowFileAccess
(
true
);
//webSetting.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
webSetting
.
setSupportZoom
(
true
);
webSetting
.
setBuiltInZoomControls
(
true
);
webSetting
.
setUseWideViewPort
(
true
);
//禁止多窗口
webSetting
.
setSupportMultipleWindows
(
false
);
// webSetting.setLoadWithOverviewMode(true);
webSetting
.
setAppCacheEnabled
(
true
);
// webSetting.setDatabaseEnabled(true);
webSetting
.
setDomStorageEnabled
(
true
);
webSetting
.
setGeolocationEnabled
(
true
);
webSetting
.
setAppCacheMaxSize
(
Long
.
MAX_VALUE
);
// webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
webSetting
.
setPluginState
(
WebSettings
.
PluginState
.
ON_DEMAND
);
// webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH);
webSetting
.
setCacheMode
(
WebSettings
.
LOAD_NO_CACHE
);
// this.getSettingsExtension().setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);//extension
// settings 的设计
webSetting
.
setSaveFormData
(
true
);
webSetting
.
setDatabaseEnabled
(
true
);
webSetting
.
setJavaScriptCanOpenWindowsAutomatically
(
true
);
setScrollBarStyle
(
WebView
.
SCROLLBARS_OUTSIDE_OVERLAY
);
setHorizontalScrollBarEnabled
(
false
);
webSetting
.
setAllowContentAccess
(
true
);
webSetting
.
setMixedContentMode
(
WebSettings
.
LOAD_NORMAL
);
}
@Override
protected
boolean
drawChild
(
Canvas
canvas
,
View
child
,
long
drawingTime
)
{
/*boolean ret = super.drawChild(canvas, child, drawingTime);
canvas.save();
Paint paint = new Paint();
paint.setColor(0x7fff0000);
paint.setTextSize(24.f);
paint.setAntiAlias(true);
if (getX5WebViewExtension() != null) {
canvas.drawText(this.getContext().getPackageName() + "-pid:"
+ android.os.Process.myPid(), 10, 50, paint);
canvas.drawText(
"X5 Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
100, paint);
} else {
canvas.drawText(this.getContext().getPackageName() + "-pid:"
+ android.os.Process.myPid(), 10, 50, paint);
canvas.drawText("Sys Core", 10, 100, paint);
}
canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
canvas.drawText(Build.MODEL, 10, 200, paint);
canvas.restore();
return ret;*/
return
super
.
drawChild
(
canvas
,
child
,
drawingTime
);
}
public
X5WebView
(
Context
arg0
)
{
super
(
arg0
);
setBackgroundColor
(
85621
);
}
}
mobile/src/core/java/cn/garymb/ygomobile/ui/plus/XWebView.java
deleted
100644 → 0
View file @
352c051d
package
cn.garymb.ygomobile.ui.plus
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.webkit.CookieManager
;
import
android.webkit.CookieSyncManager
;
import
android.webkit.DownloadListener
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
public
class
XWebView
extends
WebView
{
private
Context
context
;
public
XWebView
(
Context
context
)
{
this
(
context
,
null
);
}
public
XWebView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
this
.
context
=
context
;
init
(
context
);
}
public
XWebView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
this
(
context
,
attrs
);
}
private
void
init
(
Context
context
)
{
getSettings
().
setJavaScriptEnabled
(
true
);
getSettings
().
setLoadsImagesAutomatically
(
true
);
getSettings
().
setUseWideViewPort
(
true
);
getSettings
().
setLoadWithOverviewMode
(
true
);
getSettings
().
setSupportZoom
(
true
);
getSettings
().
setDisplayZoomControls
(
false
);
getSettings
().
setBuiltInZoomControls
(
true
);
getSettings
().
setSupportMultipleWindows
(
false
);
getSettings
().
setEnableSmoothTransition
(
true
);
getSettings
().
setJavaScriptCanOpenWindowsAutomatically
(
true
);
setScrollBarStyle
(
WebView
.
SCROLLBARS_OUTSIDE_OVERLAY
);
}
public
void
enableHtml5
()
{
getSettings
().
setGeolocationEnabled
(
true
);
getSettings
().
setPluginState
(
WebSettings
.
PluginState
.
ON_DEMAND
);
getSettings
().
setSaveFormData
(
true
);
getSettings
().
setSavePassword
(
true
);
// HTML5 API flags
getSettings
().
setAppCacheEnabled
(
true
);
getSettings
().
setDatabaseEnabled
(
true
);
getSettings
().
setDomStorageEnabled
(
true
);
// HTML5 configuration settings.
getSettings
().
setAppCacheMaxSize
(
Long
.
MAX_VALUE
);
getSettings
().
setAppCachePath
(
context
.
getDir
(
"appcache"
,
Context
.
MODE_PRIVATE
).
getPath
());
getSettings
().
setDatabasePath
(
context
.
getDir
(
"databases"
,
Context
.
MODE_PRIVATE
).
getPath
());
getSettings
().
setGeolocationDatabasePath
(
context
.
getDir
(
"geolocation"
,
0
).
getPath
());
//
getSettings
().
setJavaScriptCanOpenWindowsAutomatically
(
true
);
setScrollBarStyle
(
WebView
.
SCROLLBARS_OUTSIDE_OVERLAY
);
setHorizontalScrollBarEnabled
(
false
);
setHorizontalScrollbarOverlay
(
true
);
getSettings
().
setAllowContentAccess
(
true
);
getSettings
().
setAllowFileAccess
(
true
);
CookieSyncManager
.
createInstance
(
context
);
CookieManager
.
getInstance
().
setAcceptCookie
(
true
);
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
{
CookieManager
.
getInstance
().
setAcceptThirdPartyCookies
(
this
,
true
);
getSettings
().
setMixedContentMode
(
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
);
}
setDownloadListener
(
new
DownloadListener
()
{
@Override
public
void
onDownloadStart
(
String
url
,
String
userAgent
,
String
contentDisposition
,
String
mimetype
,
long
contentLength
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url
));
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
try
{
context
.
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
});
setWebViewClient
(
new
DefWebViewClient
());
}
public
void
onDestroy
()
{
super
.
destroy
();
}
public
void
onShow
()
{
super
.
onResume
();
}
public
void
onHide
()
{
super
.
onPause
();
}
}
mobile/src/main/java/cn/garymb/ygomobile/loader/CardSearchInfo.java
View file @
f82a88c5
...
...
@@ -133,6 +133,15 @@ class CardSearchInfo {
}
}
if
(
types
.
length
==
2
){
if
(
types
[
0
]
==
types
[
1
]){
long
type
=
types
[
0
];
if
((
card
.
Type
&
type
)
!=
type
)
{
return
false
;
}
}
}
for
(
long
type
:
types
)
{
if
(
type
>
0
)
{
if
(
st
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
View file @
f82a88c5
...
...
@@ -69,7 +69,7 @@ public class CardSearcher implements View.OnClickListener {
protected
LimitManager
mLimitManager
;
protected
AppsSettings
mSettings
;
final
String
[]
BtnVals
=
new
String
[
8
];
final
String
[]
BtnVals
=
new
String
[
9
];
int
lineKey
;
public
CardSearcher
(
View
view
,
ICardLoader
dataLoader
)
{
...
...
@@ -141,6 +141,28 @@ public class CardSearcher implements View.OnClickListener {
R
.
id
.
button_8
,
R
.
id
.
button_9
,
};
int
[]
enImgs
=
new
int
[]{
R
.
drawable
.
left_bottom_1
,
R
.
drawable
.
bottom_1
,
R
.
drawable
.
right_bottom_1
,
R
.
drawable
.
left_1
,
0
,
R
.
drawable
.
right_1
,
R
.
drawable
.
left_top_1
,
R
.
drawable
.
top_1
,
R
.
drawable
.
right_top_1
,
};
int
[]
disImgs
=
new
int
[]{
R
.
drawable
.
left_bottom_0
,
R
.
drawable
.
bottom_0
,
R
.
drawable
.
right_bottom_0
,
R
.
drawable
.
left_0
,
0
,
R
.
drawable
.
right_0
,
R
.
drawable
.
left_top_0
,
R
.
drawable
.
top_0
,
R
.
drawable
.
right_top_0
,
};
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
final
int
index
=
i
;
viewDialog
.
findViewById
(
ids
[
index
]).
setOnClickListener
((
btn
)
->
{
...
...
@@ -148,13 +170,15 @@ public class CardSearcher implements View.OnClickListener {
String
mLinkStr
=
BtnVals
[
8
]
+
BtnVals
[
7
]
+
BtnVals
[
6
]
+
BtnVals
[
5
]
+
"0"
+
BtnVals
[
3
]
+
BtnVals
[
2
]
+
BtnVals
[
1
]
+
BtnVals
[
0
];
lineKey
=
Integer
.
parseInt
(
mLinkStr
,
2
);
builder
.
dismiss
();
if
(
builder
.
isShowing
())
{
builder
.
dismiss
();
}
}
else
{
if
(
"0"
.
equals
(
BtnVals
[
index
]))
{
btn
.
setBackgroundResource
(
R
.
drawable
.
left_bottom_1
);
btn
.
setBackgroundResource
(
enImgs
[
index
]
);
BtnVals
[
index
]
=
"1"
;
}
else
{
btn
.
setBackgroundResource
(
R
.
drawable
.
left_bottom_0
);
btn
.
setBackgroundResource
(
disImgs
[
index
]
);
BtnVals
[
index
]
=
"0"
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
f82a88c5
...
...
@@ -328,7 +328,11 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
public
void
checkWindbot
()
{
Log
.
i
(
"路径"
,
mContext
.
getFilesDir
().
getPath
());
Log
.
i
(
"路径2"
,
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
);
WindBot
.
initAndroid
(
mContext
.
getFilesDir
().
getPath
(),
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
);
try
{
WindBot
.
initAndroid
(
mContext
.
getFilesDir
().
getPath
(),
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
);
}
catch
(
Throwable
e
){
e
.
printStackTrace
();
}
ResCheckTask
.
MessageReceiver
mReceiver
=
new
ResCheckTask
.
MessageReceiver
();
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
"RUN_WINDBOT"
);
...
...
@@ -346,8 +350,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
}
}
;
Handler
han
=
new
Handler
()
{
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment