use of android.transition.Transition in project ion by koush.
the class LollipopTransitionFullscreen method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lollipop_fullscreen);
final ImageView iv = (ImageView) findViewById(R.id.image);
String bitmapKey = getIntent().getStringExtra("bitmapInfo");
BitmapInfo bi = Ion.getDefault(this).getBitmapCache().get(bitmapKey);
iv.setImageBitmap(bi.bitmap);
final int thumb = getIntent().getIntExtra("thumb", 1);
getWindow().getEnterTransition().addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
getWindow().getEnterTransition().removeListener(this);
// load the full version, crossfading from the thumbnail image
Ion.with(iv).crossfade(true).load("https://raw.githubusercontent.com/koush/SampleImages/master/" + thumb + ".jpg");
}
});
}
use of android.transition.Transition in project BottomSheet by soarcn.
the class BottomSheet method showFullItems.
private void showFullItems() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Transition changeBounds = new ChangeBounds();
changeBounds.setDuration(300);
TransitionManager.beginDelayedTransition(list, changeBounds);
}
actions = fullMenuItem;
updateSection();
adapter.notifyDataSetChanged();
list.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
icon.setVisibility(View.VISIBLE);
icon.setImageDrawable(close);
icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showShortItems();
}
});
setListLayout();
}
use of android.transition.Transition in project Douya by DreaminginCodeZH.
the class TransitionUtils method setEnterReturnExplode.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void setEnterReturnExplode(Fragment fragment) {
if (!shouldEnableTransition()) {
return;
}
Window window = fragment.getActivity().getWindow();
Transition explode = new Explode().excludeTarget(android.R.id.statusBarBackground, true).excludeTarget(android.R.id.navigationBarBackground, true);
window.setEnterTransition(explode);
window.setReturnTransition(explode);
}
use of android.transition.Transition in project Conductor by bluelinelabs.
the class ArcFadeMoveChangeHandler method getSharedElementTransition.
@Nullable
@Override
public Transition getSharedElementTransition(@NonNull ViewGroup container, @Nullable final View from, @Nullable View to, boolean isPush) {
Transition transition = new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform());
transition.setPathMotion(new ArcMotion());
// The framework doesn't totally fade out the "from" shared element, so we'll hide it manually once it's safe.
transition.addListener(new TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
if (from != null) {
for (String name : sharedElementNames) {
View namedView = TransitionUtils.findNamedView(from, name);
if (namedView != null) {
namedView.setVisibility(View.INVISIBLE);
}
}
}
}
@Override
public void onTransitionEnd(Transition transition) {
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
return transition;
}
use of android.transition.Transition in project Conductor by bluelinelabs.
the class TransitionUtils method replaceTargets.
public static void replaceTargets(@NonNull Transition transition, @NonNull List<View> oldTargets, @Nullable List<View> newTargets) {
if (transition instanceof TransitionSet) {
TransitionSet set = (TransitionSet) transition;
int numTransitions = set.getTransitionCount();
for (int i = 0; i < numTransitions; i++) {
Transition child = set.getTransitionAt(i);
replaceTargets(child, oldTargets, newTargets);
}
} else if (!TransitionUtils.hasSimpleTarget(transition)) {
List<View> targets = transition.getTargets();
if (targets != null && targets.size() == oldTargets.size() && targets.containsAll(oldTargets)) {
final int targetCount = newTargets == null ? 0 : newTargets.size();
for (int i = 0; i < targetCount; i++) {
transition.addTarget(newTargets.get(i));
}
for (int i = oldTargets.size() - 1; i >= 0; i--) {
transition.removeTarget(oldTargets.get(i));
}
}
}
}
Aggregations