Apply a gradient to a listview in android - android

I'm trying to use a listview in my application with a gradient from the bottom.
I do not want to use the gradient in the background, I like to use it in the listview.
To try to explain better, I attached a picture of what I want.
The background will show images that will change.
I searched a lot and made ​​several tests, but without success.
I appreciate any help.
Thanks and regards

Android has something built in for that. It is called fading edge. The two XML properties are android:fadingEdgeLength and android:requiresFadingEdge. If you were hoping to have the image gradient change, I don't think they are dynamic.

Related

Android custom rectangle

In my app i need to create cardview with curved top and bottom lines, like this:
I tried to search answer on stackoverflow and google but i haven't found anything. Also i tried to make it via xml, but i couldn't.
Can anyone help me with this? I can't use it like image background because i need to change background color when i click on card and i have a lot of such card in my recyclerview and a lot of different colors for every card.
Thx.
You need to use a custom shape a la this as the background of the view. edit see this post

How would I draw this shape in Android using xml?

I'm porting one of my iOS apps over to Android (which I'm pretty new to), and I was wondering how I would draw this shape in Android using XML:
I want to recreate the shape (the white object) at the bottom of a tableView. The image attached is a screenshot of the bottom of a UITableView.
Any help would be greatly appreciated if you need any more info just let me know.
Thanks
EDIT:
Sorry I wasn't totally clear, I'm actually trying to recreate the slight arch at the bottom of the table. Since it's so slight, you may not be able to see it with a quick glance.
It seams to me that you want to "lift" your table up a little bit. If so, you have to implement this attribute to your tableView:
android:elevation="2dp"
or in java:
tableview.setElevation(2);
My opinion when reading this question: Stop trying to make your android apps look like iOS apps !!!
If you still want to do it.
Just have the background color for your activity to that color and set the layout_margin to either 2 or 4.
It should give you your desired effect.

Using certain elements of an image in the [ImageView] widget as buttons

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

Android custom layout

I am developing an android application with very complex design here is how it should look
I want to achieve this star-like design on the lower half of the image. Icons would represent buttons as well.
What I tried before coming here is
https://github.com/ManuelPeinado/ImageLayout
But that didn't work out so well.
Does anyone had similar experience ?
Make an image like that as layout background and place buttons with transparent background wherever u want.

background images cross fading

I have an application which have multiple backgrounds. I would like to cross-fade these backgrounds at a fixed time interval having one background fading out while slowly showing another (kind of like a slideshow). I know how to use the cross-fading effect in xml but the problem is it won't show another image until the active image is totally fading out. I want the transitions to overlap. Please help.
Thanks.
Have a look at this tutorial: http://www.pushing-pixels.org/2011/03/07/android-bits-and-pieces-image-cross-fading.html
see the below link,which solved my problem(cross-fade effect when changing backgrounds of a view):
Crossfading using TransitionDrawable not working on android

Categories

Resources