Merge pull request #209 from yangyxd/master

添加识别rss分组中的频道信息,在菜单中可以切换频道(与之前的sortUrls不冲突)
pull/219/head
kunfei 5 years ago committed by GitHub
commit 6a0b4fd1b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/src/main/java/io/legado/app/base/BaseFragment.kt
  2. 7
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  3. 6
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  4. 3
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  5. 10
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt
  6. 42
      app/src/main/java/io/legado/app/ui/rss/article/RssSortActivity.kt
  7. 12
      app/src/main/java/io/legado/app/ui/widget/prefs/Preference.kt
  8. 7
      app/src/main/java/io/legado/app/utils/MenuExtensions.kt
  9. 42
      app/src/main/java/io/legado/app/utils/UIUtils.kt
  10. 10
      app/src/main/res/drawable/ic_add.xml
  11. 16
      app/src/main/res/drawable/ic_add_online.xml
  12. 24
      app/src/main/res/drawable/ic_arrange.xml
  13. 14
      app/src/main/res/drawable/ic_download_line.xml
  14. 23
      app/src/main/res/drawable/ic_groups.xml
  15. 9
      app/src/main/res/drawable/ic_groups_menu.xml
  16. 15
      app/src/main/res/drawable/ic_more.xml
  17. 24
      app/src/main/res/drawable/ic_search.xml
  18. 28
      app/src/main/res/drawable/ic_view_quilt.xml
  19. 4
      app/src/main/res/layout/item_bookshelf_grid.xml
  20. 39
      app/src/main/res/layout/item_bookshelf_list.xml
  21. 4
      app/src/main/res/layout/item_rss.xml
  22. 8
      app/src/main/res/layout/view_preference.xml
  23. 2
      app/src/main/res/menu/main_bookshelf.xml
  24. 4
      app/src/main/res/menu/rss_articles.xml
  25. 2
      app/src/main/res/values-night/colors.xml
  26. 2
      app/src/main/res/values/colors.xml
  27. 9
      app/src/main/res/xml/pref_config_theme.xml
  28. 19
      app/src/main/res/xml/pref_main.xml

@ -6,7 +6,11 @@ import android.view.*
import androidx.appcompat.view.SupportMenuInflater
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.R
import io.legado.app.constant.Theme
import io.legado.app.utils.UIUtils
import io.legado.app.utils.applyTint
import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@ -52,6 +56,7 @@ abstract class BaseFragment(layoutID: Int) : Fragment(layoutID),
supportToolbar?.let {
it.menu.apply {
onCompatCreateOptionsMenu(this)
UIUtils.setToolbarMoreIconCustomColor(toolbar, UIUtils.getMenuColor(requireContext()))
applyTint(requireContext())
}

@ -19,6 +19,7 @@ import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.ui.widget.number.NumberPickerDialog
import io.legado.app.ui.widget.prefs.IconListPreference
import io.legado.app.ui.widget.prefs.NameListPreference
import io.legado.app.utils.*
@ -33,6 +34,12 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar
preferenceScreen.removePreference(it)
}
}
findPreference<NameListPreference>(PreferKey.themeMode)?.let {
it.setOnPreferenceChangeListener { _, _ ->
view?.post { App.INSTANCE.applyDayNight() }
true
}
}
upPreferenceSummary("barElevation", AppConfig.elevation.toString())
}

@ -1,8 +1,13 @@
package io.legado.app.ui.main
import android.graphics.drawable.Drawable
import android.os.Build
import android.os.Bundle
import android.view.KeyEvent
import android.view.MenuItem
import android.widget.Toolbar
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
@ -26,6 +31,7 @@ import io.legado.app.ui.main.rss.RssFragment
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.view_title_bar.*
class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
BottomNavigationView.OnNavigationItemSelectedListener,

@ -1,12 +1,15 @@
package io.legado.app.ui.main.bookshelf
import android.annotation.SuppressLint
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.SearchView
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter

