From 6f2b8d59b0ace37ac57eb93a5a7d59532ef60b65 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 14 Feb 2020 18:40:23 +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 --- .../book/source/manage/BookSourceActivity.kt | 4 ++-- .../app/ui/main/bookshelf/BookshelfFragment.kt | 4 ++-- .../app/ui/replacerule/ReplaceRuleActivity.kt | 4 ++-- .../ui/rss/source/manage/RssSourceActivity.kt | 4 ++-- .../widget/text/AccentBgTextView.kt} | 8 ++++---- .../widget/text/AccentStrokeTextView.kt} | 4 ++-- .../widget/text/AutoCompleteTextView.kt} | 4 ++-- .../app/ui/widget/{ => text}/BadgeView.kt | 2 +- app/src/main/res/layout/activity_book_info.xml | 18 +++++++++--------- app/src/main/res/layout/dialog_edit_text.xml | 2 +- .../main/res/layout/item_bookshelf_grid.xml | 4 ++-- .../main/res/layout/item_bookshelf_list.xml | 2 +- app/src/main/res/layout/item_import_book.xml | 4 ++-- app/src/main/res/layout/item_search.xml | 14 +++++++------- .../main/res/layout/view_select_action_bar.xml | 4 ++-- app/src/main/res/values/attrs.xml | 4 ++-- 16 files changed, 43 insertions(+), 43 deletions(-) rename app/src/main/java/io/legado/app/{lib/theme/view/ATEAccentBgTextView.kt => ui/widget/text/AccentBgTextView.kt} (76%) rename app/src/main/java/io/legado/app/{lib/theme/view/ATEAccentStrokeTextView.kt => ui/widget/text/AccentStrokeTextView.kt} (89%) rename app/src/main/java/io/legado/app/{lib/theme/view/ATEAutoCompleteTextView.kt => ui/widget/text/AutoCompleteTextView.kt} (95%) rename app/src/main/java/io/legado/app/ui/widget/{ => text}/BadgeView.kt (99%) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index b866c9865..128e4d9ca 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -25,12 +25,12 @@ import io.legado.app.help.permission.PermissionsCompat import io.legado.app.lib.dialogs.* import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor -import io.legado.app.lib.theme.view.ATEAutoCompleteTextView import io.legado.app.service.help.CheckSource import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.ui.widget.SelectActionBar +import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_book_source.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* @@ -208,7 +208,7 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity ?.splitNotBlank(",") ?.toMutableList() ?: mutableListOf() alert(titleResource = R.string.import_book_source_on_line) { - var editText: ATEAutoCompleteTextView? = null + var editText: AutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { editText = edit_view diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 66321596d..16b7b286f 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -20,12 +20,12 @@ import io.legado.app.data.entities.BookGroup import io.legado.app.lib.dialogs.* import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor -import io.legado.app.lib.theme.view.ATEAutoCompleteTextView import io.legado.app.ui.book.arrange.ArrangeBookActivity import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.download.DownloadActivity import io.legado.app.ui.importbook.ImportBookActivity +import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.fragment_bookshelf.* @@ -159,7 +159,7 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b private fun addBookByUrl() { requireContext() .alert(titleResource = R.string.add_book_url) { - var editText: ATEAutoCompleteTextView? = null + var editText: AutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { editText = edit_view diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt index f4f46c31d..f4bf1774d 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt @@ -25,10 +25,10 @@ import io.legado.app.help.permission.PermissionsCompat import io.legado.app.lib.dialogs.* import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor -import io.legado.app.lib.theme.view.ATEAutoCompleteTextView import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.replacerule.edit.ReplaceEditDialog import io.legado.app.ui.widget.SelectActionBar +import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_replace_rule.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* @@ -189,7 +189,7 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi ?.splitNotBlank(",") ?.toMutableList() ?: mutableListOf() alert(titleResource = R.string.import_replace_rule_on_line) { - var editText: ATEAutoCompleteTextView? = null + var editText: AutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { editText = edit_view diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 7de721d63..381cbb199 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -25,11 +25,11 @@ import io.legado.app.help.permission.PermissionsCompat import io.legado.app.lib.dialogs.* import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.primaryTextColor -import io.legado.app.lib.theme.view.ATEAutoCompleteTextView import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.ui.rss.source.edit.RssSourceEditActivity import io.legado.app.ui.widget.SelectActionBar +import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_rss_source.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* @@ -204,7 +204,7 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r ?.splitNotBlank(",") ?.toMutableList() ?: mutableListOf() alert(titleResource = R.string.import_book_source_on_line) { - var editText: ATEAutoCompleteTextView? = null + var editText: AutoCompleteTextView? = null customView { layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { editText = edit_view diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentBgTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt similarity index 76% rename from app/src/main/java/io/legado/app/lib/theme/view/ATEAccentBgTextView.kt rename to app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt index fe1f0b0ea..58c914143 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentBgTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/AccentBgTextView.kt @@ -1,4 +1,4 @@ -package io.legado.app.lib.theme.view +package io.legado.app.ui.widget.text import android.content.Context import android.graphics.Color @@ -9,13 +9,13 @@ import io.legado.app.lib.theme.ColorUtils import io.legado.app.lib.theme.Selector import io.legado.app.lib.theme.ThemeStore -class ATEAccentBgTextView(context: Context, attrs: AttributeSet) : +class AccentBgTextView(context: Context, attrs: AttributeSet) : AppCompatTextView(context, attrs) { init { - val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ATEAccentBgTextView) + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.AccentBgTextView) val radios = - typedArray.getDimensionPixelOffset(R.styleable.ATEAccentBgTextView_abt_radius, 0) + typedArray.getDimensionPixelOffset(R.styleable.AccentBgTextView_bg_radius, 0) typedArray.recycle() background = Selector.shapeBuild() .setCornerRadius(radios) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/AccentStrokeTextView.kt similarity index 89% rename from app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt rename to app/src/main/java/io/legado/app/ui/widget/text/AccentStrokeTextView.kt index 355ed65a6..37b18051a 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/AccentStrokeTextView.kt @@ -1,4 +1,4 @@ -package io.legado.app.lib.theme.view +package io.legado.app.ui.widget.text import android.content.Context import android.util.AttributeSet @@ -9,7 +9,7 @@ import io.legado.app.lib.theme.ThemeStore import io.legado.app.utils.dp import io.legado.app.utils.getCompatColor -class ATEAccentStrokeTextView(context: Context, attrs: AttributeSet) : +class AccentStrokeTextView(context: Context, attrs: AttributeSet) : AppCompatTextView(context, attrs) { init { diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt b/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt similarity index 95% rename from app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt rename to app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt index ae7dec6e0..ac0a5a8ac 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/AutoCompleteTextView.kt @@ -1,4 +1,4 @@ -package io.legado.app.lib.theme.view +package io.legado.app.ui.widget.text import android.annotation.SuppressLint import android.content.Context @@ -17,7 +17,7 @@ import kotlinx.android.synthetic.main.item_1line_text_and_del.view.* import org.jetbrains.anko.sdk27.listeners.onClick -class ATEAutoCompleteTextView : AppCompatAutoCompleteTextView { +class AutoCompleteTextView : AppCompatAutoCompleteTextView { constructor(context: Context) : super(context) diff --git a/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt similarity index 99% rename from app/src/main/java/io/legado/app/ui/widget/BadgeView.kt rename to app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt index 3f1572164..bcade49c7 100644 --- a/app/src/main/java/io/legado/app/ui/widget/BadgeView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt @@ -1,4 +1,4 @@ -package io.legado.app.ui.widget +package io.legado.app.ui.widget.text import android.content.Context import android.graphics.Color diff --git a/app/src/main/res/layout/activity_book_info.xml b/app/src/main/res/layout/activity_book_info.xml index fbda498b4..727e29ae9 100644 --- a/app/src/main/res/layout/activity_book_info.xml +++ b/app/src/main/res/layout/activity_book_info.xml @@ -87,7 +87,7 @@ android:textColor="@color/md_white_1000" tools:ignore="NestedWeights" /> - + app:bg_radius="2dp" /> @@ -108,7 +108,7 @@ android:orientation="horizontal" android:visibility="gone"> - + app:bg_radius="2dp" /> - + app:bg_radius="2dp" /> - + app:bg_radius="2dp" /> @@ -253,7 +253,7 @@ android:textColor="@color/tv_text_default" android:textSize="15sp" /> - - - - - - - - + app:bg_radius="2dp" /> - + app:bg_radius="2dp" /> - + app:bg_radius="2dp" /> diff --git a/app/src/main/res/layout/view_select_action_bar.xml b/app/src/main/res/layout/view_select_action_bar.xml index c9a8b0e21..97d775dc3 100644 --- a/app/src/main/res/layout/view_select_action_bar.xml +++ b/app/src/main/res/layout/view_select_action_bar.xml @@ -20,7 +20,7 @@ android:text="@string/select_all_count" android:textColor="@color/tv_text_default" /> - - - - + +