How to build Navigation Bars with Icon - java

I want to make side bars like this (some of required dropdown) and with icon , I used android studio template layout but I not find yet how to add subitem to dropdown, and I try to use expandable list, but not find yet how to add icon,
the output hope like this, any idea?

Related

Android studio: How to dynamically display and refresh a custom list which is horizontally and vertically oriented at the same time?

So I've been developping an app on Android Studio and at some point I need to display couples of values composed of texts and images but I have some issues with the display.
Let's say here that I want a list of fruit names associated with a picture, I'd like to display it that way :
Example
Each image and its related text is in linearlayout, so it's a list of linearlayouts.
The "add fruit" button open an alerdialog where the text and the image can be chosen, by clicking the 'ok' button in the alertdialog the name and the image are saved in a sqlLite database (which I already have programmed), and the linearlayout has to be added in the current list as the dialog is dismissed.
So the issue here is that:
I don't really know how to dynamically display each one of these linearlayouts in this specific order.
I don't know how to make it so that when a new fruit is added and the dialog dismissed, the list in the activity is refreshed directly.
I've been thinking of using a listview but listviews are only horizontal OR vertical but in this case I kind of need a mix of both.
Another idea was to delete the layout containing all the linearlayouts (all the list) when a new fruit was added, and then take my database to create all the linearlayouts again. But dynamically I don't think it will work, the refresh won't be done (?)
My last idea was to create a fragment and use my database in the onCreateView method to display every elements. And to refresh it, I'll just detach and attach again the fragment to the activity each time I add a new element.
I don't think my ideas are the optimal or even a correct way to do it, I've been struggling with it for a while. If you have any suggestions or ideas to help me, it would be great :)

Design xml menu in Android Studio not display objects (buttons, textview etc)

I get a strange problem. When I open design-menu for redacting xml file (Activity or Fragment) I dont see elements(buttons, textviews etc).
Picture:
How can I fix this?
This looks like a render problem, please click on the top right red exclamation mark to see the exact error.
For the time being, you can change the display theme to resolve the problem. Click on AppTheme in the top menu, and choose another theme (I would suggest Material Light > Material.Light.DarkActionBar
Please see the image below:

Android: How to create options menu outside action/tool bar

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

Android activity navigation

I'm developing an app, where there is the main activity, it display some content (texts, images, etc), and a translucent menu on top of it. In this menu, I got link to other "screens" (implemented as Activities), on clicking it, I get correctly to the new activity, but the "activity changing animation" of the device blinks and then get me to the new activity.
I would like to make the navigation experience to be seamless on navigate through the screens, keeping my menu always on top of it. Today, this menu is implemented as a custom view (extending a Linear layout), also this menu will be expandable and collapsible, so the way it is I have to store the menu state through the activities.
PS: The way I've thought was to keep always two running activities, one for the current screen and another one for the menu, keep the menu on top, and just change the activity behind it. But could not find a way to do this...
PPS: Developing for Android 2.1
Anyone got an idea?
You should take a look at Fragments, or try to keep all functionality in one activity, changing only the content view.

Android Dropdown Effect - Spinner or not?

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.

Categories

Resources