You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val scrollPickerView = findViewById<ScrollPickerView<ViewModel>>(R.id.scrollpickerview)
//Adapter takes the list of item, the layout for the item, and the bindId.val scrollPickerAdapter =ScrollPickerAdapter(list, R.layout.item_layout, BR.viewmodel)
ScrollPickerView.Builder(scrollPickerView)
.scrollViewAdapter(scrollPickerAdapter)
.onItemSelectedListener(object:OnItemSelectedListener {
overridefunonSelected(view:View, layoutPosition:Int) {
//call back for selected item
tv.text = list[layoutPosition].index
view.findViewById<AppCompatTextView>(R.id.scroll_view_tv)
.setTextColor(getColor(android.R.color.white))
}
})
.onItemUnselectedListener(object:OnItemUnselectedListener {
overridefununselected(view:View) {
//call back for all unselected item
view.findViewById<AppCompatTextView>(R.id.scroll_view_tv)
.setTextColor(getColor(android.R.color.darker_gray))
}
})
.build()