mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 19:35:36 -04:00
-readd deleted activity -revert application supertype to MultiDexApplication -temp solution to stop crash in Repository - readd tables that will be replaced by objectbox - reimplement parcelable Language
This commit is contained in:
parent
22e5d3226e
commit
bb00b063a3
@ -136,6 +136,26 @@
|
|||||||
<data android:mimeType="text/plain"/>
|
<data android:mimeType="text/plain"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".zim_manager.ZimManageActivity"
|
||||||
|
android:label="@string/choose_file"
|
||||||
|
android:launchMode="singleTop">
|
||||||
|
<!-- TODO -->
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.GET_CONTENT"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<category android:name="android.intent.category.OPENABLE"/>
|
||||||
|
|
||||||
|
<data android:mimeType="*/*"/>
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="org.kiwix.kiwixmobile.utils.KiwixSearchWidget.TEXT_CLICKED"/>
|
||||||
|
<action android:name="org.kiwix.kiwixmobile.utils.KiwixSearchWidget.ICON_CLICKED"/>
|
||||||
|
<action android:name="org.kiwix.kiwixmobile.utils.KiwixSearchWidget.MIC_CLICKED"/>
|
||||||
|
<action android:name="org.kiwix.kiwixmobile.utils.KiwixSearchWidget.STAR_CLICKED"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
<activity android:name=".settings.KiwixSettingsActivity"/>
|
<activity android:name=".settings.KiwixSettingsActivity"/>
|
||||||
<activity android:name=".search.SearchActivity"/>
|
<activity android:name=".search.SearchActivity"/>
|
||||||
<activity android:name=".bookmark.BookmarksActivity"/>
|
<activity android:name=".bookmark.BookmarksActivity"/>
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
package org.kiwix.kiwixmobile;
|
package org.kiwix.kiwixmobile;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.multidex.MultiDexApplication;
|
||||||
import com.jakewharton.threetenabp.AndroidThreeTen;
|
import com.jakewharton.threetenabp.AndroidThreeTen;
|
||||||
import com.squareup.leakcanary.LeakCanary;
|
import com.squareup.leakcanary.LeakCanary;
|
||||||
import dagger.android.AndroidInjector;
|
import dagger.android.AndroidInjector;
|
||||||
@ -34,7 +34,7 @@ import javax.inject.Inject;
|
|||||||
import org.kiwix.kiwixmobile.di.components.ApplicationComponent;
|
import org.kiwix.kiwixmobile.di.components.ApplicationComponent;
|
||||||
import org.kiwix.kiwixmobile.di.components.DaggerApplicationComponent;
|
import org.kiwix.kiwixmobile.di.components.DaggerApplicationComponent;
|
||||||
|
|
||||||
public class KiwixApplication extends Application implements HasActivityInjector {
|
public class KiwixApplication extends MultiDexApplication implements HasActivityInjector {
|
||||||
|
|
||||||
private static KiwixApplication application;
|
private static KiwixApplication application;
|
||||||
private static ApplicationComponent applicationComponent;
|
private static ApplicationComponent applicationComponent;
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
package org.kiwix.kiwixmobile.data;
|
package org.kiwix.kiwixmobile.data;
|
||||||
|
|
||||||
import io.reactivex.Completable;
|
import io.reactivex.Completable;
|
||||||
import io.reactivex.Observable;
|
|
||||||
import io.reactivex.Scheduler;
|
import io.reactivex.Scheduler;
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import org.kiwix.kiwixmobile.data.local.dao.BookDao;
|
import org.kiwix.kiwixmobile.data.local.dao.BookDao;
|
||||||
@ -52,7 +51,7 @@ public class Repository implements DataSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Single<List<LibraryNetworkEntity.Book>> getLanguageCategorizedBooks() {
|
public Single<List<LibraryNetworkEntity.Book>> getLanguageCategorizedBooks() {
|
||||||
return Observable.fromIterable(bookDao.getBooks())
|
return /*Observable.fromIterable(bookDao.getBooks())
|
||||||
.toSortedList(
|
.toSortedList(
|
||||||
(book1, book2) -> book1.getLanguage().compareToIgnoreCase(book2.getLanguage()) == 0 ?
|
(book1, book2) -> book1.getLanguage().compareToIgnoreCase(book2.getLanguage()) == 0 ?
|
||||||
book1.getTitle().compareToIgnoreCase(book2.getTitle()) :
|
book1.getTitle().compareToIgnoreCase(book2.getTitle()) :
|
||||||
@ -73,7 +72,8 @@ public class Repository implements DataSource {
|
|||||||
book = books.get(position);
|
book = books.get(position);
|
||||||
}
|
}
|
||||||
return books;
|
return books;
|
||||||
})
|
})*/
|
||||||
|
Single.just(Collections.<LibraryNetworkEntity.Book>emptyList())
|
||||||
.subscribeOn(io)
|
.subscribeOn(io)
|
||||||
.observeOn(mainThread);
|
.observeOn(mainThread);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,11 @@ public class KiwixDatabase extends SquidDatabase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Table[] getTables() {
|
protected Table[] getTables() {
|
||||||
return new Table[] {};
|
return new Table[] {
|
||||||
|
RecentSearch.TABLE,
|
||||||
|
Bookmark.TABLE,
|
||||||
|
History.TABLE
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,7 +87,7 @@ public class LanguageActivity extends BaseActivity implements LanguageContract.V
|
|||||||
|
|
||||||
Toast.makeText(this, getString(R.string.languages_saved), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, getString(R.string.languages_saved), Toast.LENGTH_SHORT).show();
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
//intent.putParcelableArrayListExtra(LANGUAGE_LIST, languages);
|
intent.putParcelableArrayListExtra(LANGUAGE_LIST, languages);
|
||||||
setResult(RESULT_OK, intent);
|
setResult(RESULT_OK, intent);
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package org.kiwix.kiwixmobile.zim_manager.library_view.adapter
|
package org.kiwix.kiwixmobile.zim_manager.library_view.adapter
|
||||||
|
|
||||||
|
import android.os.Parcelable
|
||||||
|
import kotlinx.android.parcel.Parcelize
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
data class Language constructor(
|
data class Language constructor(
|
||||||
var active: Boolean,
|
var active: Boolean,
|
||||||
var occurencesOfLanguage: Int,
|
var occurencesOfLanguage: Int,
|
||||||
@ -9,7 +12,7 @@ data class Language constructor(
|
|||||||
var languageLocalized: String,
|
var languageLocalized: String,
|
||||||
var languageCode: String,
|
var languageCode: String,
|
||||||
var languageCodeISO2: String
|
var languageCodeISO2: String
|
||||||
) {
|
) : Parcelable {
|
||||||
constructor(
|
constructor(
|
||||||
locale: Locale,
|
locale: Locale,
|
||||||
active: Boolean,
|
active: Boolean,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user