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

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.eventfilter.AreaGestureEventFilter. 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: StripLayoutHelperManager.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an instance of the {@link StripLayoutHelperManager}.
 * @param context           The current Android {@link Context}.
 * @param updateHost        The parent {@link LayoutUpdateHost}.
 * @param renderHost        The {@link LayoutRenderHost}.
 */
public StripLayoutHelperManager(Context context, LayoutUpdateHost updateHost,
        LayoutRenderHost renderHost, AreaGestureEventFilter eventFilter) {
    mUpdateHost = updateHost;
    mTabStripTreeProvider = new TabStripSceneLayer(context);

    mEventFilter = eventFilter;

    mNormalHelper = new StripLayoutHelper(context, updateHost, renderHost, false);
    mIncognitoHelper = new StripLayoutHelper(context, updateHost, renderHost, true);

    mModelSelectorButton = new CompositorButton(
            context, MODEL_SELECTOR_BUTTON_WIDTH_DP, MODEL_SELECTOR_BUTTON_HEIGHT_DP);
    mModelSelectorButton.setIncognito(false);
    mModelSelectorButton.setVisible(false);
    // Pressed resources are the same as the unpressed resources.
    mModelSelectorButton.setResources(R.drawable.btn_tabstrip_switch_normal,
            R.drawable.btn_tabstrip_switch_normal, R.drawable.btn_tabstrip_switch_incognito,
            R.drawable.btn_tabstrip_switch_incognito);
    mModelSelectorButton.setY(MODEL_SELECTOR_BUTTON_Y_OFFSET_DP);

    Resources res = context.getResources();
    mHeight = res.getDimension(R.dimen.tab_strip_height) / res.getDisplayMetrics().density;
    mModelSelectorButton.setAccessibilityDescription(
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_standard),
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_incognito));

    onContextChanged(context);
}
 
Example #2
Source File: StripLayoutHelperManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an instance of the {@link StripLayoutHelperManager}.
 * @param context           The current Android {@link Context}.
 * @param updateHost        The parent {@link LayoutUpdateHost}.
 * @param renderHost        The {@link LayoutRenderHost}.
 */
public StripLayoutHelperManager(Context context, LayoutUpdateHost updateHost,
        LayoutRenderHost renderHost, AreaGestureEventFilter eventFilter) {
    mUpdateHost = updateHost;
    mTabStripTreeProvider = new TabStripSceneLayer(context);

    mEventFilter = eventFilter;

    mNormalHelper = new StripLayoutHelper(context, updateHost, renderHost, false);
    mIncognitoHelper = new StripLayoutHelper(context, updateHost, renderHost, true);

    mModelSelectorButton = new CompositorButton(
            context, MODEL_SELECTOR_BUTTON_WIDTH_DP, MODEL_SELECTOR_BUTTON_HEIGHT_DP);
    mModelSelectorButton.setIncognito(false);
    mModelSelectorButton.setVisible(false);
    // Pressed resources are the same as the unpressed resources.
    mModelSelectorButton.setResources(R.drawable.btn_tabstrip_switch_normal,
            R.drawable.btn_tabstrip_switch_normal, R.drawable.btn_tabstrip_switch_incognito,
            R.drawable.btn_tabstrip_switch_incognito);
    mModelSelectorButton.setY(MODEL_SELECTOR_BUTTON_Y_OFFSET_DP);

    Resources res = context.getResources();
    mHeight = res.getDimension(R.dimen.tab_strip_height) / res.getDisplayMetrics().density;
    mModelSelectorButton.setAccessibilityDescription(
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_standard),
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_incognito));

    onContextChanged(context);
}
 
Example #3
Source File: StripLayoutHelperManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an instance of the {@link StripLayoutHelperManager}.
 * @param context           The current Android {@link Context}.
 * @param updateHost        The parent {@link LayoutUpdateHost}.
 * @param renderHost        The {@link LayoutRenderHost}.
 */
public StripLayoutHelperManager(
        Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) {
    mUpdateHost = updateHost;
    mTabStripTreeProvider = new TabStripSceneLayer(context);
    mTabStripEventHandler = new TabStripEventHandler();
    mEventFilter =
            new AreaGestureEventFilter(context, mTabStripEventHandler, null, false, false);

    mNormalHelper = new StripLayoutHelper(context, updateHost, renderHost, false);
    mIncognitoHelper = new StripLayoutHelper(context, updateHost, renderHost, true);

    CompositorOnClickHandler selectorClickHandler = new CompositorOnClickHandler() {
        @Override
        public void onClick(long time) {
            handleModelSelectorButtonClick();
        }
    };
    mModelSelectorButton = new CompositorButton(context, MODEL_SELECTOR_BUTTON_WIDTH_DP,
            MODEL_SELECTOR_BUTTON_HEIGHT_DP, selectorClickHandler);
    mModelSelectorButton.setIncognito(false);
    mModelSelectorButton.setVisible(false);
    // Pressed resources are the same as the unpressed resources.
    mModelSelectorButton.setResources(R.drawable.btn_tabstrip_switch_normal,
            R.drawable.btn_tabstrip_switch_normal, R.drawable.btn_tabstrip_switch_incognito,
            R.drawable.btn_tabstrip_switch_incognito);
    mModelSelectorButton.setY(MODEL_SELECTOR_BUTTON_Y_OFFSET_DP);

    Resources res = context.getResources();
    mHeight = res.getDimension(R.dimen.tab_strip_height) / res.getDisplayMetrics().density;
    mModelSelectorButton.setAccessibilityDescription(
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_standard),
            res.getString(R.string.accessibility_tabstrip_btn_incognito_toggle_incognito));

    onContextChanged(context);
}