package org.pacien.tincapp.extensions import android.widget.ArrayAdapter import android.widget.TextView import org.pacien.tincapp.R import org.pacien.tincapp.context.App /** * @author pacien */ object Android { fun ArrayAdapter.setElements(elems: Collection) { setNotifyOnChange(false) clear() addAll(elems) notifyDataSetChanged() setNotifyOnChange(true) } fun TextView.setText(list: List) = if (list.isNotEmpty()) text = list.joinToString("\n") else text = App.getContext().getString(R.string.value_none) }