val adapter = DataSetAdapter(tasks) {
(adapter, index, convertView) => {
import macroid.contrib.Layouts.VerticalLinearLayout
val item = adapter.getRecord[TasksRecord](index)
val bgcolor = item.state match {
case ActionState.Finished => colorFinished case ActionState.Started => colorStarted case _ => colorWhite }
val view = if (convertView != null)
convertView else
getUi(l[VerticalLinearLayout](
w[TextView] <~ id(Id.name),
w[TextView] <~ id(Id.code),
w[TextView] <~ id(Id.startTimePlanned),
w[TextView] <~ id(Id.taskIssuerName),
w[TextView] <~ id(Id.stateName)
) <~ padding(left = 5, right = 5, top = 20, bottom = 20) <~ id(Id.row)
)
view.find[TextView](Id.name) <~ text(item.name) <~ TextTweaks.bold view.find[TextView](Id.code) <~ text(item.code)
view.find[TextView](Id.startTimePlanned) <~ text(item.startTimePlanned) <~ show(item.startTimePlanned != null)
view.find[TextView](Id.taskIssuerName) <~ text(item.taskIssuerName)
view.find[TextView](Id.stateName) <~ text(item.state.name)
view.find[VerticalLinearLayout](Id.row) <~ bgcolor
view }
}
view.find[TextView](Id.name) <~ text(item.name)
view.find[TextView](Id.name).get.get.setText(item.name)
Hi,
Just wrap the tweaking in runUi ;)
Nick
--
You received this message because you are subscribed to the Google Groups "macroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macroid+u...@googlegroups.com.
To post to this group, send email to mac...@googlegroups.com.
Visit this group at http://groups.google.com/group/macroid.
To view this discussion on the web visit https://groups.google.com/d/msgid/macroid/a062c985-453c-495c-bb56-b5bd3669c011%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.