use of android.transition.Visibility in project Material-Animations by lgvalle.
the class TransitionActivity1 method setupLayout.
private void setupLayout() {
findViewById(R.id.sample1_button1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(TransitionActivity1.this, TransitionActivity2.class);
i.putExtra(EXTRA_SAMPLE, sample);
i.putExtra(EXTRA_TYPE, TYPE_PROGRAMMATICALLY);
transitionTo(i);
}
});
findViewById(R.id.sample1_button2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(TransitionActivity1.this, TransitionActivity2.class);
i.putExtra(EXTRA_SAMPLE, sample);
i.putExtra(EXTRA_TYPE, TYPE_XML);
transitionTo(i);
}
});
findViewById(R.id.sample1_button3).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(TransitionActivity1.this, TransitionActivity3.class);
i.putExtra(EXTRA_SAMPLE, sample);
i.putExtra(EXTRA_TYPE, TYPE_PROGRAMMATICALLY);
transitionTo(i);
}
});
findViewById(R.id.sample1_button4).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(TransitionActivity1.this, TransitionActivity3.class);
i.putExtra(EXTRA_SAMPLE, sample);
i.putExtra(EXTRA_TYPE, TYPE_XML);
transitionTo(i);
}
});
findViewById(R.id.sample1_button5).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Visibility returnTransition = buildReturnTransition();
getWindow().setReturnTransition(returnTransition);
finishAfterTransition();
}
});
findViewById(R.id.sample1_button6).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/**
* If no return transition is defined Android will use reversed enter transition
* In this case, return transition will be a reversed Slide (defined in buildEnterTransition)
*/
finishAfterTransition();
}
});
}
use of android.transition.Visibility in project Material-Animations by lgvalle.
the class TransitionActivity1 method buildReturnTransition.
private Visibility buildReturnTransition() {
Visibility enterTransition = new Slide();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
return enterTransition;
}
use of android.transition.Visibility in project android_frameworks_base by DirtyUnicorns.
the class ActivityTransitionCoordinator method noLayoutSuppressionForVisibilityTransitions.
/**
* Blocks suppressLayout from Visibility transitions. It is ok to suppress the layout,
* but we don't want to force the layout when suppressLayout becomes false. This leads
* to visual glitches.
*/
private static void noLayoutSuppressionForVisibilityTransitions(Transition transition) {
if (transition instanceof Visibility) {
final Visibility visibility = (Visibility) transition;
visibility.setSuppressLayout(false);
} else if (transition instanceof TransitionSet) {
final TransitionSet set = (TransitionSet) transition;
final int count = set.getTransitionCount();
for (int i = 0; i < count; i++) {
noLayoutSuppressionForVisibilityTransitions(set.getTransitionAt(i));
}
}
}
use of android.transition.Visibility in project android_frameworks_base by ResurrectionRemix.
the class ActivityTransitionCoordinator method noLayoutSuppressionForVisibilityTransitions.
/**
* Blocks suppressLayout from Visibility transitions. It is ok to suppress the layout,
* but we don't want to force the layout when suppressLayout becomes false. This leads
* to visual glitches.
*/
private static void noLayoutSuppressionForVisibilityTransitions(Transition transition) {
if (transition instanceof Visibility) {
final Visibility visibility = (Visibility) transition;
visibility.setSuppressLayout(false);
} else if (transition instanceof TransitionSet) {
final TransitionSet set = (TransitionSet) transition;
final int count = set.getTransitionCount();
for (int i = 0; i < count; i++) {
noLayoutSuppressionForVisibilityTransitions(set.getTransitionAt(i));
}
}
}
use of android.transition.Visibility in project android_frameworks_base by crdroidandroid.
the class ActivityTransitionCoordinator method noLayoutSuppressionForVisibilityTransitions.
/**
* Blocks suppressLayout from Visibility transitions. It is ok to suppress the layout,
* but we don't want to force the layout when suppressLayout becomes false. This leads
* to visual glitches.
*/
private static void noLayoutSuppressionForVisibilityTransitions(Transition transition) {
if (transition instanceof Visibility) {
final Visibility visibility = (Visibility) transition;
visibility.setSuppressLayout(false);
} else if (transition instanceof TransitionSet) {
final TransitionSet set = (TransitionSet) transition;
final int count = set.getTransitionCount();
for (int i = 0; i < count; i++) {
noLayoutSuppressionForVisibilityTransitions(set.getTransitionAt(i));
}
}
}
Aggregations