Hello everyone!
Here’s another cool Android tutorial that talks about creating your own DropDown Spinner widget in Android. From the Android developers page, a Spinner is a view that displays one child at a time and lets the user pick among them.Our Default Spinner provide Drop Down above 4.0 version. In this tutorial you will create a customized Spinner like Gmail app using library project. This is also work in 4.0 below version. You can create spinner like this:
Using this Library you can set following features:
setOnItemSelectedListener
You can set custom spinner control in xml like this:
Here’s another cool Android tutorial that talks about creating your own DropDown Spinner widget in Android. From the Android developers page, a Spinner is a view that displays one child at a time and lets the user pick among them.Our Default Spinner provide Drop Down above 4.0 version. In this tutorial you will create a customized Spinner like Gmail app using library project. This is also work in 4.0 below version. You can create spinner like this:
Using this Library you can set following features:
Methods:
- setItemTextColor(int color) - Set the item text font color in drop down.
- setItemBackgroundColor(int color) - Set the item background color in drop down.
- setItemTextSize (int size) - Set the item text size
- setVisibleItemNo (int no) - Set the height of DropDown spinner equal to number of visible rows
- addItem(String item) - Add the single string item in spinner
- addItem(String item, int resId) - Add the single string item and image in spinner
- setItems(String[] arr) - Set the string array in spinner
- setItems(String[] arr, int[] ico) - Set the string array & image array in list. size of string array and image array required equal.
- getSelectedPosition() - Return the position of currently selected item within the adapter's data set.
- setSelectedPosition(int selectedPosition)- Set the currently selected item.
Listener :
setOnItemClickListenersetOnItemSelectedListener
You can set custom spinner control in xml like this:
<com.anky.dropdownspinner.DropdownSpinner android:id="@+id/my_spinner1" android:layout_width="40dp" android:layout_height="40dp" android:background="@drawable/standard_menu_button_bg" android:text="" />You can set property like this:
private DropdownSpinner spinner1 = (DropdownSpinner) findViewById(R.id.my_spinner1); private String[] strings = { "Inter Milan", "AC Mila", "Manchesterb", "Barcelona", "Valencia", "Juventus" }; spinner1.setItems(strings); spinner1.addItem("Test1"); spinner1.addItem("Test2"); spinner1.addItem("Test3",R.drawable.ic_menu_moreoverflow_normal_holo_light); spinner1.addItem("", R.drawable.ic_menu_moreoverflow_normal_holo_light); spinner1.addItem("Test4", -1); spinner1.setVisibleItemNo(5); spinner1.setItemTextColor(Color.BLACK); spinner1.setItemPadding(18, 15, 18, 15); spinner1.setItemTextSize(20); spinner1.setItemBackgroundColor(Color.WHITE); spinner1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView paramAdapterView, View paramView, int paramInt, long paramLong) { // TODO Auto-generated method stub clickItem = "Center: Click item:" + paramInt; txtClick.setText(clickItem); } });You can download source code from here.
nice..
ReplyDeletenot working....
ReplyDeletegood work
ReplyDeleteit's very useful blog fr me thank you for sharing the information....
ReplyDeleteFinancial industry regulation|FCA compliance|FCA assistance
Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u
ReplyDeleteGoogle App Integration Chennai
This comment has been removed by the author.
ReplyDeleteNice blog..! I really loved reading through this article... Thanks for sharing such an amazing post with us and keep blogging...
ReplyDeleteFeels free to get amazing update regarding SSC 2018 and south results SSLC 2018
AP SSC Results date 2018
ReplyDeleteGoa Board SSC Result date 2018
GSEB SSC Result date 2018
MAH SSC Results date 2018
TS SSC Results date 2018
To get the information regarding SSLC results 2018 SSLC Result Please go through this link
ReplyDeleteWe will get the Karnataka SSLC Results on instantKarnataka SSLC ResultBy just clicking this link
Very nice to here the information of Kerala SSLC Results are availableKerala SSLC ResultOn your fingertip
Entire Tamil SSLC Results are ready on your screenTamilnadu SSLC Result Please click on this link
We will get all information regarding the Kerala SSLC results 2018kerala sslc resultsPlease click on this link
ReplyDeleteWe will get complete information of Tamilnadu HSC Results 2018tamilnadu hsc results 2018Just click on this link
ReplyDeleteWe will get complete information of Tamilnadu SSLC Results 2018tamilnadu sslc results 2018Just click on this link
ReplyDeleteWe will get complete and detailed information of Kerala Plus Two Results 2018Kerala Plus Two Results 2018On a simple on this link
ReplyDeleteWe will get complete and detailed information of Kerala DHSC Results 2018Kerala DHSC Results 2018On a simple on this link
ReplyDeleteNice blog ..! I really loved reading through this article.. Thanks for sharing such a amazing post with us and keep blogging...
ReplyDeletephonegap services in hyderabad
Very nice blog. Very informative. Limra Technosys is leading mobile app development company in Mumbai
ReplyDeleteI was recommended this web site by means of my cousin.
ReplyDeleteI am now not certain whether this post is written through him as nobody else recognise such precise about my difficulty. You're amazing! Thank you!
selenium training in Chennai
selenium training in Tambaram
selenium training in Velachery
selenium training in Omr
selenium training in Annanagar
After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in
You blog post is just completely quality and informative. Many new facts and information which I have not heard about before. Keep sharing more blog posts.
ReplyDeletePython Online training
python Course institute in Chennai
Python Course institute in Bangalore
Informative post.i learn many new things from your post it will help in my Mobile Application development company in Nagpur
ReplyDeleteVery Informative and helpful blog. prolifiquetech is leading android development company in mumbai
ReplyDeleteI really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post I would like to read this
ReplyDeleteDigital Marketing Company in mumbai
Digital Marketing agency in Mumbai
Nice work. Thank you for sharing the information.
ReplyDeletemoviebox for pc
Nice post.
ReplyDeletemoviebox
moviebox ipa
Thanks for sharing
ReplyDeleteUnicsol is a Custom Software Development Company in Hyderabad that provides value-added software services by turning bytes into business by our deligent team