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