title: How detect Fading Edge in End or Start of ListView?
body: <p>I've tried so many posts here in <code>StackOverflow</code> but with no luck. My requirement is very simple. I have a <code>listView</code>. When scrolling the <code>listView</code>, I want to detect the <code>Fading Edge</code>, i.e.  I want to show a Log massage when the fading edge will be visible. How can I detect the <code>Fading Edge</code>?</p>
  
  <p>*<strong><em>UPDATE: I found the solution. Here is my Solution.</em>*</strong></p>
  
  <p><code>STEP 1: First I extended the ListView as shown below</code></p>
  
  <p>ManipulateList.java</p>
  
  <pre><code>public class ManipulateList extends ListView {
  
  public ManipulateList(Context context) {
      super(context);
      // TODO Auto-generated constructor stub
  }
  
  public ManipulateList(Context context, AttributeSet attrs) {
      super(context, attrs);
      // TODO Auto-generated constructor stub
  }
  
  
  public ManipulateList(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
      // TODO Auto-generated constructor stub
  }
  
  @Override
  protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX,
          boolean clampedY) {
      // TODO Auto-generated method stub
      Log.d("***", "Over Scrolling: Fading Edge NOW Visible");
  
      super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
  }
  
  
  }
  </code></pre>
  
  <p>Here you can See, I've overridden the <code>onOverScrolled</code> method to do my Own Task here.</p>
  
  <p><code>Step 2: "activity_main.xml" declaration with my modified listview</code></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity" &gt;
  
  &lt;com.example.customlist.ManipulateList
      android:id="@+id/listView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true" &gt;
  
  &lt;/com.example.customlist.ManipulateList&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><code>STEP 3: My main activity's onCreate Method shown Below</code></p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      ManipulateList listView = (ManipulateList) findViewById(R.id.listView1);
      String[] swName = new String[] {"a", "b","c",
              "d", "e","f",
              "g", "h","i",
              "j", "k","l",
              "m", "n","o",
              "p", "q","r",
              "s", "t","u",
              "v", "w","x",
              "y","z","a","b",
              "c","d","e","f"
              };
  
  
      ArrayAdapter&lt;String&gt; swGAA = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, android.R.id.text1, swName);
  
  
  
      listView.setAdapter(swGAA);
  
  
  
  
  }
  </code></pre>
  
  <p><code>STEP 4: ENJOY!</code></p>