Java Code Examples for org.chromium.ui.UiUtils

The following examples show how to use org.chromium.ui.UiUtils. These examples are extracted from open source projects. 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 Project: 365browser   Source File: ActivityWindowAndroid.java    License: Apache License 2.0 7 votes vote down vote up
@Override
protected void registerKeyboardVisibilityCallbacks() {
    Activity activity = getActivity().get();
    if (activity == null) return;
    View content = activity.findViewById(android.R.id.content);
    mIsKeyboardShowing = UiUtils.isKeyboardShowing(getActivity().get(), content);
    content.addOnLayoutChangeListener(this);
}
 
Example 2
Source Project: delion   Source File: ScreenshotTask.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Prepares a given screenshot for sending with a feedback.
 * If no screenshot is given it creates one from the activity View if an activity is provided.
 * @param activity An activity or null
 * @param bitmap A screenshot or null
 * @return A feedback-ready screenshot or null
 */
private static Bitmap prepareScreenshot(@Nullable Activity activity, @Nullable Bitmap bitmap) {
    if (bitmap == null) {
        if (activity == null) return null;
        return UiUtils.generateScaledScreenshot(
                activity.getWindow().getDecorView().getRootView(),
                MAX_FEEDBACK_SCREENSHOT_DIMENSION, Bitmap.Config.ARGB_8888);
    }

    int screenshotMaxDimension = Math.max(bitmap.getWidth(), bitmap.getHeight());
    if (screenshotMaxDimension <= MAX_FEEDBACK_SCREENSHOT_DIMENSION) return bitmap;

    float screenshotScale = (float) MAX_FEEDBACK_SCREENSHOT_DIMENSION / screenshotMaxDimension;
    int destWidth = (int) (bitmap.getWidth() * screenshotScale);
    int destHeight = (int) (bitmap.getHeight() * screenshotScale);
    return Bitmap.createScaledBitmap(bitmap, destWidth, destHeight, true);
}
 
Example 3
Source Project: delion   Source File: BookmarkSearchView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    // This method might be called very early. Null check on bookmark model here.
    if (mBookmarkModel == null) return;

    if (visibility == View.VISIBLE) {
        mBookmarkModel.addObserver(mModelObserver);
        updateHistoryList();
        mSearchText.requestFocus();
        UiUtils.showKeyboard(mSearchText);
    } else {
        UiUtils.hideKeyboard(mSearchText);
        mBookmarkModel.removeObserver(mModelObserver);
        resetUI();
        clearFocus();
    }
}
 
Example 4
Source Project: delion   Source File: CompositorViewHolder.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void hideKeyboard(Runnable postHideTask) {
    // When this is called we actually want to hide the keyboard whatever owns it.
    // This includes hiding the keyboard, and dropping focus from the URL bar.
    // See http://crbug/236424
    // TODO(aberent) Find a better place to put this, possibly as part of a wider
    // redesign of focus control.
    if (mUrlBar != null) mUrlBar.clearFocus();
    boolean wasVisible = false;
    if (hasFocus()) {
        wasVisible = UiUtils.hideKeyboard(this);
    }
    if (wasVisible) {
        mPostHideKeyboardTask = postHideTask;
    } else {
        postHideTask.run();
    }
}
 
Example 5
Source Project: delion   Source File: UrlBar.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
    super.onWindowFocusChanged(hasWindowFocus);
    if (hasWindowFocus) {
        if (mShowKeyboardOnWindowFocus && isFocused()) {
            // Without the call to post(..), the keyboard was not getting shown when the
            // window regained focus despite this being the final call in the view system
            // flow.
            post(new Runnable() {
                @Override
                public void run() {
                    UiUtils.showKeyboard(UrlBar.this);
                }
            });
        }
        mShowKeyboardOnWindowFocus = false;
    }
}
 
Example 6
Source Project: delion   Source File: InfoBarContainer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the View when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(getContext(), InfoBarContainer.this)) {
        if (isShowing) {
            // Set to invisible (instead of gone) so that onLayout() will be called when the
            // keyboard is dismissed.
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing && !mIsObscured) {
            setVisibility(View.VISIBLE);
        }
    }

    super.onLayout(changed, l, t, r, b);
}
 
