Example usage for android.animation ObjectAnimator setupStartValues

List of usage examples for android.animation ObjectAnimator setupStartValues

Introduction

In this page you can find the example usage for android.animation ObjectAnimator setupStartValues.

Prototype

@Override
    public void setupStartValues() 

Source Link

Usage

From source file:com.mishiranu.dashchan.ui.navigator.NavigatorActivity.java

private void performNavigation(final PageHolder.Content content, final String chanName, final String boardName,
        final String threadNumber, final String postNumber, final String threadTitle, final String searchQuery,
        final boolean fromCache, boolean animated, final boolean returnable) {
    PageHolder pageHolder = pageManager.getCurrentPage();
    if (pageHolder != null && pageHolder.is(chanName, boardName, threadNumber, content)
            && searchQuery == null) {
        // Page could be deleted from stack during clearStack (when home button pressed, for example)
        pageHolder.returnable &= returnable;
        pageManager.moveCurrentPageTop();
        page.updatePageConfiguration(postNumber, threadTitle);
        drawerForm.invalidateItems(true, false);
        invalidateHomeUpState();// w  w  w  .  ja  va2  s.  c  om
        return;
    }
    switchView(ListPage.ViewType.LIST, null);
    listView.getWrapper().cancelBusyState();
    listView.getWrapper().setPullSides(PullableWrapper.Side.NONE);
    ClickableToast.cancel(this);
    requestStoreExtraAndPosition();
    cleanupPage();
    handler.removeCallbacks(queuedHandler);
    setActionBarLocked(LOCKER_HANDLE, true);
    if (animated) {
        queuedHandler = () -> {
            queuedHandler = null;
            if (listView.getAnimation() != null) {
                listView.getAnimation().cancel();
            }
            listView.setAlpha(1f);
            handleDataAfterAnimation(content, chanName, boardName, threadNumber, postNumber, threadTitle,
                    searchQuery, fromCache, true, returnable);
        };
        handler.postDelayed(queuedHandler, 300);
        ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(listView, View.ALPHA, 1f, 0f);
        alphaAnimator.setupStartValues();
        alphaAnimator.setStartDelay(150);
        alphaAnimator.setDuration(150);
        startListAnimator(alphaAnimator);
    } else {
        handleDataAfterAnimation(content, chanName, boardName, threadNumber, postNumber, threadTitle,
                searchQuery, fromCache, false, returnable);
    }
}