Posts

Showing posts with the label Android Spinner

Nice Spinner - Custom Spinner For Android

Image
NiceSpinner is a re-implementation of the default Android's spinner, with a nice arrow animation and a different way to display its content. It follows the material design guidelines, and it is compatible starting from Api 14. Usage The usage is pretty straightforward. Add the tag into the XML layout: < org .angmarch.views.NiceSpinner android : id = " @+id/nice_spinner " android : layout_width = " wrap_content " android : layout_height = " wrap_content " android : layout_margin = " 16dp " /> Note: change layout_width to at least the width of the largest item on the list to prevent resizing Then use this snippet to populate with contents: NiceSpinner niceSpinner = ( NiceSpinner ) findViewById( R . id . nice_spinner); List< String > dataset = new LinkedList<> ( Arrays . asList( " One " , " Two " , " Three " , " Four " , " Five " )); ni...