It was a pain to have to look for a way to change the color of the Spinner widget’s selected item because the color displayed in the screen is dark.

Using Theme.AppCompat.Light.DarkActionBar, the problem is that the Spinner blends in with the ActionBar’s dark background (black in my case).

I did not want to have to create another layout just for the Spinner widget alone and use it as the actionLayout attribute value of the MenuItem.

So the only solution left is to do it programmatically.

Here is the code snippet:

I bet you get confused why the ListView object does not capture click events at times. Ever thought that maybe the components within each ListView entry contain components that accept input events?

Take for example EditText or a Spinner? If this was a regular TextView, then there will definitely be no problem when it comes to capturing click events in the OnItemClickListener or OnItemLongClickListener().

What you can do to fix this is to set your EditText component to disable events so these such events will be relegated to the ListView.

You can do this by setting android:focusable=”false” and android:focusableInTouchMode=”false” in the XML layout file. Try it and check it out.

You will see that by setting these attributes to false in your EditText, your ListView object can then capture click events.

Here is my XML file to rotate an image in 360 degree movement.

To apply it to the ProgressBar and use it as the moving spinner, do it like this:

I have read some posts in forums that they had issues with the smoothness of the rotating animation. In my case, I did not see any issue with it. Perhaps old versions of the Android operating system contributed as a factor? I tested this with JellyBean and it worked out quite fine.

Related Posts Plugin for WordPress, Blogger...