click and choose only one button in LinearLayout android studio - android

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.

Related

Native base's Checkbox and radio button presentation not working

I am having problem with checkbox and radio button of native base. In checkbox, instead of check(tick) icon hyphen icon shows whereas for radio buttons shuffle icon shows up instead of cicle radio button. Has anybody faced similar issues?? It was all good until last week. I dont know what has happened now. I have tried reinstalling vector icons,native base.But nothing worked.[

Small bubble over a button to count items added to cart?

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

Change button border color on click (android button maker)

Ive generated android button styles online on android button maker but now i would like the button border to change on click. To make sort of feedback to the user see they clicked the button.
Ive tried with the button state selector with 2 diferent xml button files but it gave me a error.
Hope someone has a easy fix.
Thanks
A some people said the answer was to create a selector.
I've managed to make it work! Thanks everybody!

Android ExpandableList Header with spinner

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.

Custom Drop down like layout

I want a custom layout drop down box for my app as if like i am on my homepage and i press a button that's in center of page and then this layout should appear after i press that button, i tried several other and searched the internet but i was unable to get an idea on how to make a drop down box like this :
this shows like two kinds of layout first one we pick the date like 12 months in first column , then 1-31 numbers and then the year from 2001-2012, i don't get and idea that how can make this effect like glassy one i wanted to make like exact same layout as shown here, can any one please suggest me how to implement that coding will me much helpful.
There is an example you can refer this one
http://code.google.com/p/android-wheel/
you can get source from here for that
http://android-wheel.googlecode.com/svn/trunk/
another example
https://github.com/sys1yagi/AndroidPractice/tree/master/DrumPicker/trunk

Categories

Resources