Default overScrollMode value in Android View -
per android documentation, default value overscrollmode over_scroll_always.
but listview did not seem follow behavior. shows overscrolling behavior when there plenty content scroll in list.
i tried android code , found overscrollmode set over_scroll_if_content_scrolls in view.java ref
i checked code listview , abslistview check if overscrollmode beingness set anywhere couldn't find anything. place overscrollmode set in view.java.
does mean android documentation incorrect? have explicitly set overscrollmode 'always' in list view?
yes, android documentation in fact incorrect. confirmed it. can see in below code android source, overscrolling set if_content_scrolls default.
/** * simple constructor utilize when creating view code. * * @param context context view running in, through can * access current theme, resources, etc. */ public view(context context) { mcontext = context; mresources = context != null ? context.getresources() : null; mviewflags = sound_effects_enabled | haptic_feedback_enabled; // set flags defaults mprivateflags2 = (layout_direction_default << pflag2_layout_direction_mask_shift) | (text_direction_default << pflag2_text_direction_mask_shift) | (pflag2_text_direction_resolved_default) | (text_alignment_default << pflag2_text_alignment_mask_shift) | (pflag2_text_alignment_resolved_default) | (important_for_accessibility_default << pflag2_important_for_accessibility_shift); mtouchslop = viewconfiguration.get(context).getscaledtouchslop(); setoverscrollmode(over_scroll_if_content_scrolls); muserpaddingstart = undefined_padding; muserpaddingend = undefined_padding; if (!scompatibilitydone && context != null) { final int targetsdkversion = context.getapplicationinfo().targetsdkversion; // older apps may need compatibility hack measurement. susebrokenmakemeasurespec = targetsdkversion <= jelly_bean_mr1; // older apps expect onmeasure() called on layout pass, regardless // of whether layout requested on view. signoremeasurecache = targetsdkversion < kitkat; scompatibilitydone = true; } }
android-listview android-view android-overscoll
No comments:
Post a Comment