mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Revert "Optimizing refresh. Issue #538 @GeVic comment.."
This reverts commit cec66926e64d886ccc81622500b95d70b7fb9440. As it causes a crash on certain devices due to android.os.TransactionTooLargeException
This commit is contained in:
parent
060b1a6db7
commit
dc0e04adde
@ -40,7 +40,6 @@ import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.test.espresso.idling.CountingIdlingResource;
|
||||
@ -81,8 +80,8 @@ public class LibraryFragment extends BaseFragment
|
||||
public static final CountingIdlingResource IDLING_RESOURCE =
|
||||
new CountingIdlingResource("Library Fragment Idling Resource");
|
||||
public static final List<Book> downloadingBooks = new ArrayList<>();
|
||||
private static final String EXTRA_BOOKS_ONLINE = "books_online";
|
||||
public static DownloadService downloadService = new DownloadService();
|
||||
|
||||
private static NetworkBroadcastReceiver networkBroadcastReceiver;
|
||||
private static boolean isReceiverRegistered = false;
|
||||
public LibraryAdapter libraryAdapter;
|
||||
@ -100,9 +99,9 @@ public class LibraryFragment extends BaseFragment
|
||||
LibraryPresenter presenter;
|
||||
@Inject
|
||||
SharedPreferenceUtil sharedPreferenceUtil;
|
||||
private LinkedList<Book> books;
|
||||
private boolean bound;
|
||||
private DownloadServiceConnection downloadServiceConnection = new DownloadServiceConnection();
|
||||
|
||||
private ZimManageActivity activity;
|
||||
|
||||
@Override
|
||||
@ -154,7 +153,7 @@ public class LibraryFragment extends BaseFragment
|
||||
IDLING_RESOURCE.decrement();
|
||||
return;
|
||||
}
|
||||
this.books = books;
|
||||
|
||||
Log.i("kiwix-showBooks", "Contains:" + books.size());
|
||||
libraryAdapter.setAllBooks(books);
|
||||
if (activity.searchView != null) {
|
||||
@ -335,22 +334,6 @@ public class LibraryFragment extends BaseFragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putSerializable(EXTRA_BOOKS_ONLINE, books);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
|
||||
super.onViewStateRestored(savedInstanceState);
|
||||
if ((savedInstanceState != null && savedInstanceState.containsKey(EXTRA_BOOKS_ONLINE))) {
|
||||
//noinspection unchecked
|
||||
books = (LinkedList<Book>) savedInstanceState.getSerializable(EXTRA_BOOKS_ONLINE);
|
||||
showBooks(books);
|
||||
}
|
||||
}
|
||||
|
||||
class DownloadServiceConnection {
|
||||
final DownloadServiceInterface downloadServiceInterface;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user