I'm trying to add a submenu to the Android BottomBar, similar to this except the submenu should show after clicking a BottomBar icon.
I was able to get the BottomBar working, just looking for a simple submenu example. I basically want the user to click "Color" on the BottomBar and have a list of colors appear. After selecting, an ImageView tint will change based on selection.
I ended up abandoning BottomBar and using a row of plain Buttons with ListViews for pop-up menus. Much more control and better suited for my scenario.
Related
In my project I've setted the background color of my items (composed of several elements inserted in a ConstraintLayout) inside a ListView but the default animation of click and long click disappears if the background color is not at least a little transparent. In fact, as transparency decreases, the effect of clicking on the elements is less and less evident. In a few words, color goes to hide the animation if isn't transparent. How to solve this problem and then bring selection animation to the foreground?
Same problem, still unresolved: ListView items not showing tap animation
RESOLVED!
You have to simply add android:drawSelectorOnTop="true" in your ListView XML tag. In this way you can modify and customize the list item background and at the same time bring back the "selector" on top of the "z axis" of GUI. Yuhu!
If you are giving a background coloraturas to the list items then you might be hiding the system press animations. in this case you can use the methods like OnItemLongClickListener() and itemClickListener () and add your custom animations to the view.
I need help on how I would make an options menu outside of toolbar. The one with the dropdown like the options menu in chrome or messaging, not the contextual which pops up like an alert/progress dialog.
I am planning to use it beside a textview, not on a toolbar. I get the idea of having to create an xml for the menu, but what do I use on the layout and how do I inflate it?
How to add menu button without action bar?
those are two pretty acceptable solutions, doubt there is any other workaround...or just use a spinner
I am trying to create a dropdown (like a spinner) which happens when you click on a imagebutton. I've tried doing this through a spinner with a background image, but it stretches the button as wide as the largest option in the dropdown menu. I want the button to always be a fixed, small size (smaller than some options in the menu)
What is the easiest way to do this, and how would i implement it?
as the title suggests I'm trying to add code to my app which allows the user to click on an item in the action bar menu which then unfolds a drop down menu (spinner class?) containing a few options such as lamp, tv etc. - each with an icon. The user will then be able to select one of these and drag and drop the icon (or an image representing the icon) to the canvas where it is then drawn. What is the best way to go about this?
If you're referring to the ActionBar overflow menu items, then you would have to take a look at the code for the ActionBar in the framework and extend it in your application, but that would firstly require quite a hassle and secondly would break compatibility when changes are made to the ActionBar in new versions of Android.
Also, this goes completely away from what the ActionBar is intended to be. You should only have actions in the overflow menu, not contain elements that directly interact with the Activity content. It's just wrong. Consider redesigning your UI so that you implement the requested featured inside the content view, not on the ActionBar.
Achieving a true "dropdown" effect (as seen in Adobe's Photoshop Mobile app for Android, image below) has proven challenging using Androids built-in methods.
As others on Stackoverflow have told me, editing the style of a dropdown list view of an Android spinner is limiting.
How is this dropdown effect done?
(I can't seem to get an image to show, so here's a link: Adobe Photoshop Mobile for Android
After viewing the Adobe slideshow I think the way I would attempt to get that to work, using the Android Java SDK, would be to create a ListView object with a transparent background, and then dynamically hide/show it in that position when the menu button is clicked by setting the View's visibility to VISIBLE or GONE.
Getting a ListView to be transparent shouldn't be that difficult. I'd look into AbsoluteLayout to get it to hover over everything in that spot.
Another option might be to display the ListView in a custom Dialog that you've written, again positioning it in that exact spot on the screen so that it looks like a menu extending from the button that was clicked.
It's probably done using low-level draw functions.