use of android.support.v4.app.Fragment in project weiciyuan by qii.
the class ContainerFragment method animationExit.
public void animationExit(ObjectAnimator backgroundAnimator) {
Fragment fragment = getChildFragmentManager().findFragmentById(R.id.child);
if (fragment instanceof GeneralPictureFragment) {
GeneralPictureFragment child = (GeneralPictureFragment) fragment;
child.animationExit(backgroundAnimator);
} else if (fragment instanceof GifPictureFragment) {
GifPictureFragment child = (GifPictureFragment) fragment;
child.animationExit(backgroundAnimator);
}
}
use of android.support.v4.app.Fragment in project weiciyuan by qii.
the class ContainerFragment method displayPicture.
private void displayPicture(String path, boolean animateIn) {
GalleryAnimationActivity activity = (GalleryAnimationActivity) getActivity();
AnimationRect rect = getArguments().getParcelable("rect");
boolean firstOpenPage = getArguments().getBoolean("firstOpenPage");
if (firstOpenPage) {
if (animateIn) {
ObjectAnimator animator = activity.showBackgroundAnimate();
animator.start();
} else {
activity.showBackgroundImmediately();
}
getArguments().putBoolean("firstOpenPage", false);
}
if (!ImageUtility.isThisBitmapTooLargeToRead(path)) {
Fragment fragment = null;
if (ImageUtility.isThisPictureGif(path)) {
fragment = GifPictureFragment.newInstance(path, rect, animateIn);
} else {
fragment = GeneralPictureFragment.newInstance(path, rect, animateIn);
}
getChildFragmentManager().beginTransaction().replace(R.id.child, fragment).commitAllowingStateLoss();
} else {
LargePictureFragment fragment = LargePictureFragment.newInstance(path, animateIn);
getChildFragmentManager().beginTransaction().replace(R.id.child, fragment).commitAllowingStateLoss();
}
}
use of android.support.v4.app.Fragment in project httpclient by pixmob.
the class FragmentCustomAnimationSupport method addFragmentToStack.
void addFragmentToStack() {
mStackLevel++;
// Instantiate a new fragment.
Fragment newFragment = CountingFragment.newInstance(mStackLevel);
// Add the fragment to the activity, pushing this transaction
// on to the back stack.
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.fragment_slide_left_enter, R.anim.fragment_slide_left_exit, R.anim.fragment_slide_right_enter, R.anim.fragment_slide_right_exit);
ft.replace(R.id.simple_fragment, newFragment);
ft.addToBackStack(null);
ft.commit();
}
use of android.support.v4.app.Fragment in project httpclient by pixmob.
the class FragmentStackSupport method addFragmentToStack.
void addFragmentToStack() {
mStackLevel++;
// Instantiate a new fragment.
Fragment newFragment = CountingFragment.newInstance(mStackLevel);
// Add the fragment to the activity, pushing this transaction
// on to the back stack.
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.simple_fragment, newFragment);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft.addToBackStack(null);
ft.commit();
}
use of android.support.v4.app.Fragment in project httpclient by pixmob.
the class LoaderCustomSupport method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentManager fm = getSupportFragmentManager();
// Create the list fragment and add it as our sole content.
if (fm.findFragmentById(android.R.id.content) == null) {
AppListFragment list = new AppListFragment();
fm.beginTransaction().add(android.R.id.content, list).commit();
}
}
Aggregations