mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
Merge branch 'develop' into iadeelzafar/wifi-hotspot
This commit is contained in:
commit
b14b845995
@ -12,6 +12,7 @@ Kiwix is written in [Kotlin](https://kotlinlang.org/) (with a few old pieces in
|
||||
[](https://travis-ci.org/kiwix/kiwix-android)
|
||||
[](http://chat.kiwix.org)
|
||||
[](https://codecov.io/gh/kiwix/kiwix-android)
|
||||
[](https://www.codefactor.io/repository/github/kiwix/kiwix-android)
|
||||
---
|
||||
|
||||
## Build Instructions
|
||||
@ -56,8 +57,8 @@ You can use IRC web interface on [http://chat.kiwix.org/](http://chat.kiwix.org/
|
||||
|
||||
Our other sources of communications include
|
||||
|
||||
- Email: kiwix-developer@lists.sourceforge.net or contact@kiwix.org
|
||||
- Jabber: kelson@kiwix.org
|
||||
- Email: contact@kiwix.org
|
||||
- Mailing list: kiwix-developer@lists.sourceforge.net
|
||||
|
||||
For more information, please refer to [https://wiki.kiwix.org/wiki/Communication](https://wiki.kiwix.org/wiki/Communication).
|
||||
|
||||
|
@ -342,7 +342,7 @@ public class ZimContentProvider extends ContentProvider {
|
||||
|
||||
// This is the code which retrieve the mimeType from the libzim
|
||||
// "slow" and still bugyy
|
||||
if (mimeType.isEmpty()) {
|
||||
if (mimeType == null || mimeType.isEmpty()) {
|
||||
String t = uri.toString();
|
||||
int pos = uri.toString().indexOf(CONTENT_URI.toString());
|
||||
if (pos != -1) {
|
||||
|
@ -41,7 +41,7 @@ class NewBookDao @Inject constructor(private val box: Box<BookOnDiskEntity>) {
|
||||
inValues(BookOnDiskEntity_.bookId, booksOnDisk.map { it.book.id }.toTypedArray())
|
||||
}
|
||||
.remove()
|
||||
box.put(booksOnDisk.map(::BookOnDiskEntity))
|
||||
box.put(booksOnDisk.distinctBy { it.book.id }.map(::BookOnDiskEntity))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
++tempVisitCount;
|
||||
visitCounterPref.setCount(tempVisitCount);
|
||||
|
||||
if (tempVisitCount >= 5
|
||||
if (tempVisitCount >= 10
|
||||
&& !visitCounterPref.getNoThanksState()
|
||||
&& NetworkUtils.isNetworkAvailable(this) && !BuildConfig.DEBUG) {
|
||||
showRateDialog();
|
||||
@ -1119,6 +1119,9 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
|
||||
private void externalLinkPopup(Intent intent) {
|
||||
int warningResId = (sharedPreferenceUtil.nightMode())
|
||||
? R.drawable.ic_warning_white : R.drawable.ic_warning_black;
|
||||
|
||||
new AlertDialog.Builder(this, dialogStyle())
|
||||
.setTitle(R.string.external_link_popup_dialog_title)
|
||||
.setMessage(R.string.external_link_popup_dialog_message)
|
||||
@ -1132,7 +1135,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
startActivity(intent);
|
||||
})
|
||||
.setPositiveButton(android.R.string.yes, (dialogInterface, i) -> startActivity(intent))
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setIcon(warningResId)
|
||||
.show();
|
||||
}
|
||||
|
||||
@ -1410,6 +1413,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();
|
||||
@ -2106,7 +2110,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