Commit f6ae818f authored by feihuaduo's avatar feihuaduo

WebView支持YGO-DA协议中的卡组协议

parent a6cfb339
...@@ -105,7 +105,7 @@ dependencies { ...@@ -105,7 +105,7 @@ dependencies {
implementation 'com.nightonke:boommenu:2.1.0' implementation 'com.nightonke:boommenu:2.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
//dialog库 //dialog库
implementation 'com.github.feihuaduo:DialogUtils:1.8.9.23' implementation 'com.github.feihuaduo:DialogUtils:1.8.9.31'
//recyclerview的adapter库 //recyclerview的adapter库
implementation 'io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14' implementation 'io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14'
implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.appcompat:appcompat:1.7.0'
......
...@@ -79,7 +79,12 @@ public class Deck implements Parcelable { ...@@ -79,7 +79,12 @@ public class Deck implements Parcelable {
public Uri toUri() { public Uri toUri() {
Map<String,String> map=new HashMap<>(); Map<String,String> map=new HashMap<>();
map.put(Constants.QUERY_NAME, name); String deckName = name;
int ydkIndex = deckName.indexOf(YDK_FILE_EX);
if (ydkIndex != -1) {
deckName = deckName.substring(0, ydkIndex);
}
map.put(Constants.QUERY_NAME, deckName);
return YGODAUtil.toUri(mainlist,extraList,sideList,map); return YGODAUtil.toUri(mainlist,extraList,sideList,map);
} }
......
package cn.garymb.ygomobile.ui.plus; package cn.garymb.ygomobile.ui.plus;
import com.ourygo.lib.duelassistant.util.DARecord;
import com.ourygo.lib.duelassistant.util.DuelAssistantManagement;
import com.tencent.smtt.sdk.WebView; import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient; import com.tencent.smtt.sdk.WebViewClient;
public class DefWebViewClient extends WebViewClient { public class DefWebViewClient extends WebViewClient {
private static final int CHECK_ID_WEB_VIEW = 100;
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith(DARecord.DECK_URL_PREFIX)) {
DuelAssistantManagement.getInstance().deckCheck(url, CHECK_ID_WEB_VIEW);
return true;
}
return false; return false;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment