Android add crescent shape border to one side of view - android

I have a plain old recyclerView next to a relativeLayout inside a verticalLayout. Nothing fancy about it at all. I am adding some progressBars instead the recyclerView and I was wondering if there's a way to have a cresent shape cut out of the left side of it. Kind of like those typical RPG portraits where the bars are curvered around the picture - only this would scroll around it.
Any pointers would be much appreciated.

Related

Android, horizontal progressBar filled from center to sides

I need to draw a horizontal progressBar, but instead of fill from left to right or from Right to left, I need that ir can be filled from center to sides.
I've read all I've found and find out any library that allow me to do this, But I haven't found anything.
I can do it drawing rectagles, but I'll need to do some calculations to keep dimensions and so on...
Anyone can help me?
Thanks a lot beforehand.
You could quite easily do this by yourself, by combining 2 progressbars.
1 to the left, that goes right-to-left, and 1 to the right, that goes left-to-right.
Then just set the same progress on both of them, without any space in between them. This would create the illusion of 1 progress bar that grows from the middle and outward.
If you really do want a library, this library could do it for you:
https://github.com/castorflex/SmoothProgressBar

Fading edge in RelativeLayout in Android

In the ListView from Android you got native an fading edge on the top and bottom of the view if you are getting to the end or top of the list while scrolling.
Now I was wondering if it was possible to build that same fading edge into the edges of the screen of my application? (So basically in my RelativeLayout)
Can someone give me some guidance on this?
Here is a picture for a better understanding for what I want to achieve.
If I drag an object to the left I want to fade in the blue edge and if I get closer to the edge it must be getting brighter and stronger as color.
What you need to do is put your RelativeLayout inside a HorizontalScrollview and add the following line to your HorizontalScrollview:
android:overScrollMode="always"
You also can do it in code:
yourHorizontalScrollview.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
Check the following link if you want some more information.
http://developer.android.com/reference/android/view/View.html#setOverScrollMode(int)

Android layout vs. custom view

I want to generate the following for my Android application.
I tried to achieve this using RelativeLayout and some drawables (empty circle, filled circle, dotted line) I created using XML , but I am not even close to it. Is it the right way to generate such views with layouts. If so, is RelativeLayout is the way to go? Or should I create a custom view for that?
why are there 4 dots between the last item and the one before it, while the other have 3 dots?
anyway, i think you can achieve those results by having a listView with custom items.
each item would be shown as a relativeLayout with 2 imageViews (one below the other) and a textView on the right of the upper one.
the upper imageView would have the large dot (filled or not), with optional dots above it, and the imageView below would stretch its size according to the textView (align to its bottom plus add some more for extra small-dots) and have tiled dots as its background.
another approach would be to have a listView of textViews and an imageView on its left, and you draw the circles according to what the listView is currently showing (even while scrolling). it's much harder, but might be more precise.

The right layout for a curved set of buttons?

I'm working on creating a menu screen, its fairly boring set of buttons so I wanted to add a curve to their layout to make it a bit more interesting. Like this:
I've just added the curved line to give an idea of what I'm doing - it won't actually have a line when done.
My question is what is the best way to go about doing this. I have tried using a linear layout and then applying a left padding to push them increasingly away from the edge. The problem here is that this depends on the screen size. On a small screen it displays fine and on a larger screen it does not. The second problem I have it that I'd like the entire curve to be centralized in the screen. Should I use a linear layout nested inside another?
If anyone has any ideas or sample layout xml as the best way to achieve this that'd be great.
Take a look on this widget, they doing someting like this
Maybe a relative layout so you can the position of each button relative to the one that comes below it?

what is the use of shadow

What is the use of shadow in Android?
How do I implement shadow in thumbnails?
If someone has a sample screenshot, do you mind sharing it?
Shadows can be added to TextViews through XML or programmatically.
If you'r wanting to add a shadow to a standard view (or any subclasses) this thread should point you in the right direction.
Not knowing what are your objects could be tricky. you can define what's the background in the picture and filter it, then you can strech your image in the direction of the shadow. now filter everything but the background, so you've got 3 layers - background, shadows and objects. place the shadows on the background and on top of that the objects.

Categories

Resources