mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Merge and remove util classes
This commit is contained in:
		| @@ -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 | ||||
|     } | ||||
|   | ||||
| @@ -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)) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -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) | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user