@ -13,7 +13,7 @@ import io.legado.app.R
import io.legado.app.base.BaseFragment
import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig
import io.legado.app.help.channel
import io.legado.app.lib.theme.ATH
import io.legado.app.service.WebService
import io.legado.app.ui.about.AboutActivity
@ -79,13 +79,7 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog.
observeEvent<Boolean>(EventBus.WEB_SERVICE_STOP) {
webServicePre?.isChecked = false
}
findPreference<NameListPreference>(PreferKey.themeMode)?.let {
it.setOnPreferenceChangeListener { _, _ ->
view?.post { App.INSTANCE.applyDayNight() }
true
}
}
if (AppConfig.isGooglePlay) {
if (requireContext().channel == "google") {
findPreference<PreferenceCategory>("aboutCategory")
?.removePreference(findPreference("donate"))
}

@ -5,6 +5,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.SubMenu
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
@ -17,6 +18,7 @@ import io.legado.app.utils.gone
import io.legado.app.utils.visible
import kotlinx.android.synthetic.main.activity_rss_artivles.*
import org.jetbrains.anko.startActivityForResult
import java.util.LinkedHashMap
class RssSortActivity : VMBaseActivity<RssSortViewModel>(R.layout.activity_rss_artivles) {
@ -25,6 +27,8 @@ class RssSortActivity : VMBaseActivity<RssSortViewModel>(R.layout.activity_rss_a
private val editSource = 12319
private val fragments = linkedMapOf<String, RssArticlesFragment>()
private lateinit var adapter: TabFragmentPageAdapter
private val channels = LinkedHashMap<String, String>()
private var groupMenu: Menu? = null
override fun onActivityCreated(savedInstanceState: Bundle?) {
adapter = TabFragmentPageAdapter(supportFragmentManager)
@ -34,6 +38,7 @@ class RssSortActivity : VMBaseActivity<RssSortViewModel>(R.layout.activity_rss_a
title_bar.title = it
})
viewModel.initData(intent) {
upChannelMenu()
upFragments()
}
}
@ -43,6 +48,12 @@ class RssSortActivity : VMBaseActivity<RssSortViewModel>(R.layout.activity_rss_a
return super.onCompatCreateOptionsMenu(menu)
}
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
groupMenu = menu
upChannelMenu()
return super.onPrepareOptionsMenu(menu)
}
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.menu_edit_source -> viewModel.rssSource?.sourceUrl?.let {
@ -54,15 +65,44 @@ class RssSortActivity : VMBaseActivity<RssSortViewModel>(R.layout.activity_rss_a
}
}
}
if (item.groupId == R.id.source_channel) {
var key = item.title.toString();
var i = fragments.keys.indexOf(key)
if (i >= 0)
view_pager.currentItem = i
}
return super.onCompatOptionsItemSelected(item)
}
private fun upChannelMenu() {
// 加入频道列表
groupMenu?.removeGroup(R.id.source_channel)
var sourceChannel = viewModel.rssSource?.sourceGroup
channels.clear()
sourceChannel?.split("\n\n")?.forEach { c ->
val d = c.split("::")
if (d.size > 1) {
channels[d[0]] = d[1]
var item = groupMenu?.add(R.id.source_channel, Menu.NONE, Menu.NONE, d[0])
item?.isCheckable = true
var keys = fragments.keys
item?.isChecked = keys.indexOf(d[0]) == view_pager.currentItem
}
}
}
private fun upFragments() {
fragments.clear()
viewModel.rssSource?.sortUrls()?.forEach {
fragments[it.key] = RssArticlesFragment.create(it.key, it.value)
}
if (fragments.size == 1) {
var sortUrlsSize = fragments.size
if (sortUrlsSize <= 1) {
channels?.forEach {
fragments[it.key] = RssArticlesFragment.create(it.key, it.value)
}
}
if (sortUrlsSize == 1) {
tab_layout.gone()
} else {
tab_layout.visible()

@ -55,11 +55,17 @@ class Preference(context: Context, attrs: AttributeSet) :
iconView.setImageDrawable(icon)
iconView.setColorFilter(context.accentColor)
}
val paddingView = it.findViewById(R.id.preference_padding)
if (paddingView != null) {
paddingView.isVisible = view.isVisible && tvSummary != null && tvSummary.isVisible
}
}
if (weightLayoutRes != null && weightLayoutRes != 0 && viewId != null && viewId != 0) {
val lay = it.findViewById(R.id.preference_widget)
if (lay is FrameLayout) {
var needRequestLayout = false
var v = it.itemView.findViewById<T>(viewId)
if (v == null) {
val inflater: LayoutInflater = context.layoutInflater
@ -68,7 +74,8 @@ class Preference(context: Context, attrs: AttributeSet) :
lay.addView(childView)
lay.isVisible = true
v = lay.findViewById(viewId)
}
} else
needRequestLayout = true
if (weightWidth > 0 || weightHeight > 0) {
val lp = lay.layoutParams
@ -79,7 +86,8 @@ class Preference(context: Context, attrs: AttributeSet) :
lp.width =
(context.resources.displayMetrics.density * weightWidth).roundToInt()
lay.layoutParams = lp
}
} else if (needRequestLayout)
v.requestLayout()
return v
}

