Skip to content
This repository was archived by the owner on May 7, 2019. It is now read-only.

Commit faba428

Browse files
committed
Fix app crash due to Realm adapter behavior changes
1 parent 0a140b3 commit faba428

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
applicationId 'com.github.ayltai.newspaper'
2424
minSdkVersion 16
2525
targetSdkVersion 25
26-
versionCode 10
27-
versionName '1.2.4r' + VERSION_REVISION + '-' + VERSION_HASH
26+
versionCode 11
27+
versionName '1.2.5r' + VERSION_REVISION + '-' + VERSION_HASH
2828

2929
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
3030
testInstrumentationRunnerArguments disableAnalytics: 'true'

app/src/main/java/com/github/ayltai/newspaper/list/ListAdapter.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.content.Context;
88
import android.support.annotation.NonNull;
99
import android.support.annotation.Nullable;
10+
import android.support.v7.widget.RecyclerView;
1011
import android.view.LayoutInflater;
1112
import android.view.View;
1213
import android.view.ViewGroup;
@@ -19,17 +20,14 @@
1920
import com.github.ayltai.newspaper.item.ItemPresenter;
2021
import com.github.ayltai.newspaper.item.ItemUpdatedEvent;
2122
import com.github.ayltai.newspaper.item.ItemViewHolder;
22-
import com.github.ayltai.newspaper.rss.Item;
2323
import com.github.ayltai.newspaper.util.LogUtils;
2424
import com.jakewharton.rxbinding.view.RxView;
2525

2626
import io.realm.Realm;
27-
import io.realm.RealmList;
28-
import io.realm.RealmRecyclerViewAdapter;
2927
import rx.Subscriber;
3028
import rx.subscriptions.CompositeSubscription;
3129

32-
final class ListAdapter extends RealmRecyclerViewAdapter<Item, ItemViewHolder> implements Closeable {
30+
final class ListAdapter extends RecyclerView.Adapter<ItemViewHolder> implements Closeable {
3331
//region Variables
3432

3533
private final Map<ItemViewHolder, ItemPresenter> map = new HashMap<>();
@@ -83,8 +81,6 @@ public void onNext(final ItemUpdatedEvent itemUpdatedEvent) {
8381
//endregion
8482

8583
ListAdapter(@NonNull final Context context, @NonNull final ListScreen.Key parentKey, @Constants.ListViewType final int listViewType, @Nullable final Feed feed) {
86-
super(feed == null ? new RealmList<>() : feed.getItems(), false);
87-
8884
this.context = context;
8985
this.parentKey = parentKey;
9086
this.listViewType = listViewType;

0 commit comments

Comments
 (0)