Example usage for android.animation LayoutTransition CHANGING

List of usage examples for android.animation LayoutTransition CHANGING

Introduction

In this page you can find the example usage for android.animation LayoutTransition CHANGING.

Prototype

int CHANGING

To view the source code for android.animation LayoutTransition CHANGING.

Click Source Link

Document

A flag indicating the animation that runs on those items that are changing due to a layout change not caused by items being added to or removed from the container.

Usage

From source file:com.google.android.media.tv.companionlibrary.ChannelSetupFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(getLayoutResourceId(), container, false);
    // Make sure this view is focused
    view.requestFocus();/*www.ja  va2 s. c o  m*/
    mProgressBar = (ProgressBar) view.findViewById(R.id.tune_progress);
    mScanningMessage = (TextView) view.findViewById(R.id.tune_description);
    mTitle = (TextView) view.findViewById(R.id.tune_title);
    mBadge = (ImageView) view.findViewById(R.id.tune_icon);
    mChannelHolder = view.findViewById(R.id.channel_holder);
    mCancelButton = (Button) view.findViewById(R.id.tune_cancel);

    ListView channelList = (ListView) view.findViewById(R.id.channel_list);
    mAdapter = new ChannelAdapter();
    channelList.setAdapter(mAdapter);
    channelList.setOnItemClickListener(null);

    ViewGroup progressHolder = (ViewGroup) view.findViewById(R.id.progress_holder);
    LayoutTransition transition = new LayoutTransition();
    transition.enableTransitionType(LayoutTransition.CHANGING);
    progressHolder.setLayoutTransition(transition);

    mCancelButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finishScan(false);
        }
    });
    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mSyncStatusChangedReceiver,
            new IntentFilter(EpgSyncJobService.ACTION_SYNC_STATUS_CHANGED));

    mChannelScanLayout = view;
    setChannelListVisibility(false);
    setBackgroundColor(getResources().getColor(android.R.color.holo_blue_dark));
    return view;
}

From source file:com.justplay1.shoppist.features.search.widget.FloatingSearchView.java

private void setupViews() {
    searchContainer.setLayoutTransition(getDefaultLayoutTransition());

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        searchContainer.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);

    ViewUtils.setBackground(searchContainer, searchBackground);
    searchContainer.setMinimumHeight((int) searchBackground.getMinHeight());
    searchContainer.setMinimumWidth((int) searchBackground.getMinWidth());

    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.addItemDecoration(cardDecorator);
    recyclerView.setHasFixedSize(true);/*from w  w  w  . j a  v  a  2s .  com*/
    recyclerView.setVisibility(View.INVISIBLE);

    backgroundDrawable = getBackground();

    if (backgroundDrawable != null) {
        backgroundDrawable = backgroundDrawable.mutate();
    } else {
        backgroundDrawable = new ColorDrawable(DEFAULT_BACKGROUND_COLOR);
    }

    ViewUtils.setBackground(this, backgroundDrawable);
    backgroundDrawable.setAlpha(0);

    navButtonView.setOnClickListener(v -> {
        if (navigationClickListener != null)
            navigationClickListener.onNavigationClick();
    });

    setOnTouchListener((v, event) -> {
        if (!isActivated())
            return false;
        setActivated(false);
        return onContainerTouchClickListener == null || onContainerTouchClickListener.onTouch(v, event);
    });

    searchInput.setOnFocusChangeListener((v, hasFocus) -> {
        if (hasFocus != isActivated())
            setActivated(hasFocus);
    });

    searchInput.setOnKeyListener((view, keyCode, keyEvent) -> {
        if (keyCode != KeyEvent.KEYCODE_ENTER)
            return false;
        setActivated(false);
        return true;
    });
}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static LayoutTransition getDefaultTransition() {
    LayoutTransition itemLayoutTransition = new LayoutTransition();
    itemLayoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
    itemLayoutTransition.setDuration(100);
    itemLayoutTransition.setInterpolator(LayoutTransition.CHANGING, new OvershootInterpolator(2f));
    Animator scaleUp = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 0, 1));
    scaleUp.setDuration(50);//  www .  j  av  a2 s.c om
    scaleUp.setStartDelay(50);
    Animator scaleDown = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, 0));
    scaleDown.setDuration(2);
    itemLayoutTransition.setAnimator(LayoutTransition.APPEARING, scaleUp);
    itemLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    itemLayoutTransition.enableTransitionType(LayoutTransition.CHANGING);
    return itemLayoutTransition;
}

From source file:org.eyeseetea.malariacare.LoginActivity.java

private void initProgressBar() {
    bar = (CircularProgressBar) findViewById(R.id.progress_bar_circular);
    float progressBarStrokeWidth = getResources().getDimensionPixelSize(R.dimen.progressbar_stroke_width);
    bar.setIndeterminateDrawable(new CircularProgressDrawable.Builder(this)
            .color(ContextCompat.getColor(this, R.color.color_primary_default))
            .style(CircularProgressDrawable.STYLE_ROUNDED).strokeWidth(progressBarStrokeWidth).rotationSpeed(1f)
            .sweepSpeed(1f).build());/*  w  w w .  j  a  v a 2  s. co m*/
    onPostAnimationListener = new OnPostAnimationListener();

    /* adding transition animations to root layout */
    if (isGreaterThanOrJellyBean()) {
        layoutTransition = new LayoutTransition();
        layoutTransition.enableTransitionType(LayoutTransition.CHANGING);
        layoutTransition.addTransitionListener(onPostAnimationListener);

        RelativeLayout loginLayoutContent = (RelativeLayout) findViewById(
                org.hisp.dhis.client.sdk.ui.R.id.layout_content);
        loginLayoutContent.setLayoutTransition(layoutTransition);
    } else {
        layoutTransitionSlideIn = AnimationUtils.loadAnimation(this, org.hisp.dhis.client.sdk.ui.R.anim.in_up);
        layoutTransitionSlideOut = AnimationUtils.loadAnimation(this,
                org.hisp.dhis.client.sdk.ui.R.anim.out_down);

        layoutTransitionSlideIn.setAnimationListener(onPostAnimationListener);
        layoutTransitionSlideOut.setAnimationListener(onPostAnimationListener);
    }
}

From source file:com.ywesee.amiko.MainActivity.java

@TargetApi(16)
void setLayoutTransition() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        LayoutTransition lt = new LayoutTransition();
        lt.enableTransitionType(LayoutTransition.CHANGING);
        lt.setDuration(LayoutTransition.APPEARING, 100 /*500*/);
        lt.setDuration(LayoutTransition.DISAPPEARING, 100);
        mViewHolder.setLayoutTransition(lt);
    }//from   ww  w .  j  a  v  a2  s.c  o  m
}