Example 7
Source Project: delion   Source File: EmptyBackgroundViewTablet.java    License: Apache License 2.0 6 votes vote down vote up
public void setEmptyContainerState(boolean shouldShow) {
    Animator nextAnimator = null;

    if (shouldShow && getVisibility() != View.VISIBLE
            && mCurrentTransitionAnimation != mAnimateInAnimation) {
        nextAnimator = mAnimateInAnimation;
        UiUtils.hideKeyboard(this);
    } else if (!shouldShow && getVisibility() != View.GONE
            && mCurrentTransitionAnimation != mAnimateOutAnimation) {
        nextAnimator = mAnimateOutAnimation;
    }

    if (nextAnimator != null) {
        if (mCurrentTransitionAnimation != null) mCurrentTransitionAnimation.cancel();
        mCurrentTransitionAnimation = nextAnimator;
        mCurrentTransitionAnimation.start();
    }
}
 
Example 8
Source Project: delion   Source File: FindToolbar.java    License: Apache License 2.0 6 votes vote down vote up
private void showKeyboard() {
    if (!mFindQuery.hasWindowFocus()) {
        // HACK: showKeyboard() is normally called from activate() which is
        // triggered by an options menu item. Unfortunately, because the
        // options menu is still focused at this point, that means our
        // window doesn't actually have focus when this first gets called,
        // and hence it isn't the target of the Input Method, and in
        // practice that means the soft keyboard never shows up (whatever
        // flags you pass). So as a workaround we postpone asking for the
        // keyboard to be shown until just after the window gets refocused.
        // See onWindowFocusChanged(boolean hasFocus).
        mShowKeyboardOnceWindowIsFocused = true;
        return;
    }
    UiUtils.showKeyboard(mFindQuery);
}
 
Example 9
Source Project: AndroidChromium   Source File: ScreenshotTask.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Prepares a given screenshot for sending with a feedback.
 * If no screenshot is given it creates one from the activity View if an activity is provided.
 * @param activity An activity or null
 * @param bitmap A screenshot or null
 * @return A feedback-ready screenshot or null
 */
private static Bitmap prepareScreenshot(@Nullable Activity activity, @Nullable Bitmap bitmap) {
    if (bitmap == null) {
        if (activity == null) return null;
        return UiUtils.generateScaledScreenshot(
                activity.getWindow().getDecorView().getRootView(),
                MAX_FEEDBACK_SCREENSHOT_DIMENSION, Bitmap.Config.ARGB_8888);
    }

    int screenshotMaxDimension = Math.max(bitmap.getWidth(), bitmap.getHeight());
    if (screenshotMaxDimension <= MAX_FEEDBACK_SCREENSHOT_DIMENSION) return bitmap;

    float screenshotScale = (float) MAX_FEEDBACK_SCREENSHOT_DIMENSION / screenshotMaxDimension;
    int destWidth = (int) (bitmap.getWidth() * screenshotScale);
    int destHeight = (int) (bitmap.getHeight() * screenshotScale);
    return Bitmap.createScaledBitmap(bitmap, destWidth, destHeight, true);
}
 
Example 10
Source Project: AndroidChromium   Source File: BookmarkSearchView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
    super.onVisibilityChanged(changedView, visibility);
    // This method might be called very early. Null check on bookmark model here.
    if (mBookmarkModel == null) return;

    if (visibility == View.VISIBLE) {
        mBookmarkModel.addObserver(mModelObserver);
        updateHistoryList();
        mSearchText.requestFocus();
        UiUtils.showKeyboard(mSearchText);
    } else {
        UiUtils.hideKeyboard(mSearchText);
        mBookmarkModel.removeObserver(mModelObserver);
        resetUI();
        clearFocus();
    }
}
 
Example 11
Source Project: AndroidChromium   Source File: CompositorViewHolder.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void hideKeyboard(Runnable postHideTask) {
    // When this is called we actually want to hide the keyboard whatever owns it.
    // This includes hiding the keyboard, and dropping focus from the URL bar.
    // See http://crbug/236424
    // TODO(aberent) Find a better place to put this, possibly as part of a wider
    // redesign of focus control.
    if (mUrlBar != null) mUrlBar.clearFocus();
    boolean wasVisible = false;
    if (hasFocus()) {
        wasVisible = UiUtils.hideKeyboard(this);
    }
    if (wasVisible) {
        mPostHideKeyboardTask = postHideTask;
    } else {
        postHideTask.run();
    }
}
 
Example 12
Source Project: AndroidChromium   Source File: ShareHelper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Clears all shared image files.
 */
public static void clearSharedImages() {
    new AsyncTask<Void, Void, Void>() {
        @Override
        protected Void doInBackground(Void... params) {
            try {
                File imagePath = UiUtils.getDirectoryForImageCapture(
                        ContextUtils.getApplicationContext());
                deleteShareImageFiles(new File(imagePath, SHARE_IMAGES_DIRECTORY_NAME));
            } catch (IOException ie) {
                // Ignore exception.
            }
            return null;
        }
    }.execute();
}
 
