mirror of https://github.com/readrops/Readrops.git
remove old callback in main activity
This commit is contained in:
parent
3b277a1fba
commit
3e50e63626
|
@ -56,7 +56,7 @@ import io.reactivex.disposables.Disposable;
|
|||
import io.reactivex.observers.DisposableSingleObserver;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements SimpleCallback, SwipeRefreshLayout.OnRefreshListener {
|
||||
public class MainActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
public static final String TAG = MainActivity.class.getSimpleName();
|
||||
public static final int ADD_FEED_REQUEST = 1;
|
||||
|
@ -112,7 +112,6 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S
|
|||
});
|
||||
|
||||
viewModel = ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
viewModel.setSimpleCallback(this);
|
||||
|
||||
itemsMap = new TreeMap<>(LocalDateTime::compareTo);
|
||||
newItems = new ArrayList<>();
|
||||
|
@ -220,18 +219,6 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
adapter.submitList(newItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
refreshLayout.setRefreshing(false);
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
Log.d(TAG, "syncing started");
|
||||
|
|
Loading…
Reference in New Issue