Unispaw
Unispaw

Reputation: 158

remove blue glow around ListItem in ListView (android)

I want to get rid of this horrible blue HOLO glow around my listitems when clicked.

I have:

<ListView
        android:id="@+id/projects_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:cacheColorHint="#00000000"
        android:choiceMode="singleChoice"
        android:listSelector="@android:color/transparent"
        android:paddingBottom="0dp"
        android:paddingLeft="0dp"
        android:paddingRight="0dp"
        android:scrollbars="none" />

but it still looks like this: http://www.roji.be/IMG_0001.png

UPDATE: ok my app them is :

<style name="AppBaseTheme" parent="android:style/Theme.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
        <item name="android:windowBackground">@drawable/gradient_bg</item>
        <item name="android:windowContentOverlay">@null</item>
</style>

And each listitem is wrapped in a LinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/com.axxes.netinc"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/listitemshadow" //9patch shadow 
    android:orientation="vertical"
    android:paddingTop="8dp" >

Upvotes: 1

Views: 1216

Answers (3)

Atiar Talukdar
Atiar Talukdar

Reputation: 746

just add android:overScrollMode="never" in your listview.

        <ListView
            android:layout_marginTop="5dp"
            android:id="@+id/listview"
            tools:listitem="@layout/row_item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never">
        </ListView>

Upvotes: 0

Yarh
Yarh

Reputation: 4607

To remove blue glow completely:

android:overScrollMode="never" place this attribute inside listview.
To change glow color add this code in application class

int glowDrawableId = getResources().getIdentifier("overscroll_glow", "drawable", "android");
        int edgeDrawableId = getResources().getIdentifier("overscroll_edge", "drawable", "android");
        Drawable androidGlow = ContextCompat.getDrawable(this, glowDrawableId);
        Drawable androidEdge = ContextCompat.getDrawable(this, edgeDrawableId);
        androidGlow.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);
        androidEdge.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);

Upvotes: 0

Madhuri
Madhuri

Reputation: 368

set fading edge of listview to none.

<ListView
    android:id="@+id/projects_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:choiceMode="singleChoice"
    android:listSelector="@android:color/transparent"
    android:paddingBottom="0dp"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:scrollbars="none"
    android:fadingEdge="none" />

Upvotes: 2

Related Questions