本文整理汇总了Java中android.transition.TransitionSet.setOrdering方法的典型用法代码示例。如果您正苦于以下问题:Java TransitionSet.setOrdering方法的具体用法?Java TransitionSet.setOrdering怎么用?Java TransitionSet.setOrdering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.transition.TransitionSet
的用法示例。
在下文中一共展示了TransitionSet.setOrdering方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTransitions
import android.transition.TransitionSet; //导入方法依赖的package包/类
@TargetApi(21) private void initTransitions() {
Window window = getActivity().getWindow();
window.setEnterTransition(
new ExplodeFadeEnterTransition(senderNameView, senderMailView, separatorLine));
window.setExitTransition(new ExcludedExplodeTransition());
window.setReenterTransition(new ExcludedExplodeTransition());
window.setReturnTransition(new ExcludedExplodeTransition());
TransitionSet textSizeSet = new TransitionSet();
textSizeSet.addTransition(
TransitionInflater.from(getActivity()).inflateTransition(android.R.transition.move));
TextSizeTransition textSizeTransition = new TextSizeTransition();
textSizeTransition.addTarget(R.id.subject);
textSizeTransition.addTarget(getString(R.string.shared_mail_subject));
textSizeSet.addTransition(textSizeTransition);
textSizeSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
window.setSharedElementEnterTransition(textSizeSet);
getActivity().setEnterSharedElementCallback(
new TextSizeEnterSharedElementCallback(getActivity()));
}
示例2: createTransition
import android.transition.TransitionSet; //导入方法依赖的package包/类
private Transition createTransition() {
TransitionSet set = new TransitionSet();
set.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
Transition tFab = new Scale();
tFab.setDuration(150);
tFab.addTarget(fab);
Transition tTitle = new Fold();
tTitle.setDuration(150);
tTitle.addTarget(titlePanel);
Transition tTrack = new Fold();
tTrack.setDuration(150);
tTrack.addTarget(trackPanel);
set.addTransition(tTrack);
set.addTransition(tTitle);
set.addTransition(tFab);
return set;
}
示例3: onCheckedChanged
import android.transition.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;
}
}
}
示例4: makeSharedElementEnterTransition
import android.transition.TransitionSet; //导入方法依赖的package包/类
public static Transition makeSharedElementEnterTransition(List<String> textTransitionNames) {
TransitionSet set = new TransitionSet();
set.setOrdering(TransitionSet.ORDERING_TOGETHER);
Transition recolor = new Recolor();
Transition changeBounds = new ChangeBounds();
Transition textSize = new TextSizeTransition();
for (String textTName : textTransitionNames) {
changeBounds.addTarget(textTName);
textSize.addTarget(textTName);
recolor.addTarget(textTName);
}
set.addTransition(recolor);
set.addTransition(changeBounds);
set.addTransition(textSize);
///set.setDuration(3000);
return set;
}
示例5: onGoClicked
import android.transition.TransitionSet; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@OnClick(R.id.next)
protected void onGoClicked(View view) {
AccelerateInterpolator interpolator = new AccelerateInterpolator(1.5f);
Slide right = new Slide(Gravity.END);
right.setInterpolator(interpolator);
right.addTarget(R.id.text);
Slide left = new Slide(Gravity.START);
left.setInterpolator(interpolator);
left.addTarget(R.id.icon);
TransitionSet set = new TransitionSet();
set.setOrdering(TransitionSet.ORDERING_TOGETHER);
set.addTransition(right).addTransition(left);
setExitTransition(set);
AppListFragment fragment = new AppListFragment();
Bundle args = new Bundle();
int cX = (int) (view.getX() + view.getWidth() / 2);
int cY = (int) (view.getY() + view.getHeight() / 2);
args.putInt("cX", cX);
args.putInt("cY", cY);
fragment.setArguments(args);
fragment.setEnterTransition(new Fade());
getActivity().getFragmentManager().beginTransaction()
.replace(R.id.root, fragment)
.addToBackStack(null)
.commit();
}
示例6: getAudioTransition
import android.transition.TransitionSet; //导入方法依赖的package包/类
@Override public Object getAudioTransition() {
final ChangeText tc = new ChangeText();
tc.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
final TransitionSet inner = new TransitionSet();
inner.addTransition(tc).addTransition(new ChangeBounds());
final TransitionSet tg = new TransitionSet();
tg.addTransition(new Fade(Fade.OUT)).addTransition(inner).
addTransition(new Fade(Fade.IN));
tg.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
tg.setDuration(TRANSITION_DURATION);
return tg;
}
示例7: setupTransitions
import android.transition.TransitionSet; //导入方法依赖的package包/类
private void setupTransitions() {
// Slide slide = new Slide(Gravity.BOTTOM);
// slide.excludeTarget(android.R.id.statusBarBackground, true);
// getWindow().setEnterTransition(slide);
// getWindow().setSharedElementsUseOverlay(false);
mTransitionManager = new TransitionManager();
ViewGroup transitionRoot = detailContainer;
// Expanded scene
mExpandedScene = Scene.getSceneForLayout(transitionRoot,
R.layout.activity_album_detail_expanded, this);
mExpandedScene.setEnterAction(new Runnable() {
@Override
public void run() {
ButterKnife.bind(AlbumDetailActivity.this);
populate();
mCurrentScene = mExpandedScene;
}
});
TransitionSet expandTransitionSet = new TransitionSet();
expandTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
ChangeBounds changeBounds = new ChangeBounds();
changeBounds.setDuration(200);
expandTransitionSet.addTransition(changeBounds);
Fade fadeLyrics = new Fade();
fadeLyrics.addTarget(R.id.lyrics);
fadeLyrics.setDuration(150);
expandTransitionSet.addTransition(fadeLyrics);
// Collapsed scene
mCollapsedScene = Scene.getSceneForLayout(transitionRoot,
R.layout.activity_album_detail, this);
mCollapsedScene.setEnterAction(new Runnable() {
@Override
public void run() {
ButterKnife.bind(AlbumDetailActivity.this);
populate();
mCurrentScene = mCollapsedScene;
}
});
TransitionSet collapseTransitionSet = new TransitionSet();
collapseTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
Fade fadeOutLyrics = new Fade();
fadeOutLyrics.addTarget(R.id.lyrics);
fadeOutLyrics.setDuration(150);
collapseTransitionSet.addTransition(fadeOutLyrics);
ChangeBounds resetBounds = new ChangeBounds();
resetBounds.setDuration(200);
collapseTransitionSet.addTransition(resetBounds);
mTransitionManager.setTransition(mExpandedScene, mCollapsedScene, collapseTransitionSet);
mTransitionManager.setTransition(mCollapsedScene, mExpandedScene, expandTransitionSet);
mCollapsedScene.enter();
// postponeEnterTransition();
}
示例8: onCreate
import android.transition.TransitionSet; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setAllowEnterTransitionOverlap(true);
getWindow().setAllowReturnTransitionOverlap(true);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ending);
TextView bigtitle = (TextView) findViewById(R.id.title_big);
bigtitle.setText(getIntent().getStringExtra("bigtitle"));
//ViewCompat.setTransitionName(bigtitle, "bigtitle");
TextView subtitle = (TextView) findViewById(R.id.subtitle);
subtitle.setText(getIntent().getStringExtra("subtitle"));
//ViewCompat.setTransitionName(subtitle, "subtitle");
// ImageView image = (ImageView) findViewById(R.id.thumbnail);
// ViewCompat.setTransitionName(image, "thumbnail");
List<String> textNames = new ArrayList<>();
textNames.add("bigtitle");
textNames.add("subtitle");
getWindow().setEnterTransition(TransitionUtils.makeEnterTransition());
/** --------------------- ENTER TRANSITION ------------------------------ */
//Get the "Text" transition
Transition textTransition = TransitionUtils.makeSharedElementEnterTransition(textNames);
textTransition.setDuration(900);
//Get the "Reveal" transition
Transition revealTransition = TransitionInflater.from(this).inflateTransition(R.transition.shared_element_enter);
revealTransition.setDuration(800);
//Create a set for both transitions
TransitionSet set = new TransitionSet();
set.setOrdering(TransitionSet.ORDERING_TOGETHER);
set.addTransition(revealTransition);
set.addTransition(textTransition);
//Set shared element enter transition
getWindow().setSharedElementEnterTransition(set);
/** --------------------- RETURN TRANSITION ------------------------------ */
// Get the "Reveal" return transition
Transition returnTransition = TransitionInflater.from(this).inflateTransition(R.transition.shared_element_return);
returnTransition.setDuration(800);
//Create a set for the return
TransitionSet returnSet = new TransitionSet();
returnSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
returnSet.addTransition(returnTransition);
returnSet.addTransition(textTransition);
getWindow().setSharedElementReturnTransition(returnSet);
//---------------------- SHARED ELEMENT CALLBACK
// setEnterSharedElementCallback(new EnterSharedElementTextCallback(this));// Use this for "TextSmooth" only
// setEnterSharedElementCallback(new EnterSharedElementRevealCallback(this)); // Use this for "ImageReveal" only
setEnterSharedElementCallback(new EnterSharedElementRevealAndTextCallback(this)); // this should animate both!
}
示例9: createTransitionSet
import android.transition.TransitionSet; //导入方法依赖的package包/类
static Object createTransitionSet(boolean sequential) {
TransitionSet set = new TransitionSet();
set.setOrdering(sequential ? TransitionSet.ORDERING_SEQUENTIAL :
TransitionSet.ORDERING_TOGETHER);
return set;
}