├── trust.jks ├── assets ├── beep.mp3 ├── error.mp3 ├── FrankRuehl.otf ├── GentiumBasic.otf ├── FrankRuehl-Bold.otf ├── FrankRuehl-Italic.otf ├── GentiumBasic-Bold.otf ├── GentiumBookBasic.otf ├── GentiumBasic-Italic.otf ├── FrankRuehl-BoldItalic.otf ├── GentiumBasic-BoldItalic.otf ├── GentiumBookBasic-Bold.otf ├── GentiumBookBasic-Italic.otf └── GentiumBookBasic-BoldItalic.otf ├── res ├── drawable │ ├── gateway.png │ ├── shelf_single.png │ ├── ambilwarna_hue.png │ ├── unknown_cover.png │ ├── ambilwarna_cursor.png │ ├── ambilwarna_target.png │ ├── shelf_single_dark.png │ ├── ambilwarna_arrow_down.png │ ├── ambilwarna_arrow_right.png │ ├── list_activated_holo.9.png │ ├── alphabet_bar_bg.xml │ └── alphabet_bar_bg_dark.xml ├── drawable-hdpi │ ├── add.png │ ├── book.png │ ├── cog.png │ ├── edit.png │ ├── file.png │ ├── info.png │ ├── list.png │ ├── moon.png │ ├── next.png │ ├── play.png │ ├── stop.png │ ├── sun.png │ ├── user.png │ ├── zoom.png │ ├── color.png │ ├── cross.png │ ├── folder.png │ ├── shelves.png │ ├── book_add.png │ ├── book_star.png │ ├── download.png │ ├── ic_drawer.png │ ├── previous.png │ ├── trash_can.png │ ├── arrowhead_up.png │ ├── bookmark_add.png │ ├── page_turner.png │ ├── play_pause.png │ ├── arrowhead_down.png │ ├── cloud_refresh.png │ ├── speech_balloon.png │ ├── ambilwarna_cursor.png │ ├── ambilwarna_target.png │ ├── drawer_shadow.9.png │ ├── ambilwarna_arrow_down.png │ ├── ambilwarna_arrow_right.png │ └── selection_rectangular.png ├── drawable-ldpi │ ├── add.png │ ├── book.png │ ├── cog.png │ ├── edit.png │ ├── file.png │ ├── info.png │ ├── list.png │ ├── moon.png │ ├── next.png │ ├── play.png │ ├── stop.png │ ├── sun.png │ ├── user.png │ ├── zoom.png │ ├── color.png │ ├── cross.png │ ├── folder.png │ ├── shelves.png │ ├── book_add.png │ ├── book_star.png │ ├── download.png │ ├── previous.png │ ├── trash_can.png │ ├── arrowhead_up.png │ ├── bookmark_add.png │ ├── page_turner.png │ ├── play_pause.png │ ├── arrowhead_down.png │ ├── cloud_refresh.png │ ├── speech_balloon.png │ ├── ambilwarna_cursor.png │ ├── ambilwarna_target.png │ ├── ambilwarna_arrow_down.png │ ├── ambilwarna_arrow_right.png │ └── selection_rectangular.png ├── drawable-mdpi │ ├── add.png │ ├── book.png │ ├── cog.png │ ├── edit.png │ ├── file.png │ ├── info.png │ ├── list.png │ ├── moon.png │ ├── next.png │ ├── play.png │ ├── stop.png │ ├── sun.png │ ├── user.png │ ├── zoom.png │ ├── color.png │ ├── cross.png │ ├── folder.png │ ├── shelves.png │ ├── book_add.png │ ├── book_star.png │ ├── download.png │ ├── ic_drawer.png │ ├── previous.png │ ├── trash_can.png │ ├── arrowhead_up.png │ ├── bookmark_add.png │ ├── page_turner.png │ ├── play_pause.png │ ├── arrowhead_down.png │ ├── cloud_refresh.png │ ├── speech_balloon.png │ ├── drawer_shadow.9.png │ └── selection_rectangular.png ├── drawable-xhdpi │ ├── ic_drawer.png │ ├── drawer_shadow.9.png │ ├── ambilwarna_cursor.png │ ├── ambilwarna_target.png │ ├── ambilwarna_arrow_down.png │ └── ambilwarna_arrow_right.png ├── values-land │ └── dimen.xml ├── values-xlarge-land │ └── dimen.xml ├── values │ ├── roboguice.xml │ ├── dimen.xml │ ├── colors.xml │ ├── styles.xml │ └── arrays.xml ├── menu │ ├── edit_sites_menu.xml │ ├── catalog_menu.xml │ ├── library_menu.xml │ └── reading_menu.xml ├── layout │ ├── activity_file_browse.xml │ ├── fragment_catalog.xml │ ├── large_book_cover.xml │ ├── alphabet_line.xml │ ├── fragment_add_bookmark.xml │ ├── manage_sites.xml │ ├── progress_row.xml │ ├── bookcase_row.xml │ ├── folder_line.xml │ ├── activity_catalog.xml │ ├── catalog_item.xml │ ├── activity_library.xml │ ├── activity_catalog_details.xml │ ├── activity_reading.xml │ ├── drawer_list_item.xml │ ├── catalog_download_buttons.xml │ ├── fragment_library.xml │ ├── drawer_list_subitem.xml │ ├── book_row.xml │ ├── import_dialog.xml │ ├── ambilwarna_dialog.xml │ ├── book_details.xml │ └── edit_site.xml └── layout-land │ ├── activity_catalog.xml │ └── ambilwarna_dialog.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── project.properties ├── src ├── net │ └── nightwhistler │ │ ├── pageturner │ │ ├── dto │ │ │ ├── TocEntry.java │ │ │ └── SearchResult.java │ │ ├── CollectionUtil.java │ │ ├── activity │ │ │ ├── FileItem.java │ │ │ ├── LibraryActivity.java │ │ │ ├── FileBrowseActivity.java │ │ │ └── MediaButtonReceiver.java │ │ ├── view │ │ │ ├── bookview │ │ │ │ ├── SelectedWord.java │ │ │ │ ├── HighlightSpan.java │ │ │ │ ├── TextSelectionCallback.java │ │ │ │ ├── AnchorHandler.java │ │ │ │ ├── PreLoadTask.java │ │ │ │ ├── CSSLinkHandler.java │ │ │ │ └── StaticLayoutFactory.java │ │ │ ├── AnimatedImageView.java │ │ │ ├── NavigationCallback.java │ │ │ └── FastBitmapDrawable.java │ │ ├── tts │ │ │ ├── SpeechCompletedCallback.java │ │ │ ├── TTSPlaybackItem.java │ │ │ └── TTSPlaybackQueue.java │ │ ├── sync │ │ │ ├── AccessException.java │ │ │ ├── ProgressService.java │ │ │ └── BookProgress.java │ │ ├── library │ │ │ ├── ImportCallback.java │ │ │ ├── Author.java │ │ │ ├── LibraryService.java │ │ │ ├── QueryResult.java │ │ │ ├── QueryResultAdapter.java │ │ │ ├── LibraryBook.java │ │ │ └── CleanFilesTask.java │ │ ├── catalog │ │ │ ├── CatalogParent.java │ │ │ ├── LoadFeedCallback.java │ │ │ └── ParseBinDataTask.java │ │ ├── animation │ │ │ ├── Animator.java │ │ │ └── PageTimer.java │ │ ├── prefs │ │ │ └── LanguageSwitchPreference.java │ │ ├── bookmark │ │ │ └── Bookmark.java │ │ ├── scheduling │ │ │ └── QueuedTask.java │ │ ├── PageTurner.java │ │ └── CustomOPDSSite.java │ │ ├── nucular │ │ ├── parser │ │ │ ├── UnknownElementParser.java │ │ │ ├── SummaryParser.java │ │ │ ├── IDParser.java │ │ │ ├── opensearch │ │ │ │ ├── SearchDescription.java │ │ │ │ ├── UrlParser.java │ │ │ │ └── OpenSearchParser.java │ │ │ ├── LinkParser.java │ │ │ ├── TitleParser.java │ │ │ ├── EntryParser.java │ │ │ ├── FeedParser.java │ │ │ ├── ContentParser.java │ │ │ ├── ElementParser.java │ │ │ ├── AuthorParser.java │ │ │ ├── StreamParser.java │ │ │ └── Nucular.java │ │ └── atom │ │ │ ├── Content.java │ │ │ ├── Author.java │ │ │ ├── Link.java │ │ │ ├── AtomConstants.java │ │ │ ├── AtomElement.java │ │ │ └── Feed.java │ │ └── ui │ │ ├── TreeNode.java │ │ └── UiUtils.java └── yuku │ └── ambilwarna │ └── AmbilWarnaKotak.java ├── .gitignore ├── test └── src │ └── java │ └── net │ └── nightwhistler │ └── pageturner │ ├── activity │ ├── CatalogStartScreenTest.java │ └── ReadingActivityTest.java │ └── testutils │ ├── TestUtils.java │ └── SynchronousTaskQueue.java ├── proguard.cfg └── gradlew.bat /trust.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/trust.jks -------------------------------------------------------------------------------- /assets/beep.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/beep.mp3 -------------------------------------------------------------------------------- /assets/error.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/error.mp3 -------------------------------------------------------------------------------- /assets/FrankRuehl.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/FrankRuehl.otf -------------------------------------------------------------------------------- /assets/GentiumBasic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBasic.otf -------------------------------------------------------------------------------- /res/drawable/gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/gateway.png -------------------------------------------------------------------------------- /assets/FrankRuehl-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/FrankRuehl-Bold.otf -------------------------------------------------------------------------------- /res/drawable-hdpi/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/add.png -------------------------------------------------------------------------------- /res/drawable-hdpi/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/book.png -------------------------------------------------------------------------------- /res/drawable-hdpi/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/cog.png -------------------------------------------------------------------------------- /res/drawable-hdpi/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/edit.png -------------------------------------------------------------------------------- /res/drawable-hdpi/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/file.png -------------------------------------------------------------------------------- /res/drawable-hdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/info.png -------------------------------------------------------------------------------- /res/drawable-hdpi/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/list.png -------------------------------------------------------------------------------- /res/drawable-hdpi/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/moon.png -------------------------------------------------------------------------------- /res/drawable-hdpi/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/next.png -------------------------------------------------------------------------------- /res/drawable-hdpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/play.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/stop.png -------------------------------------------------------------------------------- /res/drawable-hdpi/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/sun.png -------------------------------------------------------------------------------- /res/drawable-hdpi/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/user.png -------------------------------------------------------------------------------- /res/drawable-hdpi/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/zoom.png -------------------------------------------------------------------------------- /res/drawable-ldpi/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/add.png -------------------------------------------------------------------------------- /res/drawable-ldpi/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/book.png -------------------------------------------------------------------------------- /res/drawable-ldpi/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/cog.png -------------------------------------------------------------------------------- /res/drawable-ldpi/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/edit.png -------------------------------------------------------------------------------- /res/drawable-ldpi/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/file.png -------------------------------------------------------------------------------- /res/drawable-ldpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/info.png -------------------------------------------------------------------------------- /res/drawable-ldpi/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/list.png -------------------------------------------------------------------------------- /res/drawable-ldpi/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/moon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/next.png -------------------------------------------------------------------------------- /res/drawable-ldpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/play.png -------------------------------------------------------------------------------- /res/drawable-ldpi/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/stop.png -------------------------------------------------------------------------------- /res/drawable-ldpi/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/sun.png -------------------------------------------------------------------------------- /res/drawable-ldpi/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/user.png -------------------------------------------------------------------------------- /res/drawable-ldpi/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/zoom.png -------------------------------------------------------------------------------- /res/drawable-mdpi/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/add.png -------------------------------------------------------------------------------- /res/drawable-mdpi/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/book.png -------------------------------------------------------------------------------- /res/drawable-mdpi/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/cog.png -------------------------------------------------------------------------------- /res/drawable-mdpi/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/edit.png -------------------------------------------------------------------------------- /res/drawable-mdpi/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/file.png -------------------------------------------------------------------------------- /res/drawable-mdpi/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/info.png -------------------------------------------------------------------------------- /res/drawable-mdpi/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/list.png -------------------------------------------------------------------------------- /res/drawable-mdpi/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/moon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/next.png -------------------------------------------------------------------------------- /res/drawable-mdpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/play.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/stop.png -------------------------------------------------------------------------------- /res/drawable-mdpi/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/sun.png -------------------------------------------------------------------------------- /res/drawable-mdpi/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/user.png -------------------------------------------------------------------------------- /res/drawable-mdpi/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/zoom.png -------------------------------------------------------------------------------- /assets/FrankRuehl-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/FrankRuehl-Italic.otf -------------------------------------------------------------------------------- /assets/GentiumBasic-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBasic-Bold.otf -------------------------------------------------------------------------------- /assets/GentiumBookBasic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBookBasic.otf -------------------------------------------------------------------------------- /res/drawable-hdpi/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/color.png -------------------------------------------------------------------------------- /res/drawable-hdpi/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/cross.png -------------------------------------------------------------------------------- /res/drawable-hdpi/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/folder.png -------------------------------------------------------------------------------- /res/drawable-hdpi/shelves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/shelves.png -------------------------------------------------------------------------------- /res/drawable-ldpi/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/color.png -------------------------------------------------------------------------------- /res/drawable-ldpi/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/cross.png -------------------------------------------------------------------------------- /res/drawable-ldpi/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/folder.png -------------------------------------------------------------------------------- /res/drawable-ldpi/shelves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/shelves.png -------------------------------------------------------------------------------- /res/drawable-mdpi/color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/color.png -------------------------------------------------------------------------------- /res/drawable-mdpi/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/cross.png -------------------------------------------------------------------------------- /res/drawable-mdpi/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/folder.png -------------------------------------------------------------------------------- /res/drawable-mdpi/shelves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/shelves.png -------------------------------------------------------------------------------- /res/drawable/shelf_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/shelf_single.png -------------------------------------------------------------------------------- /assets/GentiumBasic-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBasic-Italic.otf -------------------------------------------------------------------------------- /res/drawable-hdpi/book_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/book_add.png -------------------------------------------------------------------------------- /res/drawable-hdpi/book_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/book_star.png -------------------------------------------------------------------------------- /res/drawable-hdpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/download.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/ic_drawer.png -------------------------------------------------------------------------------- /res/drawable-hdpi/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/previous.png -------------------------------------------------------------------------------- /res/drawable-hdpi/trash_can.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/trash_can.png -------------------------------------------------------------------------------- /res/drawable-ldpi/book_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/book_add.png -------------------------------------------------------------------------------- /res/drawable-ldpi/book_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/book_star.png -------------------------------------------------------------------------------- /res/drawable-ldpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/download.png -------------------------------------------------------------------------------- /res/drawable-ldpi/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/previous.png -------------------------------------------------------------------------------- /res/drawable-ldpi/trash_can.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/trash_can.png -------------------------------------------------------------------------------- /res/drawable-mdpi/book_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/book_add.png -------------------------------------------------------------------------------- /res/drawable-mdpi/book_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/book_star.png -------------------------------------------------------------------------------- /res/drawable-mdpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/download.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/ic_drawer.png -------------------------------------------------------------------------------- /res/drawable-mdpi/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/previous.png -------------------------------------------------------------------------------- /res/drawable-mdpi/trash_can.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/trash_can.png -------------------------------------------------------------------------------- /res/drawable/ambilwarna_hue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/ambilwarna_hue.png -------------------------------------------------------------------------------- /res/drawable/unknown_cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/unknown_cover.png -------------------------------------------------------------------------------- /assets/FrankRuehl-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/FrankRuehl-BoldItalic.otf -------------------------------------------------------------------------------- /assets/GentiumBasic-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBasic-BoldItalic.otf -------------------------------------------------------------------------------- /assets/GentiumBookBasic-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBookBasic-Bold.otf -------------------------------------------------------------------------------- /assets/GentiumBookBasic-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBookBasic-Italic.otf -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /res/drawable-hdpi/arrowhead_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/arrowhead_up.png -------------------------------------------------------------------------------- /res/drawable-hdpi/bookmark_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/bookmark_add.png -------------------------------------------------------------------------------- /res/drawable-hdpi/page_turner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/page_turner.png -------------------------------------------------------------------------------- /res/drawable-hdpi/play_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/play_pause.png -------------------------------------------------------------------------------- /res/drawable-ldpi/arrowhead_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/arrowhead_up.png -------------------------------------------------------------------------------- /res/drawable-ldpi/bookmark_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/bookmark_add.png -------------------------------------------------------------------------------- /res/drawable-ldpi/page_turner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/page_turner.png -------------------------------------------------------------------------------- /res/drawable-ldpi/play_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/play_pause.png -------------------------------------------------------------------------------- /res/drawable-mdpi/arrowhead_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/arrowhead_up.png -------------------------------------------------------------------------------- /res/drawable-mdpi/bookmark_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/bookmark_add.png -------------------------------------------------------------------------------- /res/drawable-mdpi/page_turner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/page_turner.png -------------------------------------------------------------------------------- /res/drawable-mdpi/play_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/play_pause.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/ic_drawer.png -------------------------------------------------------------------------------- /res/drawable/ambilwarna_cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/ambilwarna_cursor.png -------------------------------------------------------------------------------- /res/drawable/ambilwarna_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/ambilwarna_target.png -------------------------------------------------------------------------------- /res/drawable/shelf_single_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/shelf_single_dark.png -------------------------------------------------------------------------------- /res/drawable-hdpi/arrowhead_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/arrowhead_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/cloud_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/cloud_refresh.png -------------------------------------------------------------------------------- /res/drawable-hdpi/speech_balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/speech_balloon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/arrowhead_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/arrowhead_down.png -------------------------------------------------------------------------------- /res/drawable-ldpi/cloud_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/cloud_refresh.png -------------------------------------------------------------------------------- /res/drawable-ldpi/speech_balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/speech_balloon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/arrowhead_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/arrowhead_down.png -------------------------------------------------------------------------------- /res/drawable-mdpi/cloud_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/cloud_refresh.png -------------------------------------------------------------------------------- /res/drawable-mdpi/speech_balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/speech_balloon.png -------------------------------------------------------------------------------- /assets/GentiumBookBasic-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/assets/GentiumBookBasic-BoldItalic.otf -------------------------------------------------------------------------------- /res/drawable-hdpi/ambilwarna_cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/ambilwarna_cursor.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ambilwarna_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/ambilwarna_target.png -------------------------------------------------------------------------------- /res/drawable-hdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ambilwarna_cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/ambilwarna_cursor.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ambilwarna_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/ambilwarna_target.png -------------------------------------------------------------------------------- /res/drawable-mdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/drawer_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/drawer_shadow.9.png -------------------------------------------------------------------------------- /res/drawable/ambilwarna_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/ambilwarna_arrow_down.png -------------------------------------------------------------------------------- /res/drawable/ambilwarna_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/ambilwarna_arrow_right.png -------------------------------------------------------------------------------- /res/drawable/list_activated_holo.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable/list_activated_holo.9.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ambilwarna_cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/ambilwarna_cursor.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ambilwarna_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/ambilwarna_target.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ambilwarna_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/ambilwarna_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ambilwarna_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/ambilwarna_arrow_right.png -------------------------------------------------------------------------------- /res/drawable-hdpi/selection_rectangular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-hdpi/selection_rectangular.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ambilwarna_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/ambilwarna_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ambilwarna_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/ambilwarna_arrow_right.png -------------------------------------------------------------------------------- /res/drawable-ldpi/selection_rectangular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-ldpi/selection_rectangular.png -------------------------------------------------------------------------------- /res/drawable-mdpi/selection_rectangular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-mdpi/selection_rectangular.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ambilwarna_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/ambilwarna_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ambilwarna_arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NightWhistler/PageTurner/HEAD/res/drawable-xhdpi/ambilwarna_arrow_right.png -------------------------------------------------------------------------------- /res/values-land/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 240dp 4 | 120dp 5 | -------------------------------------------------------------------------------- /res/values-xlarge-land/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 240dp 4 | 240dp 5 | -------------------------------------------------------------------------------- /res/values/roboguice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net.nightwhistler.pageturner.PageTurnerModule 5 | 6 | -------------------------------------------------------------------------------- /res/drawable/alphabet_bar_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/drawable/alphabet_bar_bg_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 30 14:36:18 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 240dp 4 | 240dp 5 | 30dp 6 | 8dp 7 | 8 | -------------------------------------------------------------------------------- /res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | #888888 5 | #C0000000 6 | #000000 7 | #ff5500 8 | -------------------------------------------------------------------------------- /res/menu/edit_sites_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /res/layout/activity_file_browse.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-19 12 | android.library=false 13 | 14 | -------------------------------------------------------------------------------- /res/menu/catalog_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /res/layout/fragment_catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/dto/TocEntry.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.dto; 2 | 3 | /** 4 | * Entry in a Table of Contents 5 | */ 6 | public class TocEntry { 7 | 8 | private String title; 9 | private String href; 10 | 11 | public TocEntry(String title, String href) { 12 | this.title = title; 13 | this.href = href; 14 | } 15 | 16 | public String getHref() { 17 | return href; 18 | } 19 | 20 | public String getTitle() { 21 | return title; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /res/layout/large_book_cover.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | -------------------------------------------------------------------------------- /res/layout/alphabet_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | target/ 15 | 16 | # Local configuration file (sdk path, etc) 17 | local.properties 18 | 19 | # Editor backups 20 | *~ 21 | 22 | # Eclipse project files 23 | .classpath 24 | .project 25 | .metadata 26 | .settings 27 | 28 | # IntelliJ files 29 | .idea 30 | *.iml 31 | 32 | # vi files 33 | *.swp 34 | *.swo 35 | 36 | # emacs files 37 | .\#* 38 | \#*\# 39 | 40 | # OSX files 41 | .DS_Store 42 | 43 | # Windows files 44 | Thumbs.db 45 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/CollectionUtil.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner; 2 | 3 | import jedi.option.Option; 4 | 5 | import java.util.List; 6 | 7 | import static jedi.option.Options.none; 8 | import static jedi.option.Options.some; 9 | 10 | /** 11 | * Created by alex on 11/7/14. 12 | */ 13 | public class CollectionUtil { 14 | 15 | public static Option listElement( List list, int itemIndex ) { 16 | if ( itemIndex >= 0 && itemIndex < list.size() ) { 17 | return some( list.get(itemIndex ) ); 18 | } else { 19 | return none(); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /res/layout/fragment_add_bookmark.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/activity/FileItem.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.activity; 2 | 3 | import java.io.File; 4 | 5 | public class FileItem { 6 | 7 | private CharSequence label; 8 | private File file; 9 | 10 | private boolean importOnClick; 11 | 12 | public FileItem( CharSequence label, File file, boolean importOnClick ) { 13 | this.label = label; 14 | this.file = file; 15 | this.importOnClick = importOnClick; 16 | } 17 | 18 | public CharSequence getLabel() { 19 | return label; 20 | } 21 | 22 | public File getFile() { 23 | return file; 24 | } 25 | 26 | public boolean isImportOnClick() { 27 | return importOnClick; 28 | } 29 | } -------------------------------------------------------------------------------- /res/layout/manage_sites.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /test/src/java/net/nightwhistler/pageturner/activity/CatalogStartScreenTest.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.activity; 2 | 3 | import net.nightwhistler.pageturner.fragment.CatalogFragment; 4 | 5 | import org.robolectric.RobolectricTestRunner; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | 9 | import org.robolectric.annotation.Config; 10 | 11 | @Config(emulateSdk = 18) 12 | @RunWith(RobolectricTestRunner.class) 13 | public class CatalogStartScreenTest { 14 | 15 | /** 16 | * In this test we successfully get the main 17 | * items list from the site, and display it. 18 | */ 19 | @Test 20 | public void showStartScreenSuccess() { 21 | 22 | CatalogFragment fragment = new CatalogFragment(); 23 | 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/SelectedWord.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.view.bookview; 2 | 3 | /** 4 | * Created by alex on 10/14/14. 5 | */ 6 | public class SelectedWord { 7 | 8 | private int startOffset; 9 | private int endOffset; 10 | private CharSequence text; 11 | 12 | public SelectedWord( int startOffset, int endOffset, CharSequence text ) { 13 | this.startOffset = startOffset; 14 | this.endOffset = endOffset; 15 | this.text = text; 16 | } 17 | 18 | public int getStartOffset() { 19 | return startOffset; 20 | } 21 | 22 | public int getEndOffset() { 23 | return endOffset; 24 | } 25 | 26 | public CharSequence getText() { 27 | 28 | if ( text == null ) { 29 | return ""; 30 | } 31 | 32 | return text; 33 | } 34 | } -------------------------------------------------------------------------------- /test/src/java/net/nightwhistler/pageturner/testutils/TestUtils.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.testutils; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentActivity; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentTransaction; 7 | 8 | public class TestUtils { 9 | 10 | public static void startFragment( Fragment fragment ) { 11 | startFragment(new FragmentActivity(), fragment); 12 | } 13 | 14 | public static void startFragment( FragmentActivity activity, Fragment fragment ) { 15 | FragmentManager fragmentManager = activity.getSupportFragmentManager(); 16 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); 17 | fragmentTransaction.add( fragment, null ); 18 | fragmentTransaction.commit(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /res/layout/progress_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 20 | 21 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/UnknownElementParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.parser; 20 | 21 | 22 | public class UnknownElementParser extends ElementParser { 23 | 24 | public UnknownElementParser(String name) { 25 | super(name); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /res/layout/bookcase_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 16 | 17 | 18 | 28 | 29 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/tts/SpeechCompletedCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.tts; 21 | 22 | import android.media.MediaPlayer; 23 | 24 | public interface SpeechCompletedCallback { 25 | 26 | void speechCompleted( TTSPlaybackItem item, MediaPlayer mediaPlayer ); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/HighlightSpan.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.view.bookview; 2 | 3 | import android.text.TextPaint; 4 | import android.text.style.BackgroundColorSpan; 5 | import net.nightwhistler.pageturner.dto.HighLight; 6 | import net.nightwhistler.pageturner.view.HighlightManager; 7 | 8 | /** 9 | * Created with IntelliJ IDEA. 10 | * User: alex 11 | * Date: 6/17/13 12 | * Time: 8:46 AM 13 | * To change this template use File | Settings | File Templates. 14 | */ 15 | public class HighlightSpan extends BackgroundColorSpan { 16 | 17 | private HighLight highLight; 18 | 19 | public HighlightSpan( HighLight highLight ) { 20 | super( highLight.getColor() ); 21 | this.highLight = highLight; 22 | } 23 | 24 | public HighLight getHighLight() { 25 | return this.highLight; 26 | } 27 | 28 | @Override 29 | public void updateDrawState(TextPaint ds) { 30 | super.updateDrawState(ds); 31 | 32 | ds.setUnderlineText(this.highLight.getTextNote() != null && this.highLight.getTextNote().trim().length() > 0 ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/dto/SearchResult.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.dto; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: alex 6 | * Date: 9/1/13 7 | * Time: 9:02 PM 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | public class SearchResult { 11 | 12 | private String query; 13 | private String display; 14 | private int index; 15 | private int start; 16 | private int end; 17 | 18 | public SearchResult(String query, String display, int index, int offset, int end) { 19 | this.query = query; 20 | this.display = display; 21 | this.index = index; 22 | this.start = offset; 23 | this.end = end; 24 | } 25 | 26 | public String getDisplay() { 27 | return display; 28 | } 29 | 30 | public int getIndex() { 31 | return index; 32 | } 33 | 34 | public int getStart() { 35 | return start; 36 | } 37 | 38 | public int getEnd() { 39 | return end; 40 | } 41 | 42 | public String getQuery() { 43 | return query; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/sync/AccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.sync; 20 | 21 | public class AccessException extends Exception { 22 | 23 | /** 24 | * 25 | */ 26 | private static final long serialVersionUID = 4712242407202301724L; 27 | 28 | public AccessException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/SummaryParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.parser; 20 | 21 | import net.nightwhistler.nucular.atom.Entry; 22 | 23 | public class SummaryParser extends ElementParser { 24 | 25 | private Entry parent; 26 | 27 | public SummaryParser(Entry parent) { 28 | super("summary"); 29 | this.parent = parent; 30 | } 31 | 32 | @Override 33 | public void setTextContent(String text) { 34 | parent.setSummary(text); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /res/layout/folder_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 17 | 18 | 25 | 26 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/IDParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.nucular.parser; 21 | 22 | import net.nightwhistler.nucular.atom.AtomElement; 23 | 24 | public class IDParser extends ElementParser { 25 | 26 | private AtomElement parent; 27 | 28 | public IDParser(AtomElement parent) { 29 | super("id"); 30 | this.parent = parent; 31 | } 32 | 33 | @Override 34 | public void setTextContent(String text) { 35 | parent.setId(text); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/net/nightwhistler/ui/TreeNode.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.ui; 2 | 3 | import jedi.option.Option; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import static java.util.Collections.unmodifiableList; 9 | import static jedi.functional.FunctionalPrimitives.forEach; 10 | import static net.nightwhistler.pageturner.CollectionUtil.listElement; 11 | 12 | /** 13 | * Created by alex on 11/9/14. 14 | */ 15 | public class TreeNode { 16 | 17 | private List children = new ArrayList<>(); 18 | 19 | public TreeNode() {} 20 | 21 | public TreeNode( List children ) { 22 | this.children.addAll( children ); 23 | } 24 | 25 | public void addChild( T child ) { 26 | this.children.add( child ); 27 | } 28 | 29 | public boolean hasChildren() { 30 | return ! this.children.isEmpty(); 31 | } 32 | 33 | public Option getChild( int child ) { 34 | return listElement( children, child ); 35 | } 36 | 37 | public int getChildCount() { 38 | return children.size(); 39 | } 40 | 41 | public void addChildren( Iterable children ) { 42 | forEach( children, this::addChild ); 43 | } 44 | 45 | public List getChildren() { 46 | return unmodifiableList( this.children ); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/atom/Content.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.atom; 20 | 21 | import java.io.Serializable; 22 | 23 | public class Content implements Serializable { 24 | 25 | private String type; 26 | private String text; 27 | 28 | public String getText() { 29 | return text; 30 | } 31 | 32 | public String getType() { 33 | return type; 34 | } 35 | 36 | public void setText(String text) { 37 | this.text = text; 38 | } 39 | 40 | public void setType(String type) { 41 | this.type = type; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/TextSelectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.view.bookview; 21 | 22 | public interface TextSelectionCallback { 23 | 24 | void lookupWikipedia( String text ); 25 | 26 | void lookupWiktionary( String text ); 27 | 28 | void lookupDictionary( String text ); 29 | 30 | void lookupGoogle( String text ); 31 | 32 | boolean isDictionaryAvailable(); 33 | 34 | void highLight( int from, int to, String selectedText ); 35 | 36 | void share( int from, int to, String text ); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/library/ImportCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.library; 21 | 22 | import java.util.List; 23 | 24 | public interface ImportCallback { 25 | 26 | void importComplete( int booksImported, List failures, boolean emptyLibrary, boolean silent ); 27 | 28 | void importStatusUpdate( String update, boolean silent ); 29 | 30 | void importFailed( String reason, boolean silent ); 31 | 32 | void importCancelled( int booksImported, List failures, boolean emptyLibrary, boolean silent ); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/catalog/CatalogParent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.catalog; 21 | 22 | import net.nightwhistler.nucular.atom.Entry; 23 | import net.nightwhistler.nucular.atom.Feed; 24 | 25 | /** 26 | * Super-interface for Activities that contain catalog fragments. 27 | */ 28 | public interface CatalogParent { 29 | 30 | void loadFakeFeed( Feed fakeFeed ); 31 | 32 | void loadFeed( Entry entry, String href, String baseURL, boolean asDetailsFeed ); 33 | 34 | void onFeedLoaded(Feed feed); 35 | 36 | void loadCustomSitesFeed(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /res/layout/activity_catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 20 | 30 | 31 | /> 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /res/layout/catalog_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 19 | 20 | 26 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/catalog/LoadFeedCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.catalog; 21 | 22 | import android.graphics.drawable.Drawable; 23 | import net.nightwhistler.nucular.atom.Feed; 24 | import net.nightwhistler.nucular.atom.Link; 25 | 26 | public interface LoadFeedCallback { 27 | 28 | public static enum ResultType { REPLACE, APPEND } 29 | 30 | void setNewFeed( Feed feed, ResultType resultType ); 31 | 32 | void errorLoadingFeed( String error ); 33 | 34 | void emptyFeedLoaded(Feed feed); 35 | 36 | void notifyLinkUpdated(Link link, Drawable drawable); 37 | 38 | void onLoadingStart(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/yuku/ambilwarna/AmbilWarnaKotak.java: -------------------------------------------------------------------------------- 1 | package yuku.ambilwarna; 2 | 3 | import android.content.Context; 4 | import android.graphics.*; 5 | import android.graphics.Shader.TileMode; 6 | import android.util.AttributeSet; 7 | import android.view.View; 8 | 9 | public class AmbilWarnaKotak extends View { 10 | Paint paint; 11 | Shader luar; 12 | final float[] color = { 1.f, 1.f, 1.f }; 13 | 14 | public AmbilWarnaKotak(Context context) { 15 | this(context, null); 16 | } 17 | 18 | public AmbilWarnaKotak(Context context, AttributeSet attrs) { 19 | this(context, attrs, 0); 20 | } 21 | 22 | public AmbilWarnaKotak(Context context, AttributeSet attrs, int defStyle) { 23 | super(context, attrs, defStyle); 24 | } 25 | 26 | @Override protected void onDraw(Canvas canvas) { 27 | super.onDraw(canvas); 28 | if (paint == null) { 29 | paint = new Paint(); 30 | luar = new LinearGradient(0.f, 0.f, 0.f, this.getMeasuredHeight(), 0xffffffff, 0xff000000, TileMode.CLAMP); 31 | } 32 | int rgb = Color.HSVToColor(color); 33 | Shader dalam = new LinearGradient(0.f, 0.f, this.getMeasuredWidth(), 0.f, 0xffffffff, rgb, TileMode.CLAMP); 34 | ComposeShader shader = new ComposeShader(luar, dalam, PorterDuff.Mode.MULTIPLY); 35 | paint.setShader(shader); 36 | canvas.drawRect(0.f, 0.f, this.getMeasuredWidth(), this.getMeasuredHeight(), paint); 37 | } 38 | 39 | void setHue(float hue) { 40 | color[0] = hue; 41 | invalidate(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /test/src/java/net/nightwhistler/pageturner/testutils/SynchronousTaskQueue.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.testutils; 2 | 3 | import jedi.option.Option; 4 | import net.nightwhistler.pageturner.scheduling.QueueableAsyncTask; 5 | import net.nightwhistler.pageturner.scheduling.TaskQueue; 6 | 7 | /** 8 | * Created by alex on 10/25/14. 9 | */ 10 | public class SynchronousTaskQueue extends TaskQueue { 11 | 12 | private TaskQueueListener listener; 13 | 14 | @Override 15 | public boolean isEmpty() { 16 | return true; 17 | } 18 | 19 | @Override 20 | public void executeTask(QueueableAsyncTask task, A... parameters) { 21 | task.doOnPreExecute(); 22 | Option result = task.doInBackground( parameters ); 23 | task.doOnPostExecute( result ); 24 | if ( listener != null ) { 25 | listener.queueEmpty(); 26 | } 27 | } 28 | 29 | @Override 30 | public void jumpQueueExecuteTask(QueueableAsyncTask task, A... parameters) { 31 | executeTask( task, parameters ); 32 | } 33 | 34 | @Override 35 | public void clear() { 36 | //no-op 37 | } 38 | 39 | @Override 40 | public void setTaskQueueListener(TaskQueueListener listener) { 41 | this.listener = listener; 42 | } 43 | 44 | @Override 45 | public void taskCompleted(QueueableAsyncTask task, boolean wasCancelled) { 46 | //no op 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /res/layout/activity_library.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 21 | 31 | 32 | /> 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/sync/ProgressService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.sync; 20 | 21 | import jedi.option.Option; 22 | 23 | import java.util.List; 24 | 25 | public interface ProgressService { 26 | 27 | /** 28 | * Stores the progress for the given book. 29 | * @param userId 30 | * @param fileName 31 | * @param progress 32 | */ 33 | public void storeProgress( String fileName, int index, int progress, int percentage ) throws AccessException; 34 | 35 | /** 36 | * Returns the progress, or -1 of it wasn't found. 37 | * 38 | * @param fileName 39 | * @return 40 | */ 41 | public Option> getProgress( String fileName ) throws AccessException; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/atom/Author.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.atom; 20 | 21 | import java.io.Serializable; 22 | 23 | public class Author implements Serializable { 24 | 25 | private String name; 26 | private String email; 27 | 28 | private String uri; 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public String getEmail() { 39 | return email; 40 | } 41 | 42 | public void setEmail(String email) { 43 | this.email = email; 44 | } 45 | 46 | public String getUri() { 47 | return uri; 48 | } 49 | 50 | public void setUri(String uri) { 51 | this.uri = uri; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /res/layout/activity_catalog_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 21 | 31 | 32 | /> 33 | 34 | 35 | -------------------------------------------------------------------------------- /res/layout/activity_reading.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | 34 | 35 | /> 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/opensearch/SearchDescription.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.nucular.parser.opensearch; 21 | 22 | import jedi.option.Option; 23 | import net.nightwhistler.nucular.atom.AtomConstants; 24 | import net.nightwhistler.nucular.atom.Link; 25 | 26 | import java.util.ArrayList; 27 | import java.util.List; 28 | 29 | import static jedi.functional.FunctionalPrimitives.firstOption; 30 | 31 | public class SearchDescription { 32 | 33 | private List links = new ArrayList(); 34 | 35 | public void addLink( Link link ) { 36 | this.links.add(link); 37 | } 38 | 39 | public Option getSearchLink() { 40 | return firstOption( this.links, l -> AtomConstants.TYPE_ATOM.equals( l.getType() ) ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/LinkParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.parser; 20 | 21 | import net.nightwhistler.nucular.atom.AtomElement; 22 | import net.nightwhistler.nucular.atom.Link; 23 | 24 | import java.util.Map; 25 | 26 | public class LinkParser extends ElementParser { 27 | 28 | private AtomElement element; 29 | 30 | public LinkParser(AtomElement parent) { 31 | super("link"); 32 | this.element = parent; 33 | } 34 | 35 | @Override 36 | public void setAttributes(Map attributes) { 37 | Link link = new Link( 38 | attributes.get("href"), 39 | attributes.get("type"), 40 | attributes.get("rel"), 41 | attributes.get("title")); 42 | 43 | this.element.addLink(link); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/opensearch/UrlParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.nucular.parser.opensearch; 21 | 22 | import net.nightwhistler.nucular.atom.Link; 23 | import net.nightwhistler.nucular.parser.ElementParser; 24 | 25 | import java.util.Map; 26 | 27 | public class UrlParser extends ElementParser { 28 | 29 | private SearchDescription element; 30 | 31 | public UrlParser(SearchDescription parent) { 32 | super("Url"); 33 | this.element = parent; 34 | } 35 | 36 | @Override 37 | public void setAttributes(Map attributes) { 38 | Link link = new Link( 39 | attributes.get("template"), 40 | attributes.get("type"), 41 | attributes.get("rel"), 42 | attributes.get("title")); 43 | 44 | this.element.addLink(link); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/activity/LibraryActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.activity; 20 | 21 | import net.nightwhistler.pageturner.R; 22 | import net.nightwhistler.pageturner.fragment.LibraryFragment; 23 | import roboguice.inject.InjectFragment; 24 | 25 | public class LibraryActivity extends PageTurnerActivity { 26 | 27 | @InjectFragment(R.id.fragment_library) 28 | private LibraryFragment libraryFragment; 29 | 30 | @Override 31 | protected int getMainLayoutResource() { 32 | return R.layout.activity_library; 33 | } 34 | 35 | @Override 36 | public void onBackPressed() { 37 | libraryFragment.onBackPressed(); 38 | } 39 | 40 | @Override 41 | public boolean onSearchRequested() { 42 | libraryFragment.onSearchRequested(); 43 | return true; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/activity/FileBrowseActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.activity; 20 | 21 | import android.os.Bundle; 22 | import com.github.rtyley.android.sherlock.roboguice.activity.RoboSherlockFragmentActivity; 23 | import net.nightwhistler.pageturner.Configuration; 24 | import net.nightwhistler.pageturner.PageTurner; 25 | import net.nightwhistler.pageturner.R; 26 | import roboguice.RoboGuice; 27 | 28 | public class FileBrowseActivity extends RoboSherlockFragmentActivity { 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | Configuration config = RoboGuice.getInjector(this).getInstance(Configuration.class); 33 | PageTurner.changeLanguageSetting(this, config); 34 | setTheme( config.getTheme() ); 35 | 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_file_browse); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/animation/Animator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.animation; 20 | 21 | import android.graphics.Canvas; 22 | 23 | /** 24 | * Interface for animated transitions for a textview. 25 | * 26 | * @author Alex Kuiper 27 | * 28 | */ 29 | public interface Animator { 30 | 31 | /** 32 | * Returns the speed of this animation in FPS. 33 | * 34 | * @return 35 | */ 36 | int getAnimationSpeed(); 37 | 38 | /** 39 | * Advances the animation by 1 frame. 40 | */ 41 | void advanceOneFrame(); 42 | 43 | 44 | /** 45 | * Draw an animation frame on the given Canvas. 46 | * 47 | * @param canvas 48 | */ 49 | void draw( Canvas canvas ); 50 | 51 | /** 52 | * Checks if this Animator is done animating. 53 | * 54 | * @return 55 | */ 56 | boolean isFinished(); 57 | 58 | /** 59 | * Stop the animation. 60 | */ 61 | void stop(); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/library/Author.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.pageturner.library; 20 | 21 | import java.io.Serializable; 22 | import java.util.Locale; 23 | 24 | public class Author implements Serializable { 25 | 26 | /** 27 | * 28 | */ 29 | private static final long serialVersionUID = -9027442126212861173L; 30 | 31 | private String firstName; 32 | private String lastName; 33 | 34 | private String authorKey; 35 | 36 | public Author(String firstName, String lastName ) { 37 | this.firstName = firstName; 38 | this.lastName = lastName; 39 | 40 | this.authorKey = firstName.toLowerCase(Locale.US) + "_" + lastName.toLowerCase(Locale.US); 41 | } 42 | 43 | public String getAuthorKey() { 44 | return authorKey; 45 | } 46 | 47 | public String getFirstName() { 48 | return firstName; 49 | } 50 | 51 | public String getLastName() { 52 | return lastName; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/AnimatedImageView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.view; 21 | 22 | import android.content.Context; 23 | import android.graphics.Canvas; 24 | import android.util.AttributeSet; 25 | import android.widget.ImageView; 26 | import net.nightwhistler.pageturner.animation.Animator; 27 | 28 | public class AnimatedImageView extends ImageView { 29 | 30 | private Animator animator; 31 | 32 | public AnimatedImageView(Context context, AttributeSet attributes) { 33 | super(context, attributes); 34 | } 35 | 36 | public void setAnimator(Animator animator) { 37 | this.animator = animator; 38 | } 39 | 40 | public Animator getAnimator() { 41 | return animator; 42 | } 43 | 44 | @Override 45 | protected void onDraw(Canvas canvas) { 46 | super.onDraw(canvas); 47 | 48 | if ( this.animator != null ) { 49 | animator.draw(canvas); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/AnchorHandler.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.view.bookview; 2 | 3 | import android.text.SpannableStringBuilder; 4 | import net.nightwhistler.htmlspanner.SpanStack; 5 | import net.nightwhistler.htmlspanner.TagNodeHandler; 6 | import org.htmlcleaner.TagNode; 7 | 8 | /** 9 | * Many books use 10 | *

