- CHANGE/FIX:
ManagedChangeSet
usessetValue
only for the initial load of synchronous query, otherwise usespostValue
to preventjava.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
- CHANGE:
findAllManagedWithChanges(..., asAsync = false)
is replaced withfindAllManagedWithChangesSync(...)
(for better Kotlin support) - FIX:
asAsync = false
was not working (whoops)
- BREAKING:
findAllSync
is renamed tofetchAllManagedSync
- Added
findAllManagedWithChanges(..., asAsync)
to allow synchronous evaluation of managed results. - Internal change:
ManagedChangeSet
now usessetValue
instead ofpostValue
- Fix that setting the new query should be atomic (and visible on the Monarchy thread).
- Made
Monarchy.RealmDataSourceFactory
public, and addedupdateQuery(Query<T> query)
method.
- Added
Monarchy.fetchAllMappedSync()
andMonarchy.fetchAllCopiedSync()
for those who desire to abandon all hope (in this case, change notifications). Common in DAO abstractions that ignore reactivity.
- Added counter-measures against a potential race condition when number of active subscriptions go from
1 -> 0
and0 -> 1
rapidly.
-
Added
Monarchy.findAllPagedWithChanges()
andMonarchy.createDataSourceFactory()
. -
Added dependency on
api "android.arch.paging:runtime:1.0.0"
to supportfindAllPagedWithChanges()
. -
Updated Realm to 5.1.0. Carried over breaking change that
OrderedCollectionChangeSet
is no longer nullable, and instead must check forchangeSet.getState() == State.INITIAL
. This is relevant inmanaged
mode. -
Compared to 0.2.0, a crash was fixed that happened on back navigation + paged results.
-
Javadocs.
-
startListening(LiveResults)
andstopListening(LiveResults)
is no longer public, because it should have been package-private.
-
Initial release of Monarchy.
-
Ability to read and listen for copied RealmResults from a background looper thread as LiveData:
findAllCopiedWithChanges
-
Ability to read and listen for mapped RealmResults from a background looper thread as LiveData::
findAllMappedWithChanges
-
Ability to read and listen for managed RealmResults from UI thread (with auto-managed Realm instance) as LiveData:
findAllManagedWithChanges
-
Synchronous read as list:
List<T> list = monarchy.findAllSync(realm, (realm) -> realm.where(...));
(internally, this returns managed objects in a snapshot collection) -
Realm blocks:
doWithRealm((realm) -> { ... })
-
Synchronous transactions:
runTransactionSync(transaction)
-
Async transactions:
writeAsync(transaction)