Skip to content

Commit

Permalink
Fixed the fragment's transaction commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokk committed Jan 30, 2018
1 parent a566d09 commit 3be0cc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ allprojects {
And add our dependency to your app `bundle.gradle`.

```gradle
implementation 'com.devrapid.jieyi:kotlinknifer:1.2.2'
implementation 'com.devrapid.jieyi:kotlinknifer:1.2.21'
```

Then you can use it!!!
Expand All @@ -55,7 +55,7 @@ Then you can use it!!!
<dependency>
<groupId>com.devrapid.jieyi</groupId>
<artifactId>kotlinknifer</artifactId>
<version>1.2.2</version>
<version>1.2.21</version>
<type>pom</type>
</dependency>
```
Expand All @@ -70,7 +70,7 @@ Then you can use it!!!
If you'd not like to use them to your project, you can add the exclude as like below

```gradle
implementation('com.devrapid.jieyi:kotlinknifer:1.2.2', {
implementation('com.devrapid.jieyi:kotlinknifer:1.2.21', {
exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
exclude group: 'io.reactivex.rxjava2', module: 'rxkotlin'
exclude group: 'com.google.code.gson', module: 'gson'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ proj_name=kotlinknifer
proj_libname=KotlinKnifer
proj_group=com.devrapid.jieyi
proj_artifactid=kotlinknifer
proj_version=1.2.2
proj_version=1.2.21
proj_description=For developing an Android conveniently and rapidly.
proj_websiteurl=https://github.com/pokk/KotlinKnifer
proj_issuetrackerurl=https://github.com/pokk/KotlinKnifer/issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun FragmentManager.addFragment(containerViewId: Int,
fragment: Fragment,
needBack: Boolean = false,
fragmentStack: Stack<Fragment>? = null,
sharedElements: HashMap<View, String> = hashMapOf()) = transactionNow {
sharedElements: HashMap<View, String> = hashMapOf()) = transaction {
replace(containerViewId, fragment, fragment::class.java.simpleName)
sharedElements.forEach { value -> addSharedElement(value.key, value.value) }
if (needBack) {
Expand Down Expand Up @@ -67,7 +67,7 @@ inline fun FragmentManager.popAllFragment(fragmentStack: Stack<Fragment>? = null
*
* @param manager support v4 [FragmentManager].
*/
inline fun Fragment.removeFrom(manager: FragmentManager) = manager.transactionNow { remove(this@removeFrom) }
inline fun Fragment.removeFrom(manager: FragmentManager) = manager.transaction { remove(this@removeFrom) }

/**
* Remove all fragments.
Expand All @@ -80,7 +80,7 @@ inline fun FragmentManager.removeLastFragment() = fragments.lastOrNull()?.remove
*
* @param manager support v4 [FragmentManager].
*/
inline fun Fragment.appendTo(manager: FragmentManager) = manager.transactionNow {
inline fun Fragment.appendTo(manager: FragmentManager) = manager.transaction {
hide(this@appendTo)
add(this@appendTo, this@appendTo::class.java.simpleName)
}
Expand All @@ -90,7 +90,7 @@ inline fun Fragment.appendTo(manager: FragmentManager) = manager.transactionNow
*
* @param manager support v4 [FragmentManager].
*/
inline fun Fragment.hideFrom(manager: FragmentManager) = manager.transactionNow { hide(this@hideFrom) }
inline fun Fragment.hideFrom(manager: FragmentManager) = manager.transaction { hide(this@hideFrom) }

/**
* Decorator between [beginTransaction] and [commit].
Expand Down

0 comments on commit 3be0cc9

Please sign in to comment.