diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index a36d6b9..9f5a09b 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/src/main/java/xyz/fycz/myreader/common/URLCONST.java b/app/src/main/java/xyz/fycz/myreader/common/URLCONST.java index 97d3d41..7fa4cbe 100644 --- a/app/src/main/java/xyz/fycz/myreader/common/URLCONST.java +++ b/app/src/main/java/xyz/fycz/myreader/common/URLCONST.java @@ -5,27 +5,8 @@ public class URLCONST { // 命名空间 public static String nameSpace_FY = "https://novel.fycz.xyz"; - public static String nameSpace_biquge = "https://www.52bqg.com/"; - - public static String nameSpace_qb5 = "https://www.qb5.tw"; - - public static String qidian_rank = "https://www.qidian.com/rank"; - - public static String nameSpace_system = "https://novel.fycz.xyz"; - public static boolean isRSA = false; - // 搜索小说 - public static String method_fengyue_search = "https://novel.fycz.xyz/search.html"; - - public static String method_buxiu_search = "https://www.23txt.com/search.php"; - - // 获取最新版本号 - public static String method_getCurAppVersion = nameSpace_system + "/mReaderController.do?getCurAppVersion"; - - // app下载 - public static String method_downloadApp = nameSpace_system + "/app/FYReader.apk"; - public static String APP_DIR_UR = "https://www.lanzous.com/b00ngso7e"; public static String LAN_ZOUS_URL = "https://fycz.lanzous.com"; diff --git a/app/src/main/java/xyz/fycz/myreader/ui/dialog/BookGroupDialog.java b/app/src/main/java/xyz/fycz/myreader/ui/dialog/BookGroupDialog.java index c6549c7..447318d 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/dialog/BookGroupDialog.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/dialog/BookGroupDialog.java @@ -114,7 +114,8 @@ public class BookGroupDialog { public void showAddOrRenameGroupDia(boolean isRename, boolean isAddGroup, int groupNum, OnGroup onGroup){ View view = LayoutInflater.from(mContext).inflate(R.layout.edit_dialog, null); TextInputLayout textInputLayout = view.findViewById(R.id.text_input_lay); - textInputLayout.setCounterMaxLength(10); + int maxLen = 20; + textInputLayout.setCounterMaxLength(maxLen); EditText editText = textInputLayout.getEditText(); editText.setHint("请输入分组名"); BookGroup bookGroup = !isRename ? new BookGroup() : mBookGroups.get(groupNum); @@ -178,7 +179,7 @@ public class BookGroupDialog { @Override public void afterTextChanged(Editable s) { String text = editText.getText().toString(); - if (editText.getText().length() > 0 && editText.getText().length() <= 10 && !text.equals(oldName)) { + if (editText.getText().length() > 0 && editText.getText().length() <= maxLen && !text.equals(oldName)) { posBtn.setEnabled(true); } else { posBtn.setEnabled(false); diff --git a/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java index bcfd7ef..a8d4acb 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java @@ -281,26 +281,6 @@ public class BookcasePresenter implements BasePresenter { mBookcaseFragment.getmBtnAddGroup().performClick(); } }); - /*initBookGroups(true); - showSelectGroupDia((dialog, which) -> { - if (which < mBookGroups.size()) { - BookGroup bookGroup = mBookGroups.get(which); - ArrayList mSelectBooks = (ArrayList) mBookcaseAdapter.getSelectBooks(); - for (Book book : mSelectBooks) { - if (!bookGroup.getId().equals(book.getGroupId())) { - book.setGroupId(bookGroup.getId()); - book.setGroupSort(0); - } - } - mBookService.updateBooks(mSelectBooks); - ToastUtils.showSuccess("成功将《" + mSelectBooks.get(0).getName() + "》" - + (mSelectBooks.size() > 1 ? "等" : "") - + "加入[" + bookGroup.getName() + "]分组"); - init(); - } else if (which == mBookGroups.size()) { - showAddOrRenameGroupDia(false, true, 0); - } - });*/ }); } @@ -646,124 +626,6 @@ public class BookcasePresenter implements BasePresenter { }).show(); } - - /** - * 添加/重命名分组对话框 - */ - private void showAddOrRenameGroupDia(boolean isRename, boolean isAddGroup, int groupNum){ - View view = LayoutInflater.from(mMainActivity).inflate(R.layout.edit_dialog, null); - TextInputLayout textInputLayout = view.findViewById(R.id.text_input_lay); - textInputLayout.setCounterMaxLength(10); - EditText editText = textInputLayout.getEditText(); - editText.setHint("请输入分组名"); - BookGroup bookGroup = !isRename ? new BookGroup() : mBookGroups.get(groupNum); - String oldName = bookGroup.getName(); - if (isRename) { - editText.setText(oldName); - } - editText.requestFocus(); - InputMethodManager imm = (InputMethodManager) mMainActivity.getSystemService(Context.INPUT_METHOD_SERVICE); - mHandler.postDelayed(() ->{ - imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED); - }, 220); - AlertDialog newGroupDia = MyAlertDialog.build(mMainActivity) - .setTitle(!isRename ? "新建分组" : "重命名分组") - .setView(view) - .setCancelable(false) - .setPositiveButton("确认", null) - .setNegativeButton("取消", null) - .show(); - Button posBtn = newGroupDia.getButton(AlertDialog.BUTTON_POSITIVE); - posBtn.setEnabled(false); - posBtn.setOnClickListener(v1 -> { - CharSequence newGroupName = editText.getText().toString(); - for (CharSequence oldGroupName : mGroupNames){ - if (oldGroupName.equals(newGroupName)){ - ToastUtils.showWarring("分组[" + newGroupName + "]已存在,无法" + (!isRename ? "添加!" : "重命名!")); - return; - } - } - bookGroup.setName(newGroupName.toString()); - if (!isRename) { - mBookGroupService.addBookGroup(bookGroup); - }else { - mBookGroupService.updateEntity(bookGroup); - SharedPreUtils spu = SharedPreUtils.getInstance(); - if (spu.getString(mMainActivity.getString(R.string.curBookGroupName), "").equals(oldName)){ - spu.putString(mMainActivity.getString(R.string.curBookGroupName), newGroupName.toString()); - ogcl.onChange(); - } - } - ToastUtils.showSuccess("成功" + - (!isRename ? "添加分组[" : "成功将[" + oldName + "]重命名为[") - + bookGroup.getName() + "]"); - imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED); - newGroupDia.dismiss(); - if (isAddGroup){ - mBookcaseFragment.getmBtnAddGroup().performClick(); - } - }); - editText.addTextChangedListener(new TextWatcher() { - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - - } - - @Override - public void afterTextChanged(Editable s) { - String text = editText.getText().toString(); - if (editText.getText().length() > 0 && editText.getText().length() <= 10 && !text.equals(oldName)) { - posBtn.setEnabled(true); - } else { - posBtn.setEnabled(false); - } - } - }); - } - - /** - * 删除分组对话框 - */ - private void showDeleteGroupDia() { - boolean[] checkedItems = new boolean[mGroupNames.length]; - new MultiChoiceDialog().create(mMainActivity, "删除分组", mGroupNames - , checkedItems, 0, (dialog, which) -> { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < checkedItems.length; i++) { - if (checkedItems[i]) { - mBookGroupService.deleteEntity(mBookGroups.get(i)); - sb.append(mBookGroups.get(i).getName()).append("、"); - } - } - if (sb.length() > 0){ - sb.deleteCharAt(sb.lastIndexOf("、")); - } - SharedPreUtils spu = SharedPreUtils.getInstance(); - if (mBookGroupService.getGroupById(spu.getString(mMainActivity.getString(R.string.curBookGroupId), "")) == null){ - spu.putString(mMainActivity.getString(R.string.curBookGroupId), ""); - spu.putString(mMainActivity.getString(R.string.curBookGroupName), ""); - ogcl.onChange(); - init(); - } - ToastUtils.showSuccess("分组[" + sb.toString() + "]删除成功!"); - }, null, null); - } - - //显示选择书籍对话框 - private void showSelectGroupDia(DialogInterface.OnClickListener onClickListener){ - MyAlertDialog.build(mMainActivity) - .setTitle("选择分组") - .setItems(mGroupNames, onClickListener) - .setCancelable(false) - .setPositiveButton("取消", null) - .show(); - } - //分组切换监听器 public void addOnGroupChangeListener(MainActivity.OnGroupChangeListener ogcl){ this.ogcl = ogcl; diff --git a/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java b/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java index b48db7f..eadde6a 100644 --- a/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java +++ b/app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java @@ -233,9 +233,6 @@ public class CommonApi extends BaseApi { }); } - public static void getNewestAppVersion(final ResultCallback callback) { - getCommonReturnStringApi(URLCONST.method_getCurAppVersion, null, callback); - } /** * 通过api获取蓝奏云可下载直链 diff --git a/gradle.properties b/gradle.properties index 01ac58d..af6dcbe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,5 +16,4 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true android.useAndroidX=true -android.enableJetifier=true -android.overridePathCheck=true \ No newline at end of file +android.enableJetifier=true \ No newline at end of file