I have a listview with overscroll mode on - (I need it on)
And there is a blue overscroll glow everytime I overscroll
how do I get rid of the overscroll glow ?
EDIT:
I am using a custom listview that streches the overscroll drawable (picture) - the way it should be
however, along with the picture there is a glowing effect which i want to get rid of
see the blue thing above the image?
the image IS the overScrollDrawable - but i want the same thing - without the glow
android:overScrollMode="never"
You just need to set your ListView property fadeEdge to none in your layout xml file and you will not get the shadow blue on OVERSCROLL.
android:fadingEdge="none"
EDIT:
this is now deprecated, you can use android:overScrollMode="never" instead.
In the ListView you can set the drawable when overscrolling on top or bottom. This is usually set to a white/transparent drawable that is animated with fadeIn and fadeOut. To set the glowing to something fully transparent you can write:
ListView listView = ...;
listView.setOverscrollFooter(new ColorDrawable(0));
listView.setOverscrollHeader(new ColorDrawable(0));
This keeps the overscroll itself active, so that you can react on overscrolling events, but the glowing should be gone.
Related
I have a RecyclervView with a rounded Drawable background and .clipToOutline = true in order to keep the overscroll animation inside the background. When I set requiresFadingEdge="vertical", there's a glitch where the fading edge is; example below. How can I fix this? The issue doesn't appear when I set .clipToOutline = false or when I don't have a fading edge, but I would like both of these effects. Thanks for the help.
You can see the issue in the bottom corners of the blue RecyclerView.
This can be fixed by setting a different layer type either in xml, or programatically when initialising your recyclerview:
XML
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recyclerView"
android:layerType="hardware"
...
Programatically
recyclerView.setLayerType(VIEW.LAYER_TYPE_HARDWARE, null)
You can also use LAYER_TYPE_SOFTWARE, but it's better to use LAYER_TYPE_HARDWARE for performance reasons.
Find out more about this 2 options in these docs:
https://developer.android.com/reference/android/view/View#LAYER_TYPE_HARDWARE
https://developer.android.com/reference/android/view/View#LAYER_TYPE_SOFTWARE
I have a listview with overscroll mode on - (I need it on)
And there is a blue overscroll glow everytime I overscroll
how do I get rid of the overscroll glow ?
EDIT:
I am using a custom listview that streches the overscroll drawable (picture) - the way it should be
however, along with the picture there is a glowing effect which i want to get rid of
see the blue thing above the image?
the image IS the overScrollDrawable - but i want the same thing - without the glow
android:overScrollMode="never"
You just need to set your ListView property fadeEdge to none in your layout xml file and you will not get the shadow blue on OVERSCROLL.
android:fadingEdge="none"
EDIT:
this is now deprecated, you can use android:overScrollMode="never" instead.
In the ListView you can set the drawable when overscrolling on top or bottom. This is usually set to a white/transparent drawable that is animated with fadeIn and fadeOut. To set the glowing to something fully transparent you can write:
ListView listView = ...;
listView.setOverscrollFooter(new ColorDrawable(0));
listView.setOverscrollHeader(new ColorDrawable(0));
This keeps the overscroll itself active, so that you can react on overscrolling events, but the glowing should be gone.
I am working on an android app and I have a scrollview, and in that, I have a linear layout in the main activity. I want to have the top and bottom borders of the linear layout to be "faded
" so as the user scrolls down the child views in the layout will "fade out" as the go down.
Here is an example of what I am trying to achieve in my linearlayout or scrollview (the "fading bottom border".
Thanks for you help!
Subby
You can do that by using the following attributes in the ScrollView.
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="20dp"
If you want it on devices before API14, you need to use the following:
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="20dp"
NOTE: This is actually discouraged as it is seen to have a negative performance impact on devices.
At the bottom of your layout, you can have a view above the listView, and set Gradient Color for the view, and also make it semitransparent, then you can have the effect you want.
I want to add a image button on the right side of the row in my linearlayout. I tried it with padding left which works but a grey shadow is visible for the padding area. How can I achieve this with linearlayout but without the shadow. Does someone know how to achieve this?
Thanks
android:gravity="right" into your XML code should do the trick. Essentially, this will force the View to head to the right part of the view.
We know that, when we scroll a listview at bottom or top of the list, we will see gradient color of yellow and black. Same thing will happen for ScrollView and HorizontalScrollView also at the edges. I want to disable the color when user scrolling these views.
is it possible to disable that color as we disable scrollbars with property
android:scrollbars="none"
If anybody know the solution please help me.
The yellow-black gradient color is actually appears when you over scroll the scroll views.
It can be eliminated by using below code in XML file of ScrollView or HorizontalScrollView
android:overScrollMode="never"
It will work for android 2.3 and above. I don't for below API levels.
Use android:fadingEdge="none" in <ListView>