Merge and remove util classes

This commit is contained in:
len
2017-01-08 18:50:51 +01:00
parent dd56d7c0bb
commit 07cae4d684
15 changed files with 47 additions and 75 deletions

View File

@@ -29,7 +29,7 @@ class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
* @param textResource text of information view
*/
fun show(drawable: Int, textResource: Int) {
image_view.setVectorCompat(drawable, context.theme.getResourceColor(android.R.attr.textColorHint))
image_view.setVectorCompat(drawable, context.getResourceColor(android.R.attr.textColorHint))
text_label.text = context.getString(textResource)
this.visibility = View.VISIBLE
}

View File

@@ -75,7 +75,7 @@ open class ExtendedNavigationView @JvmOverloads constructor(
*/
fun tintVector(context: Context, resId: Int): Drawable {
return VectorDrawableCompat.create(context.resources, resId, context.theme)!!.apply {
setTint(context.theme.getResourceColor(R.attr.colorAccent))
setTint(context.getResourceColor(R.attr.colorAccent))
}
}
}

View File

@@ -8,6 +8,7 @@ import android.view.View
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.source.online.LoginSource
import eu.kanade.tachiyomi.data.source.online.OnlineSource
import eu.kanade.tachiyomi.util.getResourceColor
import eu.kanade.tachiyomi.util.setVectorCompat
import kotlinx.android.synthetic.main.pref_item_source.view.*
import net.xpece.android.support.preference.CheckBoxPreference
@@ -31,7 +32,7 @@ class LoginCheckBoxPreference @JvmOverloads constructor(
val tint = if (source.isLogged())
Color.argb(255, 76, 175, 80)
else
Color.argb(97, 0, 0, 0)
context.getResourceColor(android.R.attr.textColorSecondary)
holder.itemView.login.setVectorCompat(R.drawable.ic_account_circle_black_24dp, tint)

View File

@@ -25,7 +25,7 @@ class SwitchPreferenceCategory @JvmOverloads constructor(
CompoundButton.OnCheckedChangeListener {
init {
setTitleTextColor(context.theme.getResourceColor(R.attr.colorAccent))
setTitleTextColor(context.getResourceColor(R.attr.colorAccent))
}
private var mChecked = false