I would like to ask you if is possible to add a shadow to each item in a gallery. And if is possible, what is the easiest way to do it?
Thanks in advance!
It depends on what type of view you are adding to the Gallery. For example, if it's a TextView, you can use android:shadowColor, android:shadowDx, android:shadowDy, and android:shadowRadius to specify the shadow.
If you provide your layout XML that you're using in the Gallery adapter, and explain what you want the shadow to be attached to, it would help give a more clear answer.
Here you go if you are still looking for it: Custom ImageView with drop shadow
Related
I need to develop a dialog similar to the one in the image, and I don't know what is the best approach (I'm a newbie):
Which approach do you consider to be the best?
Define one custom dialog and define the custom layout (up arrow) in some way?
Define one image with 9-patch and use it as an imageView with text inside?
Thanks a lot in advance :)
Well, You need tooltips views not dialogs. Dialogs will not serve your purpose.
please refere below library
https://github.com/nhaarman/supertooltips
In my app i need to create cardview with curved top and bottom lines, like this:
I tried to search answer on stackoverflow and google but i haven't found anything. Also i tried to make it via xml, but i couldn't.
Can anyone help me with this? I can't use it like image background because i need to change background color when i click on card and i have a lot of such card in my recyclerview and a lot of different colors for every card.
Thx.
You need to use a custom shape a la this as the background of the view. edit see this post
I am looking for a custom component to design a circular remote control view like the image below with different button and background color.
Each button should be touchable with proper press effect. I did find a useful library with this I am able to create somewhat similar design but still there are lots of improvement required like Press effect/ Inner and outer circle padding radius etc. Please help me to find the better option for this.
I think tihs is your answer.
You can download here.
https://code.google.com/p/radial-menu-widget/
You could make your own class extending view. You will then be able to override onDraw() and draw whatever you want.
You could also use default android Button with a custom xml selector defined with a different image ressource for pressed/not pressed states.
I am trying to display my layout via android xml.
Here's what I want to do:
I have 12 buttons with a animals image like this one: , and the circle is the background.
I do not have any idea related to this, how should I start?
Please give me some suggestion so I can go ahead. What things should I use to do this?
You'd be looking for making a custom view. A good place to start is, as always, android's own development site: http://developer.android.com/training/custom-views/create-view.html
i think you can do this with xml. this need simple mathematic calculation that you can not do in xml.
you most extend View class and create your own View. then you can use it in xml.
As per my requirement I need to add tow rectangles in a existing xml layout through java code. I can create the rectangle shapes using ondraw method, but using intents in fresh layout. I need to display that shapes in existing layout. If any one faces this experience, please help me to create shapes in a xml. Any responce would be appreciated.
Thanks in advance
If the rectangles have a predefined place and size it it only a question of changing the visibility at runtime.
Give the rectangle the attribute android:visibility="gone" in the xml, and from the code use the setVisibility(View.VISIBLE) on the reference to the widget when you want to show it. In this way you may hide it again when no longer needed.
If this answer does not help you please specify more details and I may be able to help you better.
BR,
Vanja