Search in sources :

Example 41 with Fragment

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);
    }
}
Also used : Fragment(android.support.v4.app.Fragment)

Example 42 with Fragment

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();
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) AnimationRect(org.qii.weiciyuan.support.lib.AnimationRect) Fragment(android.support.v4.app.Fragment)

Example 43 with Fragment

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();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment) SherlockFragment(com.actionbarsherlock.app.SherlockFragment)

Example 44 with Fragment

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();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment) SherlockFragment(com.actionbarsherlock.app.SherlockFragment)

Example 45 with Fragment

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();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager)

Aggregations

Fragment (android.support.v4.app.Fragment)663 FragmentTransaction (android.support.v4.app.FragmentTransaction)233 Bundle (android.os.Bundle)149 View (android.view.View)140 FragmentManager (android.support.v4.app.FragmentManager)134 DialogFragment (android.support.v4.app.DialogFragment)80 TextView (android.widget.TextView)59 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)48 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)48 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)48 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)43 Intent (android.content.Intent)41 ViewPager (android.support.v4.view.ViewPager)38 FragmentActivity (android.support.v4.app.FragmentActivity)34 ImageView (android.widget.ImageView)32 BaseFragment (com.waz.zclient.pages.BaseFragment)29 ArrayList (java.util.ArrayList)28 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)25 Button (android.widget.Button)24 ActionBar (android.support.v7.app.ActionBar)23