当前位置: 首页>>代码示例>>Java>>正文


Java FragmentTransaction.setCustomAnimations方法代码示例

本文整理汇总了Java中android.app.FragmentTransaction.setCustomAnimations方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentTransaction.setCustomAnimations方法的具体用法?Java FragmentTransaction.setCustomAnimations怎么用?Java FragmentTransaction.setCustomAnimations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.FragmentTransaction的用法示例。


在下文中一共展示了FragmentTransaction.setCustomAnimations方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showLoginFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * Shows the Login Fragment
 */
public void showLoginFragment() {
    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.fade_in, R.animator.fade_out, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.replace(R.id.fragment_container, new DCLoginFragment());
    transaction.addToBackStack(DCLoginFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:11,代码来源:DCAuthenticationActivity.java

示例2: showPasswordResetFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void showPasswordResetFragment() {
    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.fade_in, R.animator.fade_out, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.add(R.id.fragment_container, new DCResetPasswordFragment());
    transaction.addToBackStack(DCResetPasswordFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:8,代码来源:DCAuthenticationActivity.java

示例3: show

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private static void show(FragmentManager fm, int type, RootInfo root, DocumentInfo doc, String query, int anim) {
	final Bundle args = new Bundle();
	args.putInt(EXTRA_TYPE, type);
	args.putParcelable(EXTRA_ROOT, root);
	args.putParcelable(EXTRA_DOC, doc);
	args.putString(EXTRA_QUERY, query);

	final FragmentTransaction ft = fm.beginTransaction();
	switch (anim) {
	case ANIM_SIDE:
		args.putBoolean(EXTRA_IGNORE_STATE, true);
		break;
	case ANIM_DOWN:
		ft.setCustomAnimations(R.animator.dir_down, R.animator.dir_frozen);
		break;
	case ANIM_UP:
		ft.setCustomAnimations(R.animator.dir_frozen, R.animator.dir_up);
		break;
	}

	final DirectoryFragment fragment = new DirectoryFragment();
	fragment.setArguments(args);

	ft.replace(R.id.container_directory, fragment);
	ft.commitAllowingStateLoss();
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:27,代码来源:DirectoryFragment.java

示例4: showFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void showFragment(Fragment fragment) {
    FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
    fragmentTransaction.setCustomAnimations(
            R.animator.enter,
            R.animator.exit,
            R.animator.pop_enter,
            R.animator.pop_exit
    );
    fragmentTransaction.replace(R.id.products_activity_content, fragment);
    fragmentTransaction.addToBackStack("ProductsStack");
    fragmentTransaction.commit();
}
 
开发者ID:chicio,项目名称:Model-View-Presenter,代码行数:13,代码来源:ProductsActivity.java

示例5: switchFragments

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * This method is used to toggle between the two fragment states by
 * calling the appropriate animations between them. The entry and exit
 * animations of the text fragment are specified in R.animator resource
 * files. The entry and exit animations of the image fragment are
 * specified in the slideBack and slideForward methods below. The reason
 * for separating the animation logic in this way is because the translucent
 * dark hover view must fade in at the same time as the image fragment
 * animates into the background, which would be difficult to time
 * properly given that the setCustomAnimations method can only modify the
 * two fragments in the transaction.
 */
private void switchFragments () {
    if (mIsAnimating) {
        return;
    }
    mIsAnimating = true;
    if (mDidSlideOut) {
        mDidSlideOut = false;
        getFragmentManager().popBackStack();
    } else {
        mDidSlideOut = true;

        AnimatorListener listener = new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator arg0) {
                FragmentTransaction transaction = getFragmentManager().beginTransaction();
                transaction.setCustomAnimations(R.animator.slide_fragment_in, 0, 0,
                        R.animator.slide_fragment_out);
                transaction.add(R.id.move_to_back_container, mTextFragment);
                transaction.addToBackStack(null);
                transaction.commit();
            }
        };
        slideBack (listener);
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:38,代码来源:SlidingFragments.java

示例6: setBodyFrontBack

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * 设置人体正反面
 * @author leibing
 * @createTime 2016/10/07
 * @lastModify 2016/10/07
 * @param
 * @return
 */
private void setBodyFrontBack() {
    switch (curSexFace){
        case MAN_FRONT:
            // 当为男性正面,则设置为男性反面
            curSexFace = MAN_BACK;
            break;
        case MAN_BACK:
            // 当为男性反面,则设置为男性正面
            curSexFace = MAN_FRONT;
            break;
        case WOMEN_FRONT:
            // 当为女性正面,则设置为女性反面
            curSexFace = WOMEN_BACK;
            break;
        case WOMEN_BACK:
            // 当为女性反面,则设置为女性正面
            curSexFace = WOMEN_FRONT;
            break;
    }

    if (curSexFace == MAN_FRONT || curSexFace == WOMEN_FRONT){
        // 当前面为男性正面或女性正面均设置为正面
        reverseTv.setText("正面");
    }else if (curSexFace == MAN_BACK || curSexFace == WOMEN_BACK){
        // 当前面为男性反面或女性反面均设置为反面
        reverseTv.setText("反面");
    }

    // 执行动画更新fragment内容
    FragmentTransaction fm = getFragmentManager().beginTransaction();
    fm.setCustomAnimations(R.anim.animator_two_enter, R.anim.animator_one_exit);
    fragmentHumanBody = HumanBodyFragment.newInstance(curSexFace);
    fm.replace(R.id.ly_fragment_area, fragmentHumanBody, "FragmentHumanBody");
    fm.commit();
}
 
开发者ID:leibing8912,项目名称:HumanBody,代码行数:44,代码来源:HumanBodyActivity.java

示例7: editProfile

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void editProfile() {
    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.replace(R.id.fragment_container, new DCProfileEditFragment());
    transaction.addToBackStack(DCProfileEditFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:8,代码来源:DCProfileActivity.java

示例8: showCollectDCN

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void showCollectDCN() {
    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.replace(R.id.fragment_container, new DCCollectDCNFragment());
    transaction.addToBackStack(DCCollectDCNFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:8,代码来源:DCCollectActivity.java

示例9: showSignupFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
 * Shows the signup fragment
 */
public void showSignupFragment() {
    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.replace(R.id.fragment_container, new DCSignupFragment());
    transaction.addToBackStack(DCSignupFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:11,代码来源:DCAuthenticationActivity.java

示例10: signupUser

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void signupUser(final DCUser user) {
    DCAgreementFragment agreementFragment = new DCAgreementFragment();
    agreementFragment.setListener(new DCAgreementFragment.IDCAgreementListener() {
        @Override
        public void onAgreementAccepted() {
            final DCLoadingFragment loadingFragment = showLoading();
            DCApiManager.getInstance().registerUser(user, new DCResponseListener<DCAuthToken>() {
                @Override
                public void onFailure(DCError error) {
                    onError(error);

                    if (loadingFragment != null)
                        loadingFragment.dismissAllowingStateLoss();
                }

                @Override
                public void onResponse(DCAuthToken object) {
                    handleAuthentication(object);

                    if (loadingFragment != null)
                        loadingFragment.dismissAllowingStateLoss();
                }
            });
        }
    });

    final FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, R.animator.slide_in_left, R.animator.slide_out_right);
    transaction.add(R.id.fragment_container, agreementFragment);
    transaction.addToBackStack(DCAgreementFragment.TAG);
    transaction.commit();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:33,代码来源:DCAuthenticationActivity.java

示例11: changeContent

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void changeContent (int direction) {
    boolean change = false;

    if (currentFragment > 0 && direction == DIRECTION_RIGHT) {
        currentFragment--;
        change = true;
    }
    if (currentFragment < 3 && direction == DIRECTION_LEFT) {
        currentFragment++;
        change = true;
    }
    if (change) {

        ContentFragment newFragment = ContentFragment.newInstance();
        newFragment.setContentCode(currentFragment);

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        if (direction == DIRECTION_LEFT) {
            transaction.setCustomAnimations(R.animator.slide_left_in, R.animator.slide_left_out);
        } else {
            transaction.setCustomAnimations(R.animator.slide_right_in, R.animator.slide_right_out);
        }

        transaction.replace(R.id.fragmentContainer,  newFragment);
        transaction.commit();
    }

}
 
开发者ID:gothalo,项目名称:Android-2017,代码行数:30,代码来源:MainActivity.java

示例12: replaceFragment

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public void replaceFragment(Fragment fragment) {
    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.setCustomAnimations(R.anim.slide_in_left,
            R.anim.slide_out_right);
    fragmentTransaction.replace(R.id.container, fragment);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
}
 
开发者ID:thebestpol,项目名称:SolidRefactor,代码行数:10,代码来源:MainActivity.java

示例13: setUpRotate3dAnimator

import android.app.FragmentTransaction; //导入方法依赖的package包/类
public static void setUpRotate3dAnimator(FragmentTransaction transaction) {
    transaction.setCustomAnimations(R.animator.rotate_3d_enter, R.animator.rotate_3d_exit);
}
 
开发者ID:aesean,项目名称:Rotate3d,代码行数:4,代码来源:AnimationHelper.java


注:本文中的android.app.FragmentTransaction.setCustomAnimations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。