Java Code Examples for org.chromium.chrome.browser.compositor.layouts.components.LayoutTab#setTiltX()

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.components.LayoutTab#setTiltX() . 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: StackAnimation.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Responsible for generating the animations that make all the tabs do a full roll.
 *
 * @param tabs The tabs that make up the stack. These are the tabs that will be affected by the
 *             animations.
 * @return     The TabSwitcherAnimation instance that will tween the tabs to create the
 *             appropriate animation.
 */
protected ChromeAnimation<?> createFullRollAnimatorSet(StackTab[] tabs) {
    ChromeAnimation<Animatable<?>> set = new ChromeAnimation<Animatable<?>>();

    for (int i = 0; i < tabs.length; ++i) {
        LayoutTab layoutTab = tabs[i].getLayoutTab();
        // Set the pivot
        layoutTab.setTiltX(layoutTab.getTiltX(), layoutTab.getScaledContentHeight() / 2.0f);
        layoutTab.setTiltY(layoutTab.getTiltY(), layoutTab.getScaledContentWidth() / 2.0f);
        // Create the angle animation
        addTiltScrollAnimation(set, layoutTab, -360.0f, FULL_ROLL_ANIMATION_DURATION, 0);
    }

    return set;
}
 
Example 2
Source File: StackAnimation.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Responsible for generating the animations that make all the tabs do a full roll.
 *
 * @param tabs The tabs that make up the stack. These are the tabs that will be affected by the
 *             animations.
 * @return     The TabSwitcherAnimation instance that will tween the tabs to create the
 *             appropriate animation.
 */
protected ChromeAnimation<?> createFullRollAnimatorSet(StackTab[] tabs) {
    ChromeAnimation<Animatable<?>> set = new ChromeAnimation<Animatable<?>>();

    for (int i = 0; i < tabs.length; ++i) {
        LayoutTab layoutTab = tabs[i].getLayoutTab();
        // Set the pivot
        layoutTab.setTiltX(layoutTab.getTiltX(), layoutTab.getScaledContentHeight() / 2.0f);
        layoutTab.setTiltY(layoutTab.getTiltY(), layoutTab.getScaledContentWidth() / 2.0f);
        // Create the angle animation
        addTiltScrollAnimation(set, layoutTab, -360.0f, FULL_ROLL_ANIMATION_DURATION, 0);
    }

    return set;
}
 
Example 3
Source File: StackAnimation.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Responsible for generating the animations that make all the tabs do a full roll.
 *
 * @param tabs The tabs that make up the stack. These are the tabs that will be affected by the
 *             animations.
 * @return     The TabSwitcherAnimation instance that will tween the tabs to create the
 *             appropriate animation.
 */
protected ChromeAnimation<?> createFullRollAnimatorSet(StackTab[] tabs) {
    ChromeAnimation<Animatable<?>> set = new ChromeAnimation<Animatable<?>>();

    for (int i = 0; i < tabs.length; ++i) {
        LayoutTab layoutTab = tabs[i].getLayoutTab();
        // Set the pivot
        layoutTab.setTiltX(layoutTab.getTiltX(), layoutTab.getScaledContentHeight() / 2.0f);
        layoutTab.setTiltY(layoutTab.getTiltY(), layoutTab.getScaledContentWidth() / 2.0f);
        // Create the angle animation
        addTiltScrollAnimation(set, layoutTab, -360.0f, FULL_ROLL_ANIMATION_DURATION, 0);
    }

    return set;
}