Merge pull request #4 from yehunxin/yehunxin

fix bug
pull/5/head
fengyuecanzhu 3 years ago committed by GitHub
commit 6ba063f78b
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 2
      .idea/gradle.xml
  3. 10
      .idea/runConfigurations.xml
  4. BIN
      DialogX/libs/DialogXInterface.jar
  5. 47
      app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
  6. 2
      app/src/main/java/xyz/fycz/myreader/ui/presenter/CatalogPresenter.java
  7. 78
      app/src/test/java/File1.java
  8. 15
      app/src/test/java/Test.java
  9. 2
      app/version_code.properties

@ -7,7 +7,6 @@
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
@ -16,6 +15,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

Binary file not shown.

@ -6,7 +6,9 @@ import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.text.Editable;
import android.text.InputType;
import android.text.SpannableString;
@ -40,6 +42,9 @@ import com.kongzue.dialogx.dialogs.FullScreenDialog;
import com.kongzue.dialogx.interfaces.OnBackPressedListener;
import com.kongzue.dialogx.interfaces.OnBindView;
import java.net.URISyntaxException;
import java.util.List;
import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.common.APPCONST;
@ -380,8 +385,46 @@ public class MyAlertDialog {
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
try {
//url
if (url.startsWith("intent://")) {
Intent intent;
try {
intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
intent.addCategory("android.intent.category.BROWSABLE");
intent.setComponent(null);
intent.setSelector(null);
List<ResolveInfo> resolves = context.getPackageManager().queryIntentActivities(intent,0);
if(resolves.size()>0){
context.startActivity(intent);
}
return true;
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
// 处理自定义scheme协议
if (!url.startsWith("http")) {
try {
// 以下固定写法
final Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(intent);
} catch (Exception e) {
// 防止没有安装的情况
e.printStackTrace();
ToastUtils.showError("您所打开的第三方App未安装!");
}
return true;
}
view.loadUrl(url);
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
});

@ -58,7 +58,7 @@ public class CatalogPresenter implements BasePresenter {
changeChapterSort();
}
});
mChapters = (ArrayList<Chapter>) mChapterService.findBookAllChapterByBookId(mBook.getId());
mChapters = mChapterService.findBookAllChapterByBookId(mBook.getId());
if (mChapters.size() != 0) {
initChapterTitleList();
}else {

@ -1,78 +0,0 @@
/**
* @author fengyue
* @date 2021/5/8 18:49
*/
public class File1 {
private String icon;
private int t;
private String id;
private String name_all;
private String size;
private String time;
private String duan;
private int p_ico;
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public int getT() {
return t;
}
public void setT(int t) {
this.t = t;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName_all() {
return name_all;
}
public void setName_all(String name_all) {
this.name_all = name_all;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getDuan() {
return duan;
}
public void setDuan(String duan) {
this.duan = duan;
}
public int getP_ico() {
return p_ico;
}
public void setP_ico(int p_ico) {
this.p_ico = p_ico;
}
}

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
#Tue Jun 15 20:58:21 CST 2021
#Fri Jun 18 21:45:31 CST 2021
VERSION_CODE=213

Loading…
Cancel
Save