WerWolv / libtesla

The support library for Tesla overlays
GNU General Public License v2.0
218 stars 49 forks source link

Selectable list item #9

Closed diwo closed 4 years ago

diwo commented 4 years ago

Selectable list item element that is constructed with an action to perform.

Also change ToggleListItem::setState to also affect actual state

WerWolv commented 4 years ago

Do I understand this PR right? Is this basically a generic ListItem with just the A button directly overriden? Why not use a callback for that on the default list item?

diwo commented 4 years ago

Yeah the new class was unnecessary, I moved the callback into an overloaded constructor on ListItem. I figure 90% of the time when you want to add a list item you'd also want an onclick handler, so it'd make sense to not have to subclass it to override onclick. Also when ListItem onTouch is implemented, it can reuse the same selection handler.