How to create Imageview stack - android

I want to display image view like below where one image will be below other. I'm using Picasso to set image. But it is setting image in entire space whereas I want to set only on the top layer. How to achieve this.
Any help would be appreciated.

Use StackView.
https://developer.android.com/reference/android/widget/StackView.html
I've only used a widget application, but I probably think to be able to use it on other scene.

Related

Trying to match this design in recycler view item

The task is to make chat dialog to be like this image how can i make the background of every item to match this design i'm thinking about using card view but how can i add the extra slice for every item please help.
Update:
Here's the image for anyone in need:
You need to provide special images with extension .9.png. It calls 9-Patch files.
Here is more info about them.
In short, you need to create a simple png file with message background and in border of image mark extensible parts of image by black lines. Thus you will have opportunity to resize your image, but don't affect to it corners, for example, or some parts, that you don't want to resize.
Hope this helps.
Here is image to show, what can be achieved:

How to create round shape image using android?

I am having four piece of image.
Here I attached one sample image.
How can I create the round shaped image using these type of images?
Which layout is best for creating the UI for android?
Thanks in advance.
are you talking about something like this..
http://www.baijs.nl/tinycircleslider/
And for designing the UI for Android is depends on our requirement.it means whether you want to design something looks like rows and columns then GridLayout and tableLayout will be better,depends on requirement and look the layout will changes once try it your self and choose the best suited for your applicaiton.All the best Mate
inside relative layout add four imageview with attrs ParentTop, ParentRight, ParentBottom and ParentLeft. every image is rectangular with transparent extra area.
i can understand it is little hard to visualize on first attempt.
now come to click area. so a runtime decision about ignore transparent area click will be right thing.
more tricky way will be manage flags for all listeners and if two listener get calls its transparent area .

overlay image on an image in android? possible?

I have a CustomIcon class that displays a png using ImageView. I m going to want to be able to place another image view overtop of it on the fly and be able to hide/show the overlay. Can someone point me to a good tutorial to get me rolling?
It sounds like you would be well served by a RelativeLayout. This layout allows you (among other things) to place Views on top of each other.
You can see some "official" docs, and also a tutorial from Learn Android.

how to keep an image on top of other image

can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.

Android - how do I place an image on top of my existing layout through code?

I have a layout in which I am displaying a webview. I want to add images on top of the webview at specific places through code.
Can some one please tell me how to do that?
The translucent background example in API Demos makes the view cover the whole screen. I want to place only a small image and at a specific location (origin not 0,0)
Thanks a lot.
Have you tried putting both the WebView and the ImageView inside an Absolute Layout? This should let you specify the X/Y location of your image and by ordering make it constantly drawn over the webview.
EDIT: check out the Absolute layout:
http://developer.android.com/guide/topics/ui/layout-objects.html#absolutelayout
AbsoluteLayout is deprecated and if that bothers you, you may want to look for alternative.
I have put an example in my blog post here. It might not be exactly what you are after, but should give you an idea:
http://anothermobiledeveloper.blogspot.com/2011/10/using-relativelayout-instead-of.html

Categories

Resources