diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000..f91cdfc Binary files /dev/null and b/.idea/caches/build_file_checksums.ser differ diff --git a/DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java b/DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java index d7936ce..5a4ef66 100644 --- a/DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java +++ b/DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java @@ -141,7 +141,7 @@ public class MaterialStyle implements DialogXStyle { @Override public boolean touchSlide() { - return true; + return false; } @Override diff --git a/DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java b/DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java index 1ce5f56..8025e3f 100644 --- a/DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java +++ b/DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java @@ -1,6 +1,7 @@ package com.kongzue.dialogx.util; import android.animation.ObjectAnimator; +import android.annotation.SuppressLint; import android.content.res.Resources; import android.util.Log; import android.view.MotionEvent; @@ -42,7 +43,8 @@ public class BottomDialogTouchEventInterceptor { public BottomDialogTouchEventInterceptor(BottomDialog me, BottomDialog.DialogImpl impl) { refresh(me, impl); } - + + @SuppressLint("ClickableViewAccessibility") public void refresh(final BottomDialog me, final BottomDialog.DialogImpl impl) { if (me == null || impl == null || impl.bkg == null || impl.scrollView == null) { return; @@ -62,6 +64,7 @@ public class BottomDialogTouchEventInterceptor { */ if (me.isAllowInterceptTouch()) { impl.bkg.setOnTouchListener(new View.OnTouchListener() { + @Override public boolean onTouch(View v, MotionEvent event) { //这里 return 什么实际上无关紧要,重点在于 MaxRelativeLayout.java(dispatchTouchEvent:184) 的事件分发会独立触发此处的额外滑动事件 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index f736b91..5c6e9b9 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -81,8 +81,8 @@ import xyz.fycz.myreader.model.audio.ReadAloudService; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.storage.Backup; import xyz.fycz.myreader.ui.dialog.AudioPlayerDialog; -import xyz.fycz.myreader.ui.dialog.CopyContentDialog; import xyz.fycz.myreader.ui.dialog.DialogCreator; +import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.ReplaceDialog; import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog; import xyz.fycz.myreader.ui.popmenu.AutoPageMenu; @@ -759,7 +759,8 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe Intent ruleIntent = new Intent(this, ReplaceRuleActivity.class); startActivityForResult(ruleIntent, APPCONST.REQUEST_REFRESH_READ_UI); } else if (itemId == R.id.action_copy_content) { - new CopyContentDialog(this, mPageLoader.getContent()).show(); + String content = mPageLoader.getContentStartPage(0); + MyAlertDialog.showTipDialogWithLink(this, "拷贝内容", content == null ? "章节内容为空!" : content); } else if (itemId == R.id.action_open_link) { Uri uri = Uri.parse(NetworkUtils.getAbsoluteURL(mReadCrawler.getNameSpace(), mBook.getChapterUrl())); Intent intent = new Intent(Intent.ACTION_VIEW, uri); diff --git a/app/src/main/java/xyz/fycz/myreader/ui/dialog/CopyContentDialog.java b/app/src/main/java/xyz/fycz/myreader/ui/dialog/CopyContentDialog.java deleted file mode 100644 index 1cdfda5..0000000 --- a/app/src/main/java/xyz/fycz/myreader/ui/dialog/CopyContentDialog.java +++ /dev/null @@ -1,60 +0,0 @@ -package xyz.fycz.myreader.ui.dialog; - -import android.app.Dialog; -import android.content.Context; -import android.os.Bundle; -import android.view.Gravity; -import android.view.Window; -import android.view.WindowManager; - -import androidx.annotation.NonNull; - -import xyz.fycz.myreader.databinding.DialogCopyContentBinding; - -/** - * Created by Zhouas666 on 2019-04-14 - * Github: https://github.com/zas023 - *
- * 自由复制dialog
- */
-
-public class CopyContentDialog extends Dialog {
-
- private static final String TAG = "CopyContentDialog";
-
- private DialogCopyContentBinding binding;
-
- private String content;
-
- /***************************************************************************/
-
- public CopyContentDialog(@NonNull Context context, String content) {
- super(context);
- this.content = content;
- }
-
- /*****************************Initialization********************************/
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- binding = DialogCopyContentBinding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
-
- setUpWindow();
-
- binding.dialogTvContent.setText(content);
- }
-
- /**
- * 设置Dialog显示的位置
- */
- private void setUpWindow() {
- Window window = getWindow();
- WindowManager.LayoutParams lp = window.getAttributes();
- lp.width = WindowManager.LayoutParams.MATCH_PARENT;
- lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
- lp.gravity = Gravity.CENTER;
- window.setAttributes(lp);
- }
-
-}
diff --git a/app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java b/app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
index 258b6bc..2bcd798 100644
--- a/app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
+++ b/app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
@@ -325,6 +325,17 @@ public class MyAlertDialog {
}).setCancelButton("知道了");
}
+ public static void showTipDialogWithLink(Context context, String title, String msg){
+ BottomDialog.show(title, new OnBindView