Skip to content

Commit

Permalink
Merge pull request #6 from livefront/prepare-for-v1.1.0-release
Browse files Browse the repository at this point in the history
Prepare for v1.1.0 update
  • Loading branch information
brian-livefront committed Aug 16, 2017
2 parents d64acce + 339a49b commit eff5903
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
==========

Version 1.1.0 *(2017-08-04)*
----------------------------

* Added support for saving Bitmaps.
* Improved automatic clearing of old data.
* Added `clear` method for manually clearing data from disk for a given object.
* Added `clearAll` method for manually clearing all data from disk associated with `Bridge`.

Version 1.0.0 *(2017-06-22)*
----------------------------

Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A library for avoiding TransactionTooLargeException during state saving and rest

* [Motivation](#motivation)
* [Setup](#setup)
* [Clearing Data](#clear)
* [Install](#install)
* [How Does It Work](#how)
* [Limitations](#limitations)
Expand Down Expand Up @@ -61,6 +62,21 @@ Bridge.initialize(getApplicationContext(), new SavedStateHandler() {

That's it! You don't have to change any of your other code. If you are using any other `Icepick`-like library, simply swap out the library referred to in the `SavedStateHandler`.

<a name="clear"></a>
## Clearing Data

Bridge will clear all data written to disk each time the app is loaded and it detects that there is no saved state the system is trying to restore. It will also try to automatically clear state while the app is actively used to avoid holding onto data that is no longer relevant. However, in order to guarantee that no data is retained on disk for screens that have been left, the `Bridge.clear()` method may be used:

```java
@Override
public void onDestroy() {
super.onDestroy();
Bridge.clear(this);
}
```

In the event that you might like to migrate away from the use of `Bridge` but ensure that all associated data is cleared, `Bridge.clearAll` may be called at any time.

<a name="install"></a>
## Install

Expand All @@ -72,7 +88,7 @@ repositories {
}
dependencies {
compile 'com.github.livefront:bridge:v1.0.0'
compile 'com.github.livefront:bridge:v1.1.0'
}
```

Expand All @@ -83,11 +99,6 @@ dependencies {

There is one main caveat here : in order to ensure that as little of your app's code needs to change as possible, `Bridge` will read its data from disk on the main thread. This is currently done in a way that may add a small amount of time to your app's startup process. Fortunately, `Bridge` leverages the compact nature of `Bundle` to store data as efficiently as possible, and even extremely large amounts of data well in excess of the `1MB` limit leading to `TransactionTooLargeException` should only add something on the order of 100ms to the startup time.

<a name="limitations"></a>
## Limitations

Trying to save a `Bitmap` with `Bridge` will result in a crash, as their `Parcelable` implementation is highly optimized in a way that prevents `Bridge` from writing them to disk.

<a name="testing"></a>
## Testing

Expand Down
2 changes: 0 additions & 2 deletions bridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ android {
defaultConfig {
minSdkVersion 12
targetSdkVersion 25
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down

0 comments on commit eff5903

Please sign in to comment.