Skip to content

Commit

Permalink
Merge pull request #782 from YoKeyword/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
YoKeyword authored Feb 25, 2018
2 parents 327de61 + d1d8f2c commit 54ff12f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 22 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.6'
compile 'me.yokeyword:fragmentation:1.2.7'
// 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.2.6'
// compile 'me.yokeyword:fragmentation-core:1.2.7'
// To get SwipeBack feature, rely on both fragmentation & fragmentation-swipeback
compile 'me.yokeyword:fragmentation:1.2.6'
compile 'me.yokeyword:fragmentation:1.2.7'
// Swipeback is based on fragmentation. Refer to SwipeBackActivity/Fragment for your Customized SupportActivity/Fragment
compile 'me.yokeyword:fragmentation-swipeback:1.2.6'
compile 'me.yokeyword:fragmentation-swipeback:1.2.7'
// To simplify the communication between Fragments.
compile 'me.yokeyword:eventbus-activity-scope:1.1.0'
Expand Down
8 changes: 4 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ A powerful library that manage Fragment for Android!
**1. 项目下app的build.gradle中依赖:**
````gradle
// appcompat-v7包是必须的
compile 'me.yokeyword:fragmentation:1.2.5'
compile 'me.yokeyword:fragmentation:1.2.7'
// 如果不想继承SupportActivity/Fragment,自己定制Support,可仅依赖:
// compile 'me.yokeyword:fragmentation-core:1.2.5'
// compile 'me.yokeyword:fragmentation-core:1.2.7'
// 如果想使用SwipeBack 滑动边缘退出Fragment/Activity功能,完整的添加规则如下:
compile 'me.yokeyword:fragmentation:1.2.6'
compile 'me.yokeyword:fragmentation:1.2.7'
// swipeback基于fragmentation, 如果是自定制SupportActivity/Fragment,则参照SwipeBackActivity/Fragment实现即可
compile 'me.yokeyword:fragmentation-swipeback:1.2.6'
compile 'me.yokeyword:fragmentation-swipeback:1.2.7'
// Activity作用域的EventBus,更安全,可有效避免after onSavenInstanceState()异常
compile 'me.yokeyword:eventbus-activity-scope:1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ void popTo(final String targetFragmentTag, final boolean includeTargetFragment,
@Override
public void run() {
doPopTo(targetFragmentTag, includeTargetFragment, afterPopTransactionRunnable, fm, popAnim);

if (afterPopTransactionRunnable != null) {
afterPopTransactionRunnable.run();
}
}
});

if (afterPopTransactionRunnable != null) {
afterPopTransactionRunnable.run();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ public Action() {

public Action(int action) {
this.action = action;
if (action == ACTION_POP_MOCK) {
duration = BUFFER_TIME;
}
}

public Action(int action, FragmentManager fragmentManager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,26 @@ private void executeNextAction(Action action) {
if (action.action == Action.ACTION_POP) {
ISupportFragment top = SupportHelper.getTopFragment(action.fragmentManager);
if (top == null) return;
long duration = top.getSupportDelegate().getExitAnimDuration();
action.duration = duration + Action.BUFFER_TIME;
action.duration = top.getSupportDelegate().getExitAnimDuration() + Action.BUFFER_TIME;
}

final int currentAction = action.action;
mMainHandler.postDelayed(new Runnable() {
@Override
public void run() {
mQueue.poll();
handleAction();
if (currentAction == Action.ACTION_POP || currentAction == Action.ACTION_POP_MOCK) {
// For compatibility with v4-27+, see #653
mMainHandler.post(new Runnable() {
@Override
public void run() {
mQueue.poll();
handleAction();
}
});
} else {
mQueue.poll();
handleAction();
}
}
}, action.duration);
}
Expand Down
4 changes: 2 additions & 2 deletions fragmentation_swipeback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Activity内Fragment数大于1时,滑动返回的是Fragment,否则滑动返
1、项目下app的build.gradle中依赖:
````gradle
// appcompat v7包是必须的
compile 'me.yokeyword:fragmentation:1.2.6'
compile 'me.yokeyword:fragmentation-swipeback:1.2.6'
compile 'me.yokeyword:fragmentation:1.2.7'
compile 'me.yokeyword:fragmentation-swipeback:1.2.7'
````
2、如果Activity也需要支持SwipeBack,则继承SwipeBackActivity:
````java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public boolean swipeBackPriority() {

private void onActivityCreate() {
mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
mActivity.getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
mSwipeBackLayout = new SwipeBackLayout(mActivity);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mSwipeBackLayout.setLayoutParams(params);
Expand Down

0 comments on commit 54ff12f

Please sign in to comment.