Skip to content

Instantly share code, notes, and snippets.

View patloew's full-sized avatar

Patrick Löwenstein patloew

View GitHub Profile
public class RealmListParcelConverter implements TypeRangeParcelConverter<RealmList<? extends RealmObject>, RealmList<? extends RealmObject>> {
private static final int NULL = -1;
@Override
public void toParcel(RealmList<? extends RealmObject> input, Parcel parcel) {
if (input == null) {
parcel.writeInt(NULL);
} else {
parcel.writeInt(input.size());
for (RealmObject item : input) {
@patloew
patloew / RealmResultsObservable.java
Last active September 27, 2017 15:22
RealmResultsObservable
/* Copyright 2016 Patrick Löwenstein
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,