How to Add triangle shape for activity or page change like in facebook page?
You can use QuickAction Dialog in android Here is example code .
If you are considered about the shape
See this answer
Also this article
And simple work around ::Give your parent layout transparent background and place the triangle in center of layout and you can achieve the position in the image
Or you can go for 9 patch images directly :: see this
Related
So lets say I have a segmented circle image asset inside an 'ImageView' widget, and I want to use each segment of that circle as a clickable surface to bring up a fragment with an image and some info.
Is there any way to build transparent arrangeable borders that I can use to do this with?
I'm using android studio with the default NavigationDrawer activity if that helps.
Maybe adding some ImageViews with transparent images on top of each section and making them clickable? That's how I'd do it. Of course this won't cover perfectly the area but it may work for what you need it.
So I found this. In case it can be of help to anyone else:
https://github.com/anupcowkur/Android-Wheel-Menu
Is it possible to create a completely custom shape in xml? I'm trying to create a button which looks like this: http://s11.postimg.org/e4izrlgrj/image.png (a mockup i did in photoshop)
I need to be able to create the outline shape and the small blue tab top right.
I have tried with some xml but getting nowhere close. I'm aware you can do something with Path class but never used it, is this the only option?
Thanks
I don't know about a completely custom shape but have you tryed using font icons?
Take a look at this: http://css-tricks.com/svg-sprites-use-better-icon-fonts/
I want make a custom button in android left solid arrow (only arrow shape not its background).
How can I create this arrow button using shape drawable XML in android.
I know how to create rectangle button but not arrow.
Anybody who knows it please tell me how to do.
Sorry I can't post code, only show you where to go.
But the ultimate answer is to use a pathshape button. Then it handles everything for you.
Create the paths by following the information at http://developer.android.com/reference/android/graphics/Path.html
You can learn more about shapes at http://developer.android.com/reference/android/graphics/drawable/shapes/Shape.html
Finally you can learn about tying them together at http://developer.android.com/reference/android/graphics/drawable/shapes/PathShape.html
That way you can do it even in XML. And there's a variety of arc path methods. Check it out!
How can I wrap the content inside a box? Just like twitter.
Check how is Twitter and how is mine:
http://img17.imageshack.us/img17/8241/stackoverflow.png
To get the effect your trying to go far, you're going to have to use a 9patch png as your background image for your ListView and set padding on your ListView to match the size of your border on your 9patch.
The 9patch should look exactly like the background as it shows in the Twitter example.
You can learn more about 9patches here.
It's an optical illusion. You really want to create three 9-patches - top item, middle item, bottom item. Then dynamically set the background drawable for each item based on its position in the list. Just make sure your borders line up properly between the drawables and you should be fine.
`
Hi,
I have requirement of using my own background and blue light for toggle button.
However, using this i am not able to custom position light of toggle button which is always placed to the bottom of button.
I want to move it above and just below center of button.
I tried with paddingBottom but that did not help. Any help regarding this appreciated.
-Thanks,
Manju
That light is part of the nine-patch png. If you create new backgrounds, you need to add your own "on" and "off" circles to the file. You then use the border lines of the nine-patch to prevent stretching of the circle.
http://developer.android.com/guide/developing/tools/draw9patch.html
Read also my answer here for another explanation: How to create android spinner without down triangle on the right side of the widget
Use a LayerList and position the graphic on the toggle button by enclosing the drawable in a bitmap tag, and set its gravity to 'center' - see LayerList here
Use a relativeLayout and do android:layout_Below, if I understand your question correctly