:heavy_check_mark: Scrollable view which can be used to give different choices to user with nice ui.
:heavy_check_mark: Scrollable view which can be used to give different choices to user with nice ui.
Scrollable view which can be used to give different choices to user with nice ui.
compile 'com.webianks.library:scroll-choice:1.0.1'Maven:
com.webianks.library
scroll-choice
1.0.1
pom
15
25
Get the reference of ScrollChoice
ScrollChoice scrollChoice = (ScrollChoice) findViewById(R.id.scroll_choice);Prepare your list items
List data = new ArrayList<>();
data.add("Brazil");
data.add("USA");
data.add("China");
data.add("Pakistan");
data.add("Australia");
data.add("India");
data.add("Nepal");
data.add("Sri Lanka");
data.add("Spain");
data.add("Italy");
data.add("France");Add to the ScrollChoice object with default selected item index
scrollChoice.addItems(data,5);Attach listener to listen to know which item was selected
scrollChoice.setOnItemSelectedListener(new ScrollChoice.OnItemSelectedListener() {
@Override
public void onItemSelected(ScrollChoice scrollChoice, int position, String name) {
Log.d("webi",name);
}
});Here 5 is the index of default selected item.
app:scroll_background_color="#212121"
app:scroll_selected_item_background="#000000"
app:scroll_item_text_color="#f5f5f5"
app:scroll_atmospheric="true"
app:scroll_indicator="true"
app:scroll_indicator_color="#000000"
app:scroll_item_align="center"
app:scroll_selected_item_text_color="?attr/colorPrimary"
app:scroll_selected_item_position="center"
app:scroll_item_text_size="17sp"
app:scroll_indicator_size="1dp" Based on the awesome WheelPicker taken from SingleDateAndTimePicker by Florent CHAMPIGNY.
…No open issues yet, or sync has not completed.