@ -19,13 +19,8 @@ fun Menu.applyTint(context: Context, theme: Theme = Theme.Auto): Menu = this.let
if (menu is MenuBuilder) {
menu.setOptionalIconsVisible(true)
}
val primaryTextColor = context.primaryTextColor
val defaultTextColor = context.getCompatColor(R.color.tv_text_default)
val tintColor = when (theme) {
Theme.Dark -> context.getCompatColor(R.color.md_white_1000)
Theme.Light -> context.getCompatColor(R.color.md_black_1000)
else -> primaryTextColor
}
val tintColor = UIUtils.getMenuColor(context, theme)
menu.forEach { item ->
(item as MenuItemImpl).let { impl ->
//overflow:展开的item

@ -0,0 +1,42 @@
package io.legado.app.utils
import android.content.Context
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
import android.os.Build
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import io.legado.app.R
import io.legado.app.constant.Theme
import io.legado.app.lib.theme.primaryTextColor
@Suppress("unused")
object UIUtils {
/** 设置更多工具条图标和颜色 */
fun setToolbarMoreIconCustomColor(toolbar: Toolbar, color: Int? = null) {
if (toolbar == null)
return
val moreIcon = ContextCompat.getDrawable(toolbar.context, R.drawable.ic_more)
if(moreIcon != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (color != null ) {
moreIcon.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
}
toolbar.overflowIcon = moreIcon
}
}
fun getMenuColor(context: Context, theme: Theme = Theme.Auto, requiresOverflow: Boolean = false): Int {
val defaultTextColor = context.getCompatColor(R.color.tv_text_default)
if (requiresOverflow)
return defaultTextColor
val primaryTextColor = context.primaryTextColor
return when (theme) {
Theme.Dark -> context.getCompatColor(R.color.md_white_1000)
Theme.Light -> context.getCompatColor(R.color.md_black_1000)
else -> primaryTextColor
}
}
}

@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:fillColor="#595757"
android:pathData="M12.822,20 L11.177,20 L11.177,12.821 L4,12.821 L4,11.178 L11.178,11.178 L11.178,4 L12.823,4 L12.823,11.179 L20,11.179 L20,12.822 L12.822,12.822 L12.822,20 Z" />
android:pathData="M30,7.32L26.23,7.32a1.49,1.49 0,0 1,-1 -0.42L24,5.74a1.49,1.49 0,0 0,-1 -0.42L18,5.32a2,2 0,0 0,-2 2v10a2,2 0,0 0,2 2L30,19.32a2,2 0,0 0,2 -2v-8A2,2 0,0 0,30 7.32ZM18,6.82h4.94L24.15,8a3,3 0,0 0,2.08 0.83L30,8.83a0.5,0.5 0,0 1,0.5 0.5v1.25h-13L17.5,7.32A0.5,0.5 0,0 1,18 6.82ZM30,17.82L18,17.82a0.5,0.5 0,0 1,-0.5 -0.5L17.5,12.07h13v5.25A0.5,0.5 0,0 1,30 17.82Z"
android:fillColor="#3f3f3f"/>
</vector>

@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:fillColor="#595757"
android:pathData="M5.689,20 C5.164,20,4.74,19.844,4.432,19.537 C3.242,18.345,4.772,15.546,5.863,13.892 C5.683,13.308,5.595,12.688,5.595,12 C5.595,8.469,8.467,5.596,11.998,5.596 C12.684,5.596,13.308,5.685,13.898,5.868 C15.013,5.131,16.948,4,18.339,4 C18.84,4,19.242,4.146,19.531,4.435 C20.308,5.212,20.118,6.648,18.965,8.697 C18.724,9.127,18.433,9.588,18.099,10.076 C18.296,10.703,18.396,11.345,18.396,11.986 C18.396,15.524,15.526,18.403,11.998,18.403 C11.349,18.403,10.7,18.304,10.067,18.103 C8.774,18.991,7.013,20,5.689,20 Z M6.51,15.317 C5.331,17.292,5.196,18.449,5.357,18.611 C5.418,18.673,5.543,18.706,5.709,18.706 C6.337,18.706,7.422,18.249,8.669,17.469 C7.791,16.935,7.046,16.193,6.51,15.317 Z M11.473,17.068 C11.651,17.087,11.826,17.096,11.998,17.096 C14.806,17.096,17.089,14.803,17.089,11.985 C17.089,11.82,17.081,11.651,17.063,11.482 C16.282,12.473,15.398,13.461,14.428,14.43 C13.48,15.38,12.47,16.28,11.473,17.068 Z M11.998,6.901 C9.188,6.901,6.902,9.19,6.902,12 C6.902,14.017,8.066,15.818,9.885,16.641 C11.084,15.764,12.301,14.711,13.504,13.508 C14.686,12.326,15.765,11.076,16.635,9.883 C15.811,8.068,14.011,6.901,11.998,6.901 Z M15.317,6.516 C16.19,7.051,16.929,7.791,17.461,8.666 C17.598,8.448,17.72,8.247,17.827,8.055 C18.848,6.24,18.729,5.482,18.607,5.36 C18.605,5.357,18.549,5.304,18.335,5.304 C18.084,5.304,17.163,5.396,15.317,6.516 Z" />
android:pathData="M21.8745,13.0654L25.0494,9.8905A0.75,0.75 93.1684,0 1,26.1101 9.8905L26.1101,9.8905A0.75,0.75 93.1684,0 1,26.1101 10.9511L22.9352,14.126A0.75,0.75 107.2012,0 1,21.8745 14.126L21.8745,14.126A0.75,0.75 107.2012,0 1,21.8745 13.0654z"
android:fillColor="#3f3f3f"/>
<path
android:pathData="M23.47,8.29l2.65,-2.65a0.5,0.5 0,0 1,0.7 0l3.54,3.54a0.5,0.5 0,0 1,0 0.7l-2.65,2.65a0.74,0.74 0,0 0,0 1.06h0a0.75,0.75 0,0 0,1.06 0l2.65,-2.65a2,2 0,0 0,0 -2.82L27.88,4.58a2,2 0,0 0,-2.82 0L22.41,7.23a0.75,0.75 0,0 0,0 1.06h0A0.74,0.74 0,0 0,23.47 8.29Z"
android:fillColor="#3f3f3f"/>
<path
android:pathData="M24.53,15.71l-2.65,2.65a0.5,0.5 0,0 1,-0.7 0l-3.54,-3.54a0.5,0.5 0,0 1,0 -0.7l2.65,-2.65a0.74,0.74 0,0 0,0 -1.06h0a0.75,0.75 0,0 0,-1.06 0l-2.65,2.65a2,2 0,0 0,0 2.82l3.54,3.54a2,2 0,0 0,2.82 0l2.65,-2.65a0.75,0.75 0,0 0,0 -1.06h0A0.74,0.74 0,0 0,24.53 15.71Z"
android:fillColor="#3f3f3f"/>
</vector>

@ -1,17 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:fillColor="#595757"
android:pathData="M12.167,4h-2.025c-0.604,0-1.08,0.529-1.08,1.206v13.588c0,0.677,0.476,1.206,1.08,1.206h2.025 c0.605,0,1.08-0.529,1.08-1.206V5.206C13.247,4.529,12.772,4,12.167,4z M11.792,5.454v9.531h-1.273V5.454H11.792z M10.519,18.546 v-2.106h1.273v2.106H10.519z" />
android:pathData="M16.74,5.63L22.76,5.63A0.74,0.74 0,0 1,23.5 6.37L23.5,6.38A0.74,0.74 0,0 1,22.76 7.12L16.74,7.12A0.74,0.74 0,0 1,16 6.38L16,6.37A0.74,0.74 0,0 1,16.74 5.63z"
android:fillColor="#3c3f43"/>
<path
android:fillColor="#595757"
android:pathData="M7.104,6.693H5.079c-0.596,0-1.078,0.501-1.078,1.117v11.072C4.001,19.499,4.483,20,5.079,20h2.025 c0.596,0,1.081-0.501,1.081-1.117V7.811C8.186,7.195,7.7,6.693,7.104,6.693z M6.729,8.148v6.837H5.455V8.148H6.729z M5.455,18.546 v-2.106h1.274v2.106H5.455z" />
android:pathData="M30.72,4.22 L28.07,6.85 26.83,5.62a0.75,0.75 0,0 0,-1.06 0h0a0.74,0.74 0,0 0,0 1L27,7.9l0.7,0.7a0.51,0.51 0,0 0,0.71 0l0.71,-0.7 2.65,-2.63a0.74,0.74 0,0 0,0 -1h0A0.75,0.75 0,0 0,30.72 4.22Z"
android:fillColor="#3c3f43"/>
<path
android:fillColor="#595757"
android:pathData="M17.976,7.433c-0.098-0.534-0.551-0.921-1.075-0.921l-2.183,0.383 c-0.584,0.108-0.969,0.689-0.858,1.294l2.006,10.89c0.099,0.534,0.55,0.92,1.074,0.92l2.183-0.383 c0.585-0.108,0.969-0.689,0.859-1.294L17.976,7.433z M15.354,8.256l1.25-0.234l1.289,7.004l-1.256,0.209L15.354,8.256z M17.235,18.484L16.9,16.667l1.257-0.209l0.33,1.797L17.235,18.484z" />
android:pathData="M30.72,10.16l-2.65,2.63 -1.24,-1.22a0.75,0.75 0,0 0,-1.06 0h0a0.74,0.74 0,0 0,0 1L27,13.84l0.7,0.7a0.5,0.5 0,0 0,0.71 0l0.71,-0.7 2.65,-2.62a0.75,0.75 0,0 0,0 -1.06h0A0.75,0.75 0,0 0,30.72 10.16Z"
android:fillColor="#3c3f43"/>
<path
android:pathData="M16.74,12.07L22.76,12.07A0.74,0.74 0,0 1,23.5 12.81L23.5,12.82A0.74,0.74 0,0 1,22.76 13.56L16.74,13.56A0.74,0.74 0,0 1,16 12.82L16,12.81A0.74,0.74 0,0 1,16.74 12.07z"
android:fillColor="#3c3f43"/>
<path
android:pathData="M16.74,18.51L31.26,18.51A0.74,0.74 0,0 1,32 19.25L32,19.26A0.74,0.74 0,0 1,31.26 20L16.74,20A0.74,0.74 0,0 1,16 19.26L16,19.25A0.74,0.74 0,0 1,16.74 18.51z"
android:fillColor="#3c3f43"/>
</vector>

@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:fillColor="#595757"
android:pathData="M16.712,20 L7.288,20 C5.474,20,4,18.633,4,16.952 L4,14.287 L5.524,14.287 L5.524,16.952 C5.524,17.792,6.316,18.476,7.288,18.476 L16.713,18.476 C17.685,18.476,18.477,17.791,18.477,16.952 L18.477,14.287 L20,14.287 L20,16.952 C20,18.633,18.526,20,16.712,20 Z" />
android:pathData="M30.5,14.75V16A1.5,1.5 0,0 1,29 17.5H19A1.5,1.5 0,0 1,17.5 16V14.75a0.76,0.76 0,0 0,-0.75 -0.75h0a0.76,0.76 0,0 0,-0.75 0.75V16a3,3 0,0 0,3 3H29a3,3 0,0 0,3 -3V14.75a0.76,0.76 0,0 0,-0.75 -0.75h0A0.76,0.76 0,0 0,30.5 14.75Z"
android:fillColor="#3f3f3f"/>
<path
android:fillColor="#595757"
android:pathData="M12,15.742 L7.382,11.127 L8.459,10.05 L11.239,12.827 L11.239,4 L12.761,4 L12.761,12.827 L15.541,10.05 L16.618,11.127 Z" />
android:pathData="M29.13,9.14a0.75,0.75 0,0 0,-1.06 0l-3.32,3.32V3.75a0.75,0.75 0,0 0,-1.5 0v8.71L19.93,9.14a0.75,0.75 0,1 0,-1.06 1.06l4.07,4.07 0.71,0.7a0.48,0.48 0,0 0,0.7 0l0.71,-0.7 4.07,-4.07A0.75,0.75 0,0 0,29.13 9.14Z"
android:fillColor="#3f3f3f"/>
</vector>

@ -1,20 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="#595757"
android:pathData="M 11.221 5.832 L 11.221 6.608 L 11.221 11.094 L 9.57 11.094 L 9.57 12.647 L 11.221 12.647 L 11.221 17.909 L 11.229 17.909 L 11.229 18.686 L 13.939 18.686 L 13.939 17.132 L 12.773 17.132 L 12.773 6.608 L 13.939 6.608 L 13.939 5.055 L 11.221 5.055 Z" />
<path
android:fillColor="#595757"
android:pathData="M6.707,7.27H4.414C3.396,7.27,2.6,7.963,2.6,8.848v6.044c0,0.885,0.797,1.578,1.814,1.578h2.293 c1.019,0,1.816-0.693,1.816-1.578V8.848C8.523,7.963,7.726,7.27,6.707,7.27z M6.707,14.917H4.414c-0.131,0-0.215-0.041-0.246-0.041 c-0.01,0-0.014,0.003-0.015,0.012L4.137,8.913C4.15,8.895,4.24,8.823,4.414,8.823h2.293c0.17,0,0.26,0.067,0.263,0.029l0.017,5.975 C6.973,14.845,6.881,14.917,6.707,14.917z" />
<path
android:fillColor="#595757"
android:pathData="M16.91,8.793h2.805c0.86,0,1.561-0.699,1.561-1.559V4.429c0-0.86-0.7-1.559-1.561-1.559H16.91 c-0.859,0-1.559,0.699-1.559,1.559v2.805C15.352,8.094,16.051,8.793,16.91,8.793z M16.91,4.423l2.812,0.006L19.717,7.24 c0,0,0,0-0.002,0l-2.81-0.006L16.91,4.423z" />
<path
android:fillColor="#595757"
android:pathData="M19.84,14.947h-2.805c-0.859,0-1.558,0.699-1.558,1.559v2.805c0,0.86,0.698,1.559,1.558,1.559h2.805 c0.861,0,1.561-0.699,1.561-1.559v-2.805C21.4,15.646,20.701,14.947,19.84,14.947z M19.848,19.312c0,0-0.004,0.005-0.008,0.005 l-2.809-0.006l0.004-2.811l2.813,0.006V19.312z" />
android:fillColor="#FF000000"
android:pathData="M15,0L6.15,0a1,1 0,0 0,-1 1L5.15,2.25L1,2.25a1,1 0,0 0,-1 1v9.5a1,1 0,0 0,1 1L5.17,13.75L5.17,15a1,1 0,0 0,1 1L15,16a1,1 0,0 0,1 -1L16,11a1,1 0,0 0,-1 -1L6.15,10a1,1 0,0 0,-1 1v1.25L1.48,12.25L1.48,3.75L5.17,3.75L5.17,5a1,1 0,0 0,1 1L15,6a1,1 0,0 0,1 -1L16,1a1,1 0,0 0,-1 -1ZM6.65,4.5v-3h7.87v3ZM6.65,14.5v-3h7.87v3Z"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="24dp"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:pathData="M32,9L32,5a1,1 0,0 0,-1 -1L22.15,4a1,1 0,0 0,-1 1L21.15,6.25L17,6.25a1,1 0,0 0,-1 1v9.5a1,1 0,0 0,1 1h4.19L21.19,19a1,1 0,0 0,1 1L31,20a1,1 0,0 0,1 -1L32,15a1,1 0,0 0,-1 -1L22.15,14a1,1 0,0 0,-1 1v1.25L17.48,16.25L17.48,7.75h3.69L21.17,9a1,1 0,0 0,1 1L31,10A1,1 0,0 0,32 9ZM22.65,5.5h7.87v3L22.65,8.5ZM22.65,15.5h7.87v3L22.65,18.5Z"
android:fillColor="#3f3f3f"/>
</vector>

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,5.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
android:fillColor="#202020"/>
<path
android:pathData="M12,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
android:fillColor="#202020"/>
<path
android:pathData="M12,18.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
android:fillColor="#202020"/>
</vector>

@ -1,17 +1,15 @@
<vector android:autoMirrored="true"
android:height="24dp"
android:viewportHeight="48"
android:viewportWidth="48"
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11,5.49A5.49,5.49 0,1 1,7.1 7.1,5.44 5.44,0 0,1 11,5.49M11,4a7,7 0,1 0,4.94 2A7,7 0,0 0,11 4Z"
android:fillColor="#202020"/>
<path
android:fillColor="#39393A"
android:pathData="M20,32.7c-6.9,0 -12.6,-5.6 -12.6,-12.6c0,-6.9 5.6,-12.6 12.6,-12.6c6.9,0 12.6,5.6 12.6,12.6C32.6,27 27,32.7 20,32.7M20,9C13.9,9 8.9,14 8.9,20.1c0,6.1 5,11.1 11.1,11.1c6.1,0 11.1,-5 11.1,-11.1C31.1,14 26.2,9 20,9"
android:strokeColor="#39393A"
android:strokeWidth="2" />
android:pathData="M16.6042,16.6125L16.6042,16.6125A0.745,0.75 134.9995,0 1,17.6613 16.6161L19.7685,18.7233A0.745,0.75 134.9995,0 1,19.772 19.7804L19.772,19.7804A0.745,0.75 134.9995,0 1,18.7149 19.7768L16.6077,17.6697A0.745,0.75 134.9995,0 1,16.6042 16.6125z"
android:fillColor="#202020"/>
<path
android:fillColor="#39393A"
android:pathData="M39.8,40.4c-0.2,0 -0.4,-0.1 -0.5,-0.2L28.1,29.1c-0.3,-0.3 -0.3,-0.7 0,-1c0.3,-0.3 0.7,-0.3 1,0l11.1,11.1c0.3,0.3 0.3,0.7 0,1C40.2,40.4 40,40.4 39.8,40.4"
android:strokeColor="#39393A"
android:strokeWidth="2" />
android:fillColor="#FF000000"
android:pathData="M17.14,16.39a0.74,0.74 0,0 0,-0.53 0.22,0.75 0.75,0 0,0 0,1.06l2.11,2.11a0.74,0.74 0,0 0,0.53 0.22,0.73 0.73,0 0,0 0.53,-0.22 0.75,0.75 0,0 0,0 -1.06l-2.11,-2.11a0.74,0.74 0,0 0,-0.53 -0.22Z"/>
</vector>

@ -1,26 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<path
android:fillColor="#595757"
android:pathData="M18,4 L6,4 C4.896,4,4,4.896,4,6 L4,18 C4,19.104,4.896,20,6,20 L18,20 C19.104,20,20,19.104,20,18 L20,6 C20,4.896,19.104,4,18,4 Z M18.568,18.568 L5.432,18.568 L5.432,5.432 L18.568,5.432 L18.568,18.568 Z" />
android:pathData="M21.5,5.5v4h-4v-4h4M22,4H17a1,1 0,0 0,-1 1v5a1,1 0,0 0,1 1h5a1,1 0,0 0,1 -1V5a1,1 0,0 0,-1 -1Z"
android:fillColor="#3c3f43"/>
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M5.234,8.946 L18.734,8.946" />
android:pathData="M30.5,5.5v4h-4v-4h4M31,4H26a1,1 0,0 0,-1 1v5a1,1 0,0 0,1 1h5a1,1 0,0 0,1 -1V5a1,1 0,0 0,-1 -1Z"
android:fillColor="#3c3f43"/>
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M8.559,9.422 L8.559,18.616" />
android:pathData="M21.5,14.5v4h-4v-4h4M22,13H17a1,1 0,0 0,-1 1v5a1,1 0,0 0,1 1h5a1,1 0,0 0,1 -1V14a1,1 0,0 0,-1 -1Z"
android:fillColor="#3c3f43"/>
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M18.734,13.482 L8.969,13.482" />
android:pathData="M30.5,14.5v4h-4v-4h4M31,13H26a1,1 0,0 0,-1 1v5a1,1 0,0 0,1 1h5a1,1 0,0 0,1 -1V14a1,1 0,0 0,-1 -1Z"
android:fillColor="#3c3f43"/>
</vector>

@ -61,8 +61,8 @@
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingBottom="4dp"
android:includeFontPadding="false"
android:gravity="top|center_horizontal"

@ -14,8 +14,8 @@
android:layout_width="60dp"
android:layout_height="80dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="12dp"
android:contentDescription="@string/img_cover"
android:scaleType="centerCrop"
android:src="@drawable/image_cover_default"
@ -56,10 +56,11 @@
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="12dp"
android:includeFontPadding="false"
android:paddingLeft="4dp"
android:paddingBottom="4dp"
android:paddingLeft="2dp"
android:singleLine="true"
android:text="@string/book_name"
android:textColor="@color/tv_text_default"
@ -74,15 +75,14 @@
android:id="@+id/iv_author"
android:layout_width="@dimen/desc_icon_size"
android:layout_height="@dimen/desc_icon_size"
android:layout_marginLeft="8dp"
android:contentDescription="@string/author"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:src="@drawable/ic_author"
app:layout_constraintBottom_toBottomOf="@+id/tv_author"
app:layout_constraintLeft_toRightOf="@+id/iv_cover"
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
app:layout_constraintTop_toTopOf="@+id/tv_author"
app:tint="@color/tv_text_secondary"
app:tint="@color/tv_text_summary"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
@ -93,7 +93,7 @@
android:maxLines="1"
android:paddingEnd="6dp"
android:text="@string/author"
android:textColor="@color/tv_text_secondary"
android:textColor="@color/tv_text_summary"
android:textSize="13sp"
app:layout_constraintBottom_toTopOf="@+id/tv_read"
app:layout_constraintLeft_toRightOf="@+id/iv_author"
@ -105,15 +105,14 @@
android:id="@+id/iv_read"
android:layout_width="@dimen/desc_icon_size"
android:layout_height="@dimen/desc_icon_size"
android:layout_marginLeft="8dp"
android:contentDescription="@string/read_dur_progress"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:src="@drawable/ic_history"
app:layout_constraintBottom_toBottomOf="@+id/tv_read"
app:layout_constraintLeft_toRightOf="@+id/iv_cover"
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
app:layout_constraintTop_toTopOf="@+id/tv_read"
app:tint="@color/tv_text_secondary"
app:tint="@color/tv_text_summary"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
@ -123,7 +122,7 @@
android:includeFontPadding="false"
android:singleLine="true"
android:text="@string/read_dur_progress"
android:textColor="@color/tv_text_secondary"
android:textColor="@color/tv_text_summary"
android:textSize="13sp"
app:layout_constraintBottom_toTopOf="@id/tv_last"
app:layout_constraintLeft_toRightOf="@+id/iv_read"
@ -134,15 +133,14 @@
android:id="@+id/iv_last"
android:layout_width="@dimen/desc_icon_size"
android:layout_height="@dimen/desc_icon_size"
android:layout_marginLeft="8dp"
android:contentDescription="@string/lasted_show"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:src="@drawable/ic_book_last"
app:layout_constraintBottom_toBottomOf="@+id/tv_last"
app:layout_constraintLeft_toRightOf="@+id/iv_cover"
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
app:layout_constraintTop_toTopOf="@+id/tv_last"
app:tint="@color/tv_text_secondary"
app:tint="@color/tv_text_summary"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
@ -152,7 +150,7 @@
android:layout_marginBottom="8dp"
android:singleLine="true"
android:text="@string/lasted_show"
android:textColor="@color/tv_text_secondary"
android:textColor="@color/tv_text_summary"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/iv_last"
@ -177,12 +175,5 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="18dp"
android:layout_marginRight="18dp"
android:background="@color/btn_bg_press"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -20,6 +20,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="13sp"
android:gravity="top|center_horizontal"
android:lines="2"
android:ellipsize="end"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />

@ -28,6 +28,7 @@
android:orientation="vertical"
android:layout_weight="1.0"
android:layout_width="0dp"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
@ -39,6 +40,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:id="@+id/preference_padding"
android:layout_width="match_parent"
android:layout_height="6dp" />
<TextView
android:id="@+id/preference_desc"
android:textSize="14sp"
@ -55,8 +61,6 @@
android:orientation="vertical"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:visibility="gone"
android:gravity="right|center_vertical"
android:layout_width="wrap_content"

@ -28,7 +28,7 @@
<item
android:id="@+id/menu_group_manage"
android:icon="@drawable/ic_groups"
android:icon="@drawable/ic_groups_menu"
android:title="@string/group_manage"
app:showAsAction="never" />

@ -12,4 +12,8 @@
android:title="@string/clear"
app:showAsAction="never" />
<group android:id="@+id/source_channel">
</group>
</menu>

@ -7,7 +7,7 @@
<color name="background">@color/md_grey_900</color>
<color name="background_card">@color/md_grey_850</color>
<color name="background_menu">@color/md_grey_800</color>
<color name="background_prefs">#AA111111</color>
<color name="background_prefs">#10303030</color>
<color name="night_mask">#69000000</color>

@ -16,7 +16,7 @@
<color name="background">@color/md_grey_50</color>
<color name="background_card">@color/md_grey_100</color>
<color name="background_menu">@color/md_grey_200</color>
<color name="background_prefs">#AAFFFFFF</color>
<color name="background_prefs">#7fffffff</color>
<color name="transparent">#00000000</color>
<color name="transparent10">#10000000</color>

@ -12,6 +12,15 @@
app:icons="@array/icons"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.NameListPreference
android:defaultValue="0"
android:entries="@array/theme_mode"
android:entryValues="@array/theme_mode_v"
android:key="themeMode"
android:title="@string/theme_mode"
android:summary="@string/theme_mode_desc"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="true"
android:key="transparentStatusBar"

@ -20,23 +20,13 @@
android:icon="@drawable/ic_cfg_replace"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.NameListPreference
android:defaultValue="0"
android:entries="@array/theme_mode"
android:entryValues="@array/theme_mode_v"
android:key="themeMode"
android:title="@string/theme_mode"
android:summary="@string/theme_mode_desc"
android:icon="@drawable/ic_cfg_theme"
app:iconSpaceReserved="false" />
<!-- <io.legado.app.ui.widget.prefs.SwitchPreference
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="isEInkMode"
android:title="@string/eink_theme"
android:summary="@string/eink_theme_desc"
android:icon="@drawable/ic_cfg_e_lnk"
app:iconSpaceReserved="false" />-->
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
@ -48,7 +38,6 @@
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.PreferenceCategory
android:title="@string/setting"
app:iconSpaceReserved="false"
app:allowDividerAbove="true"
app:allowDividerBelow="false" >
@ -86,14 +75,14 @@
<io.legado.app.ui.widget.prefs.Preference
android:key="donate"
android:summary="@string/thanks"
android:summary="您的支持是我更新的动力"
android:title="@string/donate"
android:icon="@drawable/ic_cfg_jz"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.Preference
android:key="about"
android:summary="@string/about_official_account"
android:summary="公众号[开源阅读软件]"
android:title="@string/about"
android:icon="@drawable/ic_cfg_about"
app:iconSpaceReserved="false" />

Loading…
Cancel
Save