mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 12:03:09 -04:00
Merge pull request #1346 from kiwix/siddharth2010/ReloadZimList
Update Zim File queue on Home Screen on onResume
This commit is contained in:
commit
bb57ea4def
@ -1403,6 +1403,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
webViewList.get(currentWebViewIndex).findViewById(R.id.get_content_card).setEnabled(true);
|
||||
}
|
||||
updateBottomToolbarVisibility();
|
||||
presenter.loadBooks();
|
||||
|
||||
Log.d(TAG_KIWIX, "action" + getIntent().getAction());
|
||||
Intent intent = getIntent();
|
||||
@ -2097,7 +2098,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
@Override
|
||||
public void setHomePage(View view) {
|
||||
RecyclerView homeRecyclerView = view.findViewById(R.id.recycler_view);
|
||||
presenter.showHome();
|
||||
presenter.loadBooks();
|
||||
homeRecyclerView.setAdapter(booksAdapter);
|
||||
downloadBookButton = view.findViewById(R.id.content_main_card_download_button);
|
||||
downloadBookButton.setOnClickListener(v -> manageZimFiles(1));
|
||||
|
@ -19,7 +19,7 @@ class MainContract {
|
||||
}
|
||||
|
||||
interface Presenter extends BaseContract.Presenter<View> {
|
||||
void showHome();
|
||||
void loadBooks();
|
||||
|
||||
void saveBooks(List<BooksOnDiskListItem.BookOnDisk> books);
|
||||
|
||||
|
@ -9,10 +9,8 @@ import javax.inject.Inject;
|
||||
import org.kiwix.kiwixmobile.base.BasePresenter;
|
||||
import org.kiwix.kiwixmobile.bookmark.BookmarkItem;
|
||||
import org.kiwix.kiwixmobile.data.DataSource;
|
||||
import org.kiwix.kiwixmobile.data.local.entity.Bookmark;
|
||||
import org.kiwix.kiwixmobile.di.PerActivity;
|
||||
import org.kiwix.kiwixmobile.history.HistoryListItem;
|
||||
import org.kiwix.kiwixmobile.library.entity.LibraryNetworkEntity;
|
||||
import org.kiwix.kiwixmobile.zim_manager.fileselect_view.adapter.BooksOnDiskListItem;
|
||||
|
||||
/**
|
||||
@ -30,7 +28,7 @@ class MainPresenter extends BasePresenter<MainContract.View> implements MainCont
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showHome() {
|
||||
public void loadBooks() {
|
||||
dataSource.getLanguageCategorizedBooks()
|
||||
.subscribe(new SingleObserver<List<BooksOnDiskListItem>>() {
|
||||
@Override
|
||||
@ -61,7 +59,7 @@ class MainPresenter extends BasePresenter<MainContract.View> implements MainCont
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
showHome();
|
||||
loadBooks();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user