11 | * and 12 | *

tags as anchor points. This class harvests those point by wrapping 13 | * the original handler. 14 | * 15 | * @author Alex Kuiper 16 | * 17 | */ 18 | public class AnchorHandler extends TagNodeHandler { 19 | 20 | private TagNodeHandler wrappedHandler; 21 | 22 | private AnchorCallback callback; 23 | 24 | public AnchorHandler(TagNodeHandler wrappedHandler) { 25 | this.wrappedHandler = wrappedHandler; 26 | } 27 | 28 | @Override 29 | public void beforeChildren(TagNode node, SpannableStringBuilder builder, SpanStack spanStack) { 30 | this.wrappedHandler.beforeChildren(node, builder, spanStack); 31 | } 32 | 33 | @Override 34 | public void handleTagNode(TagNode node, SpannableStringBuilder builder, 35 | int start, int end, SpanStack spanStack) { 36 | 37 | String id = node.getAttributeByName("id"); 38 | if (id != null) { 39 | callback.registerAnchor(id, start); 40 | } 41 | 42 | wrappedHandler.handleTagNode(node, builder, start, end, spanStack); 43 | } 44 | 45 | public void setCallback( AnchorCallback callback ) { 46 | this.callback = callback; 47 | } 48 | 49 | public static interface AnchorCallback { 50 | void registerAnchor( String anchor, int position ); 51 | } 52 | } -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/PreLoadTask.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.view.bookview; 2 | 3 | import android.text.Spannable; 4 | import jedi.option.None; 5 | import jedi.option.Option; 6 | import net.nightwhistler.pageturner.epub.PageTurnerSpine; 7 | import net.nightwhistler.pageturner.scheduling.QueueableAsyncTask; 8 | import nl.siegmann.epublib.domain.Resource; 9 | 10 | import static jedi.functional.FunctionalPrimitives.isEmpty; 11 | import static jedi.option.Options.none; 12 | 13 | /** 14 | * Created by alex on 10/14/14. 15 | */ 16 | public class PreLoadTask extends 17 | QueueableAsyncTask { 18 | 19 | private PageTurnerSpine spine; 20 | private TextLoader textLoader; 21 | 22 | public PreLoadTask( PageTurnerSpine spine, TextLoader textLoader ) { 23 | this.spine = spine; 24 | this.textLoader = textLoader; 25 | } 26 | 27 | @Override 28 | public Option doInBackground(Void... voids) { 29 | doInBackground(); 30 | 31 | return none(); 32 | } 33 | 34 | private void doInBackground() { 35 | if ( spine == null ) { 36 | return; 37 | } 38 | 39 | Option resource = spine.getNextResource(); 40 | 41 | resource.forEach( res -> { 42 | Option cachedText = textLoader.getCachedTextForResource( res ); 43 | 44 | if ( isEmpty(cachedText) ) { 45 | try { 46 | textLoader.getText( res, PreLoadTask.this::isCancelled ); 47 | } catch ( Exception | OutOfMemoryError e ) { 48 | //Ignore 49 | } 50 | } 51 | }); 52 | } 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /res/menu/library_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 13 | 18 | 19 | 24 | 25 | 29 | 30 | 36 | 37 | 43 | 44 | 48 | 49 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/prefs/LanguageSwitchPreference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.pageturner.prefs; 21 | 22 | import android.content.Context; 23 | import android.preference.ListPreference; 24 | import android.util.AttributeSet; 25 | import android.widget.Toast; 26 | import net.nightwhistler.pageturner.R; 27 | 28 | public class LanguageSwitchPreference extends ListPreference { 29 | 30 | private Context context; 31 | 32 | private String oldValue; 33 | 34 | public LanguageSwitchPreference(Context context, AttributeSet attributes) { 35 | super(context, attributes); 36 | this.context = context; 37 | } 38 | 39 | @Override 40 | public void setValue(String value) { 41 | super.setValue(value); 42 | 43 | if (oldValue != null && !value.equalsIgnoreCase(oldValue) ) { 44 | Toast.makeText(context, R.string.language_switch_message, Toast.LENGTH_LONG).show(); 45 | } 46 | 47 | this.oldValue = value; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/view/bookview/CSSLinkHandler.java: -------------------------------------------------------------------------------- 1 | package net.nightwhistler.pageturner.view.bookview; 2 | 3 | import android.text.SpannableStringBuilder; 4 | import net.nightwhistler.htmlspanner.SpanStack; 5 | import net.nightwhistler.htmlspanner.TagNodeHandler; 6 | import net.nightwhistler.htmlspanner.css.CompiledRule; 7 | import org.htmlcleaner.TagNode; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created with IntelliJ IDEA. 15 | * User: alex 16 | * Date: 6/22/13 17 | * Time: 12:50 PM 18 | * To change this template use File | Settings | File Templates. 19 | */ 20 | public class CSSLinkHandler extends TagNodeHandler { 21 | 22 | private static final Logger LOG = LoggerFactory.getLogger("CSSLinkHandler"); 23 | 24 | private TextLoader textLoader; 25 | 26 | public CSSLinkHandler( TextLoader textLoader ) { 27 | this.textLoader = textLoader; 28 | } 29 | 30 | public void handleTagNode(TagNode node, SpannableStringBuilder builder, int start, int end, SpanStack spanStack) { 31 | 32 | if ( getSpanner().isAllowStyling() ) { 33 | String type = node.getAttributeByName("type"); 34 | String href = node.getAttributeByName("href"); 35 | 36 | LOG.debug("Found link tag: type=" + type + " and href=" + href ); 37 | 38 | if ( type == null || ! type.equals("text/css") ) { 39 | LOG.debug("Ignoring link of type " + type ); 40 | } 41 | 42 | List rules = this.textLoader.getCSSRules(href); 43 | 44 | for ( CompiledRule rule: rules ) { 45 | spanStack.registerCompiledRule(rule); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/TitleParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.parser; 20 | 21 | import net.nightwhistler.nucular.atom.AtomElement; 22 | 23 | import java.util.Map; 24 | 25 | public class TitleParser extends ElementParser { 26 | 27 | private AtomElement parent; 28 | 29 | private boolean finished = false; 30 | StringBuffer buffer = new StringBuffer(); 31 | 32 | public TitleParser(AtomElement parent) { 33 | super("title"); 34 | this.parent = parent; 35 | } 36 | 37 | @Override 38 | public void startElement(String name, Map attributes) { 39 | //Do nothing 40 | } 41 | 42 | @Override 43 | public void endElement(String name) { 44 | if ( name.equals("title") ) { 45 | this.finished = true; 46 | parent.setTitle(buffer.toString().trim()); 47 | } 48 | } 49 | 50 | @Override 51 | public boolean isFinished() { 52 | return finished; 53 | } 54 | 55 | @Override 56 | public void setTextContent(String text) { 57 | buffer.append(text); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/opensearch/OpenSearchParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | 20 | package net.nightwhistler.nucular.parser.opensearch; 21 | 22 | import net.nightwhistler.nucular.parser.ElementParser; 23 | 24 | import java.util.Map; 25 | 26 | public class OpenSearchParser extends ElementParser { 27 | 28 | private SearchDescription desc; 29 | 30 | public OpenSearchParser() { 31 | super("OpenSearchDescription"); 32 | this.desc = new SearchDescription(); 33 | } 34 | 35 | public SearchDescription getDesc() { 36 | return desc; 37 | } 38 | 39 | @Override 40 | public void startElement(String name, Map attributes) { 41 | if ( ! name.equals("OpenSearchDescription") ) { //Minor bootstrapping hack 42 | super.startElement(name, attributes); 43 | } 44 | } 45 | 46 | @Override 47 | protected ElementParser createChildParser(String tagName) { 48 | 49 | if ( tagName.equals("Url")) { 50 | return new UrlParser(desc); 51 | } 52 | 53 | return super.createChildParser(tagName); 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /res/layout/drawer_list_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 23 | 24 | 31 | 32 | 44 | 45 | -------------------------------------------------------------------------------- /src/net/nightwhistler/pageturner/bookmark/Bookmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Alex Kuiper, Rob Hoelz 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package net.nightwhistler.pageturner.bookmark; 19 | 20 | import android.content.ContentValues; 21 | 22 | public class Bookmark { 23 | 24 | private String fileName; 25 | private String name; 26 | private int index; 27 | private int position; 28 | 29 | public Bookmark(String fileName, String name, int index, int position) { 30 | this.fileName = fileName; 31 | this.name = name; 32 | this.index = index; 33 | this.position = position; 34 | } 35 | 36 | void populateContentValues(ContentValues row) { 37 | row.put("file_name", this.fileName); 38 | row.put("name", this.name); 39 | row.put("book_index", this.index); 40 | row.put("book_position", this.position); 41 | } 42 | 43 | public String getFileName() { 44 | return fileName; 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public int getIndex() { 52 | return index; 53 | } 54 | 55 | public int getPosition() { 56 | return position; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/atom/Link.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.atom; 20 | 21 | 22 | import java.io.Serializable; 23 | 24 | public class Link implements Serializable { 25 | 26 | private String href; 27 | private String type; 28 | private String rel; 29 | private String title; 30 | 31 | public Link( String href, String type, String rel, String title ) { 32 | this.href = href; 33 | this.type = type; 34 | this.rel = rel; 35 | this.title = title; 36 | } 37 | 38 | public String getHref() { 39 | return href; 40 | } 41 | public void setHref(String href) { 42 | this.href = href; 43 | } 44 | public String getType() { 45 | return type; 46 | } 47 | public void setType(String type) { 48 | this.type = type; 49 | } 50 | 51 | public String getRel() { 52 | return rel; 53 | } 54 | public void setRel(String rel) { 55 | this.rel = rel; 56 | } 57 | 58 | public String getTitle() { 59 | return title; 60 | } 61 | 62 | public void setTitle(String title) { 63 | this.title = title; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/net/nightwhistler/nucular/parser/EntryParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Alex Kuiper 3 | * 4 | * This file is part of PageTurner 5 | * 6 | * PageTurner is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * PageTurner is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with PageTurner. If not, see .* 18 | */ 19 | package net.nightwhistler.nucular.parser; 20 | 21 | import net.nightwhistler.nucular.atom.Entry; 22 | import net.nightwhistler.nucular.atom.Feed; 23 | 24 | public class EntryParser extends ElementParser { 25 | 26 | private Entry entry; 27 | 28 | public EntryParser(Feed parent) { 29 | super("entry"); 30 | this.entry = new Entry(); 31 | parent.addEntry(entry); 32 | } 33 | 34 | @Override 35 | protected ElementParser createChildParser(String tagName) { 36 | 37 | if ( tagName.equals("link")) { 38 | return new LinkParser(entry); 39 | } else if ( tagName.equals("content")) { 40 | return new ContentParser(entry); 41 | } else if ( tagName.equals("title") ) { 42 | return new TitleParser(entry); 43 | } else if ( tagName.equals("author")) { 44 | return new AuthorParser(entry); 45 | } else if ( tagName.equals("id")) { 46 | return new IDParser(entry); 47 | } else if ( tagName.equals("summary")) { 48 | return new SummaryParser(entry); 49 | } 50 | 51 | return super.createChildParser(tagName); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /res/layout/catalog_download_buttons.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 18 | 19 | 20 |