소스 검색

Fix settings crashes before Lollipop

inorichi 8 년 전
부모
커밋
55be9b9ca5
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt
  2. 1 0
      app/src/main/res/values/colors.xml

+ 2 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt

@@ -1,6 +1,7 @@
 package eu.kanade.tachiyomi.ui.setting
 
 import android.content.Context
+import android.support.graphics.drawable.VectorDrawableCompat
 import android.support.v4.graphics.drawable.DrawableCompat
 import android.support.v7.preference.*
 import eu.kanade.tachiyomi.widget.preference.IntListPreference
@@ -83,7 +84,7 @@ var Preference.titleRes: Int
 
 var Preference.iconRes: Int
     get() = 0 // set only
-    set(value) { setIcon(value) }
+    set(value) { icon = VectorDrawableCompat.create(context.resources, value, context.theme) }
 
 var Preference.summaryRes: Int
     get() = 0 // set only

+ 1 - 0
app/src/main/res/values/colors.xml

@@ -12,6 +12,7 @@
     <color name="dividerLight">@color/md_black_1000_12</color>
     <color name="rippleColorLight">@color/md_black_1000_12</color>
 
+    <color name="preference_fallback_accent_color">@color/colorAccentLight</color>
 
     <color name="statusBarLight">@color/md_grey_300</color>
     <color name="appBarLight">@color/md_grey_100</color>