Example 13
Source Project: AndroidChromium   Source File: UrlBar.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
    super.onWindowFocusChanged(hasWindowFocus);
    if (hasWindowFocus) {
        if (mShowKeyboardOnWindowFocus && isFocused()) {
            // Without the call to post(..), the keyboard was not getting shown when the
            // window regained focus despite this being the final call in the view system
            // flow.
            post(new Runnable() {
                @Override
                public void run() {
                    UiUtils.showKeyboard(UrlBar.this);
                }
            });
        }
        mShowKeyboardOnWindowFocus = false;
    }
}
 
Example 14
Source Project: AndroidChromium   Source File: LocationBarLayout.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void revertChanges() {
    if (!mUrlHasFocus) {
        setUrlToPageUrl();
    } else {
        Tab tab = mToolbarDataProvider.getTab();
        if (NativePageFactory.isNativePageUrl(tab.getUrl(), tab.isIncognito())) {
            setUrlBarText("", null);
        } else {
            setUrlBarText(
                    mToolbarDataProvider.getText(), getCurrentTabUrl());
            selectAll();
        }
        hideSuggestions();
        UiUtils.hideKeyboard(mUrlBar);
    }
}
 
Example 15
/**
 * Similar to {@link #getProficientLanguageList} except the the result is provided in
 * a {@link LinkedHashSet} to provide access to a unique ordered list.
 * @return a {@link LinkedHashSet} of languages the user is proficient using.
 */
private LinkedHashSet<String> getProficientLanguages() {
    LinkedHashSet<String> uniqueLanguages = new LinkedHashSet<String>();
    // The primary language, according to the translation-service, always comes first.
    String primaryLanguage = getNativeTranslateServiceTargetLanguage();
    if (isValidLocale(primaryLanguage)) {
        uniqueLanguages.add(trimLocaleToLanguage(primaryLanguage));
    }
    // Merge in the IME locales, if possible.
    if (!ContextualSearchFieldTrial.isKeyboardLanguagesForTranslationDisabled()) {
        Context context = mActivity.getApplicationContext();
        if (context != null) {
            for (String locale : UiUtils.getIMELocales(context)) {
                if (isValidLocale(locale)) uniqueLanguages.add(trimLocaleToLanguage(locale));
            }
        }
    }
    return uniqueLanguages;
}
 
Example 16
Source Project: AndroidChromium   Source File: TabContentViewParent.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onContentChanged(Tab tab) {
    // If the tab is frozen, both native page and content view are not ready.
    if (tab.isFrozen()) return;

    View viewToShow = getViewToShow(tab);
    if (isShowing(viewToShow)) return;

    removeCurrentContent();
    LayoutParams lp = (LayoutParams) viewToShow.getLayoutParams();
    if (lp == null) {
        lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    }
    // Weirdly enough, if gravity is not top, top_margin is not respected by FrameLayout.
    // Yet for many native pages on tablet, top_margin is necessary to not overlap the tab
    // switcher.
    lp.gravity = Gravity.TOP;
    UiUtils.removeViewFromParent(viewToShow);
    addView(viewToShow, CONTENT_INDEX, lp);
    viewToShow.requestFocus();
}
 
Example 17
Source Project: AndroidChromium   Source File: InfoBarContainer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the View when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(getContext(), InfoBarContainer.this)) {
        if (isShowing) {
            // Set to invisible (instead of gone) so that onLayout() will be called when the
            // keyboard is dismissed.
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing && !mIsObscured) {
            setVisibility(View.VISIBLE);
        }
    }

    super.onLayout(changed, l, t, r, b);
}
 
Example 18
Source Project: AndroidChromium   Source File: EmptyBackgroundViewTablet.java    License: Apache License 2.0 6 votes vote down vote up
public void setEmptyContainerState(boolean shouldShow) {
    Animator nextAnimator = null;

    if (shouldShow && getVisibility() != View.VISIBLE
            && mCurrentTransitionAnimation != mAnimateInAnimation) {
        nextAnimator = mAnimateInAnimation;
        UiUtils.hideKeyboard(this);
    } else if (!shouldShow && getVisibility() != View.GONE
            && mCurrentTransitionAnimation != mAnimateOutAnimation) {
        nextAnimator = mAnimateOutAnimation;
    }

    if (nextAnimator != null) {
        if (mCurrentTransitionAnimation != null) mCurrentTransitionAnimation.cancel();
        mCurrentTransitionAnimation = nextAnimator;
        mCurrentTransitionAnimation.start();
    }
}
 
