1

I am working on xamarin android. I am using ListView for fast scroll and also display alphabetic index as bubble text.

I want to customize scrollbar, indicator, bubble text. I am trying to apply "fastScrollStyle" but my style is not applied from style.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/White">
    <LinearLayout
        android:id="@+id/LookupSearchView_Container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@color/PrimaryColor"
        android:layout_alignParentTop="true">
        <android.support.v7.widget.SearchView
            android:id="@+id/Lookup_SearchView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:iconifiedByDefault="false"
            android:layout_margin="5dp"
            app:queryHint="Search here"
            app:defaultQueryHint="Search here"
            app:queryBackground="@android:color/transparent"
            android:background="@drawable/radius_background"/>
    </LinearLayout>
    <ListView
      android:id="@+id/Lookup_ListView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@+id/LookupSearchView_Container"
      android:paddingLeft="@dimen/ScreenLayoutMargin"
      android:paddingRight="@dimen/ScreenLayoutMargin"
      android:paddingBottom="@dimen/ScreenLayoutMargin"
      android:fastScrollEnabled="true"
      android:fastScrollAlwaysVisible="true"
      android:smoothScrollbar="true"
      android:fastScrollStyle="@style/FastScrollStyle"/>
</RelativeLayout>

recycler_view_fast_scroller__bubble.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">

  <corners
    android:topLeftRadius="44dp"
    android:topRightRadius="44dp"
    android:bottomLeftRadius="44dp"
    android:bottomRightRadius="0px"/>

  <solid android:color="@color/PrimaryColor"/>
  <size
    android:height="44dp"
    android:width="44dp"/>
</shape>

style.xml

<style name="FastScrollStyle">
    <item name="android:fastScrollPreviewBackgroundRight">@drawable/recycler_view_fast_scroller__bubble</item>
    <item name="android:fastScrollOverlayPosition">aboveThumb</item>
    <item name="android:fastScrollTextColor">@color/White</item>
  </style>

Nothing is work for me. it always uses default style.

Below Image is showing default behavior. I want to make bubble with blue color and also size should be smaller and scrollbar should be also thin.

enter image description here

RMR
  • 599
  • 3
  • 12
  • 35
  • Possible duplicate of [Custom Listview Fast Scrollbar in android](https://stackoverflow.com/questions/17337182/custom-listview-fast-scrollbar-in-android) – Raimo Dec 21 '17 at 13:59

0 Answers0