Many apps (Instagram for example) have these navigation buttons at the bottom of the screens for switching activities. A button is highlighted AFTER clicking and stays highlighted during the activity until the user switches to other activities.
I'm trying to implement these buttons in my app. Are these buttons part of the split action bar, or tabs placed at the bottom, or just regular image buttons in a group (like push-buttons/radio-buttons)? I tried using split action bar. It works well, however, I cannot figure out how to highlight or change the background of the button which was clicked. I searched but couldn't find a solution. There are postings about changing the background color of the action bar item using custom selector, but it only applies to the time the button is pressed. Since so many apps these days have these buttons, I believe there are must be solutions that I'm not aware. Please help! Thanks.
try to use the tabwidget for highlighting the tab(or)button for switching in bottom
Related
Instead of continuing the search on how to do this I thought I would pose the question here and see if I had any luck. I am working on an Android app that uses a navigation drawer and I want a custom color when the user touches one of the items in the drawer (not the default light blue). I have three XML files, one for shape/color when not pressed, one for when pressed, and a selector. All of these work great and when a touch on an item in the navigation drawer takes place it shows red like I want. But when the navigation drawer is slid out again the selected item once again shows the default color of light blue. Does anyone know how to keep this custom color selection persistent?
Thank you very much. I certainly appreciate any help!
i am developing an android application that contains tabs. my application is like this:
Please notice that I have an action bar that contains many tabs.
Now I want to add an extra tab bar. what i mean is: in the players activity i want to have anotion action bar. for example players under 21 years and players above 21 years
how can i do that please?
what i have tried
i tried manking many bottons with view pager. and when the user press on any button, i slide the view pager. it works good. but i would like to know if there is a standard solution.
hint
i think that action bar at the top and ation bar at the botton will help. but i don't know if this is available.
thank u very mush.
The framework provides TabHost, which you can bind to the ViewPager from by setting an OnTabChangedListener and changing the current page based on the selection. It's slightly more complicated than just using buttons, but you get the tab theme
I am using Action Bar in my application to implement Tab Fragments. I am successful in it. But getting a small problem. I am in a need of a drop-down list at the Right Corner of the action bar and a search button. Please see the image:
You can see the red marked buttons that i need to show in Action bar and below the actionbar we have tab fragments. I am successful in generating the Fragments but getting problem in showing these buttons on Actionbar. Please help me
The overflow button is automatically generated but if you have a phone with hardware button it wont show up. You shouldn't try to force it to show up as it goes against ussual behaviour for people with phones that have a hardware button.
I want to make a action-bar drop-down-menu that shows items (icons) horizontally. Like this:
This is suppose to be a action-bar withe drop-down menu, where you can choose a color.
So it should show the icons (colors) horizontally and the icons should be clickable. Until now I have only managed to make a vertical list.
If possible I would like to do this in XML.
The ActionBar is not designed for such a use-case. The ActionBar buttons are meant to replace the old options menu that could be triggered with a separate hardware button on older devices (pre HC/ICS). The overflow button (the one with the 3 dots) that you've drawn in your sketch is used when there isn't enough room to show all buttons (the Android framework takes care of this automatically), so those will be grouped in the overflow menu. Overriding this behavior is a bad idea (if even possible).
Instead you should consider another approach: Add one ActionButton to the ActionBar that is meant to handle the color chooser. When this button is clicked the best solution is to show an AlertDialog (you can easily insert your on Views here that show the colors you want) because this will work best even if the button is hidden in the overflow menu.
Alternatively you could trigger a PopupMenu or implement some QuickAction to handle the color chooser (this will probably suck if your button is hidden in the overflow menu and will also lead to a very confusing UI).
I'm trying to implement an application with a specific view. It needs to have a horizontal bar at the top that contains the app icon, and other buttons and spinners. These items must be static and should appear on every page of the app.
Below that horizontal bar will be a Tabbed component, with the tabs being horizontal at the bottom of the page. I can also implement the desired behavior with the tabs on top of the Tabbed component. Each tab will obviously change the fragment being displayed within the tab's frame.
I am working on an implementation that uses the ActionBar and the menu options. However, I can't get the menu options (my buttons and spinners) to appear above the tabs. And I'm not sure if menu options is the right approach. Any ideas?
Silly me! the answer was right there. I simply had to turn the title bar back on (only with no title) and the menu options would appear right into that title bar.
keep in mind that this feature is heavily dependent on the version of android and model of device that you have.
Older phones have a menu button which will bring up the same menu, as do some modern phones (like the galaxy SIII), so, be sure to test this everywhere so you know what the end-user will actually experience.