Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
fix(learnstore): set CardView foreground transparent for API 16
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Nathansen committed Dec 4, 2018
1 parent 9d493f2 commit 0150d3d
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
import com.google.android.flexbox.FlexboxLayoutManager
import kotlinx.coroutines.experimental.android.UI
import kotlinx.coroutines.experimental.async
import org.schulcloud.mobile.controllers.base.BaseAdapter
import org.schulcloud.mobile.controllers.base.BaseViewHolder
import org.schulcloud.mobile.databinding.ItemMaterialBinding
import org.schulcloud.mobile.models.material.Material
import org.schulcloud.mobile.utils.asUri
import org.schulcloud.mobile.utils.openUrl
import org.schulcloud.mobile.utils.resolveRedirect
import org.schulcloud.mobile.utils.setForegroundForJellyBean

class MaterialListAdapter
: BaseAdapter<Material, MaterialListAdapter.MaterialViewHolder, ItemMaterialBinding>() {
Expand Down Expand Up @@ -45,15 +44,13 @@ class MaterialListAdapter
override fun onItemSet() {
binding.material = item
binding.viewHolder = this
binding.materialCard.setForegroundForJellyBean(binding.materialCard.context)

tagAdapter.update(item.tags ?: emptyList())
}

fun openExternal() {
async(UI) {
resolveRedirect(item.url!!)?.also { this@MaterialViewHolder.context.openUrl(it) }
}
context.openUrl(item.url.asUri())
}
}
}

0 comments on commit 0150d3d

Please sign in to comment.