This commit is contained in:
Amine Bou 2018-01-04 20:45:25 +01:00
parent 99620cb1c5
commit 641f4f34d3

View File

@ -421,7 +421,13 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
} else {
for (tag in maybeTags) {
val gd = GradientDrawable()
gd.setColor(Color.parseColor(tag.color))
val color = try {
Color.parseColor(tag.color)
} catch (e: IllegalArgumentException) {
resources.getColor(R.color.primary)
}
gd.setColor(color)
gd.shape = GradientDrawable.RECTANGLE
gd.setSize(30, 30)
gd.cornerRadius = 30F