Skip to content

Commit

Permalink
fragmentmaster optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed May 19, 2017
1 parent c968b0e commit 3ede9c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ public void showFragment(int fillId,Fragment fragment, OnTaskDoneListener onTask
}
}

public void showFragment(int fillId,Fragment fragment,String tag, OnTaskDoneListener onTaskDoneListener){
if(!fragment.isAdded()){
transaction.add(fillId, fragment,tag);
addedFragments.add(fragment);
}else {
transaction.show(fragment);
}
if(onTaskDoneListener != null){
onTaskDoneListener.done(null);
}
}

public Fragment findFragmentByTag(String tag){
return mFragmentManager.findFragmentByTag(tag);
}


//移除所有的Fragment
public void removeAllFragment(){
begin();
Expand Down

0 comments on commit 3ede9c5

Please sign in to comment.