Minor cleanup

This commit is contained in:
arkon
2021-04-17 19:05:35 -04:00
parent 9065362fde
commit b40af7c3c6
8 changed files with 16 additions and 30 deletions

View File

@@ -54,15 +54,12 @@ class CrashLogUtil(private val context: Context) {
with(notificationBuilder) {
setContentTitle(context.getString(R.string.crash_log_saved))
// Clear old actions if they exist
clearActions()
addAction(
R.drawable.ic_folder_24dp,
context.getString(R.string.action_open_log),
NotificationReceiver.openErrorLogPendingActivity(context, uri)
)
addAction(
R.drawable.ic_share_24dp,
context.getString(R.string.action_share),

View File

@@ -157,3 +157,5 @@ private fun shouldUpdateDbChapter(dbChapter: Chapter, sourceChapter: SChapter):
dbChapter.date_upload != sourceChapter.date_upload ||
dbChapter.chapter_number != sourceChapter.chapter_number
}
class NoChaptersException : Exception()

View File

@@ -1,3 +0,0 @@
package eu.kanade.tachiyomi.util.chapter
class NoChaptersException : Exception()

View File

@@ -1,19 +1,21 @@
package eu.kanade.tachiyomi.util.view
import android.widget.ImageView
import androidx.annotation.AttrRes
import androidx.annotation.DrawableRes
import androidx.appcompat.content.res.AppCompatResources
import eu.kanade.tachiyomi.util.system.getResourceColor
/**
* Set a vector on a [ImageView].
*
* @param drawable id of drawable resource
*/
fun ImageView.setVectorCompat(@DrawableRes drawable: Int, tint: Int? = null) {
fun ImageView.setVectorCompat(@DrawableRes drawable: Int, @AttrRes tint: Int? = null) {
val vector = AppCompatResources.getDrawable(context, drawable)
if (tint != null) {
vector?.mutate()
vector?.setTint(tint)
vector?.setTint(context.getResourceColor(tint))
}
setImageDrawable(vector)
}