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

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.eventfilter.BlackHoleEventFilter. 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: 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);
}
 
Example #4
Source File: ToolbarSwipeLayout.java    From 365browser with Apache License 2.0 5 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 ToolbarSwipeLayout(
        Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) {
    super(context, updateHost, renderHost);
    mBlackHoleEventFilter = new BlackHoleEventFilter(context);
    Resources res = context.getResources();
    final float pxToDp = 1.0f / res.getDisplayMetrics().density;
    mCommitDistanceFromEdge = res.getDimension(R.dimen.toolbar_swipe_commit_distance) * pxToDp;
    mSpaceBetweenTabs = res.getDimension(R.dimen.toolbar_swipe_space_between_tabs) * pxToDp;
    mSceneLayer = new TabListSceneLayer();
}
 
Example #5
Source File: SimpleAnimationLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an instance of the {@link SimpleAnimationLayout}.
 * @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.
 */
public SimpleAnimationLayout(
        Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) {
    super(context, updateHost, renderHost);
    mBlackHoleEventFilter = new BlackHoleEventFilter(context);
    mSceneLayer = new TabListSceneLayer();
}
 
Example #6
Source File: OverviewListLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
public OverviewListLayout(
        Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) {
    super(context, updateHost, renderHost);
    mBlackHoleEventFilter = new BlackHoleEventFilter(context);
    mDpToPx = context.getResources().getDisplayMetrics().density;
    mSceneLayer = new SceneLayer();
}