use of android.transition.TransitionSet in project mosby by sockeqwe.
the class DetailsFragment method initTransitions.
@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()));
}
use of android.transition.TransitionSet in project platform_frameworks_base by android.
the class PhoneWindow method getTransition.
private Transition getTransition(Transition currentValue, Transition defaultValue, int id) {
if (currentValue != defaultValue) {
return currentValue;
}
int transitionId = getWindowStyle().getResourceId(id, -1);
Transition transition = defaultValue;
if (transitionId != -1 && transitionId != R.transition.no_transition) {
TransitionInflater inflater = TransitionInflater.from(getContext());
transition = inflater.inflateTransition(transitionId);
if (transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0) {
transition = null;
}
}
return transition;
}
use of android.transition.TransitionSet in project platform_frameworks_base by android.
the class ContactsExpansion method addContact.
private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
thumbnailView.setImageResource(thumbnailID);
((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
container.addView(contactItem);
final TransitionSet myTransition = new TransitionSet();
myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
final ToggleScene toggleScene = new ToggleScene(container, myTransition);
contactItem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
currentItem = v;
toggleScene.changeToScene();
}
});
}
use of android.transition.TransitionSet in project platform_frameworks_base by android.
the class CrossFadeDemo method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.crossfade);
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this);
mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade_1, this);
Crossfade crossfade = new Crossfade();
crossfade.setFadeBehavior(Crossfade.FADE_BEHAVIOR_CROSSFADE);
crossfade.setResizeBehavior(Crossfade.RESIZE_BEHAVIOR_NONE);
crossfade.addTarget(R.id.textview).addTarget(R.id.textview1).addTarget(R.id.textview2);
mTransitionManager = new TransitionManager();
TransitionSet moveCrossFade = new TransitionSet();
moveCrossFade.addTransition(crossfade).addTransition(new ChangeBounds());
mTransitionManager.setTransition(mScene1, moveCrossFade);
mTransitionManager.setTransition(mScene2, moveCrossFade);
mCurrentScene = 1;
}
use of android.transition.TransitionSet in project platform_frameworks_base by android.
the class CrossfadeImage method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.crossfade_image);
ViewGroup container = (ViewGroup) findViewById(R.id.container);
mSceneRoot = container;
mImageView = (ImageView) findViewById(R.id.contact_picture);
mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
Crossfade mCrossfade = new Crossfade();
mCrossfade.addTarget(R.id.contact_picture);
TransitionSet group = new TransitionSet();
group.setDuration(1500);
group.addTransition(mCrossfade).addTransition(new ChangeBounds());
mTransition = group;
}
Aggregations