Overview of ViewConfiguration in android

Source: Internet
Author: User


Android. view. ViewConfiguration
Contains methods to standard constants used in the UI for timeouts, sizes, and distances.

Common Methods:

ViewConfiguration. get (getContext (). getScaledTouchSlop () official description: Distance in PixelsA touch can wander before we think the user is scrolling

The maximum value that the user's fingers can move before being determined to be scroll.


In addition, ViewConfiguration also has the following "constants"

/*** Contains methods and standard constants used to set the UI timeout, size, and distance */public class ViewConfiguration {// sets the width of the horizontal scroll bar and the height of the vertical scroll bar, the Unit is pixel px private static final int SCROLL_BAR_SIZE = 10; // defines the time when the scroll bar gradually disappears, in milliseconds private static final int SCROLL_BAR_FADE_DURATION = 250; // The default number of seconds after the scroll bar disappears. Unit: private static final int SCROLL_BAR_DEFAULT_DELAY = 300; // defines the length of private static final int FADING_EDGE_LENGTH = 12; // define the continuous event private static of the sub-control press status Final int PRESSED_STATE_DURATION = 125; // defines a time when the status is changed. private static final int LONG_PRESS_TIMEOUT = 500; // defines that the user is holding down the appropriate button, the duration of the global pop-up dialog box is private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500; // defines the time required for clicking an event or sliding event in a touch event, if the user slides within this time period, it is considered as a click event private static final int TAP_TIMEOUT = 115; /*** Defines the duration in milliseconds we will wait to see if a touch event * is a jump ta P. If the user does not complete the jump tap within this interval, it is * considered to be a tap. * // when defining a touch event, it is a click event. If the user does not complete the click within this time period, it is considered as a click event private static final int JUMP_TAP_TIMEOUT = 500; // define the interval for double-click events private static final int DOUBLE_TAP_TIMEOUT = 300; // define the time for a scaling control to feedback to the user interface private static final int ZOOM_CONTROLS_TIMEOUT = 3000; /*** Inset in pixels to look for touchable content when the user touches the edge of the screen */private static final int EDGE_SLOP = 12; /*** Distance a touch can wander befo Re we think the user is scrolling in pixels */private static final int TOUCH_SLOP = 16; /*** Distance a touch can wander before we think the user is attempting a paged scroll * (in dips) */private static final int PAGING_TOUCH_SLOP = TOUCH_SLOP * 2; /*** Distance between the first touch and second touch to still be considered a double tap */private static final int DOUBLE_TAP_SLOP = 100 ;/** * Distance a touch needs to be outside of a window's bounds for it to * count as outside for purposes of dismissing the window. */private static final int WINDOW_TOUCH_SLOP = 16; // minimum fling initialization speed. The unit is the number of pixels per second. private static final int MINIMUM_FLING_VELOCITY = 50; // It is used to initialize the maximum fling speed. The unit is the number of pixels per second. private static final int MAXIMUM_FLING_VELOCITY = 4000; // The maximum size of the View Drawing cache, in bytes. In ARGB888 format, this size should be at least equal to the screen size @ Deprecated private static final int MAXIMUM_DRAWING_CACHE_SIZE = 320*480*4; // HVGA screen, ARGB8888 // coefficient of friction strength between flings and scrolls: private static float SCROLL_FRICTION = 0.015f;/*** Max distance to over scroll for edge effects */private static final int OVERSCROLL_DISTANCE = 0; /*** Max distance to over fling for edge effects */private static final int OVERFLING_DISTANCE = 4 ;}


Reference: http://blog.csdn.net/lonelyroamer/article/details/7568129




Related Article

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.