From 60d5bb768ca9cb50561d6f85b549342fd9eb1f65 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Sun, 27 Jun 2021 20:54:55 +0800 Subject: [PATCH] fix bug --- .idea/caches/build_file_checksums.ser | Bin 0 -> 585 bytes .../kongzue/dialogx/style/MaterialStyle.java | 2 +- .../BottomDialogTouchEventInterceptor.java | 5 +- .../myreader/ui/activity/ReadActivity.java | 5 +- .../myreader/ui/dialog/CopyContentDialog.java | 60 ------------------ .../myreader/ui/dialog/MyAlertDialog.java | 11 ++++ .../fycz/myreader/widget/page/PageLoader.java | 2 +- .../main/res/layout/dialog_copy_content.xml | 16 ----- 8 files changed, 20 insertions(+), 81 deletions(-) create mode 100644 .idea/caches/build_file_checksums.ser delete mode 100644 app/src/main/java/xyz/fycz/myreader/ui/dialog/CopyContentDialog.java delete mode 100644 app/src/main/res/layout/dialog_copy_content.xml diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000000000000000000000000000000000000..f91cdfc49b06ac1995bfa56ac62b82223d703ca3 GIT binary patch literal 585 zcmZ4UmVvdnh`~NNKUXg?FQq6yGexf?KR>5fFEb@IQ7^qHF(oHeub?PDD>b=9F91S2 zm1gFoxMk*~I%lLNXBU^|7Q2L-Ts|(GuF1r}nf0c10SK=O;~lkaUMu4O+hGCKX^#l;c^ z5tq!woc#0%{UngTVY&+$>KNES8aB*-xA1<6`uC#;mDa8BU|mtdz=K_(=@gr9bGJqH zyb3sXMB&ZvIVB7NIr+(nIiTPzNG&SKOf4>jn_4b$sW)AT>-pC3aOtKb*M%hv>iQY^ zxvBbTsd?#@rK$Q*cjzOc2*ZpkvOPEZ88)%JY~Y;n=7&>V34 - * 自由复制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(R.layout.dialog_textview) { + @Override + public void onBind(BottomDialog dialog, View v) { + TextView view = (TextView) v; + view.setText(msg); + view.setMovementMethod(LinkMovementMethod.getInstance()); + } + }).setCancelButton("取消"); + } + public static void showPrivacyDialog(Context context, DialogInterface.OnClickListener pos, DialogInterface.OnClickListener neg) { TextView view = (TextView) LayoutInflater.from(context).inflate(R.layout.dialog_textview, null); String msg = context.getString(R.string.privacy_tip); diff --git a/app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java b/app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java index c78a20d..fd2f0e9 100644 --- a/app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java +++ b/app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java @@ -2017,7 +2017,7 @@ public abstract class PageLoader { * @param page 开始页数 * @return 从page页开始的的当前章节所有内容 */ - private String getContentStartPage(int page) { + public String getContentStartPage(int page) { if (mCurChapter == null) return null; if (mCurChapter.getTxtPageList().isEmpty()) return null; StringBuilder s = new StringBuilder(); diff --git a/app/src/main/res/layout/dialog_copy_content.xml b/app/src/main/res/layout/dialog_copy_content.xml deleted file mode 100644 index 07ce353..0000000 --- a/app/src/main/res/layout/dialog_copy_content.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - -