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.
Related
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.
I'm only interested in the header that contains the product image. I am thinking possible ways to make this design but I do not find the possible way to see the whole image blurred except the central circle that looks normal.
I wanna create a custom view with three circle images view using native android. Now I can create one circle image view using CircleImageView from hdodenhof. I wonder if anyone can tell me which way is better to put three circles like the following pic. Thanks.
You could, as you suggest, build a custom view from three CircleImageViews and an appropriate layout.
However, I suspect that you would have difficulty getting the circles to layout in the manner shown in your sample.
I'm fairly certain that this would be next to impossible with RelativeLayout, though you may be able to accomplish this with creative use of one of the other layouts.
Other options include:
Merge the 3 images in a graphics editor, and then create a custom view using that.
Merge the 3 images as above, and just use it in an ImageView
Create a custom view from a Canvas, and draw the images yourself, at the appropriate locations.
Which you do will probably depend on how you want the custom control to behave, including:
is any part of it to be animated?
are the 3 circles to be separately clickable?
I am trying to implement the above layout in my Android app.
Basically its two images filling the whole screen, but with a "slider" that is draggable and masks one image over the other. The labels are just some text relating to the image, and should also be masked over when dragged.
So far I haven't been able to see how best to do this using standard layouts, and have been thinking of how to implement this using Canvas.
Any help/tips on the most efficient way to implement this would be appreciated.
NOTE: The slider is supposed to work a lot like the one in the gallery image editor in stock android gallery - except that it stays in place after letting go.
I ended up using LibGDX and making a custom scene for everything.
Didn't find a way to do this using built-in layouts.
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