Search in sources :

Example 1 with OverScroller

use of android.widget.OverScroller in project android_frameworks_base by ParanoidAndroid.

the class WebViewClassic method init.

/**
     * See {@link WebViewProvider#init(Map, boolean)}
     */
@Override
public void init(Map<String, Object> javaScriptInterfaces, boolean privateBrowsing) {
    Context context = mContext;
    // Used by the chrome stack to find application paths
    JniUtil.setContext(context);
    mCallbackProxy = new CallbackProxy(context, this);
    mViewManager = new ViewManager(this);
    L10nUtils.setApplicationContext(context.getApplicationContext());
    mWebViewCore = new WebViewCore(context, this, mCallbackProxy, javaScriptInterfaces);
    mDatabase = WebViewDatabaseClassic.getInstance(context);
    //TODO Use OverScroller's flywheel
    mScroller = new OverScroller(context, null, 0, 0, false);
    mZoomManager = new ZoomManager(this, mCallbackProxy);
    /* The init method must follow the creation of certain member variables,
         * such as the mZoomManager.
         */
    init();
    setupPackageListener(context);
    setupProxyListener(context);
    setupTrustStorageListener(context);
    updateMultiTouchSupport(context);
    if (privateBrowsing) {
        startPrivateBrowsing();
    }
    mAutoFillData = new WebViewCore.AutoFillData();
    mEditTextScroller = new Scroller(context);
    // Calculate channel distance
    calculateChannelDistance(context);
}
Also used : Context(android.content.Context) OverScroller(android.widget.OverScroller) Scroller(android.widget.Scroller) OverScroller(android.widget.OverScroller)

Example 2 with OverScroller

use of android.widget.OverScroller in project platform_frameworks_base by android.

the class NotificationStackScrollLayout method initView.

private void initView(Context context) {
    mScroller = new OverScroller(getContext());
    setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
    setClipChildren(false);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mOverflingDistance = configuration.getScaledOverflingDistance();
    mCollapsedSize = context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
    mBottomStackPeekSize = context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
    mStackScrollAlgorithm.initView(context);
    mPaddingBetweenElements = Math.max(1, context.getResources().getDimensionPixelSize(R.dimen.notification_divider_height));
    mIncreasedPaddingBetweenElements = context.getResources().getDimensionPixelSize(R.dimen.notification_divider_height_increased);
    mBottomStackSlowDownHeight = mStackScrollAlgorithm.getBottomStackSlowDownLength();
    mMinTopOverScrollToEscape = getResources().getDimensionPixelSize(R.dimen.min_top_overscroll_to_qs);
}
Also used : ViewConfiguration(android.view.ViewConfiguration) OverScroller(android.widget.OverScroller)

Example 3 with OverScroller

use of android.widget.OverScroller in project platform_frameworks_base by android.

the class SystemGesturesPointerEventListener method systemReady.

public void systemReady() {
    Handler h = new Handler(Looper.myLooper());
    mGestureDetector = new GestureDetector(mContext, new FlingGestureDetector(), h);
    mOverscroller = new OverScroller(mContext);
}
Also used : Handler(android.os.Handler) GestureDetector(android.view.GestureDetector) OverScroller(android.widget.OverScroller)

Example 4 with OverScroller

use of android.widget.OverScroller in project android_frameworks_base by DirtyUnicorns.

the class ActionBarOverlayLayout method init.

private void init(Context context) {
    TypedArray ta = getContext().getTheme().obtainStyledAttributes(ATTRS);
    mActionBarHeight = ta.getDimensionPixelSize(0, 0);
    mWindowContentOverlay = ta.getDrawable(1);
    setWillNotDraw(mWindowContentOverlay == null);
    ta.recycle();
    mIgnoreWindowContentOverlay = context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.KITKAT;
    mFlingEstimator = new OverScroller(context);
}
Also used : TypedArray(android.content.res.TypedArray) OverScroller(android.widget.OverScroller)

Example 5 with OverScroller

use of android.widget.OverScroller in project android_frameworks_base by AOSPA.

the class ActionBarOverlayLayout method init.

private void init(Context context) {
    TypedArray ta = getContext().getTheme().obtainStyledAttributes(ATTRS);
    mActionBarHeight = ta.getDimensionPixelSize(0, 0);
    mWindowContentOverlay = ta.getDrawable(1);
    setWillNotDraw(mWindowContentOverlay == null);
    ta.recycle();
    mIgnoreWindowContentOverlay = context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.KITKAT;
    mFlingEstimator = new OverScroller(context);
}
Also used : TypedArray(android.content.res.TypedArray) OverScroller(android.widget.OverScroller)

Aggregations

OverScroller (android.widget.OverScroller)23 ViewConfiguration (android.view.ViewConfiguration)10 TypedArray (android.content.res.TypedArray)5 GestureDetector (android.view.GestureDetector)5 Handler (android.os.Handler)4 Paint (android.graphics.Paint)2 Rect (android.graphics.Rect)2 GestureDetectorCompat (android.support.v4.view.GestureDetectorCompat)2 TextPaint (android.text.TextPaint)2 Scroller (android.widget.Scroller)2 Context (android.content.Context)1 FastOutLinearInInterpolator (android.support.v4.view.animation.FastOutLinearInInterpolator)1 ScaleGestureDetector (android.view.ScaleGestureDetector)1 View (android.view.View)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 FrameLayout (android.widget.FrameLayout)1 TouchInterceptionFrameLayout (com.github.ksoichiro.android.observablescrollview.TouchInterceptionFrameLayout)1 SlidingTabLayout (com.google.samples.apps.iosched.ui.widget.SlidingTabLayout)1