本文整理汇总了Java中com.transitionseverywhere.TransitionSet类的典型用法代码示例。如果您正苦于以下问题:Java TransitionSet类的具体用法?Java TransitionSet怎么用?Java TransitionSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransitionSet类属于com.transitionseverywhere包,在下文中一共展示了TransitionSet类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onClose
import com.transitionseverywhere.TransitionSet; //导入依赖的package包/类
private void onClose() {
if (mOnVisibilityChangeListener != null) {
mOnVisibilityChangeListener.onDismiss();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& mAdapter != null && mAdapter.getItemCount() > 0) {
TransitionSet transition = new SizeTransition()
.setDuration(ANIMATOR_MIN_SUGGESTION_DURATION)
.setInterpolator(new LinearInterpolator())
.addListener(mSuggestionsDismissListener);
TransitionManager.beginDelayedTransition(mSearchOverlay, transition);
mSuggestionsRegion.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
0));
} else {
animateDismiss(mSearchOverlay, mSearchRegion, mMenuItemId);
}
}
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:23,代码来源:SearchView.java
示例2: onShowSearchAnimationEnd
import com.transitionseverywhere.TransitionSet; //导入依赖的package包/类
@Override
protected void onShowSearchAnimationEnd() {
mShowSearchAnimationFinished = true;
if (mAdapter != null && mAdapter.getItemCount() > 0) {
mSuggestionsView.setAdapter(mAdapter);
int itemHeight = ((VerticalLinearLayoutManager) mSuggestionsView.getLayoutManager()).getChildHeight();
int itemCount = mAdapter.getItemCount();
long duration = Math.max(
ANIMATOR_MIN_SUGGESTION_DURATION,
Math.min(ANIMATOR_MAX_SUGGESTION_DURATION, itemCount * itemHeight));
TransitionSet transition = new SizeTransition()
.setDuration(duration)
.setInterpolator(new LinearInterpolator());
TransitionManager.beginDelayedTransition(mRoot, transition);
mSuggestionsRegion.setLayoutParams(new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT));
}
}
开发者ID:VyacheslavShmakin,项目名称:Material-SearchView,代码行数:26,代码来源:SearchView.java
示例3: onCheckedChanged
import com.transitionseverywhere.TransitionSet; //导入依赖的package包/类
@Override
public void onCheckedChanged(final RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.select_scene_1: {
// You can start an automatic transition with TransitionManager.go().
TransitionManager.go(mScene1);
break;
}
case R.id.select_scene_2: {
TransitionSet set = new TransitionSet();
Slide slide = new Slide(Gravity.LEFT);
slide.addTarget(R.id.transition_title);
set.addTransition(slide);
set.addTransition(new ChangeBounds());
set.setOrdering(TransitionSet.ORDERING_TOGETHER);
set.setDuration(350);
TransitionManager.go(mScene2, set);
break;
}
case R.id.select_scene_3: {
// You can also start a transition with a custom TransitionManager.
mTransitionManagerForScene3.transitionTo(mScene3);
break;
}
}
}
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:27,代码来源:ScenesSample.java
示例4: getTransition
import com.transitionseverywhere.TransitionSet; //导入依赖的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
示例5: setEnterSearchAnimation
import com.transitionseverywhere.TransitionSet; //导入依赖的package包/类
private void setEnterSearchAnimation() {
TransitionSet transitionSet = new TransitionSet();
if (mClearableEditText != null) {
transitionSet.addTransition(
new Slide(Gravity.TOP).addTarget(mClearableEditText).setDuration(150));
}
if (mCloseSearchButton != null) {
transitionSet.addTransition(new Fade(Fade.IN).addTarget(mCloseSearchButton));
}
if (mLeftButton != null) {
transitionSet.addTransition(new Fade(Fade.OUT).addTarget(mLeftButton));
}
if (mLeftImageButton != null) {
transitionSet.addTransition(new Fade(Fade.OUT).addTarget(mLeftImageButton));
}
if (mTitleTextView != null) {
transitionSet.addTransition(new Fade(Fade.OUT).addTarget(mTitleTextView).setDuration(
150));
}
if (mRightButton != null) {
transitionSet.addTransition(new Fade(Fade.OUT).addTarget(mRightButton));
}
if (mRightImageButton != null) {
transitionSet.addTransition(new Fade(Fade.OUT).addTarget(mRightImageButton));
}
TransitionManager.beginDelayedTransition(this, transitionSet);
}
开发者ID:Piasy,项目名称:HandyWidgets,代码行数:29,代码来源:CenterTitleSideButtonBar.java
示例6: onCreateView
import com.transitionseverywhere.TransitionSet; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_image_transform, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final ImageView imageView = (ImageView) transitionsContainer.findViewById(R.id.image);
imageView.setOnClickListener(new View.OnClickListener() {
boolean mExpanded;
@Override
public void onClick(View v) {
mExpanded = !mExpanded;
TransitionManager.beginDelayedTransition(transitionsContainer, new TransitionSet()
.addTransition(new ChangeBounds())
.addTransition(new ChangeImageTransform()));
ViewGroup.LayoutParams params = imageView.getLayoutParams();
params.height = mExpanded ? ViewGroup.LayoutParams.MATCH_PARENT : ViewGroup.LayoutParams.WRAP_CONTENT;
imageView.setLayoutParams(params);
imageView.setScaleType(mExpanded ? ImageView.ScaleType.CENTER_CROP : ImageView.ScaleType.FIT_CENTER);
}
});
return view;
}
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:31,代码来源:ImageTransformSample.java
示例7: updateOverflowState
import com.transitionseverywhere.TransitionSet; //导入依赖的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
注:本文中的com.transitionseverywhere.TransitionSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论