当前位置: 首页>>代码示例>>Java>>正文


Java Transition类代码示例

本文整理汇总了Java中com.transitionseverywhere.Transition的典型用法代码示例。如果您正苦于以下问题:Java Transition类的具体用法?Java Transition怎么用?Java Transition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Transition类属于com.transitionseverywhere包,在下文中一共展示了Transition类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTransition

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
@NonNull
protected Transition getTransition(@NonNull ViewGroup container, View from, View to, boolean isPush) {
    TransitionSet transition = new TransitionSet()
            .setOrdering(TransitionSet.ORDERING_SEQUENTIAL)
            .addTransition(new Fade(Fade.OUT))
            .addTransition(new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform()))
            .addTransition(new Fade(Fade.IN));

    transition.setPathMotion(new ArcMotion());
    return transition;
}
 
开发者ID:zawadz88,项目名称:Conductor-TransitionsEverywhere,代码行数:13,代码来源:ArcFadeMoveChangeHandlerTransitionsEverywhere.java

示例2: onActivityResult

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == REQUEST_CODE_DEF && resultCode == RESULT_OK) {
        TransitionsEntity outEntity = (TransitionsEntity) data.getSerializableExtra(DetailActivity.KEY_ENTITY);
        if(outEntity == null) return;
        clickImage.setVisibility(View.GONE);
        ivTrans.setVisibility(View.VISIBLE);
        ivTrans.setTranslationX(outEntity.getLeft());
        ivTrans.setTranslationY(outEntity.getTop());

        vSceneRoot.postDelayed(new Runnable() {
            @Override
            public void run() {
                TransitionManager.beginDelayedTransition(vSceneRoot, new TranslationTransition().setPathMotion(new ArcMotion()).setDuration(200).addListener(new Transition.TransitionListenerAdapter(){
                    @Override
                    public void onTransitionEnd(Transition transition) {
                        super.onTransitionEnd(transition);
                        ivTrans.setVisibility(View.GONE);
                        clickImage.setVisibility(View.VISIBLE);
                    }
                }));
                ivTrans.setTranslationX(outEntity.getOldLeft());
                ivTrans.setTranslationY(outEntity.getOldTop());
            }
        }, 20);
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:Sherchen,项目名称:AnimationsDemo,代码行数:29,代码来源:HomeActivity.java

示例3: onCreateView

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_interpolator, container, false);

    final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
    final View button = transitionsContainer.findViewById(R.id.button);

    button.setOnClickListener(new View.OnClickListener() {

        boolean mToRightAnimation;

        @Override
        public void onClick(View v) {
            mToRightAnimation = !mToRightAnimation;

            Transition transition = new ChangeBounds();
            transition.setDuration(mToRightAnimation ? 700 : 300);
            transition.setInterpolator(mToRightAnimation ? new FastOutSlowInInterpolator() : new AccelerateInterpolator());
            transition.setStartDelay(mToRightAnimation ? 0 : 500);
            TransitionManager.beginDelayedTransition(transitionsContainer, transition);

            FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
            params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.TOP) : (Gravity.LEFT | Gravity.TOP);
            button.setLayoutParams(params);
        }

    });

    return view;
}
 
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:32,代码来源:InterpolatorDurationStartDelaySample.java

示例4: createAnimation

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Nullable
private Animator createAnimation(final View view, float startScale, float endScale, TransitionValues values) {
    final float initialScaleX = view.getScaleX();
    final float initialScaleY = view.getScaleY();
    float startScaleX = initialScaleX * startScale;
    float endScaleX = initialScaleX * endScale;
    float startScaleY = initialScaleY * startScale;
    float endScaleY = initialScaleY * endScale;

    if (values != null) {
        Float savedScaleX = (Float) values.values.get(PROPNAME_SCALE_X);
        Float savedScaleY = (Float) values.values.get(PROPNAME_SCALE_Y);
        // if saved value is not equal initial value it means that previous
        // transition was interrupted and in the onTransitionEnd
        // we've applied endScale. we should apply proper value to
        // continue animation from the interrupted state
        if (savedScaleX != null && savedScaleX != initialScaleX) {
            startScaleX = savedScaleX;
        }
        if (savedScaleY != null && savedScaleY != initialScaleY) {
            startScaleY = savedScaleY;
        }
    }

    view.setScaleX(startScaleX);
    view.setScaleY(startScaleY);

    Animator animator = TransitionUtils.mergeAnimators(
        ObjectAnimator.ofFloat(view, View.SCALE_X, startScaleX, endScaleX),
        ObjectAnimator.ofFloat(view, View.SCALE_Y, startScaleY, endScaleY));
    addListener(new TransitionListenerAdapter() {
        @Override
        public void onTransitionEnd(Transition transition) {
            view.setScaleX(initialScaleX);
            view.setScaleY(initialScaleY);
            transition.removeListener(this);
        }
    });
    return animator;
}
 
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:41,代码来源:Scale.java

示例5: updateOverflowState