Example 19
Source Project: AndroidChromium   Source File: FindToolbar.java    License: Apache License 2.0 6 votes vote down vote up
private void showKeyboard() {
    if (!mFindQuery.hasWindowFocus()) {
        // HACK: showKeyboard() is normally called from activate() which is
        // triggered by an options menu item. Unfortunately, because the
        // options menu is still focused at this point, that means our
        // window doesn't actually have focus when this first gets called,
        // and hence it isn't the target of the Input Method, and in
        // practice that means the soft keyboard never shows up (whatever
        // flags you pass). So as a workaround we postpone asking for the
        // keyboard to be shown until just after the window gets refocused.
        // See onWindowFocusChanged(boolean hasFocus).
        mShowKeyboardOnceWindowIsFocused = true;
        return;
    }
    UiUtils.showKeyboard(mFindQuery);
}
 
Example 20
private void focusTextBox() {
    if (mNativeInitialized) onUrlFocusChange(true);

    mUrlBar.setIgnoreTextChangesForAutocomplete(true);
    mUrlBar.setUrl("", null);
    mUrlBar.setIgnoreTextChangesForAutocomplete(false);

    mUrlBar.setCursorVisible(true);
    mUrlBar.setSelection(0, mUrlBar.getText().length());
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            UiUtils.showKeyboard(mUrlBar);
        }
    });
}
 
Example 21
Source Project: 365browser   Source File: ScreenshotTask.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Prepares a given screenshot for sending with a feedback.
 * If no screenshot is given it creates one from the activity View if an activity is provided.
 * @param activity An activity or null
 * @param bitmap A screenshot or null
 * @return A feedback-ready screenshot or null
 */
private static Bitmap prepareScreenshot(@Nullable Activity activity, @Nullable Bitmap bitmap) {
    if (bitmap == null) {
        if (activity == null) return null;
        return UiUtils.generateScaledScreenshot(
                activity.getWindow().getDecorView().getRootView(),
                MAX_FEEDBACK_SCREENSHOT_DIMENSION, Bitmap.Config.ARGB_8888);
    }

    int screenshotMaxDimension = Math.max(bitmap.getWidth(), bitmap.getHeight());
    if (screenshotMaxDimension <= MAX_FEEDBACK_SCREENSHOT_DIMENSION) return bitmap;

    float screenshotScale = (float) MAX_FEEDBACK_SCREENSHOT_DIMENSION / screenshotMaxDimension;
    int destWidth = (int) (bitmap.getWidth() * screenshotScale);
    int destHeight = (int) (bitmap.getHeight() * screenshotScale);
    return Bitmap.createScaledBitmap(bitmap, destWidth, destHeight, true);
}
 
Example 22
Source Project: 365browser   Source File: CompositorViewHolder.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void hideKeyboard(Runnable postHideTask) {
    // When this is called we actually want to hide the keyboard whatever owns it.
    // This includes hiding the keyboard, and dropping focus from the URL bar.
    // See http://crbug/236424
    // TODO(aberent) Find a better place to put this, possibly as part of a wider
    // redesign of focus control.
    if (mUrlBar != null) mUrlBar.clearFocus();
    boolean wasVisible = false;
    if (hasFocus()) {
        wasVisible = UiUtils.hideKeyboard(this);
    }
    if (wasVisible) {
        mPostHideKeyboardTask = postHideTask;
    } else {
        postHideTask.run();
    }
}
 
Example 23
Source Project: 365browser   Source File: ShareHelper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Clears all shared image files.
 */
public static void clearSharedImages() {
    new AsyncTask<Void, Void, Void>() {
        @Override
        protected Void doInBackground(Void... params) {
            try {
                File imagePath = UiUtils.getDirectoryForImageCapture(
                        ContextUtils.getApplicationContext());
                deleteShareImageFiles(new File(imagePath, SHARE_IMAGES_DIRECTORY_NAME));
            } catch (IOException ie) {
                // Ignore exception.
            }
            return null;
        }
    }.execute();
}
 
Example 24
Source Project: 365browser   Source File: VrShellImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void shutdown() {
    if (mNativeVrShell != 0) {
        nativeDestroy(mNativeVrShell);
        mNativeVrShell = 0;
    }
    if (mNativePage != null) UiUtils.removeViewFromParent(mNativePage.getView());
    mTabModelSelector.removeObserver(mTabModelSelectorObserver);
    mTabModelSelectorTabObserver.destroy();
    mTab.removeObserver(mTabObserver);
    restoreTabFromVR();

    if (mTab != null) {
        mTab.updateBrowserControlsState(BrowserControlsState.SHOWN, true);
    }

    mContentVirtualDisplay.destroy();
    super.shutdown();
}
 
