diff --git a/README.md b/README.md index d92173cc..194e9d91 100755 --- a/README.md +++ b/README.md @@ -46,15 +46,15 @@ The first demo shows the basic usage of the library. The second one shows the wa **1、build.gradle** ````gradle // appcompat-v7 is required -compile 'me.yokeyword:fragmentation:1.3.4' +compile 'me.yokeyword:fragmentation:1.3.5' // If you don't want to extends SupportActivity/Fragment and would like to customize your own support, just rely on fragmentation-core -// compile 'me.yokeyword:fragmentation-core:1.3.4' +// compile 'me.yokeyword:fragmentation-core:1.3.5' // To get SwipeBack feature, rely on both fragmentation & fragmentation-swipeback -compile 'me.yokeyword:fragmentation:1.3.4' +compile 'me.yokeyword:fragmentation:1.3.5' // Swipeback is based on fragmentation. Refer to SwipeBackActivity/Fragment for your Customized SupportActivity/Fragment -compile 'me.yokeyword:fragmentation-swipeback:1.3.4' +compile 'me.yokeyword:fragmentation-swipeback:1.3.5' // To simplify the communication between Fragments. compile 'me.yokeyword:eventbus-activity-scope:1.1.0' diff --git a/README_CN.md b/README_CN.md index deed1d3f..d21bfb81 100644 --- a/README_CN.md +++ b/README_CN.md @@ -52,15 +52,15 @@ A powerful library that manage Fragment for Android! **1. 项目下app的build.gradle中依赖:** ````gradle // appcompat-v7包是必须的 -compile 'me.yokeyword:fragmentation:1.3.4' +compile 'me.yokeyword:fragmentation:1.3.5' // 如果不想继承SupportActivity/Fragment,自己定制Support,可仅依赖: -// compile 'me.yokeyword:fragmentation-core:1.3.4' +// compile 'me.yokeyword:fragmentation-core:1.3.5' // 如果想使用SwipeBack 滑动边缘退出Fragment/Activity功能,完整的添加规则如下: -compile 'me.yokeyword:fragmentation:1.3.4' +compile 'me.yokeyword:fragmentation:1.3.5' // swipeback基于fragmentation, 如果是自定制SupportActivity/Fragment,则参照SwipeBackActivity/Fragment实现即可 -compile 'me.yokeyword:fragmentation-swipeback:1.3.4' +compile 'me.yokeyword:fragmentation-swipeback:1.3.5' // Activity作用域的EventBus,更安全,可有效避免after onSavenInstanceState()异常 compile 'me.yokeyword:eventbus-activity-scope:1.1.0' diff --git a/fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java b/fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java index 303fc41b..e2fae9ff 100644 --- a/fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java +++ b/fragmentation_core/src/main/java/me/yokeyword/fragmentation/ExtraTransaction.java @@ -68,6 +68,8 @@ public abstract ExtraTransaction setCustomAnimations(@AnimatorRes @AnimRes int t public abstract void startDontHideSelf(ISupportFragment toFragment); + public abstract void startDontHideSelf(ISupportFragment toFragment, @ISupportFragment.LaunchMode int launchMode); + public abstract void start(ISupportFragment toFragment, @ISupportFragment.LaunchMode int launchMode); public abstract void startForResult(ISupportFragment toFragment, int requestCode); @@ -241,6 +243,12 @@ public void startDontHideSelf(ISupportFragment toFragment) { mTransactionDelegate.dispatchStartTransaction(getFragmentManager(), mSupportF, toFragment, 0, ISupportFragment.STANDARD, TransactionDelegate.TYPE_ADD_WITHOUT_HIDE); } + @Override + public void startDontHideSelf(ISupportFragment toFragment, @ISupportFragment.LaunchMode int launchMode) { + toFragment.getSupportDelegate().mTransactionRecord = mRecord; + mTransactionDelegate.dispatchStartTransaction(getFragmentManager(), mSupportF, toFragment, 0, launchMode, TransactionDelegate.TYPE_ADD_WITHOUT_HIDE); + } + @Override public void start(ISupportFragment toFragment, @ISupportFragment.LaunchMode int launchMode) { toFragment.getSupportDelegate().mTransactionRecord = mRecord; diff --git a/fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java b/fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java index afd308aa..90e52ada 100644 --- a/fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java +++ b/fragmentation_core/src/main/java/me/yokeyword/fragmentation/SupportFragmentDelegate.java @@ -205,6 +205,9 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { || (mFragment.getTag() != null && mFragment.getTag().startsWith("android:switcher:")) || (mReplaceMode && !mFirstCreateView)) { notifyEnterAnimEnd(); + } else if (mCustomEnterAnim != Integer.MIN_VALUE) { + fixAnimationListener(mCustomEnterAnim == 0 ? + mAnimHelper.getNoneAnim() : AnimationUtils.loadAnimation(_mActivity, mCustomEnterAnim)); } if (mFirstCreateView) { diff --git a/fragmentation_swipeback/README.md b/fragmentation_swipeback/README.md index 6fb22189..d2a6abe6 100644 --- a/fragmentation_swipeback/README.md +++ b/fragmentation_swipeback/README.md @@ -10,8 +10,8 @@ Activity内Fragment数大于1时,滑动返回的是Fragment,否则滑动返 1、项目下app的build.gradle中依赖: ````gradle // appcompat v7包是必须的 -compile 'me.yokeyword:fragmentation:1.3.4' -compile 'me.yokeyword:fragmentation-swipeback:1.3.4' +compile 'me.yokeyword:fragmentation:1.3.5' +compile 'me.yokeyword:fragmentation-swipeback:1.3.5' ```` 2、如果Activity也需要支持SwipeBack,则继承SwipeBackActivity: