Added iOS colours for user customisation, "No internet available" snackbar now tinted red

This commit is contained in:
Deniz Düzgören
2019-08-06 11:56:44 +02:00
parent 6ed3257ca1
commit f9cac0b123
7 changed files with 187 additions and 8 deletions
@@ -31,10 +31,6 @@ class CardAdapter(private var mSubst: List<Subst>) : RecyclerView.Adapter<CardAd
return CardViewHolder(v)
}
fun getSubstAt(i: Int): Subst {
return mSubst[i]
} // do I need this in Kotlin?
override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
val currentItem = mSubst[position]
val prefs = PreferenceManager.getDefaultSharedPreferences(holder.mImageView.context)
@@ -95,6 +91,19 @@ class CardAdapter(private var mSubst: List<Subst>) : RecyclerView.Adapter<CardAd
} else {
holder.mCard.setCardBackgroundColor(ContextCompat.getColor(holder.mCourse.context, R.color.colorBackgroundLight))
}
val textColor = when (colour) {
R.color.bgPureWhite -> R.color.colorTextDark
R.color.bgPureBlack -> R.color.colorTextLight
else -> R.color.colorText
}
holder.mImageView.setColorFilter(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mGroup.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mDate.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mTime.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mRoom.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
holder.mAdditional.setTextColor(ContextCompat.getColor(holder.mImageView.context, textColor))
}
override fun getItemCount(): Int = mSubst.size