Author: Adam Pioterek <adam.pioterek@protonmail.ch>
departures list icons flickering
%!v(PANIC=String method: strings: negative Repeat count)
diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/adapters/DeparturesAdapter.kt b/app/src/main/java/ml/adamsprogs/bimba/models/adapters/DeparturesAdapter.kt index c8915edf9e1b3e8b8444f3661e989ce6f3dc2810..920b6741fea569dcdc950c55aa77a78cf110732e 100644 --- a/app/src/main/java/ml/adamsprogs/bimba/models/adapters/DeparturesAdapter.kt +++ b/app/src/main/java/ml/adamsprogs/bimba/models/adapters/DeparturesAdapter.kt @@ -22,7 +22,6 @@ companion object { const val VIEW_TYPE_LOADING: Int = 0 const val VIEW_TYPE_CONTENT: Int = 1 - const val VIEW_TYPE_EMPTY: Int = 2 } override fun getItemCount(): Int { @@ -40,10 +39,13 @@ } } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - // todo migotanie ikon + holder.floorIcon.visibility = View.GONE + holder.infoIcon.visibility = View.GONE + if (departures == null) { return } + val line = holder.lineTextView val time = holder.timeTextView val direction = holder.directionTextView @@ -78,9 +80,8 @@ icon.setImageDrawable(ResourcesCompat.getDrawable(context.resources, R.drawable.ic_departure_timetable, context.theme)) if (departure.lowFloor) holder.floorIcon.visibility = View.VISIBLE - if (departure.isModified) { + if (departure.isModified) holder.infoIcon.visibility = View.VISIBLE - } holder.root.setOnClickListener { AlertDialog.Builder(context) .setPositiveButton(context.getText(android.R.string.ok)