Skip to content

Commit f932723

Browse files
committed
undo unecessary changes
1 parent 3c8687a commit f932723

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public abstract class FirestorePagingAdapter<T, VH extends RecyclerView.ViewHold
3535
LiveData created via Transformation do not have a value until an Observer is attached.
3636
We attach this empty observer so that our getValue() calls return non-null later.
3737
*/
38-
private final Observer<FirestoreDataSource> mPagingSourceObserver = new Observer<FirestoreDataSource>() {
38+
private final Observer<FirestoreDataSource> mDataSourceObserver = new Observer<FirestoreDataSource>() {
3939
@Override
4040
public void onChanged(@Nullable FirestoreDataSource source) {
4141

@@ -100,8 +100,8 @@ private void init() {
100100
new Function<PagedList<DocumentSnapshot>, LiveData<LoadingState>>() {
101101
@Override
102102
public LiveData<LoadingState> apply(PagedList<DocumentSnapshot> input) {
103-
FirestoreDataSource pagingSource = (FirestoreDataSource) input.getDataSource();
104-
return pagingSource.getLoadingState();
103+
FirestoreDataSource dataSource = (FirestoreDataSource) input.getDataSource();
104+
return dataSource.getLoadingState();
105105
}
106106
});
107107

@@ -117,8 +117,8 @@ public FirestoreDataSource apply(PagedList<DocumentSnapshot> input) {
117117
new Function<PagedList<DocumentSnapshot>, LiveData<Exception>>() {
118118
@Override
119119
public LiveData<Exception> apply(PagedList<DocumentSnapshot> input) {
120-
FirestoreDataSource pagingSource = (FirestoreDataSource) input.getDataSource();
121-
return pagingSource.getLastError();
120+
FirestoreDataSource dataSource = (FirestoreDataSource) input.getDataSource();
121+
return dataSource.getLastError();
122122
}
123123
});
124124

@@ -134,24 +134,24 @@ public LiveData<Exception> apply(PagedList<DocumentSnapshot> input) {
134134
* attempt to retry the most recent failure.
135135
*/
136136
public void retry() {
137-
PagedList<DocumentSnapshot> pagedList = mSnapshots.getValue();
138-
if (pagedList == null) {
139-
Log.w(TAG, "Called retry() when PagedList is null!");
137+
FirestoreDataSource source = mDataSource.getValue();
138+
if (source == null) {
139+
Log.w(TAG, "Called retry() when FirestoreDataSource is null!");
140140
return;
141141
}
142-
pagedList.retry();
142+
source.retry();
143143
}
144144

145145
/**
146146
* To attempt to refresh the list. It will reload the list from beginning.
147147
*/
148148
public void refresh() {
149-
FirestoreDataSource mFirebasePagingSource = mDataSource.getValue();
150-
if (mFirebasePagingSource == null) {
149+
FirestoreDataSource mFirebaseDataSource = mDataSource.getValue();
150+
if (mFirebaseDataSource == null) {
151151
Log.w(TAG, "Called refresh() when FirestorePagingSource is null!");
152152
return;
153153
}
154-
mFirebasePagingSource.invalidate();
154+
mFirebaseDataSource.invalidate();
155155
}
156156

157157
/**
@@ -183,7 +183,7 @@ public void updateOptions(@NonNull FirestorePagingOptions<T> options) {
183183
public void startListening() {
184184
mSnapshots.observeForever(mDataObserver);
185185
mLoadingState.observeForever(mStateObserver);
186-
mDataSource.observeForever(mPagingSourceObserver);
186+
mDataSource.observeForever(mDataSourceObserver);
187187
mException.observeForever(mErrorObserver);
188188
}
189189

@@ -195,7 +195,7 @@ public void startListening() {
195195
public void stopListening() {
196196
mSnapshots.removeObserver(mDataObserver);
197197
mLoadingState.removeObserver(mStateObserver);
198-
mDataSource.removeObserver(mPagingSourceObserver);
198+
mDataSource.removeObserver(mDataSourceObserver);
199199
mException.removeObserver(mErrorObserver);
200200
}
201201

firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ public Builder<T> setQuery(@NonNull final Query query,
267267
assertNull(mData, ERR_DATA_SET);
268268

269269
// Build paged list
270-
final FirestoreDataSource.Factory factory = new FirestoreDataSource.Factory(query, source);
271-
mData = new LivePagedListBuilder<PageKey, DocumentSnapshot>(factory, config).build();
270+
FirestoreDataSource.Factory factory = new FirestoreDataSource.Factory(query, source);
271+
mData = new LivePagedListBuilder<>(factory, config).build();
272272

273273
mParser = parser;
274274
return this;

0 commit comments

Comments
 (0)