org.chromium.chrome.browser.compositor.layouts.eventfilter.GestureEventFilter Java Examples

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.eventfilter.GestureEventFilter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LayoutManagerChrome.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the {@link LayoutManagerChrome} instance.
 * @param host              A {@link LayoutManagerHost} instance.
 * @param overviewLayoutFactoryDelegate A {@link OverviewLayoutFactoryDelegate} instance.
 */
public LayoutManagerChrome(
        LayoutManagerHost host, OverviewLayoutFactoryDelegate overviewLayoutFactoryDelegate) {
    super(host);
    Context context = host.getContext();
    LayoutRenderHost renderHost = host.getLayoutRenderHost();

    mOverviewModeObservers = new ObserverList<OverviewModeObserver>();

    // Build Event Filter Handlers
    mToolbarSwipeHandler = new ToolbarSwipeHandler(this);

    // Build Event Filters
    mBlackHoleEventFilter = new BlackHoleEventFilter(context, this);
    mGestureEventFilter = new GestureEventFilter(context, this, mGestureHandler);

    // Build Layouts
    mOverviewListLayout =
            new OverviewListLayout(context, this, renderHost, mBlackHoleEventFilter);
    mToolbarSwipeLayout =
            new ToolbarSwipeLayout(context, this, renderHost, mBlackHoleEventFilter);
    if (overviewLayoutFactoryDelegate != null) {
        mOverviewLayout = overviewLayoutFactoryDelegate.createOverviewLayout(
                context, this, renderHost, mGestureEventFilter);
    }
}
 
Example #2
Source File: LayoutManagerChrome.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the {@link LayoutManagerChrome} instance.
 * @param host              A {@link LayoutManagerHost} instance.
 * @param overviewLayoutFactoryDelegate A {@link OverviewLayoutFactoryDelegate} instance.
 */
public LayoutManagerChrome(
        LayoutManagerHost host, OverviewLayoutFactoryDelegate overviewLayoutFactoryDelegate) {
    super(host);
    Context context = host.getContext();
    LayoutRenderHost renderHost = host.getLayoutRenderHost();

    mOverviewModeObservers = new ObserverList<OverviewModeObserver>();

    // Build Event Filter Handlers
    mToolbarSwipeHandler = new ToolbarSwipeHandler(this);

    // Build Event Filters
    mBlackHoleEventFilter = new BlackHoleEventFilter(context, this);
    mGestureEventFilter = new GestureEventFilter(context, this, mGestureHandler);

    // Build Layouts
    mOverviewListLayout =
            new OverviewListLayout(context, this, renderHost, mBlackHoleEventFilter);
    mToolbarSwipeLayout =
            new ToolbarSwipeLayout(context, this, renderHost, mBlackHoleEventFilter);
    if (overviewLayoutFactoryDelegate != null) {
        mOverviewLayout = overviewLayoutFactoryDelegate.createOverviewLayout(
                context, this, renderHost, mGestureEventFilter);
    }
}
 
Example #3
Source File: StackLayout.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * @param context     The current Android's context.
 * @param updateHost  The {@link LayoutUpdateHost} view for this layout.
 * @param renderHost  The {@link LayoutRenderHost} view for this layout.
 * @param eventFilter The {@link EventFilter} that is needed for this view.
 */
public StackLayout(Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) {
    super(context, updateHost, renderHost);

    mGestureHandler = new StackLayoutGestureHandler();
    mGestureEventFilter = new GestureEventFilter(context, mGestureHandler);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mMinDirectionThreshold = configuration.getScaledTouchSlop();
    mMinShortPressThresholdSqr =
            configuration.getScaledPagingTouchSlop() * configuration.getScaledPagingTouchSlop();

    mMinMaxInnerMargin = (int) (MIN_INNER_MARGIN_PERCENT_DP + 0.5);
    mFlingSpeed = FLING_SPEED_DP;
    mStacks = new Stack[2];
    mStacks[0] = new Stack(context, this);
    mStacks[1] = new Stack(context, this);
    mStackRects = new RectF[2];
    mStackRects[0] = new RectF();
    mStackRects[1] = new RectF();

    mViewContainer = new FrameLayout(getContext());
    mSceneLayer = new TabListSceneLayer();
}
 
Example #4
Source File: LayoutManagerDocumentTabSwitcher.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link LayoutManagerDocumentTabSwitcher} instance.
 * @param host            A {@link LayoutManagerHost} instance.
 */
public LayoutManagerDocumentTabSwitcher(LayoutManagerHost host) {
    super(host);
    Context context = host.getContext();
    LayoutRenderHost renderHost = host.getLayoutRenderHost();

    mBlackHoleEventFilter = new BlackHoleEventFilter(context, this);
    mGestureEventFilter = new GestureEventFilter(context, this, mGestureHandler);
    mOverviewListLayout =
            new OverviewListLayout(context, this, renderHost, mBlackHoleEventFilter);
    mOverviewLayout = new StackLayout(context, this, renderHost, mGestureEventFilter);
}