import com.transitionseverywhere.Transition; //导入依赖的package包/类
private void updateOverflowState(int position) {
	if (mIndicatorCount == 0) {
		return;
	}

	Transition transition = new TransitionSet()
			.setOrdering(TransitionSet.ORDERING_TOGETHER)
			.addTransition(new ChangeBounds())
			.addTransition(new Fade());

	TransitionManager.beginDelayedTransition(this, transition);

	float[] positionStates = new float[mIndicatorCount + 1];
	Arrays.fill(positionStates, STATE_GONE);

	int start     = position - MAX_INDICATORS + 4;
	int realStart = Math.max(0, start);

	if (realStart + MAX_INDICATORS > mIndicatorCount) {
		realStart = mIndicatorCount - MAX_INDICATORS;
		positionStates[mIndicatorCount - 1] = STATE_NORMAL;
		positionStates[mIndicatorCount - 2] = STATE_NORMAL;
	} else {
		if (realStart + MAX_INDICATORS - 2 < mIndicatorCount) {
			positionStates[realStart + MAX_INDICATORS - 2] = STATE_SMALL;
		}
		if (realStart + MAX_INDICATORS - 1 < mIndicatorCount) {
			positionStates[realStart + MAX_INDICATORS - 1] = STATE_SMALLEST;
		}
	}

	for (int i = realStart; i < realStart + MAX_INDICATORS - 2; i++) {
		positionStates[i] = STATE_NORMAL;
	}

	if (position > 5) {
		positionStates[realStart] = STATE_SMALLEST;
		positionStates[realStart + 1] = STATE_SMALL;
	} else if (position == 5) {
		positionStates[realStart] = STATE_SMALL;
	}

	positionStates[position] = STATE_SELECTED;

	updateIndicators(positionStates);

	mLastSelected = position;
}
 
开发者ID:intik,项目名称:overflow-pager-indicator,代码行数:49,代码来源:OverflowPagerIndicator.java

示例6: animateBounds

import com.transitionseverywhere.Transition; //导入依赖的package包/类
/**
 * Basic transition animation
 * @param view
 */
private void animateBounds(ViewGroup view){

    Transition changeBounds = new ChangeBounds();
    TransitionManager.beginDelayedTransition(view, changeBounds);
}
 
开发者ID:ArthurSav,项目名称:paradise,代码行数:10,代码来源:StartupDetailsView.java

示例7: onTransitionEnd

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
public void onTransitionEnd(Transition transition) {
    onSuggestionDismissed();
}
 
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:5,代码来源:SuggestionDismissListener.java

示例8: executePropertyChanges

import com.transitionseverywhere.Transition; //导入依赖的package包/类
/**
 * This should set all view properties needed for the transition to work properly. By default it removes the "from" view
 * and adds the "to" view.
 *
 * @param container  The container these Views are hosted in
 * @param from       The previous View in the container or {@code null} if there was no Controller before this transition
 * @param to         The next View that should be put in the container or {@code null} if no Controller is being transitioned to
 * @param transition The transition with which {@code TransitionManager.beginDelayedTransition} has been called
 * @param isPush     True if this is a push transaction, false if it's a pop
 */
public void executePropertyChanges(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, @NonNull Transition transition, boolean isPush) {
    if (from != null && (removesFromViewOnPush() || !isPush) && from.getParent() == container) {
        container.removeView(from);
    }
    if (to != null && to.getParent() == null) {
        container.addView(to);
    }
}
 
开发者ID:zawadz88,项目名称:Conductor-TransitionsEverywhere,代码行数:19,代码来源:TransitionsEverywhereChangeHandler.java

示例9: getTransition

import com.transitionseverywhere.Transition; //导入依赖的package包/类
/**
 * Should be overridden to return the Transition to use while replacing Views.
 *
 * @param container The container these Views are hosted in
 * @param from      The previous View in the container or {@code null} if there was no Controller before this transition
 * @param to        The next View that should be put in the container or {@code null} if no Controller is being transitioned to
 * @param isPush    True if this is a push transaction, false if it's a pop
 * @return transition
 */
@NonNull
protected abstract Transition getTransition(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, boolean isPush);
 
开发者ID:zawadz88,项目名称:Conductor-TransitionsEverywhere,代码行数:12,代码来源:TransitionsEverywhereChangeHandler.java

示例10: prepareForTransition

import com.transitionseverywhere.Transition; //导入依赖的package包/类
/**
 * Called before a transition occurs. This can be used to reorder views, set their transition names, etc. The transition will begin
 * when {@code onTransitionPreparedListener} is called.
 *
 * @param container  The container these Views are hosted in
 * @param from       The previous View in the container or {@code null} if there was no Controller before this transition
 * @param to         The next View that should be put in the container or {@code null} if no Controller is being transitioned to
 * @param transition The transition that is being prepared for
 * @param isPush     True if this is a push transaction, false if it's a pop
 * @param onTransitionPreparedListener listener
 */
public void prepareForTransition(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, @NonNull Transition transition, boolean isPush, @NonNull OnTransitionPreparedListener onTransitionPreparedListener) {
    onTransitionPreparedListener.onPrepared();
}
 
开发者ID:zawadz88,项目名称:Conductor-TransitionsEverywhere,代码行数:15,代码来源:TransitionsEverywhereChangeHandler.java

示例11: onTransitionStart

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
public void onTransitionStart(Transition transition) {

}
 
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:5,代码来源:SuggestionDismissListener.java

示例12: onTransitionCancel

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
public void onTransitionCancel(Transition transition) {

}
 
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:5,代码来源:SuggestionDismissListener.java

示例13: onTransitionPause

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
public void onTransitionPause(Transition transition) {

}
 
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:5,代码来源:SuggestionDismissListener.java

示例14: onTransitionResume

import com.transitionseverywhere.Transition; //导入依赖的package包/类
@Override
public void onTransitionResume(Transition transition) {

}
 
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:5,代码来源:SuggestionDismissListener.java


注:本文中的com.transitionseverywhere.Transition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。