I want to make a small bubble over a button in android which essentially tell the number of times the button is clicked or added items to the cart. I believe its called badges in iOS environment, I don't know about android, but this is what I want to achieve:
I also found a working solution here: Add new item count to icon on button - Android
But this doesn't work on Android 5.0+. In 5.0+ versions the bubble is hidden behind the button completely.
In Working solution code if your arrange the button and the textview in Grid according to your need than it will solve your problem
Find more about Gridview Here
Related
I'm working on my first app and I got stuck.
I was wondering how is it possible to choose only one button at a time when all are in the same linear layout?
Also, when it was selected - to change the color of the selected button.
For example, in the screenshot below I uploaded you can see the 4 buttons in the same layout.
I decided to go with radioGroup and radioButtons as a solution.
Worked like a charm.
I have an android app which presents list of items with icons.
icon1 - ItemName1
icon2 - ItemName2
icon3 - ItemName3
Like in latest gmail app when we long press on an item the icon displays tick mark indicating item is selected.
There could be one way that I have two icons (one normal and other with tick mark) and i can replace the icon on long press.
Is this correct approach or could there be a better option or some library for it from google ?
Regards
The solution was very simple. Found by navigating through stackoverflow.
For the icon put an imageview or imageviewbutton. Put a onClicklistener on it.
On click change the source of the imageview or imageviebutton to a image with selection indicator. You can also put an animation to make the image transition appear more smooth.
Regards, Ashwani Kr Sharma
I'm developing an application and I am facing a problem using ExpandableListView. What I'm trying to do is, in GroupHeader, not only show the group name, but also an spinner with options. That's because I want to show the football second division games in the list but, also, give the option to choose the round, in case the user wants to check older/future games. SO far I have that
As you can see both, title and spinner, shows. Also you can see the arrow on the right which is supposed to expand the list. Problem is that, if I click, only spinner opens, group expand button doesn't. So, here is my question, how can I make both of them work depending on where you click (one or another)??? Is that possible?
Also I must say that if I only place the TextView with the group name works perfect. If I only place the spinner, the problem persists. So I'm guessing that's a focus problem.
Btw: grey areas are the layout backgrounds, so no, they are not hiding behind the button.
I found the solution, I just neede to add this line android:descendantFocusability="blocksDescendants" to the Main Layout of the xml where I define the GroupHeader elements.
Im creating an in app chat and I cant figure out how to keep the listview I have implemented to keep from growing down below the edittext box I set up to take user chat. Whats happening now is that new lines add to the listview just fine but after the list grows large enough it starts to add to itself below the edittext box. I find that pretty annoying and imagine a user would too so my question is:
How can I keep a listview from growing downwards.
Id like for new fields/text to add to the bottom of the listview but be placed ontop of the edittext just like any normal chat would do.
It's very easy, simply set the transcriptMode. If you do it from XML, you have the choice between normal and alwaysScroll:
http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:transcriptMode
This is how the built-in Google Talk and SMS/MMS applications are implemented (they use the normal transcript mode.)
i am using default android spinner for drop down selection from multiple items array ,but i see the ui in Iphone it looks cool then android then is it possible to make like iphone ui picker view in android means a dropdown would be open with bottom to top animation with a "done" button on upper side of picker view and when i choose one and press "done" then that item should be selected as in iphone...
i think android must have this feature bcoz android is more better then Iphone as in cost and newer version of android capture the whole market ,
so pls any one help me..
thanks in advance
Check the following: http://android-devblog.blogspot.com/2010/05/wheel-ui-contol-backgrounds.html
Introduction to the Wheel control
The Wheel control layouts
Scrolling the wheel control
Ideas for the future
Do not forget to check "See Also"
Usually they use Spinner in Android
If you want a wheel thingy like in iPhone use this