Iam working on an tablet app that needs a dropdown panel that flots on top of everything inclunding my toolbar. And should look something like
Can you please suggest the best UI widget that best suits this purpose, putting into consideration elevation and alignment inside the toolbar
For me it's a PopupWindow shown with showAsDropDown. You would have to prepare a layout with highlit back button and the product list. Then create a PopupWindow with that layout set as a content.
The other option is to prepare the popup as a custom, hidden layout lying on your main screen (use FrameLayout) and change its visibility when needed.
I'm not sure, but you may need a custom ViewOutlineProvider with convex path outline. PopupWindow may be unable to drop a non-rectangular shadow like on your screenshot. In such case you would have to set its background to transparent (or maybe null?), disable window's shadow and cast shadow with custom ViewOutlineProvider.
Related
I have an issue regarding design 'Setting screen' for my app. In this screen I need to design circular menu options in a triangular shape and I need to set OnClickListener only on the triangular area, which is only visible option border area. I can't understand what approach I need to use to achieve this design as well as set OnClickListener.
In Android, a feature called radial reaction exists (find it at https://material.google.com/motion/choreography.html#choreography-radial-reaction).
After a bit of research, I discovered that we can use this to reveal views (see http://android-developers.blogspot.com/2014/10/implementing-material-design-in-your.html and http://pulse7.net/android/android-create-circular-reveal-animation-and-ripple-effect-like-whatsapp/).
Is it possible to reveal a certain color, instead of a view? (For example, change the background color to red when the user clicks the layout)
For now, only revealing a view is supported out-of-the box in ViewAnimationUtils https://developer.android.com/reference/android/view/ViewAnimationUtils.html
You could have your layout file define two different background layouts (LinearLayouts for example). The circular reveal would reveal whichever view you need.
I'm new to Android development and I'm trying to implement some custom buttons, they should look something like this:
So I was wondering if I can use something like a imagebutton and use the image as a background and add text on top of it (I tried this but the text is always in the middle and doesn't have a label so its hard to see..), or should I write a custom style or theme for my button. In case that I have to write a custom style or theme, could you please help me out with this? How should I go about doing it?
For each of those Grid elements, create a framelayout for each, put the background and then the label in front. Frame layouts allow things on top of each other. You can put the labels with layout_gravity bottom and also add a transparent color to it so the image in the back can be seen. Also add a onClickListener to each of the framelayouts so they act as buttons.
I am working on a bottom toolbar for android by forking the SlidingUpPanel at:
https://github.com/umano/AndroidSlidingUpPanel
I want to make it always on top of every thing not defined in my sliding up panel. But when I slide it up, if there is something behind it, my layout is acting like it's transparent. How can I fix it to act like a real toolbar ?
before sliding :
after sliding :
source : http://www.4shared.com/rar/jeA2gbZy/androidslidinguppanel-master.html
Add a onClickListener to the root view of sliding up pannel.I did that and it works well, hope it works for you too.
Set a background to the button and change text color.
I dont think they are transparent but the text just has the same color and the button has a transparent background by default.
As shown in the picture, I need similar functionality when the user touches/clicks on the EditText. When the keyboard is open , the view should be covered by a semi-transparent overlay. What is the best way to implement this?
I have my view inside a FrameLayout.
You could add a simple View as the last child in your FrameLayout and set its background to a semi-transparent color. Whenever the EditText changes focus, set the visibility of the overlay View appropriately (View.VISIBLE or View.GONE).
Starting from JellyBean 4.3 (API 18) you probably may do this using new ViewOverlay and ViewGroupOverlay - just add semi-transparent overlay above any parent View or ViewGroup. Here is good introduction into this system.