ListView Rebound Effect 1

Source: Internet
Author: User

The main use of the Overscrollby method, provided that the entire screen must be filled to be effective

 PackageCom.weidingqiang.customlistview;ImportAndroid.content.Context;ImportAndroid.util.AttributeSet;ImportAndroid.util.DisplayMetrics;ImportAndroid.widget.ListView;/*** Created by Weidingqiang on 15/11/28.*/ Public classListviewmoveextendsListView {Private Static Final intMax_y_overscroll_distance = 200; PrivateContext Mcontext; Private intmmaxyoverscrolldistance;  PublicListviewmove (Context context) { This(Context,NULL); }     PublicListviewmove (Context context, AttributeSet attrs) {Super(context, attrs); Mcontext=context;    Initbouncelistview (); }    Private voidInitbouncelistview () {FinalDisplaymetrics metrics =mcontext.getresources (). Getdisplaymetrics (); Final floatDensity =metrics.density; Mmaxyoverscrolldistance= (int) (Density *max_y_overscroll_distance); } @Overrideprotected BooleanOverscrollby (intDeltaX,intDeltaY,intSCROLLX,intScrolly,intScrollrangex,intScrollrangey,intMAXOVERSCROLLX,intMaxoverscrolly,Booleanistouchevent) {        return Super. Overscrollby (DeltaX, DeltaY, Scrollx, scrolly, Scrollrangex, Scrollrangey, MAXOVERSCROLLX,    Mmaxyoverscrolldistance, istouchevent); }}

ListView Rebound Effect 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.