之前一篇文章实现了Activity 与Activity 之前大图查看https://blog.csdn.net/zhu_nana/article/details/108241971
下面介绍一下Fragment 与Fragment 之前
实现点击 FragmentA 中 的图片,FragmentB大图显示,FragmentA中启动FragmentB代码
public void onClick(View ve) {
FragmentTransaction ft2 = getFragmentManager().beginTransaction();
ft2.replace(R.id.fragment_a, new FragmentB()); //fragment_a为FragmentA的id
ft2.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
ft2.addToBackStack(null);
ft2.commit();
}
FragmentB.java 重点是销毁FragmentB时回到FragmentA
private static final long ANIM_TIME = 200;
private RectF mThumbMaskRect;
private Matrix mThumbImageMatrix;
private ObjectAnimator mBackgroundAnimator;
private PinchImageView mImageView;
private View mBackgro