From 8b4f4bca2ac707f70140a620816c75ca5e1bcdbc Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 15 Nov 2019 20:38:22 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/read/config/PageKeyDialog.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt index 74933fef6..28a46b7f2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PageKeyDialog.kt @@ -5,6 +5,7 @@ import android.content.Context import android.view.KeyEvent import io.legado.app.R import io.legado.app.constant.PreferKey +import io.legado.app.utils.getPrefInt import io.legado.app.utils.hideSoftInput import io.legado.app.utils.putPrefInt import kotlinx.android.synthetic.main.dialog_page_key.* @@ -15,6 +16,8 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi init { setContentView(R.layout.dialog_page_key) + et_prev.setText(context.getPrefInt(PreferKey.prevKey).toString()) + et_next.setText(context.getPrefInt(PreferKey.nextKey).toString()) tv_ok.onClick { et_prev.text?.let { context.putPrefInt(PreferKey.prevKey, it.toString().toInt()) @@ -33,6 +36,7 @@ class PageKeyDialog(context: Context) : Dialog(context, R.style.AppTheme_AlertDi } else if (et_next.hasFocus()) { et_next.setText(keyCode.toString()) } + return true } return super.onKeyDown(keyCode, event) }