diff --git a/README.md b/README.md index f99023a76..a18f1505e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ FolioReader-Android is an ePub reader written in Java. Add following dependency to your app build.gradle: ``` java -compile 'com.folioreader:folioreader:0.4.0' +compile 'com.folioreader:folioreader:0.4.1' ``` Add maven repository to your top level build.gradle: @@ -55,39 +55,40 @@ allprojects { } ``` -### Usage +### AndroidManifest + +Starting with Android 9.0 (API level 28), cleartext support is disabled by default. -First add permissions and activity tag for `FolioActivity` in your `AndroidManifest.xml`: +{your-app-module}/res/xml/network_security_config.xml ```xml - - - - - - - - ... - - - - ... - + + + 127.0.0.1 + localhost + + +``` + +Then add network_security_config.xml in your app module's AndroidManifest.xml + +```xml + + + ... + + ... - ``` -**Note: In case if you are upgrading to 0.4.0 and above don't forget to remove `android:configChanges="orientation|screenSize"` from `` tag of `FolioActivity`.** +### Usage Get singleton object of `FolioReader`: ```java -FolioReader folioReader = FolioReader.getInstance(getApplicationContext()); +FolioReader folioReader = FolioReader.get(); ``` Call the function `openBook()`: @@ -103,6 +104,12 @@ folioReader.openBook("file:///android_asset/TheSilverChair.epub"); folioReader.openBook(R.raw.adventures); ``` +
+ +**Note: From v0.4.1 you don't need to specify permissions and `FolioActivity` tag in AndroidManifest.xml** + +
+ ## WIKI * [Home](https://github.com/FolioReader/FolioReader-Android/wiki) diff --git a/build.gradle b/build.gradle index 3287b8a17..1a25bd41f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.KOTLIN_VERSION = '1.2.50' + ext.KOTLIN_VERSION = '1.2.60' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.1.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -31,17 +31,16 @@ allprojects { } ext { - LIBRARY_VERSION = "0.4.0" + LIBRARY_VERSION = '0.4.1' + R2_STREAMER_VERSION = '0.1.8' VERSION_NAME = "1.0" VERSION_CODE = 1 - ANDROID_MIN_SDK = 14 + ANDROID_MIN_SDK = 15 ANDROID_COMPILE_SDK_VERSION = 28 ANDROID_TARGET_SDK_VERSION = 28 - ANDROID_LIB_VERSION = '28.0.0-alpha3' - - R2_STREAMER_VERSION = '0.1.7' + ANDROID_LIB_VERSION = '28.0.0-rc01' } task clean(type: Delete) { diff --git a/folioreader/AndroidManifest.xml b/folioreader/AndroidManifest.xml index 12474418c..251764b58 100644 --- a/folioreader/AndroidManifest.xml +++ b/folioreader/AndroidManifest.xml @@ -2,10 +2,36 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/folioreader/build.gradle b/folioreader/build.gradle index 1b9093118..900ab292f 100644 --- a/folioreader/build.gradle +++ b/folioreader/build.gradle @@ -95,6 +95,7 @@ dependencies { //Kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" + implementation "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION" // r2-streamer api "org.readium:r2-fetcher:$R2_STREAMER_VERSION" @@ -102,5 +103,6 @@ dependencies { api "org.readium:r2-server:$R2_STREAMER_VERSION" implementation 'org.greenrobot:eventbus:3.1.1' + implementation "org.apache.commons:commons-text:1.4" } apply from: '../folioreader/bintray/bintrayv1.gradle' diff --git a/folioreader/res/drawable-hdpi/icon_font.png b/folioreader/res/drawable-hdpi/icon_font.png deleted file mode 100644 index 475b72869..000000000 Binary files a/folioreader/res/drawable-hdpi/icon_font.png and /dev/null differ diff --git a/folioreader/res/drawable-mdpi/icon_font.png b/folioreader/res/drawable-mdpi/icon_font.png deleted file mode 100644 index 0c812cd9d..000000000 Binary files a/folioreader/res/drawable-mdpi/icon_font.png and /dev/null differ diff --git a/folioreader/res/drawable-xhdpi/ic_drawer.png b/folioreader/res/drawable-xhdpi/ic_drawer.png deleted file mode 100644 index 2da331e71..000000000 Binary files a/folioreader/res/drawable-xhdpi/ic_drawer.png and /dev/null differ diff --git a/folioreader/res/drawable-xhdpi/icon_font.png b/folioreader/res/drawable-xhdpi/icon_font.png deleted file mode 100644 index af945f909..000000000 Binary files a/folioreader/res/drawable-xhdpi/icon_font.png and /dev/null differ diff --git a/folioreader/res/drawable-xhdpi/man_speech_icon.png b/folioreader/res/drawable-xhdpi/man_speech_icon.png deleted file mode 100644 index c6f6d9a3e..000000000 Binary files a/folioreader/res/drawable-xhdpi/man_speech_icon.png and /dev/null differ diff --git a/folioreader/res/drawable-xxhdpi/icon_font.png b/folioreader/res/drawable-xxhdpi/icon_font.png deleted file mode 100644 index 22a41067c..000000000 Binary files a/folioreader/res/drawable-xxhdpi/icon_font.png and /dev/null differ diff --git a/folioreader/res/drawable-xxxhdpi/icon_font.png b/folioreader/res/drawable-xxxhdpi/icon_font.png deleted file mode 100644 index d34fd9b92..000000000 Binary files a/folioreader/res/drawable-xxxhdpi/icon_font.png and /dev/null differ diff --git a/folioreader/res/drawable/ic_drawer.xml b/folioreader/res/drawable/ic_drawer.xml new file mode 100644 index 000000000..286181292 --- /dev/null +++ b/folioreader/res/drawable/ic_drawer.xml @@ -0,0 +1,9 @@ + + + diff --git a/folioreader/res/drawable/ic_drawer_green_24dp.xml b/folioreader/res/drawable/ic_drawer_green_24dp.xml deleted file mode 100644 index a0b9d3694..000000000 --- a/folioreader/res/drawable/ic_drawer_green_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/folioreader/res/drawable/ic_search.xml b/folioreader/res/drawable/ic_search.xml new file mode 100644 index 000000000..2774870ad --- /dev/null +++ b/folioreader/res/drawable/ic_search.xml @@ -0,0 +1,10 @@ + + + diff --git a/folioreader/res/drawable/icon_font.xml b/folioreader/res/drawable/icon_font.xml new file mode 100644 index 000000000..f25b3bf10 --- /dev/null +++ b/folioreader/res/drawable/icon_font.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/folioreader/res/drawable/man_speech_icon.xml b/folioreader/res/drawable/man_speech_icon.xml new file mode 100644 index 000000000..9c71ce2b0 --- /dev/null +++ b/folioreader/res/drawable/man_speech_icon.xml @@ -0,0 +1,12 @@ + + + + diff --git a/folioreader/res/layout/activity_search.xml b/folioreader/res/layout/activity_search.xml new file mode 100644 index 000000000..337761b13 --- /dev/null +++ b/folioreader/res/layout/activity_search.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/folioreader/res/layout/folio_activity.xml b/folioreader/res/layout/folio_activity.xml index be99caae4..70fcc65be 100644 --- a/folioreader/res/layout/folio_activity.xml +++ b/folioreader/res/layout/folio_activity.xml @@ -1,25 +1,39 @@ - + tools:context=".ui.folio.activity.FolioActivity" + tools:menu="menu_main"> + android:layout_width="0dp" + android:layout_height="0dp" + app:direction="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + - + - \ No newline at end of file + + + \ No newline at end of file diff --git a/folioreader/res/layout/folio_page_fragment.xml b/folioreader/res/layout/folio_page_fragment.xml index 45e2e1e81..7415be09d 100644 --- a/folioreader/res/layout/folio_page_fragment.xml +++ b/folioreader/res/layout/folio_page_fragment.xml @@ -1,5 +1,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/folioreader/res/layout/item_dictionary.xml b/folioreader/res/layout/item_dictionary.xml index 59e5925ac..02a54e8b4 100644 --- a/folioreader/res/layout/item_dictionary.xml +++ b/folioreader/res/layout/item_dictionary.xml @@ -2,6 +2,7 @@ + + + + + \ No newline at end of file diff --git a/folioreader/res/layout/item_search_failure.xml b/folioreader/res/layout/item_search_failure.xml new file mode 100644 index 000000000..bc78b7256 --- /dev/null +++ b/folioreader/res/layout/item_search_failure.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/folioreader/res/layout/item_search_init.xml b/folioreader/res/layout/item_search_init.xml new file mode 100644 index 000000000..78e2893c7 --- /dev/null +++ b/folioreader/res/layout/item_search_init.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/folioreader/res/layout/item_search_loading.xml b/folioreader/res/layout/item_search_loading.xml new file mode 100644 index 000000000..02b967af9 --- /dev/null +++ b/folioreader/res/layout/item_search_loading.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/folioreader/res/layout/item_search_normal.xml b/folioreader/res/layout/item_search_normal.xml new file mode 100644 index 000000000..18a2379d8 --- /dev/null +++ b/folioreader/res/layout/item_search_normal.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/folioreader/res/layout/layout_dictionary.xml b/folioreader/res/layout/layout_dictionary.xml index 9189a87d1..6d3b87f38 100644 --- a/folioreader/res/layout/layout_dictionary.xml +++ b/folioreader/res/layout/layout_dictionary.xml @@ -1,6 +1,7 @@ @@ -20,7 +21,7 @@ + android:layout_height="match_parent"> @@ -95,7 +98,8 @@ android:drawablePadding="8dp" android:drawableTop="@drawable/ic_offline_gray_48dp" android:text="offline" - android:visibility="gone" /> + android:visibility="gone" + tools:visibility="visible" />