新增私密书架

pull/5/head
fengyuecanzhu 4 years ago
parent 9ffec429a7
commit 2bdb5f362f
  1. 4
      app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
  2. 6
      app/src/main/java/xyz/fycz/myreader/ui/fragment/WebDavFragment.java

@ -89,7 +89,9 @@ public class MyAlertDialog {
imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED); imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
}) })
.setNegativeButton("取消", (dialog, which) -> { .setNegativeButton("取消", (dialog, which) -> {
negListener.onClick(dialog, which); if (negListener != null) {
negListener.onClick(dialog, which);
}
imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED); imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
}) })
.show(); .show();

@ -84,13 +84,17 @@ public class WebDavFragment extends BaseFragment {
llWebdavUrl.setOnClickListener(v -> { llWebdavUrl.setOnClickListener(v -> {
MyAlertDialog.createInputDia(getContext(), getString(R.string.webdav_url), MyAlertDialog.createInputDia(getContext(), getString(R.string.webdav_url),
"", webdavUrl.equals(APPCONST.DEFAULT_WEB_DAV_URL) ? "", webdavUrl.equals(APPCONST.DEFAULT_WEB_DAV_URL) ?
"" : webdavUrl, true, 100, "" : webdavUrl, InputType.TYPE_CLASS_TEXT,true, 100,
text -> webdavTexts[0] = text, text -> webdavTexts[0] = text,
(dialog, which) -> { (dialog, which) -> {
webdavUrl = webdavTexts[0]; webdavUrl = webdavTexts[0];
tvWebdavUrl.setText(webdavUrl); tvWebdavUrl.setText(webdavUrl);
SharedPreUtils.getInstance().putString("webdavUrl", webdavUrl); SharedPreUtils.getInstance().putString("webdavUrl", webdavUrl);
dialog.dismiss(); dialog.dismiss();
}, null, "恢复默认", (dialog, which) -> {
webdavUrl = APPCONST.DEFAULT_WEB_DAV_URL;
tvWebdavUrl.setText(webdavUrl);
SharedPreUtils.getInstance().putString("webdavUrl", webdavUrl);
}); });
}); });
llWebdavAccount.setOnClickListener(v -> { llWebdavAccount.setOnClickListener(v -> {

Loading…
Cancel
Save