Android 关于View时间配置都放在了ViewConfig文件中
/**
* Defines the duration in milliseconds before a press turns into
* a long press
*/
private static final int LONG_PRESS_TIMEOUT = 500; // t1
完整的代码为:
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.view;
import android.app.AppGlobals;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.RemoteException;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.SparseArray;
/**
* Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
*/
public class ViewConfiguration {
/**
* Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in
* dips
*/
private static final int SCROLL_BAR_SIZE = 10;
/**
* Duration of the fade when scrollbars fade away in milliseconds
*/
private static final int SCROLL_BAR_FADE_DURATION = 250;
/**
* Default delay before the scrollbars fade in milliseconds
*/
private static final int SCROLL_BAR_DEFAULT_DELAY = 300;
/**
* Defines the length of the fading edges in dips
*/
private static final int FADING_EDGE_LENGTH = 12;
/**
* Defines the duration in milliseconds of the pressed state in child
* components.
*/
private static final int PRESSED_STATE_DURATION = 64;
/**
* Defines the default duration in milliseconds before a press turns into
* a long press
*/
private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500;
/**
* Defines the time between successive key repeats in milliseconds.
*/
private static final int KEY_REPEAT_DELAY = 50;
/**
* Defines the duration in milliseconds a user needs to hold down the
* appropriate button to bring up the global actions dialog (power off,
* lock screen, etc).
*/
private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500;
/**
* Defines the duration in milliseconds we will wait to see if a touch event
* is a tap or a scroll. If the user does not move within this interval, it is
* considered to be a tap.
*/
private static final int TAP_TIMEOUT = 100;
/**
* Defines the duration in milliseconds we will wait to see if a touch event
* is a jump tap. If the user does not complete the jump tap within this interval, it is
* considered to be a tap.
*/
private static final int JUMP_TAP_TIMEOUT = 500;
/**
* Defines the duration in milliseconds between the first tap's up event and
* the second tap's down event for an interaction to be considered a
* double-tap.
*/
private static final int DOUBLE_TAP_TIMEOUT = 300;
/**
* Defines the minimum duration in milliseconds between the first tap's up event and
* the second tap's down event for an interaction to be considered a
* double-tap.
*/
private static final int DOUBLE_TAP_MIN_TIME = 40;
/**
* Defines the maximum duration in milliseconds between a touch pad
* touch and release for a given touch to be considered a tap (click) as
* opposed to a hover movement gesture.
*/
private static final int HOVER_TAP_TIMEOUT = 150;
/**
* Defines the maximum distance in pixels that a touch pad touch can move
* before being released for it to be considered a tap (click) as opposed
* to a hover movement gesture.
*/
private static final int HOVER_TAP_SLOP = 20;
/**
* Defines the duration in milliseconds we want to display zoom controls in response
* to a user panning within an application.
*/
private static final int ZOOM_CONTROLS_TIMEOUT = 3000;
/**
* Inset in dips 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 before we think the user is scrolling in dips.
* Note that this value defined here is only used as a fallback by legacy/misbehaving
* applications that do not provide a Context for determining density/configuration-dependent
* values.
*
* To alter this value, see the configuration resource config_viewConfigurationTouchSlop
* in frameworks/base/core/res/res/values/config.xml or the appropriate device resource overlay.
* It may be appropriate to tweak this on a device-specific basis in