From dbdc079141b0fa0c9eea4d7b5f5f5f7811f3690c Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Mar 2020 22:16:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/info/BookInfoActivity.kt | 9 +++++---- app/src/main/res/layout/dialog_linear_layout.xml | 8 -------- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 app/src/main/res/layout/dialog_linear_layout.xml diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index b0fb383bb..bd9b3700f 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -5,7 +5,6 @@ import android.app.Activity import android.content.Intent import android.graphics.drawable.Drawable import android.os.Bundle -import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem import android.widget.CheckBox @@ -33,6 +32,7 @@ import io.legado.app.ui.book.info.edit.BookInfoEditActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity +import io.legado.app.utils.dp import io.legado.app.utils.getViewModel import io.legado.app.utils.gone import io.legado.app.utils.visible @@ -244,9 +244,10 @@ class BookInfoActivity : val checkBox = CheckBox(this@BookInfoActivity).apply { setText(R.string.delete_book_file) } - val view = LayoutInflater.from(this@BookInfoActivity) - .inflate(R.layout.dialog_linear_layout, null) - (view as LinearLayout).addView(checkBox) + val view = LinearLayout(this@BookInfoActivity).apply { + setPadding(16.dp, 0, 16.dp, 0) + addView(checkBox) + } customView = view positiveButton(R.string.yes) { viewModel.delBook(checkBox.isChecked) { diff --git a/app/src/main/res/layout/dialog_linear_layout.xml b/app/src/main/res/layout/dialog_linear_layout.xml deleted file mode 100644 index 2f73f4bc3..000000000 --- a/app/src/main/res/layout/dialog_linear_layout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file