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?
Related
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 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 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 .
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.
I have created a button in Photoshop and I have split them into 3 images. Now I want to put those images into android button. I know how to create layouts in android but the point I am missing is how can I make them fluid?
So there is a button for which I have 3 images.
I now want to ask how can I use these images for a <Button> tag so it expands repeating the middle one. Do I need to create style here and then put background="#drawable/three_button_style" or there is something I really need to know?
Is the same going to be true for ListView? I got a list view and images for top, middle and bottom so can I create a ListView of 3 images repeating the middle one?
For scaling items Android usually uses 9-patch, which behaves something like your example but also vertically. Here's a link to the 9-patch tool that can be used to draw these:
http://developer.android.com/guide/developing/tools/draw9patch.html