-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change state initialization lifecycle
Request change for android. Activity is calling save instance state on child fragments before the view was attached when the currentState was uninitialized which leads to crash. We are using currentState in onSaveInstanceState to keep state in android. Presenter's initializeState gives flexibility to init a state depending on platform specific requirements. Also fixed type, expose exceptions classes to give possibility to handle exceptions from library.
- Loading branch information
Arkadiusz Pałka
committed
Dec 22, 2020
1 parent
a49f4f9
commit 79ece5a
Showing
9 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
mvi-presenter/src/main/java/pl/valueadd/mvi/exception/ViewNotAttachedException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package pl.valueadd.mvi.exception | ||
|
||
internal class ViewNotAttachedException : | ||
class ViewNotAttachedException internal constructor() : | ||
RuntimeException("View was called before that has been attached to presenter") |
5 changes: 2 additions & 3 deletions
5
mvi-presenter/src/main/java/pl/valueadd/mvi/exception/ViewWasNotDetachedException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
package pl.valueadd.mvi.exception | ||
|
||
import java.lang.RuntimeException | ||
|
||
internal class ViewWasNotDetachedException : RuntimeException("Detach previous view first.") | ||
class ViewWasNotDetachedException internal constructor() : | ||
RuntimeException("Detach previous view first.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ android { | |
unitTests.all { | ||
useJUnitPlatform() | ||
} | ||
unitTests.returnDefaultValues = true | ||
} | ||
|
||
buildTypes { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters