替换首页图标

pull/169/head
yangyxd 5 years ago
parent 764bb1b624
commit 1ece88762e
  1. 6
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  3. 27
      app/src/main/java/io/legado/app/utils/UIUtils.kt
  4. 12
      app/src/main/res/drawable/ic_add.xml
  5. 18
      app/src/main/res/drawable/ic_add_online.xml
  6. 30
      app/src/main/res/drawable/ic_arrange.xml
  7. 18
      app/src/main/res/drawable/ic_download_line.xml
  8. 21
      app/src/main/res/drawable/ic_groups.xml
  9. 15
      app/src/main/res/drawable/ic_more.xml
  10. 17
      app/src/main/res/drawable/ic_search.xml
  11. 36
      app/src/main/res/drawable/ic_view_quilt.xml
  12. 9
      app/src/main/res/layout/item_bookshelf_list.xml

@ -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
@ -25,6 +30,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
@ -58,6 +61,7 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b
setSupportToolbar(toolbar)
initView()
initBookGroupData()
UIUtils.setToolbarMoreIconCustomColor(toolbar)
}
override fun onCompatCreateOptionsMenu(menu: Menu) {

@ -0,0 +1,27 @@
package io.legado.app.utils
import android.graphics.ColorFilter
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
@Suppress("unused")
object UIUtils {
/** 设置更多工具条图标和颜色 */
fun setToolbarMoreIconCustomColor(toolbar: Toolbar, colorId: 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 (colorId != null ) {
moreIcon.colorFilter = PorterDuffColorFilter(ContextCompat.getColor(toolbar.context, colorId), PorterDuff.Mode.SRC_ATOP)
}
toolbar.overflowIcon = moreIcon
}
}
}

@ -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" />
<path
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" />
<path
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" />
<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" />
<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" />
<path
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: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: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" />
<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" />
<path
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: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:width="48dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportWidth="48"
android:viewportHeight="24">
<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" />
<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,12 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M7,1.49a5.48,5.48 0,1 1,0 11A5.48,5.48 0,0 1,3.1 3.1,5.41 5.41,0 0,1 7,1.49M7,0a7,7 0,1 0,4.94 2A7,7 0,0 0,7 0Z"/>
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: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="#FF000000"
android:pathData="M13.14,12.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"/>
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" />
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M5.234,8.946 L18.734,8.946" />
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M8.559,9.422 L8.559,18.616" />
<path
android:strokeColor="#595757"
android:strokeWidth="1.435"
android:strokeMiterLimit="10"
android:pathData="M18.734,13.482 L8.969,13.482" />
<path
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: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: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: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>

@ -56,7 +56,7 @@
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="12dp"
android:includeFontPadding="false"
android:paddingBottom="4dp"
@ -175,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/background_menu"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save