Example 25
Source Project: 365browser   Source File: UrlBar.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
    super.onWindowFocusChanged(hasWindowFocus);
    if (DEBUG) Log.i(TAG, "onWindowFocusChanged: " + hasWindowFocus);
    if (hasWindowFocus) {
        if (isFocused()) {
            // Without the call to post(..), the keyboard was not getting shown when the
            // window regained focus despite this being the final call in the view system
            // flow.
            post(new Runnable() {
                @Override
                public void run() {
                    UiUtils.showKeyboard(UrlBar.this);
                }
            });
        }
    }
}
 
Example 26
Source Project: 365browser   Source File: LocationBarLayout.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void revertChanges() {
    if (!mUrlHasFocus) {
        setUrlToPageUrl();
    } else {
        Tab tab = mToolbarDataProvider.getTab();
        if (NativePageFactory.isNativePageUrl(tab.getUrl(), tab.isIncognito())) {
            setUrlBarText("", null);
        } else {
            setUrlBarText(
                    mToolbarDataProvider.getText(), getCurrentTabUrl());
            selectAll();
        }
        hideSuggestions();
        UiUtils.hideKeyboard(mUrlBar);
    }
}
 
Example 27
/**
 * Similar to {@link #getProficientLanguageList} except the the result is provided in
 * a {@link LinkedHashSet} to provide access to a unique ordered list.
 * @return a {@link LinkedHashSet} of languages the user is proficient using.
 */
private LinkedHashSet<String> getProficientLanguages() {
    LinkedHashSet<String> uniqueLanguages = new LinkedHashSet<String>();
    // The primary language, according to the translation-service, always comes first.
    String primaryLanguage = getNativeTranslateServiceTargetLanguage();
    if (isValidLocale(primaryLanguage)) {
        uniqueLanguages.add(trimLocaleToLanguage(primaryLanguage));
    }
    // Merge in the IME locales, if possible.
    Context context = mActivity.getApplicationContext();
    if (context != null) {
        for (String locale : UiUtils.getIMELocales(context)) {
            if (isValidLocale(locale)) uniqueLanguages.add(trimLocaleToLanguage(locale));
        }
    }
    return uniqueLanguages;
}
 
Example 28
Source Project: 365browser   Source File: InfoBarContainer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    // Hide the View when the keyboard is showing.
    boolean isShowing = (getVisibility() == View.VISIBLE);
    if (UiUtils.isKeyboardShowing(getContext(), InfoBarContainer.this)) {
        if (isShowing) {
            // Set to invisible (instead of gone) so that onLayout() will be called when the
            // keyboard is dismissed.
            setVisibility(View.INVISIBLE);
        }
    } else {
        if (!isShowing && !mIsObscured) {
            setVisibility(View.VISIBLE);
        }
    }

    super.onLayout(changed, l, t, r, b);
}
 
Example 29
Source Project: 365browser   Source File: SelectableListToolbar.java    License: Apache License 2.0 6 votes vote down vote up
protected void showSelectionView(List<E> selectedItems, boolean wasSelectionEnabled) {
    getMenu().setGroupVisible(mNormalGroupResId, false);
    getMenu().setGroupVisible(mSelectedGroupResId, true);
    if (mHasSearchView) mSearchView.setVisibility(View.GONE);

    setNavigationButton(NAVIGATION_BUTTON_SELECTION_BACK);
    setBackgroundColor(mSelectionBackgroundColor);
    setOverflowIcon(mSelectionMenuButton);

    switchToNumberRollView(selectedItems, wasSelectionEnabled);

    if (mIsSearching) UiUtils.hideKeyboard(mSearchEditText);

    onThemeChanged(false);
    updateDisplayStyleIfNecessary();
}
 
Example 30
Source Project: 365browser   Source File: EmptyBackgroundViewTablet.java    License: Apache License 2.0 6 votes vote down vote up
public void setEmptyContainerState(boolean shouldShow) {
    Animator nextAnimator = null;

    if (shouldShow && getVisibility() != View.VISIBLE
            && mCurrentTransitionAnimation != mAnimateInAnimation) {
        nextAnimator = mAnimateInAnimation;
        UiUtils.hideKeyboard(this);
    } else if (!shouldShow && getVisibility() != View.GONE
            && mCurrentTransitionAnimation != mAnimateOutAnimation) {
        nextAnimator = mAnimateOutAnimation;
    }

    if (nextAnimator != null) {
        if (mCurrentTransitionAnimation != null) mCurrentTransitionAnimation.cancel();
        mCurrentTransitionAnimation = nextAnimator;
        mCurrentTransitionAnimation.start();
    }
}