I have a 4 sharp cornered image to display it my android application. But i want that image to be little curved from Top Left Corner. There should be no animation, nothing. Just an Image with a Curve on its top left corner.
Please look into the following image for reference, for what i wanted to achieved.
take a linear layout with fill parent and set background color while. then use image with in linear layout to show another one image on the screen.
Related
Is that possible to create different corner for drawable (or draw over the canvas whatever) like this in Android?
demo picture
My goals is to become tab layout indicator to look like that picture, I can make tab layout indicator to be a full width by setting tabIndicatorGravity to stretch.
But I have no idea to complete such as corner and left/top/right margin (look at the pic).
** Edit **
Some icon from the demo picture (like spinner) isn't my point.
I am building an Android app and trying to create a list item view for my RecyclerView, that will look like the one in the picture.
I successfully created the view (using 3 RelativeLayouts side by side inside a LinearLayout) but without the triangle arrow.
Can someone please advise on how to reach the desired result with the triangle arrow in an xml drawable?
Please note that the rectangles should have same x coordinates and only the arrow needs to "invade" to the adjacent layout area.
you can add images with the desired color with attribute center vertical to true, you can find the icons on https://material.io/icons/
I am working on some animation in which there are four images. I want to do as follows:
Flip them from right to center
Then from center to left side
The right side should be smaller and when flipped, it should come to center and size of the image should be enlarged.
The next image should come to the center and the current image should go to left side and the size of the image should decrease by animation(or scaled).
Basically I want images to grow from right to center and then shrink to left side...same thing for left to right.
Can anybody please tell how to do this animation?
Thanks
Perhaps android-3d-flip-view-transition is what you are looking for? There is also the FlipAnimator class, it really depends on how you want to implement this but from what I can tell they both allow you to specify pivotal points so you can flip left-to-right like a book or centered like in iOS when you click the little "i" info button at the bottom-right hand corner of some apps.
So I've patched an image however it has padding on the left and right which I DO NOT want, however when I patch the image without padding the corners on the image get distorted when it's drawn in a layout.
Below is a screenshot of how I am doing it, how would you overcome this issue?
Maybe just try to specify the padding the way it's meant to be specified, i.e. by drawing the bottom (and right if you want) border in 9-patch tool. Like this:
This way the padding should be right (side to side) and corners not distorted.
The left and top lines define the stretchable area. When you include your corners in the stretchable area, the image gets distorted. In this case, one black pixel touching the center of the image on the left and the same on the top would suffice.
To identify the rectangle for the view contents, and thus the padding, you can use right and bottom lines.
I am trying to create a stretchable scroll handle for my app.
The first image is the scrollhandle.9.png that I include in my app's resources.
The second image shows what this 9patch image looks like when used in my app.
Any advice on how to accomplish a stretchable scroll handle?
Edit: With help from posters, I was able to get an image that works. I added it below to help those who may find this in the future.
The area covered by the top and the left black line(dots) will be used while scaling your image. This area will be highlighted to you when you click the "show patch" option. You can see how the image scales by using the "Patch scale" option given in the draw9patch tool.
The area covered by the right and bottom lines(dots) will hold the content for the background.
Eg: You can define boundaries for the text inside 9 patch image for editor background. For your case you don't need right and bottom lines.
So for your case place two dots at the top corner and two dots at the left corner. Make sure patches doesn't fall in the arrow image of the scroll(if they do fall your arrow image will also get stretched) . Try putting the dots only in the left and top lines till you get the desired preview with "Patch scale" option.
If you use only one dot (instead of four) at the top and bottom left, and one at image top center, it should stretch the way you want it to.