Compare commits

..
2337 Commits
Author SHA1 Message Date
seven332 ba6d41b91f DEPRECATED 2019-08-09 12:50:16 +08:00
seven332 6a9e0198a2 Add cookie to torrent request 2019-08-07 11:05:38 +08:00
seven332 92f716170c Fix plain txt checking 2019-08-07 09:55:21 +08:00
seven332 d72f686d5a Fix data exporting 2019-08-01 17:02:36 +08:00
seven332 28eade9451 Fix check plain txt 2019-07-31 20:06:02 +08:00
seven332 7b95bc804a Check plain text after downloading 2019-07-31 19:41:51 +08:00
seven332 47c9d48787 Close #659, fix parsing gallery parent 2019-07-29 14:04:27 +08:00
seven332 8a7adbe838 1.7.3 2019-07-27 01:35:04 +08:00
seven332 0248fd4e02 Add kokomade tip 2019-07-26 21:22:26 +08:00
seven332 1cd5f7bbf7 Update libraries 2019-07-13 13:16:27 +08:00
seven332 db893b899d Add preset download dir 2019-07-13 12:59:51 +08:00
seven332 d86dd3bc06 1.7.2 2019-07-01 10:28:12 +08:00
seven332 49f420c1eb Remove useless import 2019-07-01 10:23:41 +08:00
seven332 c9103caad8 Add a tip about signing in 2019-06-21 15:08:04 +08:00
seven332 ee0ffc48d2 Remove recaptcha 2019-06-21 13:41:37 +08:00
seven332 ed7eba7ef4 Update issue templates 2019-06-20 20:30:39 +08:00
seven332 b6a16d1d58 Filter uploader for thumbnail mode 2019-06-20 19:50:02 +08:00
seven332 04521dfeb6 Remove gallery if it's downloaded 2019-06-20 19:32:08 +08:00
seven332 d00f6e6cc6 Show a confirm dialog before deleting galleries 2019-06-20 18:48:16 +08:00
seven332 7a47b2504d Show icon in selection dialogs 2019-06-20 18:21:52 +08:00
seven332 2da10a5855 Show delete downloads option if the gallery is downloaded 2019-06-20 16:37:32 +08:00
seven332 323b36c58a Remove old github issue template 2019-06-20 16:18:46 +08:00
seven332 9834d45ca9 Close #627, add quotation marks to titles for similar galleries 2019-06-20 16:17:38 +08:00
seven332 c058bb01f0 Update issue templates 2019-06-20 15:37:44 +08:00
seven332 f578c6cb8b Merge pull request #624 from dntil/master
Add auto screen rotation support.
2019-06-17 10:53:50 +08:00
liqichang 2c43589c1c Add auto screen rotation support. 2019-06-16 10:04:41 +08:00
seven332 6e73f03c19 Apply theme color to navigation bar in default 2019-06-16 00:39:58 +08:00
seven332 b7e2c5bce1 Use org.apache.http.legacy
Avoid crash in com.tencent.open.utils.HttpUtils.getHttpClient
2019-06-16 00:30:38 +08:00
seven332 9707ac470a Fix GalleryHeader 2019-06-15 12:02:53 +08:00
seven332 06fd28290c Fix GalleryHeader 2019-06-14 20:33:41 +08:00
seven332 21ef5897ef Add GalleryHeader avoid notch 2019-06-14 16:06:04 +08:00
seven332 bdd45b5f10 Readable time is more readable 2019-06-10 20:26:30 +08:00
seven332 e68d4ad2c4 Show last edited time of comments 2019-06-10 19:41:24 +08:00
seven332 2e56ba4ed0 Convert gallery title to lowercase before checking filter 2019-06-10 14:27:45 +08:00
seven332 54b6dd99a9 1.7.1 2019-05-27 23:03:47 +08:00
seven332 6389b09d64 Fix thumb url 2019-05-27 22:57:00 +08:00
seven332 998d87b206 1.7.0 2019-05-25 19:32:59 +08:00
seven332 0b6a9da664 Update libraries 2019-05-25 19:04:43 +08:00
seven332 6086175ef6 Disable view transition in GalleryDetailScene 2019-05-25 15:31:38 +08:00
seven332 5e690c6983 Android Studio 3.4.1 2019-05-23 14:18:49 +08:00
seven332 a898f289fe Remove default text from gallery detail tip 2019-05-14 13:19:30 +08:00
seven332 a215389b98 Add loading more comments 2019-05-11 22:58:57 +08:00
seven332 60af7937c7 Add GalleryCommentList to hold hasMore 2019-05-11 17:59:25 +08:00
seven332 4064510b14 Implement editing comment 2019-05-08 11:29:59 +08:00
seven332 c9146324f8 Use ThemeOverlay instead of Theme for views 2019-05-07 22:44:32 +08:00
seven332 bd7c806ad9 Check text to get comment actions 2019-05-07 21:00:07 +08:00
seven332 efe7d4757a Show empty page tip if getting empty html string 2019-05-07 19:31:39 +08:00
seven332 3554fe1188 Add release link to readme 2019-05-07 16:46:26 +08:00
seven332 06357b37d6 Update libraries 2019-05-07 14:28:26 +08:00
seven332 ae2443fbf0 Always save crash file if onCreate() is not done 2019-05-07 14:24:12 +08:00
seven332 19403975ba Add go to and refresh to FavouriteScene 2019-05-06 23:10:11 +08:00
seven332 5087311b26 Add ReLinker dependency 2019-04-22 22:08:39 +08:00
seven332 de854ac7ac Ignore gone fabs in FabLayout 2019-04-19 16:20:15 +08:00
seven332 40c0506f6e Android Studio 3.4.0 2019-04-19 13:38:38 +08:00
seven332 7beb49e599 Remove wrong RecyclerView.hasFixedSize() 2019-04-16 20:40:05 +08:00
seven332 7c5486aa08 Fix RecyclerView drag and drop 2019-04-16 20:39:14 +08:00
seven332 120124101a Fix spanish translation file 2019-04-07 14:46:39 +08:00
seven332 c286d2c543 Merge pull request #592 from scese250/patch-6
Updated Spanish translation
2019-04-07 14:45:03 +08:00
scese250 5f411661e9 Updated Spanish translation
Some options weren't transladated. And minor fixes.
2019-04-06 02:11:09 -04:00
seven332 981a7c7851 Apply fullscreen for phone with notch 2019-04-06 12:43:33 +08:00
seven332 43b169371d Update firebase-core 2019-04-04 10:43:58 +08:00
seven332 311dabba17 Throw ParseException if no gallery found 2019-04-04 10:20:20 +08:00
seven332 c7d7ce8225 1.6.3 2019-04-03 20:16:25 +08:00
seven332 4b1c6ac917 Fix parsing title 2019-04-03 19:56:51 +08:00
seven332 24612b7d14 Fix parsing thumbnail url 2019-04-03 19:37:55 +08:00
seven332 3530faabf1 Fix GalleryListParser 2019-04-03 19:13:08 +08:00
seven332 0f3a95575c Fix spanish translation file 2019-04-01 19:44:29 +08:00
seven332 0334833bf8 Merge pull request #581 from scese250/patch-5
Updated Spanish translation
2019-04-01 19:35:23 +08:00
scese250 1b1d94a98d Updated Spanish translation
Thanks for continuing updating the app.
2019-04-01 03:09:07 -04:00
seven332 dfa1de9745 Close #578, search in subscriptions if subscriptions are shown 2019-03-31 01:45:19 +08:00
seven332 84fe397c18 1.6.2 2019-03-29 12:09:31 +08:00
seven332 07b1b5034d Check mSearchLayout null in onUpdateUrlBuilder() 2019-03-29 12:08:39 +08:00
seven332 7f73eb0bd4 Add device_language as user property 2019-03-29 11:01:49 +08:00
seven332 f129ac649d Don't quote quoted keyword 2019-03-28 18:33:38 +08:00
seven332 e9d5569e81 Escape quotation marks 2019-03-28 18:27:38 +08:00
seven332 db31e5c740 Wrap keywords with quotation marks if they are tags 2019-03-28 18:22:02 +08:00
seven332 c83fcee21a Merge pull request #574 from UShimamura/master
Update German, French and Japanese translations
2019-03-27 16:02:40 +08:00
UShimamura 6270e1695d Fix another typo 2019-03-27 11:15:36 +08:00
UShimamura a8b11c8e21 Fix a typo 2019-03-27 11:02:16 +08:00
UShimamura a12b2c4eac Add contributers for Japanese translations 2019-03-27 11:00:39 +08:00
UShimamura 31412b78cf Remove duplicate translations 2019-03-26 23:36:39 +08:00
UShimamura 4a986a8428 Remove duplicate translations 2019-03-26 23:35:25 +08:00
UShimamura d58b2ba03e Update Japanese translations 2019-03-26 23:34:05 +08:00
UShimamura 176c64330f Update French translations 2019-03-26 23:32:40 +08:00
UShimamura 342ed0c709 Update German translations 2019-03-26 23:31:05 +08:00
UShimamura d8ee689db7 Update French translations 2019-03-26 22:56:52 +08:00
UShimamura 229e429809 Remove old translations 2019-03-26 22:30:47 +08:00
seven332 f5128cd17a Add latest release preference 2019-03-26 17:05:21 +08:00
UShimamura 5e5a736f1c Update Japanese translations 2019-03-25 23:42:53 +08:00
seven332 1ec3681b7c Add @string/search_sp_suffix for some languages 2019-03-25 23:02:07 +08:00
seven332 67f9b6cb83 Remove useless analytics reporting 2019-03-25 13:58:56 +08:00
seven332 58ac39cf2c Filter is back 2019-03-25 13:34:24 +08:00
seven332 3cd4fc7ce9 Classify EhFilter 2019-03-22 14:46:15 +08:00
seven332 d731719f1c Add readonly FilterActivity 2019-03-22 14:36:35 +08:00
seven332 be0c394de1 1.6.1 2019-03-22 13:23:14 +08:00
seven332 a739300260 Use mEndPage to restrict mPages instead of mPages itself 2019-03-22 13:16:55 +08:00
seven332 da9940d581 Merge ContentLayout.setPages() to onGetPageData() 2019-03-22 13:12:52 +08:00
seven332 a2523aae75 Don't make mEndPage beyond mPages 2019-03-22 13:02:26 +08:00
seven332 3ae3602671 Cancel footer refreshing if can't get next page 2019-03-22 12:36:03 +08:00
seven332 6350fc1ece Fix parsing next page 2019-03-22 12:27:25 +08:00
seven332 29a27cbe00 Fix null FavouriteStatusRouter 2019-03-22 12:21:56 +08:00
seven332 5fc0fb997a 1.6.0 2019-03-22 02:09:29 +08:00
seven332 aa01ddd594 Disable ChangeImageTransform on Android 5 2019-03-22 02:08:05 +08:00
seven332 8774268adf Check map null 2019-03-22 01:27:02 +08:00
seven332 265cbd0df5 Add GalleryInfoContentHelper to hold a data map 2019-03-22 01:19:40 +08:00
seven332 82cdfeb1b2 Remove gallery from local favourites in CommonOperations.removeFromFavorites() 2019-03-22 01:17:49 +08:00
seven332 71dd9d3693 Remove download listener and favourite listener in GalleryListScene.onDestroy() 2019-03-21 23:57:14 +08:00
seven332 fd9f1bd219 Add FavouriteStatusRouter to forward the favourite status 2019-03-21 23:17:09 +08:00
seven332 956b7455a3 Notify download status on GalleryListScene 2019-03-21 21:41:45 +08:00
seven332 b3c855a5dc Enrich gallery list item menu 2019-03-21 21:26:36 +08:00
seven332 06e624a1e3 Remove EhFilter 2019-03-21 20:38:21 +08:00
seven332 871c0a43ca Add disable default filters options 2019-03-21 20:19:00 +08:00
seven332 6775246d4c Add login tip for EHentai Setting and My Tags 2019-03-21 19:16:14 +08:00
seven332 a0b0109424 Switch to subscription search in subscription screen 2019-03-21 18:48:27 +08:00
seven332 c5566aa5e8 Add subscription search 2019-03-21 18:31:32 +08:00
seven332 1d70572d92 Add arrow icon callback on MyTagsActivity 2019-03-21 16:47:48 +08:00
seven332 5dc6446d64 Close #561, add launch page selector 2019-03-21 16:44:42 +08:00
seven332 13eb9e2f16 Add all cookie entries to CookieStore in WebViewSignIn 2019-03-21 15:47:09 +08:00
seven332 7e1e4a0f57 Only show tips for subscription if no watched tags 2019-03-21 15:30:33 +08:00
seven332 c0933eb8f0 Add tips for subscription 2019-03-21 15:14:31 +08:00
seven332 a0e6a847ab Remove help route 2019-03-21 15:07:26 +08:00
seven332 23a7053597 Adjust EhUrl fields 2019-03-21 14:36:31 +08:00
seven332 d463cf2295 Close #559, add subscription 2019-03-21 14:33:28 +08:00
seven332 94db37c899 Hide IME after searching 2019-03-21 13:08:46 +08:00
seven332 94f6eecbc7 Add the entry of My Tags 2019-03-21 12:57:03 +08:00
seven332 c0f20ca975 Always apply Name, Tags and Note on favourite search 2019-03-21 10:06:13 +08:00
seven332 749f2610af Use switch string 2019-03-20 20:31:46 +08:00
seven332 a2a6422917 Parse page from and page to from url 2019-03-20 20:25:00 +08:00
seven332 df72243bb6 Add page from and page to 2019-03-20 19:00:38 +08:00
seven332 50c7a23566 Fix description about show_jpn_title and show_gallery_pages 2019-03-20 14:59:02 +08:00
seven332 1cbb725920 Add nextPage field to avoid require duplicate page 2019-03-20 14:30:49 +08:00
seven332 8b76eaa740 Remove duplicate galleries 2019-03-20 13:43:25 +08:00
seven332 65f320f8f7 Close #550, add language pattern for Japanese title 2019-03-20 11:07:18 +08:00
seven332 a7e4a2cd61 1.5.0 2019-03-19 23:32:13 +08:00
seven332 88baeeb335 Revert "Show pages if it's available"
This reverts commit 08d1ef8
2019-03-19 23:21:05 +08:00
seven332 00289d106d Update EhDns 2019-03-19 23:14:33 +08:00
seven332 08d1ef87d4 Show pages if it's available 2019-03-19 23:04:34 +08:00
seven332 388d507257 Parsing GalleryInfo.rated 2019-03-19 23:03:51 +08:00
seven332 89209a3c44 Don't call API if all data is got 2019-03-19 23:02:08 +08:00
seven332 9208c53d4f Fix gallery list url builder 2019-03-19 22:37:37 +08:00
seven332 defa670a26 Add missing generateSLang() 2019-03-19 21:36:16 +08:00
seven332 2ec229c8ef Fix parsing popular 2019-03-19 21:22:43 +08:00
seven332 e5df5714de Don't show favourited icon on FavouritesScene 2019-03-19 21:04:29 +08:00
seven332 5b8e031e50 Add GalleryListParserTest 2019-03-19 20:57:45 +08:00
seven332 b0ccfe4793 Fix parse category of gallery detail 2019-03-19 20:54:57 +08:00
seven332 b101ae142d Fix parsing gallery list 2019-03-19 20:51:19 +08:00
seven332 c165c9071d Enable builtin hosts if the country is CN 2019-03-15 15:45:14 +08:00
seven332 7fc9ef9e1f Android Studio 3.3.2 2019-03-15 15:44:45 +08:00
seven332 c4514589c0 Fix France name 2019-03-13 13:35:34 +08:00
seven332 0305c541aa Fix Thai translations 2019-03-13 13:03:45 +08:00
seven332 7631e3b4f9 Apply Thai translations 2019-03-13 13:02:09 +08:00
seven332 350d846a39 Merge pull request #544 from maxjame5432/master
Add Thai langauge
2019-03-13 12:38:29 +08:00
maxjame5432 c119562c16 First commit 2019-03-13 01:24:06 +07:00
Mekokung 37de170729 Add Thai language
Add Thai language
2019-03-12 20:44:34 +07:00
Mekokung 8d992d737e Merge pull request #1 from maxjame5432/thai-lang
Add Thai language
2019-03-12 20:40:24 +07:00
Mekokung 81434a682f Add Thai Language
Add thai language in your app
2019-03-12 17:10:46 +07:00
Mekokung b3a446ffcd Add thai language
add thai language translation
2019-03-12 16:32:52 +07:00
seven332 e659ba91b4 Fix English translations
"Swipe to left" or "Swipe left"?
2019-03-11 22:24:41 +08:00
seven332 7866722ec4 Fix ripple clipping in pre-L devices 2019-03-05 14:44:28 +08:00
seven332 2a944f5e0a Adjust the center of circular reveal in gallery detail scene 2019-03-05 14:20:18 +08:00
seven332 34eccad8be Use AndroidX transition library 2019-03-05 12:39:48 +08:00
seven332 57a18b7215 Add warning about minors 2019-02-27 15:22:12 +08:00
seven332 6c253238ad Show an icon if the gallery is downloaded 2019-02-23 17:04:17 +08:00
seven332 c08068eeea Show heart icon if the gallery is favourited 2019-02-23 16:23:14 +08:00
seven332 303c51f93d Remove "No more new SkipHathKey" tip
It's confusing.
2019-02-23 00:40:23 +08:00
seven332 e1a88cdfe3 1.4.2 2019-02-19 10:19:09 +08:00
seven332 6adad86bc5 Revert okhttp to 3.12.1
okhttp 3.13.1 doesn't support Android 4.x
2019-02-19 10:18:44 +08:00
seven332 0dbb030663 1.4.1 2019-02-18 22:05:28 +08:00
seven332 169f4c3eb8 Add operation records analytics 2019-02-18 22:03:36 +08:00
seven332 dd700a0f2d Add Referer and Origin to HTTP request 2019-02-17 14:31:36 +08:00
seven332 77a2875b9f Remove EhConfig from EhRequestBuilder 2019-02-17 12:59:03 +08:00
seven332 fd5f6c3466 Use api to get page image url 2019-02-16 15:07:16 +08:00
seven332 3380389453 Remove useless exception is EhRequestBuilder 2019-02-16 15:06:04 +08:00
seven332 fc9270d48c Thrown exception if no test resource 2019-02-16 15:03:35 +08:00
seven332 a3aa4ba17f Add GalleryPageApiParser 2019-02-16 15:02:40 +08:00
seven332 cca6e2a72e Get show key from gallery page html 2019-02-16 15:01:37 +08:00
seven332 cc9205700c EhException supports cause now 2019-02-16 15:00:03 +08:00
seven332 ced2139703 Update libraries 2019-02-16 12:08:17 +08:00
seven332 2ad5edfe3b Merge pull request #528 from lilymaniac/l10n-ko
Update Korean localization
2019-02-14 10:59:29 +08:00
lilymaniac b6e822e6d1 Update Korean localization
Catch up to commit 4d4571aa30 ("Remove android-chinese-string plugin").
2019-02-13 15:19:22 +09:00
seven332 4d4571aa30 Remove android-chinese-string plugin 2019-02-12 23:08:06 +08:00
seven332 c326adfe48 Remove image cache after refreshing 2019-02-11 23:23:46 +08:00
seven332 b8cb9f66b6 Update libraries
Remove GLView ColorMatrix support
2019-02-11 23:16:55 +08:00
seven332 c5a6526171 Add saving crash log 2019-02-11 18:14:35 +08:00
seven332 6d72349ee7 Fix missing Firebase gradle plugin 2019-02-11 11:47:35 +08:00
seven332 334c248acb Use classloader in the SavedState of TaskPreference 2019-02-10 13:42:20 +08:00
seven332 41ef8d2374 Catch all exception when saving tag translations 2019-02-10 13:07:02 +08:00
seven332 fef42c0832 Fix wrong widget in xml 2019-02-09 19:46:39 +08:00
seven332 8ffd959659 Fix gallery detail rating bar 2019-02-09 19:41:56 +08:00
seven332 5c0772e5b9 Update android-advancedrecyclerview 2019-02-09 19:29:49 +08:00
seven332 0afb78da3f Use AndroidX 2019-02-09 19:25:15 +08:00
seven332 04a5c762dd Update libraries 2019-02-09 17:44:08 +08:00
seven332 1eaad6f669 Support proxy 2019-02-03 19:19:50 +08:00
seven332 beeb083cb3 Avoid MalformedURLException in ChromeRequestBuilder 2019-02-03 18:59:13 +08:00
seven332 ce5655def6 Fix image transition 2019-02-02 15:16:51 +08:00
seven332 f1c446f7de Adjust description about chinese tag translations 2019-01-31 12:00:13 +08:00
seven332 ca6b2c6917 Apply CN tag translations to HK and TW 2019-01-31 11:45:17 +08:00
seven332 95bb75c9b4 Add tag translations source 2019-01-30 15:37:55 +08:00
seven332 073934a2a0 Disable google-services plugin if can't find google-services.json
It fix compiling without google-services.json.
2019-01-27 23:24:25 +08:00
seven332 1edb8941ee Clear EhTagDatabase if it's not available 2019-01-27 14:17:55 +08:00
seven332 81195726d5 Put tag translation metadata to xml resources 2019-01-27 13:55:09 +08:00
seven332 bc2b21b0f5 1.4.0 2019-01-26 15:56:19 +08:00
seven332 ec132440e7 Close #514, extend the duration of SnackBar 2019-01-24 22:50:05 +08:00
seven332 9d49973504 Add new downloaded gallery to history 2019-01-22 22:23:07 +08:00
seven332 016ec23fbd Fix rating if the gallery has been rated by the user 2019-01-21 20:17:27 +08:00
seven332 59d141fc8e Improve ChromeRequestBuilder
Add request header Accept and Accept-Language.
Update User-Agent.
2019-01-21 16:46:41 +08:00
Tsuki 3d3c3a9273 Update License year 2019-01-21 12:19:41 +08:00
seven332 c580938806 Support tag translations 2019-01-20 00:49:54 +08:00
seven332 3904406d74 Add IoThreadPoolExecutor 2019-01-19 14:05:33 +08:00
seven332 879b8fa50a Support downloading galleries from FavoritesScene 2019-01-17 18:41:49 +08:00
seven332 7228736c95 Avoid crash in unbindService() 2019-01-16 18:46:47 +08:00
seven332 e8eb126135 Catch SQLException in SearchDatabase 2019-01-16 18:38:31 +08:00
seven332 0eb86e37e6 Android Studio 3.3.0 2019-01-16 18:20:12 +08:00
seven332 eff2ed94fe Update GLView
Support OpenGL ES 1.x
2019-01-14 19:38:37 +08:00
seven332 fb2011a408 Adjust thumbnail aspect 2019-01-14 15:32:13 +08:00
seven332 a442578927 Update okhttp 2019-01-14 00:56:11 +08:00
seven332 673735ab2e Update a7zip 2019-01-14 00:55:06 +08:00
seven332 f1bab7e3d4 Add FixedThumb to fix thumbnail size 2019-01-13 02:38:48 +08:00
seven332 1d5b26ee51 Update a7zip 2019-01-10 14:02:01 +08:00
seven332 a1a82b0ce9 Restrict GalleryDetailUrlParser token to 10 characters 2019-01-10 10:34:35 +08:00
seven332 5b961d71b8 Block drawer gesture if it's on ScrollView 2019-01-07 13:01:44 +08:00
seven332 0353c1cebb Update DrawerLayout 2019-01-07 11:49:07 +08:00
seven332 7b07bdc51f 1.3.5 2019-01-05 14:56:25 +08:00
seven332 cf1ac32e17 Add android.max_aspect 2019-01-05 13:37:24 +08:00
seven332 bb28dd97cc Ignore IllegalArgumentException in URLDecoder.decode() 2019-01-05 13:24:42 +08:00
seven332 a33bd63e6e Safe number string parsing 2019-01-05 13:13:37 +08:00
seven332 a0b786b2a6 Avoid NumberFormatException in Html.getHtmlColor() 2019-01-05 12:38:43 +08:00
seven332 9dd39412d4 Update a7zip 2019-01-04 21:55:08 +08:00
seven332 3fdf9453ef Fix Pipe stuck 2019-01-04 21:48:33 +08:00
seven332 116f30e496 1.3.4 2019-01-04 18:57:16 +08:00
seven332 e8d05c273f Update crashlytics sdk 2019-01-04 18:47:05 +08:00
seven332 29e3a50cd3 Update URL_PREFIX_THUMB_E 2019-01-04 13:41:49 +08:00
seven332 1409571ad8 Add ehgt.org and ul.ehgt.org to builtin hosts 2019-01-04 13:41:27 +08:00
seven332 8a7e72c412 Add repo.e-hentai.org to builtin hosts 2019-01-04 13:11:42 +08:00
seven332 948cb9ef9c Update GLView 2019-01-03 19:47:03 +08:00
seven332 926391a0fe Avoid NullPointerException in PrettyPreferenceActivity 2019-01-03 18:42:15 +08:00
seven332 24195430ab Use a7zip to extract archives 2019-01-03 18:03:15 +08:00
seven332 c9afa597d5 Avoid NullPointerException in StageActivity.onCreate() 2019-01-02 20:51:48 +08:00
seven332 adf38af673 Check updateCursorPositionMz method instead of device manufacturer 2019-01-02 18:40:14 +08:00
seven332 17f2bb670e Ignore Throwable in TextInputEditText.onDraw()
Ignore crash in updateCursorPositionMz.
2019-01-02 17:05:43 +08:00
seven332 2293654da8 Call notifyDataSetChanged() in ContentLayout restoring state 2019-01-02 16:37:20 +08:00
seven332 36067c9fac Ignore Throwable in ActivityCompat.requestPermissions() 2019-01-02 16:02:20 +08:00
seven332 8d20621ad4 Avoid crash in bindService() 2019-01-02 15:44:27 +08:00
seven332 a1d1db14c6 Override startService() instead of using SilentContextWrapper 2019-01-02 15:37:56 +08:00
seven332 44cf2b67d0 Set hint to TextInputLayout instead of TextInputEditText
It may avoid a bug of AssistStructure.
https://issuetracker.google.com/issues/62834931
2019-01-02 15:25:49 +08:00
seven332 74c0e478ef Avoid NullPointerException in MainActivity.handleIntent() 2019-01-02 14:53:41 +08:00
seven332 7496534b30 Exclude 64bit .so library
It may fix system .so missing, like "XXX.so is 32-bit instead of 64-bit"
2019-01-02 10:56:00 +08:00
seven332 415ffbc21d Avoid NullPointerException when restore items 2019-01-01 15:51:05 +08:00
seven332 ed4267cb36 Delay SystemUiHelper synchronizing in onWindowFocusChanged()
It fixes invalid SystemUiHelper synchronizing
on XiaoMi MIX2 MIUI 10 Android 8.0
2018-12-27 16:29:11 +08:00
seven332 2de859398b Fix big number causing NumberFormatException in NaturalComparator 2018-12-26 11:08:08 +08:00
seven332 62348433df Insert SilentContextWrapper to avoid crash in startService() 2018-12-25 22:36:10 +08:00
seven332 b64b14c69a Update Image
libjpeg-turbo neon runtime check
2018-12-25 10:52:29 +08:00
seven332 28e8e91303 Do io initialization tasks in new thread 2018-12-23 12:48:06 +08:00
seven332 44026f0ccc Avoid mysterious crash 2018-12-23 12:28:48 +08:00
seven332 95f2d46420 Avoid non-UI thread view touching on some devices 2018-12-23 12:20:10 +08:00
seven332 8f76f50526 Disable left drawer in GalleryDetailScene 2018-12-22 13:52:41 +08:00
seven332 ecd215d632 Avoid RecyclerView inconsistency in HistoryScene 2018-12-22 12:18:02 +08:00
seven332 b138de9563 Update GLView-Image 2018-12-22 00:29:15 +08:00
seven332 9bd344cc58 Avoid NullPointerException in deleteFileAsync() 2018-12-21 21:21:48 +08:00
seven332 ababfd57a6 Update GLView 2018-12-21 21:20:23 +08:00
seven332 45c760a507 Check mGalleryView null in GalleryMenuHelper 2018-12-21 19:51:44 +08:00
seven332 e721a6da1f 1.3.3 2018-12-21 19:35:40 +08:00
seven332 9eeba868d5 Update GLView-Image 2018-12-21 19:32:47 +08:00
seven332 8f3247bac4 Get update information from GitHub 2018-12-21 19:31:57 +08:00
seven332 e5a375c3fe Catch all throwable from startActivityForResult() 2018-12-21 18:53:50 +08:00
seven332 8d75752835 Catch all throwable while calling DownloadManager 2018-12-21 18:26:21 +08:00
seven332 8af786e687 Catch all throwable from startActivity() 2018-12-21 18:04:23 +08:00
seven332 4b1c516b3e Refresh if can't restore ContentLayout data 2018-12-21 17:01:37 +08:00
seven332 f32b79ba72 Save global stuff next id 2018-12-21 16:55:14 +08:00
seven332 92b5f2d766 Use notifyDataSetChanged() instead of notifyItemRemoved() to avoid crash 2018-12-21 16:22:01 +08:00
seven332 a5767e0fe6 Update UniFile 2018-12-21 15:04:03 +08:00
seven332 2fc48bb726 Update Image 2018-12-21 11:09:58 +08:00
seven332 4a5a426fd3 1.3.2 2018-12-20 20:11:48 +08:00
seven332 06adf8594c Fix HistoryScene crash
https://github.com/h6ah4i/android-advancedrecyclerview/issues/315
2018-12-20 19:39:48 +08:00
seven332 1ac43e6293 1.3.1 2018-12-20 18:21:28 +08:00
seven332 ceeb84812b Only ignore a special version update 2018-12-20 18:16:37 +08:00
seven332 bfd85e9bc7 Catch Throwable instead of Exception 2018-12-20 16:02:56 +08:00
seven332 8c3796605e Add scene_view action 2018-12-20 15:47:12 +08:00
seven332 3214bae157 Fix NullPointerException in ClearTask.clearFile() 2018-12-20 11:01:03 +08:00
seven332 a5b178df49 Returns null if IndexOutOfBoundsException in ContentHelper 2018-12-20 10:58:48 +08:00
seven332 c2a93f2ce4 Avoid NullPointerException in SpiderWorker.downloadImage() 2018-12-20 10:36:52 +08:00
seven332 257758b27d Avoid FingerprintManager.hasEnrolledFingerprints() crash on samsung devices 2018-12-20 10:18:32 +08:00
seven332 2681e4a6e6 Check FingerprintManager null 2018-12-19 22:17:51 +08:00
seven332 722653ac46 Update advrecyclerview 2018-12-19 20:02:27 +08:00
seven332 cb706941c5 Avoid TextInputEditText crash on some Meizu devices 2018-12-19 19:39:58 +08:00
seven332 195e9a5655 Revert "Set hint to TextInputEditText instead of TextInputLayout"
This reverts commit 405655d
2018-12-19 19:37:36 +08:00
seven332 ed2043ab7a Update Image 2018-12-19 19:16:09 +08:00
seven332 405655d0e2 Set hint to TextInputEditText instead of TextInputLayout 2018-12-19 16:03:02 +08:00
seven332 0cead11180 Update UniFile 2018-12-19 15:49:19 +08:00
seven332 141ab73089 1.3.0 2018-12-19 14:21:59 +08:00
seven332 7c349153de Fix fingerprint icon 2018-12-19 13:28:01 +08:00
seven332 168b701cca Remove G+ from readme 2018-12-19 12:49:04 +08:00
seven332 0b67e685d2 Print an error 2018-12-19 11:06:31 +08:00
seven332 741bb10a1c Allow http protocol 2018-12-19 11:06:01 +08:00
seven332 829591229d Update okhttp 2018-12-19 11:05:02 +08:00
seven332 cbed5ee8cb Add the declaration 2018-12-18 22:27:04 +08:00
seven332 a2db9038e3 Use sad pandroid icon instead of weird face icon 2018-12-18 17:44:16 +08:00
seven332 14328eaf83 Move webp images to v15 folder 2018-12-18 16:58:54 +08:00
seven332 a11fb869e2 Don't private classes or methods of support libraries 2018-12-18 16:50:15 +08:00
seven332 1285abdf71 Fix string resources 2018-12-18 15:33:53 +08:00
seven332 f0fa226b16 Use custom AssertUtils instead of Assert 2018-12-18 15:22:32 +08:00
seven332 88aebbd075 Add USE_BIOMETRIC and FOREGROUND_SERVICE permissions 2018-12-18 15:20:13 +08:00
seven332 2c08a7b56f Target SDK version 28 2018-12-18 15:19:22 +08:00
seven332 561e396c97 Use Firebase Crashlytics 2018-12-18 14:43:38 +08:00
seven332 f8676b71dc "Google Analytics" to "Google Analytics for Firebase" 2018-12-18 13:17:32 +08:00
seven332 259550e5cc Close #490, keep downloading after removing current download item 2018-12-17 17:02:19 +08:00
seven332 478e53ab96 Add download label delete button 2018-12-17 14:00:09 +08:00
seven332 286b39e679 Add quick search delete button 2018-12-17 13:44:32 +08:00
seven332 af771c7086 Remove specify gallery search 2018-12-16 02:08:56 +08:00
seven332 24d386da44 Don't scroll to top after delete a suggestion 2018-12-15 04:11:47 +08:00
seven332 419405f4e2 Apply theme color to navigation bar 2018-12-14 20:20:22 +08:00
seven332 e8de8ac5c8 Show clipboard url tip in Snackbar 2018-12-14 19:41:01 +08:00
seven332 934ec87390 Add gallery suggestion to search bar 2018-12-14 18:59:22 +08:00
seven332 46bd8e4297 Scroll suggestion list to top every time 2018-12-14 15:59:52 +08:00
seven332 70ceb83205 Increase suggestion count 2018-12-14 15:49:11 +08:00
seven332 0553fda3fa Long click category to set other categories to the opposite 2018-12-14 13:40:47 +08:00
seven332 b5f36dafdc Exclude solid archives 2018-12-13 23:29:48 +08:00
seven332 77fd0eb73e Update libraries 2018-12-13 21:50:35 +08:00
seven332 ff6b0bf01d Remove ZipGalleryProvider 2018-12-13 21:42:35 +08:00
seven332 6734ace077 Add ArchiveGalleryProvider 2018-12-13 15:15:39 +08:00
seven332 c013c82f90 Use NaturalComparator in DirGalleryProvider 2018-12-12 21:43:45 +08:00
seven332 618ca14eca Add NaturalComparator and PathNaturalComparator 2018-12-12 21:30:42 +08:00
seven332 700ebdfee3 Remove useless code 2018-12-11 09:55:31 +08:00
seven332 9899552e4b Close #488, detect gallery page url in clipboard 2018-12-04 21:45:22 +08:00
seven332 7104fddded GalleryPageUrlParser supports non-strict url 2018-12-04 21:27:37 +08:00
seven332 54f1c4806f GalleryDetailUrlParser supports non-strict url 2018-12-04 20:54:22 +08:00
UShimamura 9c66298cb8 Some little fixes 2018-11-29 21:57:35 +08:00
UShimamura bb266d46d3 Improved sentence to avoid ambiguity 2018-11-29 21:57:35 +08:00
UShimamura 8cd7d01e10 Add new translated strings 2018-11-29 21:57:35 +08:00
UShimamura 9692224dec Add new translated strings 2018-11-29 21:57:35 +08:00
UShimamura 41b4f00b91 Add translated strings 2018-11-29 21:57:35 +08:00
UShimamura 611a4c8853 Improve English strings. 2018-11-29 21:57:35 +08:00
UShimamura c8f1080b9e Update strings.xml
Error corrections
2018-11-24 11:53:04 +08:00
UShimamura 92ecf84c5e Update strings.xml
Polishing
2018-11-24 11:53:04 +08:00
UShimamura d9c0c80172 Update strings.xml
Grammar polishing
2018-11-24 11:53:04 +08:00
GUIHU 74a7b16252 Deleted wordy translations 2018-11-24 11:52:28 +08:00
GUIHU 5ccbeda6d5 Fixed incorrect spelled translations in values-zh-rTW 2018-11-24 11:52:28 +08:00
GUIHU 75a2be5d38 Translations polishing in values-zh-rTW 2018-11-24 11:52:28 +08:00
akazaa96 c5d5778961 Denmark strings.xml are missing a string argument 2018-11-19 21:35:04 +08:00
hbina4326 eb16df63e1 fixed french typo causing build failure 2018-11-16 14:08:38 +08:00
hzy980512 1bb2f6eb5f Update strings.xml 2018-11-05 14:54:24 +08:00
hzy980512 4a905a5226 Update strings.xml 2018-11-05 14:54:24 +08:00
hzy980512 fe60b26eec Update strings.xml 2018-11-05 14:54:24 +08:00
hzy980512 3b1028b9cc Add new translations. 2018-11-05 14:54:24 +08:00
hzy980512 36b7a6211e Update strings.xml 2018-11-05 14:54:24 +08:00
hzy980512 8cd89f8a06 Add new translations 2018-11-05 14:54:24 +08:00
hzy980512 b599f6e71c Update strings.xml 2018-11-05 14:54:24 +08:00
hzy980512 2e38237a99 Add new translations 2018-11-05 14:54:24 +08:00
seven332 d23c145790 Add shadow to adaptive icon 2018-11-03 20:26:57 +08:00
seven332 c3e0bbaa0a Exclude all google-services.json 2018-11-03 20:05:34 +08:00
seven332 4582556f65 Moved from Google Analytics to Firebase Analytics 2018-11-02 20:54:55 +08:00
seven332 e07316f25a Support mpv links 2018-10-30 18:34:26 +08:00
scese250 7379bdaa67 Translated new features to Spanish
And by the way, also I updated text.

btw thanks for add dark theme. 👍
2018-10-30 12:26:12 +08:00
seven332 c4519c5914 Fix missing gallery uploader 2018-10-29 20:30:06 +08:00
seven332 358d9861f5 Add changing theme shortcut to left drawer 2018-10-29 15:24:11 +08:00
seven332 bdf2df0ed1 Get simple language from tags 2018-10-29 13:53:11 +08:00
seven332 291a6515c1 Fix missing simple language 2018-10-29 11:38:20 +08:00
seven332 2667bacd9d 1.2.1 2018-10-27 13:55:56 +08:00
seven332 7967f289b7 Fix preference header background 2018-10-27 12:09:48 +08:00
seven332 31e1cb7e6d Fix gallery comments EditText bg color 2018-10-27 10:42:44 +08:00
seven332 a472d0509a 1.2.0 2018-10-25 20:08:37 +08:00
seven332 3f71a97cbd Change colorEdgeEffect 2018-10-25 19:26:06 +08:00
seven332 ed8c818d4f Adjust dark theme color 2018-10-25 18:40:27 +08:00
seven332 1db14cd998 Parse gallery list in thumbnail view 2018-10-25 16:02:04 +08:00
seven332 d06dd87ff4 Adjust text color 2018-10-25 14:32:26 +08:00
seven332 a31a64efd6 Revert textColor of ButtonInCard 2018-10-25 14:14:18 +08:00
seven332 cfa87a5a02 Adjust text color 2018-10-25 14:00:03 +08:00
seven332 2833691c34 Adjust text color 2018-10-25 13:37:25 +08:00
seven332 22d6ed8c39 Revert colorPrimary and colorAccent 2018-10-24 19:05:29 +08:00
seven332 110bae7cb7 Adjust progress view color 2018-10-22 13:45:15 +08:00
seven332 5bd7d6fae3 Adjust gallery detail header button background color 2018-10-22 13:35:59 +08:00
seven332 afa45fd8d9 Change black colorPrimary and colorAccent to grey_700 2018-10-22 13:08:16 +08:00
seven332 2c544607ec Add tagGroupBackgroundColor and tagBackgroundColor attribute 2018-10-22 13:05:38 +08:00
seven332 730b52d6cd Fix RatingBar color 2018-10-20 01:45:54 +08:00
seven332 0704579d26 Adjust card elevation 2018-10-20 01:41:20 +08:00
seven332 cb92fbad3d Don't finish the activity in second level of SettingsActivity 2018-10-19 23:07:45 +08:00
seven332 c7c6f8f706 Disable right swipe of HistoryScene 2018-10-19 23:04:06 +08:00
seven332 fdd81e21b1 Adjust card color 2018-10-19 22:54:02 +08:00
seven332 1093da6565 Update strings.xml 2018-10-19 22:13:12 +08:00
seven332 c625315a76 Apply theme to GalleryActivity 2018-10-19 22:09:04 +08:00
seven332 1deb4c2d6c Add dark widget color 2018-10-19 21:55:48 +08:00
seven332 9201b9baed Apply theme to dialog background 2018-10-19 21:52:43 +08:00
seven332 557bd9f54b Apply theme to play icon 2018-10-19 21:47:28 +08:00
seven332 0353dbdb27 Add activated color to reactive items 2018-10-19 21:45:13 +08:00
seven332 8b07cf62a9 Yellow RatingBar 2018-10-19 21:12:32 +08:00
seven332 111025cb98 Change colorControlActivated 2018-10-19 20:39:57 +08:00
seven332 b3d9c4c2b9 Apply theme to Security 2018-10-19 20:04:32 +08:00
seven332 f2695b6a2c Apply theme to some drawables 2018-10-19 19:39:52 +08:00
seven332 f6ec40e8ed Revert colorPrimary and colorAccent 2018-10-19 19:19:39 +08:00
seven332 9bc6920448 Add galleryDetailDivider attribute 2018-10-19 19:03:31 +08:00
seven332 abb8483723 Apply theme to Guides 2018-10-19 18:47:53 +08:00
seven332 81eadbb794 Apply theme to image_failed 2018-10-19 18:11:33 +08:00
seven332 22cc32778d Use system image in Html 2018-10-19 16:56:59 +08:00
seven332 c9d432b7c8 Change colorPrimary and colorAccent of dark theme and black theme 2018-10-19 16:48:53 +08:00
seven332 168a1dcfb2 Apply theme to text 2018-10-19 16:39:42 +08:00
seven332 b6718078f2 Add widgetColorThemePrimary and widgetColorThemeAccent attributes 2018-10-19 15:59:59 +08:00
seven332 960a7751ad Apply theme to ShadowLinearLayout 2018-10-19 15:34:22 +08:00
seven332 e5335de859 Apply theme to content color 2018-10-19 15:26:46 +08:00
seven332 1eb960eaf9 Clean theme 2018-10-19 14:57:09 +08:00
seven332 6bc9f0da64 Apply theme to big icons 2018-10-19 14:08:48 +08:00
seven332 f4d986a5bd Rename attributes
colorDivider -> dividerColor
colorToolbar -> toolbarColor
colorDrawablePrimary -> textColorThemeAccent
colorDrawableThemePrimary -> drawableColorPrimary
colorTextThemeAccent -> drawableColorThemePrimary
2018-10-19 13:56:33 +08:00
seven332 9aa22aab34 Apply theme to accent text 2018-10-18 23:08:31 +08:00
seven332 afa839ed0b Rename color drawable attribute
colorDrawableOpposite -> colorDrawablePrimary
colorDrawablePrimary -> colorDrawableThemePrimary
2018-10-18 23:01:57 +08:00
seven332 f2725331fe Fix duplicate clipboard text test 2018-10-18 22:20:55 +08:00
seven332 590963024a Apply theme to Ripple 2018-10-18 22:10:50 +08:00
seven332 1f55977182 Apply theme to the color of comment vote 2018-10-18 21:51:18 +08:00
seven332 4bed3d5b8e Rename colorXXXDrawable to colorDrawableXXX 2018-10-18 21:45:42 +08:00
seven332 7eab4e00e1 Replace @color/primary_text_light with ?android:attr/textColorPrimary 2018-10-18 21:39:28 +08:00
seven332 776813df17 Add colorPrimaryDrawable attribute 2018-10-18 21:36:22 +08:00
seven332 12beeedf29 Rename colorPrimaryDrawable to colorOppositeDrawable 2018-10-18 20:06:11 +08:00
seven332 d0e7f25fd9 Apply theme to AddDeleteDrawable and DrawerArrowDrawable 2018-10-18 19:58:50 +08:00
seven332 ab2a066992 Optimize themes.xml 2018-10-18 18:42:19 +08:00
seven332 596f95e463 Fix toolbarPopupTheme 2018-10-18 16:43:46 +08:00
seven332 79d07f98a8 Change Toolbar popup them 2018-10-18 15:53:42 +08:00
seven332 22ec2e8926 Change Toolbar background color 2018-10-18 15:33:53 +08:00
seven332 bc4d20d0a4 Fix SearchBar animations 2018-10-18 14:44:47 +08:00
seven332 84ed520c1c Change divider color 2018-10-18 14:37:59 +08:00
seven332 34eb6a423a Use CardView instead of card 9 png drawable 2018-10-18 13:28:07 +08:00
seven332 7dc1491c26 Use ?android:attr/windowBackground to draw background 2018-10-18 13:02:25 +08:00
seven332 6ecce9ddc5 Add dark theme and black theme 2018-10-18 12:56:56 +08:00
seven332 029373a8d2 Recreate all activities if theme changed 2018-10-18 12:44:43 +08:00
seven332 e8c06fd876 Add theme setting 2018-10-17 23:07:01 +08:00
seven332 8c9218e8af Use a non-reflect way to change how PreferenceActivity looks
Android P doesn't support invoking hidden API.
2018-10-15 22:31:53 +08:00
jerry855202 f922d41775 Fixed rCN text in rTW
"不允許螢幕抓取" was still rCN, fixed in this commit
2018-10-13 17:59:29 +08:00
seven332 e483105eb2 Android Studio 3.2.0 2018-10-10 18:26:20 +08:00
seven332 9aecb79b17 Calculate height of history item at runtime 2018-10-10 18:25:33 +08:00
seven332 bfc6bf07d9 Calculate height of download item at runtime 2018-10-10 15:51:39 +08:00
seven332 b671999e5a Calculate height of gallery list item at runtime 2018-10-10 13:13:20 +08:00
seven332 3ed2cb329c Remove the link of Google+ Community
Google+ is dying.
2018-10-09 15:20:05 +08:00
seven332 fe9970523f Avoid detecting current gallery 2018-09-23 16:00:30 +08:00
seven332 62944f7b71 Lint on release builds 2018-09-19 20:00:09 +08:00
seven332 a7e1101c87 Statement about about donation 2018-09-19 19:58:40 +08:00
seven332 b79d991b25 Set favoriteName null if isFavorited is false 2018-09-19 16:19:08 +08:00
seven332 10a15fc5cf fix: only update favoriteName after success 2018-09-19 15:50:37 +08:00
Tsukatsuki Kanade 428a5ab20e fix: change favoriteName b4 send request 2018-09-19 15:47:58 +08:00
Tsukatsuki Kanade b3d19d752b fix: update favoriteName after added favorite 2018-09-19 15:47:58 +08:00
Tsukatsuki Kanade 73b702aa56 feat: Add favorite gallery name to scene 2018-09-19 15:47:58 +08:00
hzy980512 3360035402 Fix choices of words 2018-09-18 10:19:26 +08:00
hzy980512 b97069a04e A little fix 2018-09-18 10:19:26 +08:00
hzy980512 9df8d050b2 Add some new translations 2018-09-18 10:19:26 +08:00
hzy980512 ba4ca96b77 Add some translations 2018-09-18 10:19:26 +08:00
hzy980512 fd93baf583 Add some new translations 2018-09-18 10:19:26 +08:00
hzy980512 0a9a1976cd Grammar fix 2018-09-18 10:19:26 +08:00
hzy980512 450e05c819 Make some sentences shorter 2018-09-18 10:19:26 +08:00
hzy980512 59d36d29da Fix some bugs, where quotes break the sentences 2018-09-18 10:19:26 +08:00
seven332 f0cd92f82e Check settings while try showing gallery page count 2018-09-17 11:34:32 +08:00
seven332 e847338ef4 Light background toolbar popup 2018-09-17 00:32:17 +08:00
seven332 23c34258ff Update strings.xml 2018-09-16 23:36:58 +08:00
seven332 d441960107 Update strings.xml 2018-09-16 23:35:53 +08:00
seven332 185ae6beb4 1.1.0 2018-09-16 22:18:06 +08:00
seven332 d84376e4dc Google style reorder icon 2018-09-16 22:12:26 +08:00
seven332 dcc6af3367 Update local favourites count 2018-09-14 19:48:48 +08:00
seven332 1cd8ef1b47 Back up gallery list moved from local favourites to cloud favourites 2018-09-14 19:35:02 +08:00
seven332 f8c5caf6bc Don't throw null exception 2018-09-14 19:15:39 +08:00
seven332 8e84b5b67b Update libraries 2018-09-14 13:33:32 +08:00
seven332 dc697af081 Show identity cookies 2018-09-14 13:32:03 +08:00
seven332 a69f36b652 Don't cache gif while reading
Update GLGallery
2018-09-02 14:53:33 +08:00
seven332 d5c788fe80 Add resetting reading progress 2018-09-02 01:25:43 +08:00
seven332 021fe45c8d Fix string format in zh-rTW translation 2018-09-01 20:56:43 +08:00
seven332 18881e549f Save gallery toke to saved filename 2018-08-15 21:54:35 +08:00
seven332 ed2f3510d8 Android Studio 3.1.4 2018-08-07 14:02:04 +08:00
seven332 5290340b97 Show gallery pages 2018-08-06 13:25:12 +08:00
hzy980512 9514d42032 Fix translations 2018-07-31 10:38:23 +08:00
hzy980512 2cc140eaf4 Translations fix 2018-07-31 10:38:23 +08:00
hzy980512 c4934fc89e Fix translations 2018-07-31 10:38:23 +08:00
seven332 7feb5552c1 Always print errors in EhEngine 2018-07-30 10:03:24 +08:00
seven332 fce659c41c Fix error_bad_status_code chinese string 2018-07-23 19:13:53 +08:00
seven332 2e899f5fa8 SSLException is network error 2018-07-20 14:03:43 +08:00
hzy980512 4580d781db Correct a typo 2018-07-18 12:14:16 +08:00
hzy980512 6fdab6f89c Fix a typo 2018-07-18 12:14:16 +08:00
hzy980512 145b6523e9 Fixed grammar 2018-07-18 12:14:16 +08:00
hzy980512 1d03d35685 Fix translation 2018-07-18 12:14:16 +08:00
hzy980512 71396bc632 Fix translation 2018-07-18 12:14:16 +08:00
hzy980512 511d70838a Fix more translations 2018-07-18 12:14:16 +08:00
hzy980512 1e31052767 Some fixes 2018-07-18 12:14:16 +08:00
hzy980512 e1c88c53f3 Some more corrections 2018-07-18 12:14:16 +08:00
hzy980512 de16081c79 Some corrections 2018-07-18 12:14:16 +08:00
hzy980512 e9d1ce1720 Some corrections 2018-07-18 12:14:16 +08:00
hzy980512 3bce3c41f2 Some corrections 2018-07-18 12:14:16 +08:00
hzy980512 c71729c560 Correcting sentences 2018-07-18 12:14:16 +08:00
seven332 3cbf5d0a8f Disable no media file checker at during startup 2018-07-16 13:56:07 +08:00
hzy980512 6f99f5a226 Fix translations 2018-07-12 16:48:34 +08:00
hzy980512 252dcb6175 Corrections 2018-07-12 16:48:34 +08:00
hzy980512 72971341b2 Corrections 2018-07-12 16:48:34 +08:00
hzy980512 32f4205240 Improved 2018-07-12 16:48:34 +08:00
hzy980512 36e66a8714 Grammar fix 2018-07-12 16:48:34 +08:00
hzy980512 7ee1777e7b More fixes of errors 2018-07-12 16:48:34 +08:00
hzy980512 d8dc9ad576 Fix of translation 2018-07-11 22:17:20 +08:00
hzy980512 8ae8842f81 A little fix of translation 2018-07-11 21:31:35 +08:00
hzy980512 ddb82292f9 Update strings.xml 2018-07-11 21:31:35 +08:00
hzy980512 83ade321bb A little fix 2018-07-11 21:31:35 +08:00
hzy980512 a4ea8a6bfc Add support for French and German translations 2018-07-11 21:31:35 +08:00
hzy980512 2d32852d18 Update Spanish translations (partly) 2018-07-11 21:31:35 +08:00
hzy980512 3ef3510ad3 Fix crash when there's an image in clipboard 2018-07-11 21:31:35 +08:00
hzy980512 82cb0eb7d6 Add strings for language switcher 2018-07-11 21:31:35 +08:00
hzy980512 2c428d3306 Add new languages to language switcher 2018-07-11 21:31:35 +08:00
hzy980512 5fa9e8677d Improve English translation 2018-07-11 21:31:35 +08:00
hzy980512 b57abfdc57 Add French and German translations 2018-07-11 21:31:35 +08:00
hzy980512 2f7906d3db Correct errors and update Japanese translation 2018-07-11 21:31:35 +08:00
seven332 d56f86b47e Show password toggle 2018-07-02 19:25:25 +08:00
seven332 e558be2b89 Disable clipboard check if the top scene is solid 2018-06-25 14:53:33 +08:00
seven332 66cab7b41e Close #417, click error text to refresh 2018-06-25 13:55:49 +08:00
seven332 4f431bb7ea Check ClipData null 2018-06-22 15:37:24 +08:00
seven332 d411623da6 Only save the hash code of the text in the clipboard 2018-06-21 13:42:53 +08:00
seven332 d121e839c9 Close #312, read gallery link from clipboard 2018-06-14 20:28:31 +08:00
seven332 c397bd0211 Close #276, save drawer view state 2018-06-13 15:18:48 +08:00
seven332 ec2782ddad Android Studio 3.1.3 2018-06-11 21:52:40 +08:00
scese250 6b6a60ae02 Updated spanish translation
Translated new options and updated some texts.

Thanks for keep working in this great app!!
2018-06-07 18:55:10 +08:00
seven332 f870674bd2 Use intent chooser when sharing 2018-06-05 21:03:59 +08:00
seven332 6af75a9758 1.0.30 2018-06-04 11:07:40 +08:00
seven332 e4fc925b04 Fix preview page estimation 2018-05-24 20:11:05 +08:00
seven332 2262779ba0 Close #396, fix preload pages calculation 2018-05-10 20:32:16 +08:00
lilymaniac b52cd2a619 Update Korean localization
Catch up to commit 8bad20e58c ("add option of disable auto update").
2018-05-02 22:03:06 +08:00
onlymash 8bad20e58c add option of disable auto update 2018-05-02 13:03:56 +08:00
seven332 30ca44b9c6 Android Studio 3.1.2 2018-04-28 22:47:30 +08:00
seven332 cf43ed965e Add Filter.hashCode() 2018-04-28 22:47:01 +08:00
onlymash dab29819bd make gradlew executable for linux 2018-04-28 22:29:50 +08:00
seven332 5fb090f241 No more mandatory check on igneous field 2018-04-20 09:15:59 +08:00
onlymash ff84c63445 update fav drawer 2018-04-10 22:13:37 +08:00
onlymash 140ace739e update support libs 2018-04-10 22:13:37 +08:00
onlymash 5f8c078367 rename recyclerview drawer layout 2018-04-10 22:13:37 +08:00
onlymash faddb37557 save favorites count 2018-04-10 22:13:37 +08:00
onlymash 5d8fe06d5c fix favories layout & count issue 2018-04-10 22:13:37 +08:00
seven332 2e34913c7d Android Studio 3.1.1 2018-04-10 22:10:10 +08:00
onlymash 6cc607469b update favorites list layout 2018-04-08 12:10:12 +08:00
onlymash 26eff55e6d update favorites right drawer layout 2018-04-08 12:10:12 +08:00
PYC 9a5743dd67 Correct the japanese sentence. 2018-04-02 12:02:32 +08:00
onlymash 0b547147b1 fix judgment issue 2018-04-02 11:56:56 +08:00
onlymash 6bd3bd5e80 fix judgment issue 2018-04-02 11:56:56 +08:00
onlymash af93a6730e update shortcut background 2018-03-29 19:30:58 +08:00
onlymash 27e4bd4e0b merge background color to color.xml 2018-03-29 19:30:58 +08:00
onlymash 459b27253a redraw shortcut icon 2018-03-29 19:30:58 +08:00
onlymash bb99570cd4 update shortcut foreground icon inset 2018-03-29 19:30:58 +08:00
onlymash 3f2b62c119 restore unifile 2018-03-29 19:30:58 +08:00
onlymash 91e9975a24 update shortcut 2018-03-29 19:30:58 +08:00
onlymash 00485efd0e update shortcut 2018-03-29 19:30:58 +08:00
onlymash c5d56243e0 update shortcut icon 2018-03-29 19:30:58 +08:00
onlymash b8c3229d9f add license to shortcut icon 2018-03-29 19:30:58 +08:00
onlymash 8cf935accc fix shortcuts 2018-03-29 19:30:58 +08:00
onlymash 2cf5589369 shortcuts: update icons 2018-03-29 19:30:58 +08:00
onlymash 89addaf211 update unifile 2018-03-29 19:30:58 +08:00
onlymash f5409c7b8a update shortcut 2018-03-29 19:30:58 +08:00
onlymash 733ddb5964 remove process 2018-03-29 19:30:58 +08:00
onlymash 537380eeb7 update shortcut categories 2018-03-29 19:30:58 +08:00
onlymash e44473f26b clean import 2018-03-29 19:30:58 +08:00
onlymash a503832016 update app shortcuts 2018-03-29 19:30:58 +08:00
onlymash 4935995342 update manifest 2018-03-29 19:30:58 +08:00
onlymash a367373c87 add shortcut icon for android 7.1 2018-03-29 19:30:58 +08:00
onlymash 62cd2e4809 add app shortcuts 2018-03-29 19:30:58 +08:00
seven332 7df7defa92 Save the images, which will be shared, to temp dir 2018-03-28 09:35:17 +08:00
seven332 56b42c67d5 Fix gallery favorite block 2018-03-27 18:06:05 +08:00
seven332 d1afcc2f54 Fix the parsing, language to Local 2018-03-27 17:09:09 +08:00
seven332 f6b05ed42b Fix strings 2018-03-27 16:51:01 +08:00
seven332 095334d338 Recreate all activities after changing app language 2018-03-27 14:01:05 +08:00
seven332 dac0ef178d Add RecordingApplication 2018-03-27 13:59:35 +08:00
seven332 c23a502e9e Add app language option 2018-03-27 13:40:58 +08:00
seven332 5ddd652076 Ignore past error while reading 2018-03-27 10:53:45 +08:00
seven332 3f9e3f620d Android Studio 3.1.0 2018-03-27 10:29:50 +08:00
seven332 1c62fe9615 1.0.29 2018-03-26 22:46:55 +08:00
seven332 8703102c97 Update UniFile 2018-03-26 22:45:45 +08:00
onlymash 28ab591769 update showPageDialog 2018-03-26 20:42:12 +08:00
onlymash 8cc2bfbced dynamically add dialog items 2018-03-26 20:42:12 +08:00
onlymash 7612dde6d4 clean string.xml 2018-03-26 20:42:12 +08:00
onlymash 5188fe7170 only show 'Save to...' at KiKat or higher 2018-03-26 20:42:12 +08:00
onlymash c31048e829 clean import 2018-03-26 20:42:12 +08:00
onlymash 44629bb405 support image custom save 2018-03-26 20:42:12 +08:00
seven332 3e387b1833 1.0.28 2018-03-26 18:24:03 +08:00
seven332 080693656a Update adaptive icon 2018-03-26 17:56:25 +08:00
seven332 bc5479fa96 Add built-in hosts 2018-03-26 12:02:44 +08:00
seven332 b95892d3b6 Use "Custom hosts.txt" to distinguish "built-in" and "custom" 2018-03-26 11:07:13 +08:00
seven332 e1eea40fd7 Use "hosts.txt" instead of "Hosts"
Users might be more familiar with the former
2018-03-26 10:16:51 +08:00
seven332 c00fb901a0 Close #363, select download pipe if download dir exists 2018-03-25 20:23:16 +08:00
seven332 029bca22ed Add hosts UI 2018-03-24 02:17:58 +08:00
seven332 facb931cb6 Use Java 8 language features 2018-03-24 01:16:32 +08:00
onlymash 2f319afd40 restore app_name 2018-03-23 21:24:08 +08:00
onlymash 95114502c9 add strings.xml to debug 2018-03-23 21:24:08 +08:00
onlymash 2eef9b8fb0 rename FILE_PROVIDER_AUTHORITY 2018-03-23 21:24:08 +08:00
onlymash 6180ea3302 remove productFlavors 2018-03-23 21:24:08 +08:00
onlymash bf3ebc5ff8 remove unused applicationId 2018-03-23 21:24:08 +08:00
onlymash 5f77728a7b use another package name for debug 2018-03-23 21:24:08 +08:00
seven332 e823834889 Fix UConfigActivity registered name 2018-03-23 12:48:06 +08:00
seven332 35c97a7772 Add Hosts 2018-03-23 12:10:03 +08:00
seven332 d59a520aa5 Fix test 2018-03-23 12:09:15 +08:00
seven332 6bcdbfeaa4 Use field mLocation instead of local variable location 2018-03-21 19:41:12 +08:00
bfkro dcb11102f6 use ViewUtils to calculate offset between SeekBar and SeekBarPanel 2018-03-21 19:25:12 +08:00
bfkro a0e957b1fd Fix a bug so when user clicks the SeekBarPanel, the x coordinate with the correct x-offset is sent to SeekBar. 2018-03-21 19:25:12 +08:00
onlymash c8c0a3aae0 update foreground 2018-03-20 23:10:52 +08:00
onlymash aed7acfdc8 update foreground 2018-03-20 23:10:52 +08:00
onlymash 6707f0ee35 update launcher backgound 2018-03-20 23:10:52 +08:00
onlymash 44694f351e add adaptive icons for android 8.0+ 2018-03-20 23:10:52 +08:00
onlymash 8e3585b32d use implementation for gradle 3.0+ 2018-03-20 15:18:47 +08:00
onlymash 25312953af add notification channel for Oreo 2018-03-19 22:44:23 +08:00
seven332 c8a32ba76e Update ISSUE_TEMPLATE.md
能说中文就别说英文了
2018-03-19 18:15:10 +08:00
lilymaniac a97a6682fb Add Korean localization 2018-03-19 09:28:03 +08:00
lilymaniac ed8151632e Add Korean to resConfigs entry 2018-03-19 09:28:03 +08:00
seven332 aca061ecf6 Ignore release dir 2018-03-08 20:42:32 +08:00
seven332 b2bef7a4b0 Update okhttp 2018-03-08 20:35:02 +08:00
seven332 db63a8f05b Print exception in ExceptionUtils.getReadableString()
I don't want to track all callings, just add it here
2018-03-08 19:33:44 +08:00
seven332 998f57f435 Fix gallery comment parsing 2018-03-05 10:09:47 +08:00
seven332 46c9197cce Update sdk version and libraries 2018-03-04 15:59:32 +08:00
seven332 3f3c0c6c6a Show sign in failure reason 2018-03-03 23:52:54 +08:00
seven332 ff34acfe59 Update values-zh-rTW/strings.xml 2018-03-02 09:03:42 +08:00
seven332 b969177244 Update values-zh-rHK/strings.xml 2018-02-28 17:03:00 +08:00
seven332 32efad2b33 1.0.27 2018-02-28 10:08:03 +08:00
trhjew bad4cdac1a Update strings.xml 2018-02-27 22:35:27 +08:00
seven332 5cebca42e9 Add Japanese support 2018-02-27 22:20:08 +08:00
trhjew 3ef2447eef Update strings.xml 2018-02-27 22:06:34 +08:00
trhjew a8faa2930a Update strings.xml 2018-02-27 22:06:34 +08:00
trhjew 02abba52a7 Create strings.xml 2018-02-27 22:06:34 +08:00
seven332 6da2bc352d Update gradle 2018-02-25 20:27:40 +08:00
seven332 cc39e0dda3 Show post gallery comment error 2018-02-25 20:26:34 +08:00
seven332 c81145d46e Close #341, update gallery comment post format 2018-02-24 19:03:09 +08:00
0w0@0w0.pw a56c79d4bb Remove some translations
Rename Privacy settings
2018-02-11 13:20:18 +08:00
0w0@0w0.pw fa3f409a70 Clean up the import 2018-02-11 13:20:18 +08:00
0w0@0w0.pw 1865924469 Clean Code 2018-02-11 13:20:18 +08:00
0w0@0w0.pw b3a23ad4e8 Add Privacy and Security Settings 2018-02-11 13:20:18 +08:00
seven332 7a02103e05 Close #328, fix Chinese language detection
Add 中国翻訳
2018-02-10 21:50:22 +08:00
seven332 95ed0eb7ea 1.0.26 2018-02-10 16:02:41 +08:00
seven332 9ec74934bc Always show the help route in error message 2018-02-10 15:56:21 +08:00
seven332 4f868a4556 Add uconfig saving tip 2018-02-10 14:51:18 +08:00
seven332 21bff4dff7 Merge branch 'master' of https://github.com/seven332/EhViewer 2018-02-10 14:03:03 +08:00
seven332 30819fc7c6 Add UConfigActivity 2018-02-10 14:02:20 +08:00
scese250 ce70859fb2 Fixed orthography and translation (Spanish)
Some words weren't translated and there were several orthographic errors.
2018-02-06 00:06:35 +08:00
seven332 197a34721b Closes #320, fix strings.xml 2018-01-29 20:04:40 +08:00
seven332 3a21724342 Add an option to disable page interval 2018-01-25 22:33:43 +08:00
seven332 ffceda72b1 Merge branch 'master' of https://github.com/seven332/EhViewer 2018-01-25 21:42:26 +08:00
seven332 bb655783b8 Update GLView-Image library to fix invalid gif autoplay 2018-01-25 21:38:06 +08:00
seven332 d5cd23c130 Update Image library to avoid gif super short delay 2018-01-25 18:42:29 +08:00
seven332 70bb0d06b2 Update ISSUE_TEMPLATE.md 2018-01-25 11:19:59 +08:00
GUIHU 18f1ec7403 Update strings.xml 2018-01-13 22:05:36 +08:00
gui 20c0030cdc polish 2018-01-13 22:05:36 +08:00
gui 7509bf9776 polish 2018-01-13 22:05:36 +08:00
gui fb7b9b28a7 針對台灣使用者慣用語(或已有既有用法)的文字字串進行調整
以迎合台灣使用者使用習慣
localization for values-zh-rTW  in order to fit Taiwanese user's habit
2018-01-13 22:05:36 +08:00
seven332 185ab00431 1.0.25 2017-12-28 22:00:51 +08:00
LackOfDream b48b38e8c4 remove redundant trailing whitespace of tags when parsing gallery detail 2017-12-24 18:12:44 +08:00
LackOfDream 34632342fc Notify change of single item instead of the whole data set, disable item animation 2017-12-19 15:46:42 +08:00
LackOfDream c7bf9509e3 Add enable/disable feature on Filter 2017-12-19 15:46:42 +08:00
seven332 877c354f84 Add the Telegram link 2017-11-14 21:42:58 +08:00
seven332 6c7b33e86f Add community links 2017-11-14 21:35:02 +08:00
seven332 2c3fa31e91 Add recaptcha 2017-09-06 16:49:48 +08:00
scese250 550d3735c7 Fixed typos, incorrect capital and added accents
Thanks for add spanish translation, I'll help for correct errors.
2017-07-24 12:48:05 +08:00
Jabasukuriputo Wang 71f654635c Add textbox for cookie:igneous.
Fix #208 #274
It seems that login via other ways is impossible to get correct igneous atm.
(DAMN, SAVE IT ELSEWHERE NOW)
2017-07-14 21:08:12 +08:00
seven332 e9c7695367 1.0.24 2017-06-04 23:03:28 +08:00
seven332 b2e34e622c Set default request id to invalid one 2017-06-04 23:02:13 +08:00
seven332 78db7ecbc5 1.0.23 2017-06-01 22:31:41 +08:00
seven332 4896a1edbc Use HashMap instead of WeakHashMap for GlobalStuffMap 2017-06-01 22:30:02 +08:00
seven332 61b2075302 Add e-hentai.org to intent-filter
Close #249
2017-05-25 01:04:35 +08:00
seven332 b21fe89ea1 1.0.22 2017-05-23 16:35:42 +08:00
seven332 4af054a9cd Update gradle tools 2017-05-23 16:35:19 +08:00
seven332 3f579060b5 Fix GalleryDetailParser parsing gallery cover 2017-05-23 16:31:26 +08:00
seven332 1e87279310 Avoid saving large data in ContentLayout 2017-05-23 16:21:05 +08:00
seven332 5fae1df78c Update libraries 2017-04-22 20:48:26 +08:00
seven332 84949442ee Add ISSUE_TEMPLATE English translate 2017-04-07 19:48:21 +08:00
seven332 3b395380c7 Merge remote-tracking branch 'origin/master' 2017-04-05 20:26:00 +08:00
seven332 3e3de0ff2a Update gradle library 2017-04-05 20:24:45 +08:00
seven332 da802c5371 Update ISSUE_TEMPLATE 2017-04-05 20:23:20 +08:00
seven332 24405f7c44 Merge pull request #251 from danthe100/mycommits
Fixed Spanish translation
2017-03-30 22:09:41 -05:00
Dante Garcia 9ed826a87e Fixed certain errors 2017-03-30 12:01:03 -05:00
seven332 9c5c9dfa95 Add ISSUE_TEMPLATE 2017-03-27 23:26:21 +08:00
seven332 6eb29c783a 1.0.21 2017-03-20 22:36:05 +08:00
seven332 cb11ecc9f0 Fix category parsing 2017-03-20 22:34:05 +08:00
seven332 bf5feaacd1 Merge pull request #242 from sorz/master
Add fingerprint unlock
2017-03-18 01:41:53 -05:00
seven332 0ef4088b88 Update gradle 2017-03-17 23:12:11 +08:00
sorz 1e87d34806 Add translations for fingerprint setting
Spanish by Google Translate
2017-03-16 01:52:54 +11:00
sorz 0b35fb01ee Add fingerprint on SecurityScene 2017-03-16 01:11:19 +11:00
sorz 7f1d590fbd Add fingerprint protection switch 2017-03-15 22:38:47 +11:00
seven332 97ce2bbe54 Apply Spanish strings.xml to all countries 2017-02-23 16:54:06 +08:00
seven332 d8a6424ecc Merge pull request #235 from danthe100/mycommits
Added translation into Spanish
2017-02-23 13:10:04 +08:00
Dante Garcia fdc199cc49 Added translation into Spanish 2017-02-22 20:18:17 -05:00
seven332 a02fe88765 1.0.20 2017-02-09 21:45:24 +08:00
seven332 6488de75f1 Adjust gallery detail actions order 2017-02-09 21:40:24 +08:00
seven332 439f199a10 Sanitize torrent filename 2017-02-09 21:36:44 +08:00
seven332 e535b2fa09 Fix TorrentParser 2017-02-09 21:30:07 +08:00
seven332 81ae752975 Fix Chinese translations 2017-02-09 21:24:28 +08:00
seven332 5dd584776a Fix Chinese translations 2017-02-09 21:19:36 +08:00
seven332 f617e62b85 Add android-chinese-string 2017-02-09 21:09:58 +08:00
Lin, Yi-Li 4d95a7163f use snackbar to tell users that H@H client is required for this feature 2017-01-29 17:27:56 +09:00
Lin, Yi-Li b5cae76de5 able to request archive download 2017-01-29 02:00:02 +09:00
seven332 9065e7457a 1.0.19 2017-01-26 13:30:48 +08:00
seven332 08ab9159a5 Fix RecyclerView crashing 2017-01-26 11:39:56 +08:00
seven332 6b5b961986 1.0.18 2017-01-25 13:22:09 +08:00
seven332 6a96035149 Avoid RecyclerView scrolling after detached 2017-01-25 13:19:23 +08:00
seven332 1ce035591a Fix GalleryPageParser 2017-01-25 00:13:55 +08:00
seven332 6cc78802ee 1.0.17 2017-01-24 19:41:23 +08:00
seven332 636c011c23 Rename XXX_G to XXX_E 2017-01-24 19:39:05 +08:00
seven332 92490ca1a6 e-hentai switched to HTTPS 2017-01-24 19:34:24 +08:00
seven332 b6a5d237ac Add EhUrl.getFixedPreviewThumbUrl() 2017-01-24 19:22:58 +08:00
seven332 8be0b5c588 Don't use jack anymore 2016-12-31 19:29:33 +08:00
seven332 fcbe129b6e Fix URL_PREFIX_THUMB_EX 2016-12-30 12:10:59 +08:00
seven332 befbcd6720 Add fix thumb url 2016-12-29 21:50:26 +08:00
seven332 ee5062d4c7 Add round icon 2016-12-19 00:38:26 +08:00
seven332 a4392523d6 1.0.16 2016-12-15 02:06:46 +08:00
seven332 b3371304bf Sync media store after saving image 2016-12-15 02:05:23 +08:00
seven332 38911c2d34 Be compatible with some bad share mechanism
Some apps need file path to share it, but it's not necessary at all.
2016-12-15 01:59:49 +08:00
seven332 6c5ad068d2 Update gradle tools and libraries 2016-12-15 01:30:32 +08:00
seven332 868521f19f Try to get image reload key more than once 2016-12-15 01:13:58 +08:00
seven332 c4cd965306 Add excluding japanese original
Eh site doesn't support it, but just modifying the cookie works fine.
2016-12-03 19:38:49 +08:00
seven332 639adaf7fa Close #201, list local favorites by favorited time 2016-10-29 00:05:18 +08:00
seven332 e174ee0b2c Ensure dao gen called 2016-10-22 00:42:41 +08:00
seven332 04da83f950 Set targetSdkVersion to 25 2016-10-22 00:16:06 +08:00
seven332 84a35e9283 1.0.15 2016-10-18 00:10:10 +08:00
seven332 a907db43be Update libraries 2016-10-18 00:06:09 +08:00
seven332 890be41aa5 Update gradle tool 2016-08-13 18:49:57 +08:00
seven332 f3db305cee Add https in intent-filter 2016-08-13 18:48:57 +08:00
seven332 4626ab1ec4 Update image search url 2016-07-31 19:27:59 +08:00
seven332 a44b070120 1.0.14 2016-07-28 14:28:23 +08:00
seven332 1760fb65e2 Use LinearLayout instead of android.support.v7.widget.ButtonBarLayout 2016-07-28 14:25:01 +08:00
seven332 47d28beddd 1.0.13 2016-07-28 00:17:39 +08:00
seven332 8d39829e54 Update libraries 2016-07-28 00:17:06 +08:00
seven332 2cb8319c91 Check download image size 2016-07-27 23:34:09 +08:00
seven332 27ca88f0c2 Use https for ex and forums 2016-07-27 23:32:31 +08:00
seven332 9aa033c31b Add https support for url parser 2016-07-27 23:27:27 +08:00
seven332 1f1d968766 Make error message different 2016-07-27 23:24:53 +08:00
seven332 3b8ba148dc Save temp share image to internal folder 2016-06-20 23:27:03 +08:00
seven332 5448bdf7bb Use FileProvider to share image
For apps targeting Android N, file:// URIs outside app is not supported any more.
2016-06-18 22:08:29 +08:00
seven332 e7cfd8831e Set targetSdkVersion to 24, upgrade libraries 2016-06-18 21:04:26 +08:00
seven332 148588e53a Show version name in about 2016-06-10 20:37:27 +08:00
seven332 cacfd58330 1.0.12 2016-06-09 21:14:23 +08:00
seven332 97cf075ffb Upgrade libraries 2016-06-09 21:10:21 +08:00
seven332 d93ce846e2 Remove item from decode queue when cancel request 2016-06-08 21:20:53 +08:00
seven332 7e45e379b3 Fix fragment class check 2016-06-08 20:43:21 +08:00
seven332 f3c90d46fd Remove AssertUtils 2016-06-08 20:31:47 +08:00
seven332 c80445e43a Upgrade libraries 2016-06-08 19:33:21 +08:00
seven332 4faa031ae1 Upgrade gradle tool 2016-06-07 17:55:58 +08:00
seven332 17bdb7cb93 Use Queue for decode list 2016-06-07 17:55:10 +08:00
seven332 d17f98f3e4 Upgrade GLGallery to 0.1.2 2016-06-03 01:31:34 +08:00
seven332 52bc260998 Start gallery provider before get start page 2016-06-01 18:58:44 +08:00
seven332 ebaba88cde Add GLGallery library 2016-05-31 00:01:05 +08:00
seven332 94c50b27bf Check existence of views in onAnimationEnd 2016-05-30 00:28:32 +08:00
seven332 b2cf4d1fb0 Check existence of index when clear pToken 2016-05-30 00:25:20 +08:00
seven332 b52f260c9e Avoid restore download null 2016-05-30 00:20:04 +08:00
seven332 b4fc856a51 Fix SpiderInfo read 2016-05-30 00:18:20 +08:00
seven332 e1b07b715f Add GLView library 2016-05-29 15:52:33 +08:00
seven332 1e434c09e6 Use webp image resources 2016-05-28 22:13:53 +08:00
seven332 7fb4ae682a Add compileOptions.incremental 2016-05-25 20:14:38 +08:00
seven332 f2f7821b55 Don't use TransitionDrawable when LoadImageView is not showing 2016-05-25 13:59:00 +08:00
seven332 02b5f6289e Run executeDaoGenerator after copyNotice 2016-05-24 01:30:12 +08:00
seven332 9293e92a99 Upgrade build tool and image library 2016-05-24 00:53:34 +08:00
seven332 ccd98ff36e Block new intent when SolidScene is shown 2016-05-19 16:16:48 +08:00
seven332 6c5cbd9f2f Fix for java6 2016-05-19 15:18:10 +08:00
seven332 4a7edf648b 1.0.11 2016-05-14 13:56:15 +08:00
seven332 cfc9411223 Clean up 2016-05-14 13:23:59 +08:00
seven332 05030e9bb6 Save separated memory information in crash file
app memory, app native memory, app max memory, system total memory
2016-05-14 12:54:38 +08:00
seven332 ab3fc7d842 Avoid create dir when loading thumb in download list 2016-05-14 12:45:02 +08:00
seven332 fb216a960b Lock drawer when suggestion list showing 2016-05-13 13:43:37 +08:00
seven332 c0fbdee61f Copy email address when click donate item 2016-05-13 02:12:10 +08:00
seven332 901c0ae3ec Disable zero rating to gallery 2016-05-12 14:53:46 +08:00
seven332 f727554afd Update libraries 2016-05-12 14:32:09 +08:00
seven332 b0a5666a6d Fix gallery restore
SpiderInfo has changed, but restore code was the old version
2016-05-12 01:22:31 +08:00
seven332 1edf98c9e1 1.0.10 2016-05-11 18:22:28 +08:00
seven332 32ed409a28 Update strings.xml 2016-05-10 17:09:46 +08:00
seven332 cac950fa40 Get ThumbDataContainer file in non-UI thread 2016-05-10 14:05:37 +08:00
seven332 3a03e9aad1 Change fab color
Primary fab is colorPrimary, secondary fab is colorAccent
2016-05-10 13:40:39 +08:00
seven332 971aa86c4e Set SpiderQueen.mMode to local 2016-05-10 02:10:23 +08:00
seven332 bbb5f89a66 Avoid mSpiderInfo null
Use AtomicReference for mSpiderInfo
2016-05-10 02:09:06 +08:00
seven332 f777b694d5 Add memory usage to crash file 2016-05-10 00:56:58 +08:00
seven332 d59fa1756e Use OSUtils 2016-05-10 00:46:00 +08:00
seven332 5ac9ad4d71 Upgrade yorozuya to 0.1.1 2016-05-10 00:40:51 +08:00
seven332 adb3860107 Upgrade libraries 2016-05-09 22:41:54 +08:00
seven332 81876955c6 Upgrade Yorozuya-Thread library to 0.1.1 2016-05-09 21:48:21 +08:00
seven332 b8189d76d6 Decode image partly 2016-05-09 18:47:03 +08:00
seven332 0a472d28b5 Add multi-thread support for image decoding 2016-05-09 00:40:25 +08:00
seven332 9a0ba6f676 Ensure notifyGetImageXXX called after pipe released 2016-05-08 15:52:47 +08:00
seven332 e22010f2b0 Update state at once when force request 2016-05-07 18:49:36 +08:00
seven332 5a2fe3fe19 Update beerbelly to 0.1.3 2016-05-07 18:48:44 +08:00
seven332 c9bbbca311 Set decoder thread priority to default
The priority of a decode thread was THREAD_PRIORITY_BACKGROUND. It may cause a long time waiting before image decoded.
2016-05-07 16:46:01 +08:00
seven332 83d66f9c56 Fix ptoken failed error
When get last page of gallery, the page preview count is not preview count pre page. So old version spider info file may store wrong preview count pre page. Spider info file version is added in the first line.
2016-05-07 15:51:47 +08:00
seven332 1feca40a5c Use System.nanoTime() to calculate frame delay compensation
Use System.nanoTime() instead of SystemClock.elapsedRealtime()
2016-05-07 14:17:10 +08:00
seven332 1bc07a89b8 Prepare for library upgrade 2016-05-07 14:09:03 +08:00
seven332 6c0ad0e329 Upgrade image library to 0.1.6 2016-05-07 14:03:20 +08:00
seven332 21151a5031 Fix FabLayout onClick
mExpanded blocked onClickPrimaryFab and onClickSecondaryFab before. But it should only block onClickSecondaryFab
2016-05-07 14:02:37 +08:00
seven332 74e10178be Fix default rating text 2016-05-05 22:56:43 +08:00
seven332 e289e83983 Update string.xml
Change unfavorited to not favorited
2016-05-05 01:06:33 +08:00
seven332 d07dc49dc7 Add cellular network warning 2016-05-05 01:05:00 +08:00
seven332 981598dc70 Fix some cookies missing in request 2016-05-04 23:50:29 +08:00
seven332 f82c576970 Update pd_big_weird_face 2016-05-04 21:18:24 +08:00
seven332 a0f1e97332 Upgrade image library to 0.1.5 2016-05-04 15:51:00 +08:00
seven332 2dca63b342 Avoid call fab on click listener when not expanded 2016-05-03 21:35:23 +08:00
seven332 9590c758fd 1.0.9 2016-05-03 02:50:51 +08:00
seven332 74bbbabdd4 Add debug print Image count 2016-05-03 02:46:24 +08:00
seven332 363ad7686e Use ImageMovableTextTexture instead of MovableTextTexture
NativeTexture can avoid bad buffer
2016-05-03 02:34:23 +08:00
seven332 ad9f544fe1 Add GLView.onPause and GLView.onResume 2016-05-03 00:52:03 +08:00
seven332 4c3c84f1a6 Clean up 2016-05-02 23:17:29 +08:00
seven332 512fef80db Bump TuXiang library version to 0.1.1 2016-05-02 22:50:36 +08:00
seven332 fad9e3ccc0 1.0.8 2016-05-02 19:38:21 +08:00
seven332 5aa56e0237 Add detail size options
Large for 480dp width
Small for 320dp width
2016-05-02 19:36:41 +08:00
seven332 d4d4ba8c75 Use TuXiang library
Make GLRootView extends com.hippo.tuxiang.GLSurfaceView
2016-05-02 18:56:56 +08:00
seven332 2a324c4d89 Call GLRootView onPause and onResume 2016-05-02 13:20:35 +08:00
seven332 e6638b6f56 Remove ANRWatchDog 2016-05-01 23:20:00 +08:00
seven332 5d956b43fb 1.0.7 2016-05-01 17:11:17 +08:00
seven332 9e19b16735 Close #142, save thumb to download dir 2016-05-01 17:08:03 +08:00
seven332 af8cc34048 Bump image library version 2016-05-01 15:53:18 +08:00
seven332 430e748490 Remove TODO list 2016-05-01 15:23:46 +08:00
seven332 297c35b14d Use custom GLSurfaceView
Ensure GLRootView's mContentView.detachFromRoot() called in render thread
2016-05-01 15:21:26 +08:00
seven332 b973e0244e Add gallery image cache 2016-05-01 13:26:13 +08:00
seven332 f672fe1e96 Remove 'git submodule update --init' in build instruction 2016-04-30 19:09:22 +08:00
seven332 e3113083bc Use jitpack libraries 2016-04-30 19:03:59 +08:00
seven332 d186a6ac3b Run copyNotice task automatically 2016-04-28 02:07:17 +08:00
seven332 10693c5ffc Use jack and jill 2016-04-27 22:07:42 +08:00
seven332 9b54fd09c9 Bump gradle tool version 2016-04-27 22:06:30 +08:00
seven332 7f4dc1f131 Fix regex for jack 2016-04-27 21:58:56 +08:00
seven332 5638832c05 Use image library 2016-04-27 21:15:01 +08:00
seven332 a7e8b96b4c Change gallery_list_column_width to 480dp 2016-04-26 18:04:39 +08:00
seven332 a8df181ff8 Add TODO list 2016-04-26 18:03:45 +08:00
seven332 58acaa7287 Add html-format NOTICE 2016-04-25 17:03:35 +08:00
seven332 b00ed5a360 Bump libraries version 2016-04-25 17:02:05 +08:00
seven332 42eeb4f44c Bump libraries and gradle tool version 2016-04-25 00:10:11 +08:00
seven332 2ccb5d92c9 Bump gradle tool version 2016-04-21 16:41:38 +08:00
seven332 e12a35cb52 Remove DumpBrowsableActivity to fix default app error 2016-04-21 16:41:05 +08:00
seven332 fbeaf3d5ea Add anr watch dog 2016-04-14 19:10:38 +08:00
seven332 b4d8168457 Bump gradle tool version 2016-04-14 14:50:23 +08:00
seven332 9561fcf662 requestLayout when set different-size ImageTexture in ImageView 2016-04-14 02:40:25 +08:00
seven332 453a56aa23 Use hotspot and ripple library 2016-04-14 00:58:38 +08:00
seven332 df108f9678 Adjust build instruction for Linux 2016-04-13 14:04:26 +08:00
seven332 a835ca9547 Remove some @TargetApi 2016-04-13 01:54:45 +08:00
seven332 3f4cc46bc1 Do not show animation for image has no valid rect 2016-04-12 01:09:13 +08:00
seven332 27bc38ae8b Fix gif delay calculation 2016-04-12 00:55:36 +08:00
seven332 fd1aca48d6 Update UniFile library 2016-04-12 00:22:44 +08:00
seven332 adbb1f11a5 Use SystemClock.currentThreadTimeMillis to calculate gif delay 2016-04-12 00:21:58 +08:00
seven332 4b8e46d220 Use drawerLayout library 2016-04-11 15:36:00 +08:00
seven332 1c45c4b042 Add thumb resolution option 2016-04-11 14:28:01 +08:00
seven332 d33e3c27fc Rename image_size to image_resolution 2016-04-11 13:59:35 +08:00
seven332 189a95e49c Use RefreshLayout from jitpack 2016-04-11 00:05:17 +08:00
seven332 4e3717fa69 Avoid write null in SpiderInfo 2016-04-10 15:58:41 +08:00
seven332 97d51b1fc3 Start home page when can't recognize the intent 2016-04-10 15:41:17 +08:00
seven332 ba5a554ca8 Use unifile library for jitpack 2016-04-10 15:22:48 +08:00
seven332 b4095449c1 Fix mDownloadingDelay NullPointerException 2016-04-09 22:36:20 +08:00
seven332 05f9ce59f3 Update giflib to 5.1.4 2016-04-09 21:42:50 +08:00
seven332 793dca3674 Set APP_PLATFORM to android-15 2016-04-09 21:42:23 +08:00
seven332 e10172c09c Hide ime in go to dialog 2016-04-09 20:41:52 +08:00
seven332 2d65b71fff Rename ActivityHelper to AppHelper 2016-04-09 20:35:57 +08:00
seven332 7693275967 Use card for gallery thumb 2016-04-09 18:40:31 +08:00
seven332 9d4eadffac Add up react to SnackBar 2016-04-09 16:52:27 +08:00
seven332 1bf826a923 Clean up 2016-04-09 13:44:12 +08:00
seven332 4866e963de 1.0.6 2016-04-09 02:01:02 +08:00
seven332 2b15c8f620 Use clipRect instead of clipPath in SearchBar 2016-04-09 01:54:47 +08:00
seven332 d9265610c3 Check pages in read SpiderInfo 2016-04-08 22:44:09 +08:00
seven332 81dce7d297 Remove customtabs, set minSdkVersion to 14 2016-04-08 22:40:36 +08:00
seven332 078d086362 1.0.5 2016-04-08 22:09:15 +08:00
seven332 492d483467 Request again if image missing in cache 2016-04-08 21:19:57 +08:00
seven332 d9c1b81eb3 Add support zip file support for GalleryActivity 2016-04-08 20:46:07 +08:00
seven332 a2a9dbcb02 Add media scan config 2016-04-08 20:28:05 +08:00
seven332 97c28c04c5 Fix typo 2016-04-08 19:53:08 +08:00
seven332 f4d8cbf3a4 Add back icon callback in SetSecurityActivity 2016-04-08 19:49:58 +08:00
seven332 4291493256 Fix status bar background color above NavigationView 2016-04-08 19:33:13 +08:00
seven332 ce6cb19e73 Rename SlidingDrawerLayout to DrawerLayout 2016-04-08 18:59:36 +08:00
seven332 574d09302e Bump libraries version 2016-04-08 16:36:41 +08:00
seven332 f37b479400 Adjust table layout 2016-04-08 15:30:11 +08:00
seven332 87c27b6256 Avoid showing download path warning for the first time 2016-04-08 02:02:09 +08:00
seven332 b3881f8562 Adjust layout for table 2016-04-07 20:45:20 +08:00
seven332 3f8e872d55 Apply new MarginItemDecoration 2016-04-07 19:33:09 +08:00
seven332 7e62673e5a Improve SpiderQueen 2016-04-07 02:23:52 +08:00
seven332 69be0c48fb Put save parse error to AppConfig 2016-04-07 02:23:10 +08:00
seven332 9d783fa86d Use GetText in ExceptionUtils 2016-04-07 02:22:06 +08:00
seven332 28b81a0db0 Fix parse gallery page error in e-hentai 2016-04-07 02:16:13 +08:00
seven332 3ac1964069 Adjust download thumb guide 2016-04-07 00:53:35 +08:00
seven332 a2241e62a3 Fix SwipeProgressBar finish animation 2016-04-07 00:33:50 +08:00
seven332 100a3d872e Set minSdkVersion to 15 2016-04-06 18:24:33 +08:00
seven332 413a17acf1 Update icon 2016-04-06 18:05:49 +08:00
seven332 79bc2bcd22 Apply thumb size settings to preview size 2016-04-06 14:53:33 +08:00
seven332 c6e45cc080 Update EasyRecyclerView 2016-04-06 01:53:05 +08:00
seven332 7a215acd18 Add progress in GalleryActivity 2016-04-05 20:38:26 +08:00
seven332 3ca6b69984 Add image size option 2016-04-05 02:07:08 +08:00
seven332 084f352d71 Add favorites sort, image size, gallery title, popular for EhConfig 2016-04-05 00:47:11 +08:00
seven332 f4a16b3edd Only show error when no cookie saved 2016-04-04 22:20:58 +08:00
seven332 e8d8ee8501 1.0.4 2016-04-04 21:08:53 +08:00
seven332 9a87701ad6 Fix memory leak which due to GalleryView.onDetachFromRootInternal not called 2016-04-04 15:20:26 +08:00
seven332 cdc8a7aea6 Adjust GLView attachToRoot detachFromRoot 2016-04-04 15:12:33 +08:00
seven332 90bfd445d1 Do not show warning after get profile error 2016-04-04 13:24:20 +08:00
seven332 7493bd57f4 Fix not showing click-thumb-detail guide 2016-04-04 13:15:52 +08:00
seven332 629c2bb80d Fix add to favorites failed 2016-04-03 23:59:17 +08:00
seven332 4d45d717e2 1.0.3 2016-04-03 20:18:38 +08:00
seven332 b8e80c6c8c Make identity live long 2016-04-03 20:15:58 +08:00
seven332 efed7776d3 Remove cancel button in sign in failed dialog 2016-04-03 19:24:57 +08:00
seven332 56cfc0669b Add set read cache max size 2016-04-03 19:19:20 +08:00
seven332 6d9ed41382 Don't scroll vertically unloaded page when scaling for ScrollLayoutManager 2016-04-03 18:20:46 +08:00
seven332 505efbdef6 Avoid unnecessary invalidate in GalleryView 2016-04-03 17:18:41 +08:00
seven332 52ab8cebb0 Improve ScrollLayoutManager 2016-04-03 17:12:13 +08:00
seven332 e8251ee521 Improve PageLayoutManager scale 2016-04-03 02:37:28 +08:00
seven332 d4195c6e5b Add scale for ScrollLayoutManager 2016-04-03 02:36:51 +08:00
seven332 f50975d767 Adjust search bar size 2016-04-02 23:11:56 +08:00
seven332 4d9452c791 Add thumb size option 2016-04-02 21:12:17 +08:00
seven332 474eea094d Add remove download redundancy 2016-04-02 19:14:42 +08:00
seven332 bbb6b634ff Remove unused resources 2016-04-02 16:59:32 +08:00
seven332 d5da97141f Remove unsupported language 2016-04-02 16:59:03 +08:00
seven332 a12f9ba595 Add fullscreen option 2016-04-02 16:36:37 +08:00
seven332 75944e5a8b Improve EhGalleryProvider 2016-04-02 16:03:49 +08:00
seven332 1aa51a5934 Bump gradle version 2016-04-02 15:49:35 +08:00
seven332 092fd6779c Bump build tools version 2016-04-02 15:42:14 +08:00
seven332 618dc2b180 Adjust SlidingDrawerLayout min margin 2016-04-02 14:05:21 +08:00
seven332 44a84f2bc2 1.0.2 2016-04-02 00:06:20 +08:00
seven332 5fb3b61669 Add screen lightness 2016-04-01 23:18:37 +08:00
seven332 57a9865d99 Add rotation effect for showing fab 2016-04-01 20:08:07 +08:00
seven332 250e1256b9 Add insert helper for SlidingDrawerLayout 2016-04-01 19:18:00 +08:00
seven332 015bcce8a3 Use -1.0f instead of NaN to represent no rating 2016-04-01 18:18:31 +08:00
seven332 b874a259fe Improve SimpleRatingView 2016-04-01 18:08:53 +08:00
seven332 c8ab84aa9e Improve render status bar and nav bar 2016-04-01 17:18:05 +08:00
seven332 d6efe2c7ba Fix status bar color in KK 2016-04-01 17:17:39 +08:00
seven332 46915fed3a Close #133, search via sharing 2016-04-01 16:22:27 +08:00
seven332 5d1f599f48 OH MY GREENDAO 2016-04-01 14:38:44 +08:00
seven332 9d5877e867 Hide status bar for pre-KK 2016-04-01 14:20:34 +08:00
seven332 e998f80574 Use no padding card 2016-04-01 02:03:32 +08:00
seven332 4faefb3f34 1.0.1 2016-03-31 22:35:49 +08:00
seven332 c48f282a2d Add search cover 2016-03-31 22:33:35 +08:00
seven332 d0ad3c158f Block image search to quick search 2016-03-31 22:05:57 +08:00
seven332 c285562971 Fix select invalid image null error 2016-03-31 20:42:55 +08:00
seven332 53ba692375 Clear temp dir 2016-03-31 20:34:00 +08:00
seven332 6879c5ea71 Improve restore download items 2016-03-31 20:29:11 +08:00
seven332 fa1348860b Add TaskPreference 2016-03-31 20:28:31 +08:00
seven332 efe4955836 Make EhEngine available 2016-03-31 20:27:40 +08:00
seven332 ad83f4d3ee Make chrome send implicit intent 2016-03-31 19:03:31 +08:00
seven332 be129a6147 Use BaseSavedState to save state 2016-03-31 16:36:25 +08:00
seven332 89b224e397 Add PreferenceUtils to registerOnActivityDestroyListener and unregisterOnActivityDestroyListener 2016-03-31 16:28:12 +08:00
seven332 97f82d4962 Remove some TODOs 2016-03-31 15:52:50 +08:00
seven332 4453ddbf07 Try to get old version cookie info 2016-03-31 15:50:32 +08:00
seven332 3b9d040881 Add SlidingDrawerLayout 2016-03-31 15:26:27 +08:00
seven332 b62b6c7b35 Fix not found nativeRemoveAllCookie 2016-03-31 13:19:50 +08:00
seven332 045218f8ca Adjust string 2016-03-31 13:14:55 +08:00
seven332 8b426c72d1 Remove invalid attr 2016-03-31 01:31:53 +08:00
seven332 51eaa73b9c Bump libraries version 2016-03-31 01:04:35 +08:00
seven332 ad081d8192 Add missing translatable="false" 2016-03-31 00:11:37 +08:00
seven332 19daaf7ee4 Update yorozuya 2016-03-30 23:57:17 +08:00
seven332 643412e11b Close response when stop download image 2016-03-30 22:57:53 +08:00
seven332 389119c468 Check storage before download image 2016-03-30 22:55:15 +08:00
seven332 9b60cdc612 Fix ScrollLayoutManager.getCurrentIndex() 2016-03-30 20:35:58 +08:00
seven332 203d6134c2 Improve ScrollLayoutManager layout 2016-03-30 20:00:22 +08:00
seven332 87e714aff6 Add screen orientation configure for reading 2016-03-30 01:38:20 +08:00
seven332 125fe0e691 Check layout null in LinkifyTextView 2016-03-30 00:59:38 +08:00
seven332 0485d9690e Make spider more thread-safe 2016-03-29 21:53:58 +08:00
seven332 d7b01d455b Fix search fab missing 2016-03-29 21:31:29 +08:00
seven332 d7d0c4e250 Set windowSoftInputMode stateHidden for MainActivity 2016-03-29 20:47:43 +08:00
seven332 231e463605 Add image search 2016-03-29 20:46:47 +08:00
seven332 311185825e Add TODO 2016-03-29 13:42:12 +08:00
seven332 325cf311df Use ThreadPoolExecutor for spider worker 2016-03-29 13:35:54 +08:00
seven332 cddb51b399 Cancel beta 2016-03-28 19:06:56 +08:00
seven332 c2c98003f1 1.0.0 2016-03-28 18:34:50 +08:00
seven332 dd6f02395c Save comments after voting 2016-03-28 18:32:48 +08:00
seven332 f419264540 Use extra buffer to avoid gif blink 2016-03-28 17:00:10 +08:00
seven332 d7565ce0bb Update Readme 2016-03-28 16:29:46 +08:00
seven332 095ccf1b55 Add check vote status 2016-03-28 16:15:36 +08:00
seven332 8abefdb6d4 Use user own apiuid and apikey 2016-03-28 15:14:05 +08:00
seven332 0aad8ca1e8 Add vote comment 2016-03-28 02:04:05 +08:00
seven332 0bc4569084 Safer 2016-03-27 22:49:48 +08:00
seven332 337c859040 Add UrlPreference, add help 2016-03-27 22:13:30 +08:00
seven332 e0cb0fca18 Fix typo 2016-03-27 19:13:29 +08:00
seven332 b8d5a7d80d Add reveal effect for gallery detail header on pre-L 2016-03-27 18:23:15 +08:00
seven332 2ddb234e72 Don't show all comment as default 2016-03-27 18:14:29 +08:00
seven332 19ebd4c28f Use my own reveal stuff 2016-03-27 18:13:35 +08:00
seven332 e6367055fb Improve GalleryCommentsScene 2016-03-27 16:22:56 +08:00
seven332 ba72dbff7c Add RevealLinearLayout for pre-L 2016-03-27 16:15:05 +08:00
seven332 df41c62269 Remove bookmark item in gallery page menu 2016-03-27 15:00:34 +08:00
seven332 a1cea27cdc Add fullBackupContent, only database 2016-03-27 14:49:09 +08:00
seven332 173f01853b Add largeHeap 2016-03-27 14:25:33 +08:00
seven332 8568f1c7a0 Adjust gallery list item rating view position 2016-03-27 14:23:26 +08:00
seven332 400f92ebb5 0.9.4 2016-03-26 22:41:00 +08:00
seven332 dcac616391 Add show tag definition 2016-03-26 22:39:13 +08:00
seven332 10c814fc2b Add filter tag namespace 2016-03-26 22:02:41 +08:00
seven332 8a1c0c0766 Adjust gallery gesture area 2016-03-26 20:20:00 +08:00
seven332 5c179a4e5d Adjust show acton fab condition 2016-03-26 19:25:37 +08:00
seven332 e72dfae998 Adjust CookieSignInScene UI 2016-03-26 19:20:26 +08:00
seven332 fd4a535701 Adjust button layout 2016-03-26 19:04:39 +08:00
seven332 d01370e480 Make star yellow 2016-03-26 18:20:27 +08:00
seven332 e110647a17 Quick search content check back 2016-03-26 18:07:10 +08:00
seven332 4edc7f082b Add refresh and go to fab in GalleryListScene 2016-03-26 17:02:06 +08:00
seven332 3a01dd6b5b Fix left drawer in SecurityScene 2016-03-26 16:18:28 +08:00
seven332 6ef208db91 Add import data 2016-03-25 20:14:16 +08:00
seven332 d25ea0957e Do not check duplicate content QuickSearch any more 2016-03-25 16:47:45 +08:00
seven332 c8030c6454 Update gallery list search bar hint 2016-03-25 14:40:29 +08:00
seven332 e608d8e142 Remove unused import 2016-03-25 14:35:06 +08:00
seven332 df01343c97 Add refresh top scene 2016-03-25 14:34:26 +08:00
seven332 2ee792c6a8 Improve gallery comment EditText UI 2016-03-25 01:12:04 +08:00
seven332 e601fc85d1 Add theme content for BaseScene 2016-03-25 00:55:01 +08:00
seven332 bbceb4e493 Add download origin image 2016-03-24 20:51:05 +08:00
seven332 43df2a5887 Improve download button text 2016-03-24 19:56:37 +08:00
seven332 be8e03e99d Remove GalleryDetail.resize 2016-03-24 19:09:02 +08:00
seven332 3cac88362c Update field name 2016-03-24 18:59:51 +08:00
seven332 cf0659db85 Improve gallery detail parsing 2016-03-24 18:48:03 +08:00
seven332 72c1190aa9 Stop RecyclerView scroll in onDestroyView. Maybe it will fix Inconsistency detected error. 2016-03-24 13:27:48 +08:00
seven332 6986a84cf6 Put cursor to end when set keyword 2016-03-24 01:54:39 +08:00
seven332 9c11ffde3c Add exporting data 2016-03-24 01:43:27 +08:00
seven332 492fcd56a0 Improve extract title 2016-03-24 01:18:25 +08:00
seven332 481499c124 Add missing notNull 2016-03-24 00:47:11 +08:00
seven332 3f11ad9f53 Improve favorite info dialog 2016-03-23 17:26:05 +08:00
seven332 e36c3fe796 Update download state 2016-03-23 16:39:57 +08:00
seven332 7c235d2a33 Remove delete icon on download item 2016-03-23 16:15:37 +08:00
seven332 727eb73721 Fix SeekBar thumb position 2016-03-23 14:38:49 +08:00
seven332 42f5e6ae4e 0.9.3 2016-03-23 14:16:45 +08:00
seven332 7515303e87 Adjust similar gallery strategy 2016-03-23 14:09:15 +08:00
seven332 281af4140a Fix GalleryActivity system UI state 2016-03-23 13:07:33 +08:00
seven332 4fa6a1f544 Fix thumb url parsing 2016-03-23 12:56:47 +08:00
seven332 53f8cc4488 Show nav bar and status bar when show seek bar in GalleryActivity 2016-03-23 02:25:12 +08:00
seven332 0f980a5cee Update library 2016-03-22 22:47:52 +08:00
seven332 6e06cca962 Add check duplicate quick search 2016-03-22 22:46:03 +08:00
seven332 ba884f8c99 Improve gallery list parser 2016-03-22 21:52:31 +08:00
seven332 44c2d25218 Click downloading notification to go to the downloading item 2016-03-22 19:44:50 +08:00
seven332 cd33a557cd Improve chinese simple language regex 2016-03-22 18:42:52 +08:00
seven332 2c4daa447e Add normal preview support 2016-03-22 17:01:58 +08:00
seven332 6659fefc21 Show require signing in tip in FavoriteScene 2016-03-22 16:58:49 +08:00
seven332 48face0e9e Remove useless notifyDataSetChanged 2016-03-22 13:33:57 +08:00
seven332 fe16ccd8b9 Fix HistoryScene no transition name error 2016-03-22 12:26:45 +08:00
seven332 99fedf4e3c Bump libraries version 2016-03-22 02:05:48 +08:00
seven332 7924b53d00 Fix seek bar panel not show above GalleryView 2016-03-22 01:43:48 +08:00
seven332 ed15f403cc 0.9.2 2016-03-21 22:16:17 +08:00
seven332 2c69b67731 Add check download location 2016-03-21 21:49:40 +08:00
seven332 ed8073eebf Create nomedia file in download location 2016-03-21 21:19:47 +08:00
seven332 c03b33fe2f Add search tip 2016-03-21 20:56:24 +08:00
seven332 1fe7500251 Add hath proxy 2016-03-21 20:37:57 +08:00
seven332 8900b0fa4a Shake device to clear pattern protection 2016-03-21 18:04:46 +08:00
seven332 7626c8e89e Add pattern protection 2016-03-21 17:02:16 +08:00
seven332 81428446d9 Remove NotFoundException 2016-03-21 14:28:06 +08:00
seven332 d6b6976277 Make ReversibleSeekBar safe 2016-03-21 14:21:24 +08:00
seven332 b5f15cbbd2 Add similar gallery 2016-03-21 14:17:19 +08:00
seven332 075fe52b4e Adjust tile thumb aspect range 2016-03-21 01:45:09 +08:00
seven332 0d8054b59d Use StaggeredGridLayoutManager for gallery thumb list 2016-03-21 00:49:28 +08:00
seven332 5706771c88 Add quick search tip 2016-03-20 22:58:53 +08:00
seven332 6c08f068d0 Use SeekBar instead of Slider in GalleryActivity to be compatible with old devices 2016-03-20 22:22:16 +08:00
seven332 9ad1c9b050 Adjusts gallery tag parser 2016-03-20 20:56:19 +08:00
seven332 3ac64cd973 Make ShowcaseView safe 2016-03-20 19:51:26 +08:00
seven332 27660f448f Improve FilterActivity view transition animation 2016-03-20 18:38:54 +08:00
seven332 c5c01b3a48 Add clear history 2016-03-20 17:32:55 +08:00
seven332 1166c0d547 Add select site scene 2016-03-20 16:16:29 +08:00
seven332 9e2c5715ed Update 2016-03-20 14:51:45 +08:00
seven332 a4f9580171 Set span size 2 for wide thumb 2016-03-20 02:03:36 +08:00
seven332 e84a060194 Change SimpleGridAutoSpanLayout package 2016-03-20 02:00:15 +08:00
seven332 5d858501b0 Improve GLRootView 2016-03-19 20:51:42 +08:00
seven332 cf24c86981 Adjust dialog view context 2016-03-19 20:05:09 +08:00
seven332 ed67831156 Add clearing memory cache 2016-03-19 19:17:46 +08:00
seven332 43d7e532db Avoid signing in twice 2016-03-19 19:16:59 +08:00
seven332 c8f38c0079 Add sqlEscapeString 2016-03-19 16:04:22 +08:00
seven332 249960825a Adjust Slider default color to colorAccent 2016-03-19 15:43:49 +08:00
seven332 cdaf2b80b6 Make scene safer 2016-03-19 15:41:41 +08:00
seven332 d345512caa Adjust content warning cookie 2016-03-19 02:03:35 +08:00
seven332 ec2cc5b13a Make EhConfig thread safe 2016-03-19 01:37:35 +08:00
seven332 9a5f6ccb74 Actually it my fault. Make mRequestPTokenQueue thread safe 2016-03-19 01:19:12 +08:00
seven332 42c4c4cfda Ensure poll safe for some bad ROM 2016-03-19 01:14:25 +08:00
seven332 5325c0c4f7 Add top activity and top scene for Crash 2016-03-19 01:09:37 +08:00
seven332 ff8bf2be64 Update giflib to 5.1.3 2016-03-19 00:27:44 +08:00
seven332 5b4ee608b8 Add filter tip dialog 2016-03-18 21:44:32 +08:00
seven332 2aadad487e Add clear download path cache 2016-03-18 20:28:24 +08:00
seven332 e97c82dbd7 Fix MessagePreference missing OnClickListener 2016-03-18 20:27:42 +08:00
seven332 d56c429175 Add filter 2016-03-18 19:52:04 +08:00
seven332 47e8f73296 Fix old history merge failed 2016-03-18 19:40:22 +08:00
seven332 2c50429ef9 Use max-length-name folder as download folder 2016-03-18 19:39:24 +08:00
seven332 933f51c96b Add finding gallery download path 2016-03-17 22:30:28 +08:00
seven332 59e704c992 Add more jsoup parser 2016-03-17 20:50:13 +08:00
seven332 fb4c79a722 Improve grid span count calculation 2016-03-17 18:35:53 +08:00
seven332 644113ba56 Ignore site for SpiderInfo read 2016-03-17 16:27:27 +08:00
seven332 2160deb34a Select e-hentai for skipping signing in 2016-03-17 16:24:08 +08:00
seven332 d4a39990ed Improve gallery spider 2016-03-17 15:33:58 +08:00
seven332 6e315ea94d Add e-hentai site support 2016-03-17 15:27:17 +08:00
seven332 25d75deb3c Adjust preview item margin 2016-03-17 01:52:51 +08:00
seven332 275a0766fa Show add to download list tip 2016-03-17 01:47:07 +08:00
seven332 4b2801190c Add gallery guide 2016-03-17 01:28:38 +08:00
seven332 073f6d1b60 0.9.1 2016-03-16 20:03:56 +08:00
seven332 a30f5e992c Update string.xml 2016-03-16 19:53:36 +08:00
seven332 6cb209a11f Fix NullPointerException in torrent dialog 2016-03-16 19:39:11 +08:00
seven332 ed8ad35968 Update README and NOTICE 2016-03-16 19:31:02 +08:00
seven332 896d731069 Improve Settings 2016-03-16 19:28:13 +08:00
seven332 37bec12843 Clear cache onTrimMemory 2016-03-16 18:45:37 +08:00
seven332 bf97290e57 Add shadow image for drawer in pre-L 2016-03-16 18:32:16 +08:00
seven332 83b0d1e961 Add guide 2016-03-16 18:10:32 +08:00
seven332 775ccfba7f Fix fab position in pre-L 2016-03-16 15:00:58 +08:00
seven332 a05246c405 Remove FitPaddingLayout, use constant padding 2016-03-16 14:40:45 +08:00
seven332 2dd26e9b00 Do not stop or delete download items through DownloadService 2016-03-16 13:43:38 +08:00
seven332 44a39ff230 Combine start and stop button in DownloadsScene 2016-03-16 13:29:58 +08:00
seven332 43272ac535 Fix show jp title 2016-03-16 13:16:59 +08:00
seven332 36128830f9 Make thumb cache key as first large preview cache key 2016-03-16 12:18:48 +08:00
seven332 006788ea2e Improve scene render order 2016-03-16 01:44:05 +08:00
seven332 e071599391 Update string.xml 2016-03-15 23:49:56 +08:00
seven332 f3b42f0070 Remove sad panda 2016-03-15 22:05:45 +08:00
seven332 81c22811d6 Save current index as state in GalleryActivity 2016-03-15 20:47:12 +08:00
seven332 c4e35189ec Fix gallery page key error 2016-03-15 20:36:00 +08:00
seven332 d10242c722 Refresh if content layout was refresh state 2016-03-15 20:33:47 +08:00
seven332 664e830c7b Add sign out 2016-03-15 18:31:49 +08:00
seven332 7ae50430f8 No not judge sign in state by display name 2016-03-15 17:16:35 +08:00
seven332 f2ca9fd70b Show display name 2016-03-15 17:14:43 +08:00
seven332 faad776d59 Add ExcludedTagNamespaces 2016-03-15 16:54:28 +08:00
seven332 9572447b59 Add ActivityPreference 2016-03-15 16:23:39 +08:00
seven332 950870afdb Add SensitiveCheckBox 2016-03-15 16:03:27 +08:00
seven332 1e6f681643 Add default categories 2016-03-15 16:02:37 +08:00
seven332 d89b9bbec9 Adjust gallery grid layout 2016-03-15 14:54:58 +08:00
seven332 397b0d91aa Save state in DirPickerActivity 2016-03-15 14:32:51 +08:00
seven332 a3ce06c07f Add excluded languages 2016-03-15 14:26:30 +08:00
seven332 bf16b13ca9 Fix AddDeleteDrawable getIntrinsicHeight and getIntrinsicWidth 2016-03-15 02:04:58 +08:00
seven332 407f5b102c Fix reset download state unnecessarily 2016-03-15 01:46:38 +08:00
seven332 04ae2c1b4b Long click download button to download with default label 2016-03-15 01:24:25 +08:00
seven332 b6a6863f6c Add multi-thread-download setting and preload-image setting 2016-03-15 01:09:34 +08:00
seven332 60351a5f1c Check mFab null 2016-03-15 00:16:32 +08:00
seven332 3c4605944e Update search EditText when update url builder in GalleryListScene 2016-03-15 00:15:48 +08:00
seven332 f3b442fbcd Do not add DownloadInfo to wait list when addDownloadInfo 2016-03-15 00:07:14 +08:00
seven332 8263ead395 Fix download button text update 2016-03-14 23:50:15 +08:00
seven332 59085f1371 Use LruCache instead of LruCacheEx 2016-03-14 23:20:00 +08:00
seven332 9276244b28 Remove SimpleImageView 2016-03-14 22:39:03 +08:00
seven332 15d4819089 Sort download item by descending time 2016-03-14 22:24:15 +08:00
seven332 34109d3a93 Calculate span count for previews 2016-03-14 19:15:55 +08:00
seven332 160601d333 Adjust list mode action receiver 2016-03-14 19:01:27 +08:00
seven332 a81f4b40f1 Add grid gallery list 2016-03-14 18:36:13 +08:00
seven332 94a838f4b7 Aspect do not depend on AdjustViewBounds in FixedAspectImageView 2016-03-14 14:12:12 +08:00
seven332 866e3f8885 Add custom ListPreference 2016-03-14 00:52:40 +08:00
seven332 8eb43c6893 Rename MessageDialogPreference to MessagePreference 2016-03-14 00:29:02 +08:00
seven332 f1cfe21780 Rename FixedSwitchPreference to SwitchPreference 2016-03-14 00:25:26 +08:00
seven332 bd7cc665e2 Add custom DialogPreference which use AppCompat dialog 2016-03-14 00:01:37 +08:00
seven332 af2102ded8 Fix no namespace for click tag 2016-03-13 22:38:32 +08:00
seven332 bc2877a1aa Fix SearchBar list header 2016-03-13 22:29:46 +08:00
seven332 95f7cc016c Fix volume key page 2016-03-13 21:10:21 +08:00
seven332 5fe5737769 Add save html content when parse error 2016-03-13 19:46:20 +08:00
seven332 be8f78fa4f Improve parsing profile 2016-03-13 19:10:21 +08:00
seven332 db5caa9d00 Add missing onNavigationClick() 2016-03-13 18:00:04 +08:00
seven332 a931983219 Remove no-animator animated-vector 2016-03-13 17:54:53 +08:00
seven332 e28a143358 Avoid ClassCastException when get value from Settings 2016-03-13 16:39:31 +08:00
seven332 f99a7f8cbf Use different key for default fav, to avoid different type in old version 2016-03-13 16:16:01 +08:00
seven332 149111ae5a Avoid get time string twice in Crash 2016-03-13 13:58:05 +08:00
seven332 6c3fa03d18 Fix label can swipe right in DownloadLabelScene 2016-03-13 13:57:03 +08:00
seven332 7e21bced21 Fix DownloadsScene removeDownloadInfoListener null 2016-03-13 13:54:34 +08:00
seven332 1be88799dd Fix GalleryView pause and resume 2016-03-13 13:38:26 +08:00
seven332 74ae747c94 Do not show select download label dialog for no custom labels 2016-03-13 13:13:41 +08:00
seven332 7b28eeec5d Fix update UI for download items changing 2016-03-13 12:51:37 +08:00
seven332 9d2d3d3395 Store download dir to DB when restore download items 2016-03-13 12:50:48 +08:00
seven332 f23cd6ef42 Fix title from api 2016-03-13 12:03:29 +08:00
seven332 15d915b6be Add restore download items 2016-03-13 02:10:09 +08:00
seven332 c4ccaa58bb Add ProgressDialog 2016-03-13 02:09:25 +08:00
seven332 2f3c3fbb12 Use low profile for pre-KK in GalleryActivity 2016-03-13 00:46:34 +08:00
seven332 e5e532d990 Fix GalleryActivity page left and right mistake 2016-03-13 00:37:02 +08:00
seven332 bac3b3a970 Add check update 2016-03-12 23:33:13 +08:00
seven332 4921566ddd Set minSdkVersion to 16 2016-03-12 22:07:40 +08:00
seven332 0cbe074fbb Add crash catch 2016-03-12 13:32:30 +08:00
seven332 493b70f885 New DownloadScene big icon 2016-03-11 23:50:25 +08:00
seven332 ad4206fb7e Use readable filename for save image 2016-03-11 23:20:44 +08:00
seven332 95bdb85609 Fix SpiderInfo parser 2016-03-11 23:00:47 +08:00
seven332 5dd781a3fb Add share and save image in GalleryActivity 2016-03-11 22:42:05 +08:00
seven332 44c9c66952 Fix no resources for create BitmapDrawable 2016-03-11 20:12:42 +08:00
seven332 ef967102eb Make DirPickerActivity safe 2016-03-11 19:44:27 +08:00
seven332 37ee0f2076 Use different big icon for empty state 2016-03-11 18:59:01 +08:00
seven332 85d201a9ff Improve DownloadLabelScene 2016-03-11 16:39:41 +08:00
seven332 50245bb13f Store version code 2016-03-11 16:14:55 +08:00
seven332 4aa21bab09 Store spider info file in cache 2016-03-11 15:39:18 +08:00
seven332 e74b49fff7 Add mips libjpeg-turbo simd support 2016-03-11 15:02:27 +08:00
seven332 8badf7aad7 Fix arg type error 2016-03-11 14:23:00 +08:00
seven332 62d805508f Cache OutOfMemoryError for BitmapHelper 2016-03-11 14:17:06 +08:00
seven332 d9f56830a4 Use Bitmap for thumb instead of Image 2016-03-11 14:09:01 +08:00
seven332 722a51d243 Improve dialog layout 2016-03-11 02:18:46 +08:00
seven332 55e7ef7c73 Add History 2016-03-11 01:49:08 +08:00
seven332 9c8f7960fb Update build command line 2016-03-10 23:47:24 +08:00
seven332 e66d7b0d90 Add about settings 2016-03-10 23:45:41 +08:00
seven332 1a31b2f1cd Update README and NOTICE 2016-03-10 22:29:59 +08:00
seven332 da015db365 Detach GalleryView layout manager when Activity onPause 2016-03-10 22:04:09 +08:00
seven332 a073c2829e Fix for pass build 2016-03-10 20:41:09 +08:00
seven332 cb6e2c3895 Use clang instead of gcc 2016-03-10 20:35:53 +08:00
seven332 15152cf4f6 Update libjpeg-turbo to 1.4.90 2016-03-10 20:31:59 +08:00
seven332 8c072e7fd7 Reset spider state when start downloading 2016-03-10 18:22:01 +08:00
seven332 63a2f9e796 Try to copy image from cache to download dir when getting image from download dir 2016-03-10 18:21:23 +08:00
seven332 921856f53f Add CookieSignInScene 2016-03-10 17:54:58 +08:00
seven332 b015c8ae51 Rename WebViewLoginScene to WebViewSignInScene 2016-03-10 14:15:00 +08:00
seven332 a3be13d46d Remove display name, update avatar after signing in 2016-03-10 13:50:02 +08:00
seven332 f511ea7f46 Show avatar and display name 2016-03-10 02:13:21 +08:00
seven332 8650565829 Add get profile 2016-03-10 00:44:54 +08:00
seven332 6549f070eb Use SafeCoordinatorLayout to avoid crash 2016-03-09 23:28:18 +08:00
seven332 8ad0f691e8 Do not download image when get error respond code 2016-03-09 23:03:16 +08:00
seven332 9676a71375 Update strings.xml 2016-03-09 22:55:48 +08:00
seven332 fdcf1a0be5 Add WebViewLoginScene 2016-03-09 22:39:42 +08:00
seven332 0f9bcf31ed Improve signing in 2016-03-09 20:05:03 +08:00
seven332 7ec5cf7ca1 Fix error in EhDB 2016-03-09 18:44:26 +08:00
seven332 89ba87bc57 Add QuickSearchScene 2016-03-09 18:29:15 +08:00
seven332 e748229e15 Add QuickSearch 2016-03-09 15:42:02 +08:00
seven332 3c815bc847 Use BestConfigChooser to avoid no gl config error 2016-03-09 02:08:52 +08:00
seven332 662c1c0d9c Update Image 2016-03-08 21:06:41 +08:00
seven332 b09b261098 Use SnackBar 2016-03-08 17:18:29 +08:00
seven332 cd016a126c Add open gallery from preview 2016-03-08 16:08:39 +08:00
seven332 e3226d3f70 Save read progress 2016-03-08 14:34:27 +08:00
seven332 2e5efa1cd6 Disable right drawer when scroll FastScroller 2016-03-08 12:34:06 +08:00
seven332 f674e2331e Add whats hot 2016-03-08 01:42:25 +08:00
seven332 bdc80578cf Make DownloadService state static 2016-03-07 22:06:25 +08:00
seven332 e6d1dbc1e6 Avoid SearchBar list header error 2016-03-07 18:46:27 +08:00
seven332 1851ce0ab7 Add analytics settings 2016-03-07 17:38:03 +08:00
seven332 5b6b6f63b2 Add analytics 2016-03-07 13:28:37 +08:00
seven332 ac5f839a75 Handle nav checked item in onViewCreated 2016-03-06 21:01:57 +08:00
seven332 5b85a9ddef Request left drawer locked state after scene view created 2016-03-06 20:31:59 +08:00
seven332 f213254e2b Always show WarningScene and LoginScene if necessary 2016-03-06 20:10:25 +08:00
seven332 1905fa526e Adjust StageActivity Intent logic 2016-03-06 18:43:00 +08:00
seven332 1f05057ddd Remove ThumbImageView 2016-03-06 14:53:44 +08:00
seven332 de6a5141b9 Update string.xml 2016-03-06 14:49:30 +08:00
seven332 008c662209 Show download state in GalleryDetailScene 2016-03-06 14:33:47 +08:00
seven332 09d481db53 Adjust for library 2016-03-06 12:37:39 +08:00
seven332 102aaae542 Add bookmark in DB 2016-03-06 02:07:10 +08:00
seven332 c3e5e308ec Improve EhDB 2016-03-06 01:58:39 +08:00
seven332 4444899e4b Improve DownloadInfo in EhDB 2016-03-05 23:48:39 +08:00
seven332 b1ae94824c Fix search bar show and hide 2016-03-05 17:44:40 +08:00
seven332 92fc062ca0 Call glTexSubImage2D in native code for ImageTexture.Tile 2016-03-05 16:34:59 +08:00
seven332 e80df262a3 Bump okhttp version 2016-03-05 01:32:03 +08:00
seven332 d7e2adaef4 Add favorites info 2016-03-05 01:22:52 +08:00
seven332 d2553b39a6 Add select download label 2016-03-05 00:47:25 +08:00
seven332 a0b273bb72 Add set default favorites slot 2016-03-04 20:15:11 +08:00
seven332 162f627052 Add favorites 2016-03-04 19:46:15 +08:00
seven332 d4cbaabefe Improve torrent list dialog layout 2016-03-04 16:49:15 +08:00
seven332 ee5ce0307f Fix ImageTexture animate detect 2016-03-04 16:03:28 +08:00
seven332 41a383c1ac Add animated image support 2016-03-04 15:29:10 +08:00
seven332 c32ffb8bbb Improve Scene launch mode 2016-03-04 12:18:29 +08:00
seven332 d01d053859 Remove stupid log 2016-03-04 12:14:09 +08:00
seven332 b0e43018f3 Fix download statistics error 2016-03-04 11:55:24 +08:00
seven332 b5e7dcc8d1 Add FastHandler in DownloadScene 2016-03-04 00:32:43 +08:00
seven332 10f54871fb Fix GalleryView long press and scale conflict 2016-03-03 20:43:47 +08:00
seven332 3770f74709 Show remaining time in download notification 2016-03-03 20:18:37 +08:00
seven332 d32168ff02 Improve download notification 2016-03-03 18:19:50 +08:00
seven332 fa5d2568b1 Add get torrent 2016-03-03 17:16:36 +08:00
seven332 fc32252772 Move from local favorites to cloud favorites 2016-03-03 14:18:13 +08:00
seven332 997ee15c4d Fix favorite to favorites 2016-03-02 22:50:18 +08:00
seven332 35e48cb79b Add FavoritesScene 2016-03-02 22:41:35 +08:00
seven332 f402dd92b5 Improve EhEngine 2016-03-02 14:46:05 +08:00
seven332 5732191058 Create SearchBarMover 2016-03-02 01:11:20 +08:00
seven332 f40b5cfbfc Update string.xml 2016-03-01 18:54:47 +08:00
seven332 27b528ffcf Adjust book open icon 2016-03-01 17:15:31 +08:00
seven332 1c882a0b6c Adjust preference header activated color 2016-03-01 17:14:25 +08:00
seven332 b4f9e77a76 Improve settings 2016-03-01 17:12:35 +08:00
seven332 da905f2a4f Add some vector drawable 2016-03-01 14:55:46 +08:00
seven332 92dc8ce74f Use support-vector-drawable and animated-vector-drawable 2016-03-01 14:38:07 +08:00
seven332 8f7c67661b Make FabLayout layout looks fine in pre-L 2016-02-29 19:30:57 +08:00
seven332 356bcb7bca Add license, notice, readme, art 2016-02-29 16:51:06 +08:00
seven332 7a63e0a59f Read NDK_HOME system variable 2016-02-29 16:42:20 +08:00
seven332 d590a78a30 Merge branch 'dev0121' into dev0118 2016-02-29 15:40:48 +08:00
seven332 9f83694972 Merge branch 'dev-AS' into dev0118 2016-02-29 15:40:35 +08:00
seven332 68873ab6d9 Merge branch 'dev' into dev0118 2016-02-29 15:40:09 +08:00
seven332 29d360f8ec Add rename download label and delete download label 2016-02-29 15:27:28 +08:00
seven332 a55b5a84d5 Add download label scene 2016-02-29 00:38:30 +08:00
seven332 feb9bbadc6 Add GalleryProvider.cancelRequest(int), fix SpiderQueen.request(int, boolean) 2016-02-28 15:39:21 +08:00
seven332 efdb488781 Fix DownloadService.startRangeDownload(IntList) 2016-02-28 14:40:33 +08:00
seven332 41590fcdeb Fix download info UI update 2016-02-28 14:39:25 +08:00
seven332 7d166f7b7c Avoid frequent download notification 2016-02-28 01:55:39 +08:00
seven332 ab9edf1cf7 Add change download label 2016-02-28 01:05:15 +08:00
seven332 f47c09deda Add DownloadService start range, stop range and delete range 2016-02-27 22:34:37 +08:00
seven332 11d492c8fa Improve download item UI 2016-02-27 17:35:50 +08:00
seven332 85d4bc814f Add DownloadScene multiple check 2016-02-27 15:29:52 +08:00
seven332 2eb20b6a04 Add GalleryListScene long click dialog 2016-02-27 15:28:33 +08:00
seven332 d649229ec0 Add FabLayout.OnClickFabListener and FabLayout.setHidePrimaryFab(boolean) 2016-02-27 15:13:01 +08:00
seven332 271dddb389 Add download label view 2016-02-27 01:07:37 +08:00
seven332 d9ee9631a6 Fix gallery preview item width error 2016-02-26 23:06:32 +08:00
seven332 dfc6872001 AppCompat 23.2.0 AppCompatSpinner item height is too large, use CuteSpinner instead 2016-02-26 22:58:12 +08:00
seven332 4512284ef4 Fix GalleryInfoScene item height error 2016-02-26 22:55:35 +08:00
seven332 197e617481 Rename menu file name 2016-02-26 22:10:36 +08:00
seven332 9634843109 Add start all download items 2016-02-26 22:09:27 +08:00
seven332 bfe1853bb5 Add stop all action in download notification 2016-02-26 20:40:08 +08:00
seven332 7b604146f1 Fix notification large icon 2016-02-26 19:32:01 +08:00
seven332 5ce6c4cf66 Improve download notification 2016-02-26 19:05:04 +08:00
seven332 a4b4de08da Add delete download item 2016-02-26 17:01:40 +08:00
seven332 ce797bcf24 Bump libraries version 2016-02-26 14:22:35 +08:00
seven332 61f09dc9f3 Improve download 2016-02-26 14:09:01 +08:00
seven332 41afc75cce Improve GalleryPageView.setImage() 2016-02-24 17:11:01 +08:00
seven332 4ec9e2d9a8 Upload ImageTexture in GalleryActivity 2016-02-24 17:09:43 +08:00
seven332 e623616a50 Add Image.isOpaque() 2016-02-24 17:08:45 +08:00
seven332 82b6374e7e Improve thai detection 2016-02-24 13:34:05 +08:00
seven332 8360a86e80 Try to fit thumb image view 2016-02-24 13:24:55 +08:00
seven332 3575c856b4 Add alpha animation for ImageView 2016-02-24 01:55:01 +08:00
seven332 5463aba10e Avoid request decode twice 2016-02-24 01:45:56 +08:00
seven332 72af2a3322 Improve ImageView mPositionInRootDirty 2016-02-24 00:58:12 +08:00
seven332 6c65faf521 Make gallery tag round side rect 2016-02-23 20:24:32 +08:00
seven332 50fd63e0d8 Add GalleryActivity keep screen on 2016-02-23 17:07:02 +08:00
seven332 e0e040aace Fix GalleryPageView min height 2016-02-23 16:44:16 +08:00
seven332 8faf0131c2 Auto hide gallery slider 2016-02-23 16:30:16 +08:00
seven332 bdace936fc Adjust OnSetProgressListener behavior 2016-02-23 16:15:52 +08:00
seven332 1ca26334de Apply scale mode and start position for GalleryView 2016-02-23 16:07:37 +08:00
seven332 995146f60f Add IndicatingScrollView 2016-02-23 16:06:01 +08:00
seven332 a5856e67ee Adjust ImageView scaleDefault 2016-02-23 14:16:25 +08:00
seven332 be9ed688c8 Use GLView.offsetTopAndBottom(int) in ScrollLayoutManager 2016-02-23 14:15:01 +08:00
seven332 2c8b56c3bb Fix notifyPositionInRoot and onLayout order in GLView 2016-02-23 14:08:05 +08:00
seven332 570cd97236 Make CookieDBStore thread safe 2016-02-23 02:15:19 +08:00
seven332 9e8ca62d3b Use skipHathKey for force request in SpiderQueen 2016-02-23 00:03:24 +08:00
seven332 d5bf8aaf92 Update slider for changing reading direction 2016-02-22 23:59:53 +08:00
seven332 9a94dbf2ef Fix ScrollLayoutManager.setCurrentIndex(int) 2016-02-22 23:58:47 +08:00
seven332 be09ad6c27 Add gallery menu 2016-02-22 23:37:41 +08:00
seven332 2724a647f6 Improve gallery 2016-02-22 22:29:43 +08:00
seven332 1097396c52 Improve gallery 2016-02-22 17:09:50 +08:00
seven332 8dc9160f21 Add SliderPanel to enlarge Slider touch range 2016-02-22 17:09:04 +08:00
seven332 fe7a34ff6a Fix Slider bubble position for reverse is false 2016-02-22 16:56:07 +08:00
seven332 ba51bd823e Create MovableTextTexture when GalleryView attached 2016-02-22 12:52:39 +08:00
seven332 43b8a57849 Scroll up to keep first shown loaded page top, otherwise keep first shown page top 2016-02-22 00:28:26 +08:00
seven332 9a18ad543a Improve gallery 2016-02-21 23:44:10 +08:00
seven332 56c95740df Fix removing failed image 2016-02-20 16:18:34 +08:00
seven332 77f7840cf6 Ensure first shown loaded page top is the same in ScrollLayoutManager 2016-02-20 16:14:22 +08:00
seven332 383fc3b227 Add GLView.isAttachedToRoot() 2016-02-20 16:08:21 +08:00
seven332 a6ed8a44e6 Do not draw GLView when it is out of GLRoot 2016-02-20 15:14:15 +08:00
seven332 2f3ab8d244 Long click to remove suggestion 2016-02-20 12:59:20 +08:00
seven332 64e22ade37 Ensure GalleryProviderListener work in render thread 2016-02-20 11:14:15 +08:00
seven332 31ffa6f8a9 Add eh gallery spider 2016-02-19 22:53:24 +08:00
seven332 6f37491471 Improve GalleryActivity 2016-02-16 16:37:18 +08:00
seven332 7ad8a3afd1 Add GalleryProvider 2016-02-14 16:51:56 +08:00
seven332 091ef383eb Add GLView.GONE 2016-02-13 15:20:52 +08:00
seven332 b3d4aff98d Improve ScrollLayoutManager 2016-02-13 13:12:06 +08:00
seven332 33f86fd32b Add ScrollLayoutManager 2016-02-12 23:32:02 +08:00
seven332 9e6895b775 Add PagerLayoutManager.onDoubleTapConfirmed(float, float) 2016-02-11 23:12:51 +08:00
seven332 293ada12c6 Improve GalleryView 2016-02-11 22:14:21 +08:00
seven332 a585c7cd20 Use EhCallback 2016-02-11 01:22:33 +08:00
seven332 3566d3ea90 Handle IME onViewCreated 2016-02-11 00:31:24 +08:00
seven332 65aec91029 Adjust gallery search 2016-02-11 00:22:09 +08:00
seven332 ffd122c105 Improve GalleryView 2016-02-10 16:04:50 +08:00
seven332 dff16b3834 okhttp version dump 2016-02-08 15:26:29 +08:00
seven332 2897a2fe12 Add gl file 2016-02-07 23:19:52 +08:00
seven332 76812c26f4 Move vector xml file to separate dir 2016-02-07 15:47:56 +08:00
seven332 2779176bbe Add permission request 2016-02-07 11:54:49 +08:00
seven332 c4457f67a2 Update string.xml 2016-02-07 02:29:10 +08:00
seven332 e1252572ad Improve comment animation 2016-02-07 01:38:01 +08:00
seven332 e8ac5ed946 Fix wrong intent-filter 2016-02-07 00:10:30 +08:00
seven332 1528ac875c Remove custom drawable to xml for new gradle plugin, rename some drawable, replace some drawable by vector 2016-02-06 22:38:08 +08:00
seven332 3ef767791d Add open eh url 2016-02-06 20:26:01 +08:00
seven332 67e3c8dc60 Add scene result, update gallery comments for post comment, add isViewCreated in BaseScene 2016-02-06 16:08:08 +08:00
seven332 875509be68 Add comment gallery, add Announcer 2016-02-06 15:02:44 +08:00
seven332 596966b4ab Add refresh for GalleryDetailScene, fix circular reveal radius 2016-02-06 14:35:26 +08:00
seven332 a4568d811e Add get gallery jpn title 2016-02-05 23:47:04 +08:00
seven332 a61eb49b27 Remove all the other scene when click Homepage 2016-02-05 14:37:18 +08:00
seven332 8387ff3fc6 Update nav checked item 2016-02-05 13:23:15 +08:00
seven332 91a17ca219 Improve search bar position return 2016-02-05 13:12:06 +08:00
seven332 2400fa3dff Add share gallery 2016-02-05 02:22:00 +08:00
seven332 dfbe3767fe Add rate gallery 2016-02-05 02:10:23 +08:00
seven332 f7b443e0fa Add sad panda head 2016-02-04 23:14:03 +08:00
seven332 4924c1f08c Add circular reveal for gallery detail header 2016-02-04 21:46:14 +08:00
seven332 6d58477f37 Add SceneGalleryPreviews 2016-02-04 20:17:18 +08:00
seven332 cac0aedc42 Improve scene animation 2016-02-04 15:36:29 +08:00
seven332 7e252eb096 Update card bg resources 2016-02-04 14:21:43 +08:00
seven332 ebd72e61c8 Remove cardsalon 2016-02-04 01:02:00 +08:00
seven332 427550829c Add missing resources 2016-02-04 00:59:42 +08:00
seven332 705dd16541 Update 2016-02-04 00:59:14 +08:00
seven332 f3a7bcbfd3 Use LinearLayout divider 2016-02-03 22:41:42 +08:00
seven332 f684b9f7a4 Add start scene from onNewIntent in StageActivity 2016-02-03 18:50:05 +08:00
seven332 507c7e7879 Improve Gallery Detail 2016-02-03 14:15:40 +08:00
seven332 dd1daa96d2 LoadImageView auto cancel 2016-02-03 14:11:04 +08:00
seven332 056a6eb394 Improve GalleryDetailScene 2016-02-01 22:34:55 +08:00
seven332 7b13da66af Add EhConfig for EhRequest 2016-02-01 00:17:01 +08:00
seven332 9925abf40f Do trick to draw disappearing children first 2016-01-31 15:21:48 +08:00
seven332 9b23153e04 Add findStageActivityById 2016-01-30 21:59:51 +08:00
seven332 a521278e33 Update strings.xml 2016-01-30 17:00:02 +08:00
seven332 201914c336 Set conaco debug for debug type 2016-01-30 16:59:26 +08:00
seven332 6b569ee82d Add EhConfig for each request 2016-01-30 16:58:25 +08:00
seven332 740ab2950c Add get gallery detail 2016-01-30 01:53:20 +08:00
seven332 4cf3db2ee1 Improve scene animation 2016-01-29 23:22:15 +08:00
seven332 7dcdf783ea Show divider between suggestion and search edit text 2016-01-28 15:34:23 +08:00
seven332 97f3d0ae30 Fix missing original padding in FitPaddingLayout 2016-01-28 15:08:26 +08:00
seven332 89e16e4ec5 Improve GalleryListScene 2016-01-27 23:00:08 +08:00
seven332 fd60291d7b Save state for ContentLayout 2016-01-27 22:59:04 +08:00
seven332 b3802c064e Fix the same id for different scene 2016-01-27 22:55:18 +08:00
seven332 43837ef9c7 Add GalleryDetailScene 2016-01-27 00:54:39 +08:00
seven332 4e651066fb Fix domain error in CookieStore 2016-01-26 20:37:44 +08:00
seven332 24a64c23dc Improve GalleryListScene 2016-01-26 19:54:26 +08:00
seven332 d1650c4ec5 Add files 2016-01-26 01:03:31 +08:00
seven332 217c81a6d1 Update libraries 2016-01-24 00:22:42 +08:00
seven332 52209017a3 Init 2016-01-24 00:17:57 +08:00
seven332 17b1d674a5 Push 2016-01-18 22:13:55 +08:00
seven332 d4d1a0e6c6 Update for libraries 2015-10-11 18:14:36 +08:00
seven332 aeb49f4bb6 Use Vector 2015-10-08 12:22:48 +08:00
seven332 866c70e34c New icon 2015-08-26 13:42:36 +08:00
seven332 ee7a3ac3b3 Add favorite 2015-08-26 13:08:33 +08:00
seven332 59c14245ee Add Sign in by WebView 2015-08-26 00:43:25 +08:00
seven332 0ae6d48a7d Add ProgressDialog 2015-08-26 00:40:52 +08:00
seven332 b240f48d88 Fixed string,xml 2015-08-25 14:40:13 +08:00
seven332 37049f83d8 Fixed rating gallery 2015-08-25 13:37:39 +08:00
seven332 4fe2c1ace3 Improved SearchBar 2015-08-25 12:05:35 +08:00
seven332 98e177c58a Add history 2015-08-24 23:55:07 +08:00
seven332 d9f29c7b25 Update string.xml 2015-08-24 21:45:00 +08:00
seven332 5f5a8d026b Show activated download label 2015-08-24 17:31:05 +08:00
seven332 7b95c21030 Fixed deleting DownloadInfo 2015-08-24 17:29:58 +08:00
seven332 4cefcd8822 Realized deleting DownloadInfo 2015-08-24 16:57:23 +08:00
seven332 0eff20b45a Add GalleryDir 2015-08-24 15:52:13 +08:00
seven332 48e379d356 Add download list empty tip 2015-08-24 11:40:13 +08:00
seven332 052e5cdbb3 Realized moving DownloadInfo 2015-08-24 01:13:29 +08:00
seven332 91fd6c2de8 Fixed downloaded pages starting from -1 2015-08-24 00:05:41 +08:00
seven332 49b7109e55 Use EhViewer instead of EhViewer Test 2015-08-23 23:46:40 +08:00
seven332 23a76e6e7b Add changing download info label 2015-08-23 23:27:06 +08:00
seven332 65965b411a Update DownloadScene title for changing label 2015-08-23 15:36:29 +08:00
seven332 c30c3aef77 Add empty list tip 2015-08-23 15:19:39 +08:00
seven332 6992b1591b Normalized vector drawable resources naming 2015-08-23 12:31:56 +08:00
seven332 1728da0363 Reset DownloadInfo non-persisted state after released 2015-08-23 01:54:12 +08:00
seven332 4d6bcd8b79 Improve download 2015-08-22 23:51:57 +08:00
seven332 9b7ebdff61 Update 2015-08-21 20:31:11 +08:00
seven332 a0d5cb9937 Remove ActionBarActivity in EasyRecyclerView 2015-08-20 21:40:13 +08:00
seven332 2c7d5a3369 Improve download 2015-08-20 20:34:52 +08:00
seven332 4a80ea7dcd Add download 2015-08-19 22:20:03 +08:00
seven332 3aaf14ef3f Fix BadParcelableException error 2015-08-17 21:57:00 +08:00
seven332 b1cee421a5 Fix star error 2015-08-16 19:56:49 +08:00
seven332 1d65db78f2 Add quick search 2015-08-16 16:08:20 +08:00
seven332 c015d05e77 Improve 2015-08-14 00:23:03 +08:00
seven332 523ff94f71 Update 2015-08-14 00:00:45 +08:00
seven332 4ca95f0b7c Invalid click on GalleryPanel children 2015-08-12 15:04:10 +08:00
seven332 e9c1eac800 Add rating gallery 2015-08-12 14:59:12 +08:00
seven332 a1c11a4472 Add animation to Slider 2015-08-11 22:40:13 +08:00
seven332 b4d3c430a0 Fix XmlResourceTexture bounds error 2015-08-11 22:31:10 +08:00
seven332 89f9df6e44 Improve parser 2015-08-11 17:06:46 +08:00
seven332 cd852f4003 Update 2015-08-10 16:16:53 +08:00
seven332 dc465e89a6 Add Slider reverse 2015-08-09 14:45:38 +08:00
seven332 d3baa72e82 Add GLView click and long click 2015-08-09 13:07:20 +08:00
seven332 31fe21007d Add GLView save state 2015-08-09 01:34:21 +08:00
seven332 36424b11a9 Improve gallery activity 2015-08-09 00:11:51 +08:00
seven332 b6c726162d Improve ProgressView 2015-08-06 23:14:43 +08:00
seven332 76a241d2da Check response code for DownloadClient 2015-08-06 11:48:15 +08:00
seven332 e156d27f20 Improve filename 2015-08-06 01:19:24 +08:00
seven332 76825ad66e Skip hath when download image failed 2015-08-05 16:09:35 +08:00
seven332 200abb281f Only GLES20 2015-08-05 13:02:33 +08:00
seven332 b555e3fc29 Use jni to load gif 2015-08-04 19:04:42 +08:00
seven332 f833bd829e Use gradle-experimental:0.2.0 2015-08-04 18:56:26 +08:00
seven332 1addfe2b66 Update 2015-08-03 18:17:59 +08:00
seven332 ac39947d6a Update RecyclerView 2015-08-02 23:52:50 +08:00
seven332 04d888f4c8 Fix no removeOnLayoutListener error 2015-08-02 18:15:31 +08:00
seven332 348f810df4 Fix EdgeView onPull 2015-08-02 13:59:55 +08:00
seven332 132d866dd9 Adapt Lollipop EdgeEffect 2015-08-02 13:44:33 +08:00
seven332 3523503d08 Use ProgressView instance of ProgressBar, remove useless stuff 2015-08-02 11:38:30 +08:00
seven332 ca2a55fd12 Improve GL draw circle 2015-08-02 00:13:44 +08:00
seven332 5e2f51531d Fix startScene Curtain 2015-08-01 19:17:26 +08:00
seven332 41ed55188b Improve Scene 2015-08-01 19:03:54 +08:00
seven332 c47b8a021e Ensure fill in render thread to keep thread safe 2015-07-31 22:28:47 +08:00
seven332 903d25aee2 Add set location summary update 2015-07-31 15:47:11 +08:00
seven332 dd52e06488 Fix GifTexture lock 2015-07-31 12:08:41 +08:00
seven332 25505bb0a9 Improve gif play 2015-07-31 01:07:34 +08:00
seven332 c463714a9b Add gif support 2015-07-30 23:37:29 +08:00
seven332 ccea1ffc06 Add build instructions 2015-07-29 10:58:50 +08:00
seven332 4e2caa5b4d Update 2015-07-29 10:18:31 +08:00
seven332 74c1c2144f Add download settings 2015-07-28 22:31:05 +08:00
seven332 93396f4181 Fix download dirname 2015-07-28 11:30:39 +08:00
seven332 c2b640dec0 Add ZipGalleryProvider 2015-07-27 23:23:44 +08:00
seven332 bc29540a48 Improve GalleryActivity 2015-07-27 16:01:23 +08:00
seven332 9ee91aae19 Add ProgressView 2015-07-26 11:54:15 +08:00
seven332 55fabbcfe4 Add getTextHeight 2015-07-26 11:53:46 +08:00
seven332 8a10af090f Add TextView 2015-07-26 11:53:08 +08:00
seven332 afe28f866a Add FrameView and LinearView 2015-07-26 11:52:36 +08:00
seven332 8bfffcda1f Improve GLView 2015-07-26 11:51:42 +08:00
seven332 ad081dd962 Improve splitting text 2015-07-25 12:26:19 +08:00
seven332 a3251720ff Fix mCanvas == null in mIdleRunner 2015-07-24 23:26:59 +08:00
seven332 8dd939f4dc Add SpriteTexture and TextTexture 2015-07-24 16:40:35 +08:00
seven332 d3af20fe4d Fix alpha in TiledTexture 2015-07-24 16:39:33 +08:00
seven332 aedd80e82b Fix GLES20 check 2015-07-24 11:43:15 +08:00
seven332 c7525ca1fb Add draw arc 2015-07-24 11:05:00 +08:00
seven332 ee9d23dd60 Add stuff from Gallery2 2015-07-23 19:00:04 +08:00
seven332 a54f00808a Update 2015-07-23 17:23:44 +08:00
seven332 310c510e33 Use AppTheme.Dark.NoActionBar.Translucent for GalleryActivity 2015-07-23 17:21:00 +08:00
seven332 702376979a Improve GallerySpider 2015-07-21 10:33:04 +08:00
seven332 ec7e3948d9 Add ProgressView 2015-07-19 23:39:02 +08:00
seven332 87e3db3dc5 Add GalleryView 2015-07-19 15:19:49 +08:00
seven332 440898fba5 Add gallery spider 2015-07-18 23:27:26 +08:00
seven332 ce68c32cf2 Add dao generator 2015-07-18 23:26:36 +08:00
seven332 d65ce05324 Make popular list show jpn title 2015-07-14 22:17:58 +08:00
seven332 d87238f5e6 Fixes url matching 2015-07-14 21:24:49 +08:00
seven332 0cd06a8354 Fixes #22, try to show jpn title 2015-07-14 20:43:55 +08:00
seven332 f589124cc8 Fix no hits found 2015-07-14 16:15:24 +08:00
seven332 e9f51e2b1f Add clear image memory cache 2015-07-14 15:20:33 +08:00
seven332 f3f6957910 Sync libraries 2015-07-13 22:11:20 +08:00
seven332 a75c4ecffd Add Yorozuya 2015-07-13 21:44:32 +08:00
seven332 24faddf5b0 Add set preview size 2015-07-12 21:51:04 +08:00
seven332 22af14e83b Add set excluded languages 2015-07-12 16:15:21 +08:00
seven332 593b32f03b Sync libraries 2015-07-11 20:09:50 +08:00
seven332 8d5c8c4236 Make EhClient request cancellable 2015-07-11 20:08:49 +08:00
seven332 30ff85e25b Update 2015-07-07 23:32:43 +08:00
seven332 c832589ac6 Fix SceneDialog in multiple SceneManager 2015-07-06 15:20:10 +08:00
seven332 951e7323e3 Fix normal preview index error 2015-07-06 15:17:22 +08:00
seven332 0025c76573 Support multiple SceneManager 2015-07-06 01:11:42 +08:00
seven332 458a275dcd Use default AnimatorListener 2015-07-05 20:55:10 +08:00
seven332 56fc7507e3 Improve detail scene layout 2015-07-05 20:53:22 +08:00
seven332 efed224018 Fix cookie error on old Android 2015-07-05 20:52:19 +08:00
seven332 432c29f19a Improve url analysis in comment 2015-07-04 23:33:11 +08:00
seven332 ece0db88ab Swipe on PreviewLayout to page 2015-07-04 20:35:48 +08:00
seven332 96ed9d3952 Improve detail scene 2015-07-04 16:18:17 +08:00
seven332 8aa6695e1b Improve detail scene 2015-07-04 10:49:48 +08:00
seven332 8d980cd48b Improve detail scene 2015-07-03 12:40:47 +08:00
seven332 76ffde2f32 Move preference scene 2015-07-02 19:38:44 +08:00
seven332 f71883a2b9 Improve scene lifecycle 2015-07-02 16:57:52 +08:00
seven332 3f6d3ea21c Improve detail scene 2015-07-02 01:21:07 +08:00
seven332 a01e43ea95 Add CommentScene 2015-06-30 00:04:40 +08:00
seven332 76e9dac1f6 Fix using useful bitmap 2015-06-29 19:15:07 +08:00
seven332 57acf0585d Update detail scene 2015-06-29 15:13:37 +08:00
seven332 a26686c31b Update detail scene 2015-06-28 14:56:03 +08:00
seven332 2599b032f0 Sync libraries 2015-06-26 12:54:23 +08:00
seven332 2763b694a6 Use CardSalon instead of CardView 2015-06-26 12:52:44 +08:00
seven332 9b2bdbd9c0 Avoid setSource invalid 2015-06-26 01:09:13 +08:00
seven332 4affa28dfd Update proguard-rules 2015-06-24 14:03:13 +08:00
seven332 27d1ab6ecc Update strings.xml 2015-06-24 14:01:53 +08:00
seven332 6e36876758 Use Conaco instead of Fresco 2015-06-24 11:10:29 +08:00
seven332 39377175ac More powerful read, remove pause, add memoryEntryRemoved 2015-06-24 10:54:59 +08:00
seven332 5a6fb73a56 Sync BeerBelly 2015-06-21 12:50:09 +08:00
seven332 5978bce786 Add BeerBelly 2015-06-21 12:49:23 +08:00
seven332 1399b3b0f1 Sync RippleOld 2015-06-17 22:27:36 +08:00
seven332 e2eb8ed9ea Fix getClipToPadding NoSuchMethod 2015-06-17 17:10:56 +08:00
seven332 352b2c1834 Move Hotspot and RippleOld to submodule 2015-06-17 15:23:19 +08:00
seven332 23bc6870e0 Fix drawer list activated item 2015-06-16 00:27:44 +08:00
seven332 5a2a5b4289 Keep scene after Activity restart 2015-06-15 22:42:55 +08:00
seven332 588b255788 Sync UniFile 2015-06-09 13:17:31 +08:00
seven332 2fae84958f Remove RenderNodeAnimator 2015-06-08 23:43:34 +08:00
seven332 e86500d189 New theme color 2015-06-08 23:27:36 +08:00
seven332 e4365f7a0e Remove svg-android 2015-06-08 23:21:15 +08:00
seven332 683a3d7cb9 Remove useless stuff 2015-06-08 19:20:29 +08:00
seven332 9b2e582052 Use VectorOld submodule 2015-06-08 19:17:12 +08:00
seven332 a7abbb77cd Update .gitgnore 2015-06-08 18:14:39 +08:00
seven332 51179c4c99 Remove .idea 2015-06-08 18:08:57 +08:00
seven332 1899571aef Use UnFile submodule 2015-06-08 17:03:44 +08:00
seven332 f6a63dd8df Remove *.iml 2015-06-08 16:56:54 +08:00
seven332 3f75e1d685 Fix error due to bad android.jar 2015-06-07 20:40:21 +08:00
seven332 e3134bbea1 buildTools version bump 2015-06-07 19:21:13 +08:00
seven332 87a18bac94 Use android.support.annotation.DrawableRes 2015-06-07 19:20:06 +08:00
seven332 cfe0ca9801 : may fail creating file 2015-06-07 19:18:50 +08:00
seven332 3b25fcf45c Update proguard-rules for VectorResources 2015-06-07 16:55:31 +08:00
seven332 cfe8ba06ab Add show_application_stats preference 2015-06-07 16:54:25 +08:00
seven332 9116312875 Restore EhClient 2015-06-07 16:31:39 +08:00
seven332 9b067c9296 svg to VectorDrawable 2015-06-07 16:24:04 +08:00
seven332 6edc156dd0 Update scene gallery detail 2015-06-07 13:44:52 +08:00
seven332 6318d02551 black_mesa is better than lambda 2015-06-07 13:43:20 +08:00
seven332 2b69aa10d5 Add UniFile 2015-06-07 02:05:52 +08:00
seven332 b6af27dcb0 fresco and okhttp version bump 2015-06-04 22:27:55 +08:00
seven332 8acc80a5b9 Fix copyright 2015-06-03 19:21:12 +08:00
seven332 6136b5c9c2 Update 2015-06-03 19:00:10 +08:00
seven332 cba2811ec5 CardView version bump 2015-06-03 18:52:30 +08:00
seven332 40ef147cbc Add RecyclerView helper 2015-06-03 17:03:22 +08:00
seven332 ce75c6a67c RecyclerView version bump 2015-06-03 17:02:36 +08:00
seven332 2130e7a8dd Improve preference, use leakcanary, start GalleryDetailScene 2015-06-02 23:23:34 +08:00
seven332 9b6815c60c Correct register to unregister 2015-06-01 16:04:00 +08:00
seven332 a568c9f965 Use enter view on close in TransitionCurtain 2015-05-31 21:03:48 +08:00
seven332 a329597fb3 Improve TransitionCurtain 2015-05-30 23:41:36 +08:00
seven332 2ffd764e63 Improve Preference 2015-05-30 03:07:38 +08:00
seven332 374395eec9 Support dependencies version bump 2015-05-29 18:18:03 +08:00
seven332 67c33ad8a2 Improve Preference 2015-05-29 11:33:15 +08:00
seven332 3bcb96d89f Optimize SimpleDialogCurtain 2015-05-29 00:53:48 +08:00
seven332 aa61dada92 Add Preference 2015-05-28 21:29:20 +08:00
seven332 c1af94afa0 setWillNotCacheDrawing true for SimpleImageView 2015-05-28 20:43:22 +08:00
seven332 2c151cafe9 Fix GalleryListScene state store 2015-05-27 22:52:54 +08:00
seven332 a4cc2de577 Fix padding in DrawerLayout for content and drawer 2015-05-27 13:41:48 +08:00
seven332 f750922dce Update strings.xml 2015-05-26 15:39:22 +08:00
seven332 843ea2540a Fix go to homepage 2015-05-26 12:18:52 +08:00
seven332 8c13d08360 getSceneView return NonNull 2015-05-26 12:10:46 +08:00
seven332 416d5ed588 Disable SceneView touch event when it hidden 2015-05-26 12:00:43 +08:00
seven332 0e4ded4231 Add AppbarScene 2015-05-24 21:06:49 +08:00
seven332 f334b250ef Add setState for GalleryListScene 2015-05-24 02:53:02 +08:00
seven332 5565180730 Add SceneStateListener 2015-05-23 03:08:06 +08:00
seven332 7728438492 Fix for mouse scroll 2015-05-22 22:36:59 +08:00
seven332 0d56f13ee3 Use RecyclerView onGenericMotionEvent 2015-05-22 22:28:07 +08:00
seven332 27abd5f5e0 Adjust DrawerLayout for KK 2015-05-22 21:45:48 +08:00
seven332 17625f9f97 Move vectorold to separated package 2015-05-22 19:28:44 +08:00
seven332 104918ef82 Add image tap retry 2015-05-21 00:28:58 +08:00
seven332 d1659ae460 Add drawer_shadow 2015-05-20 19:38:43 +08:00
seven332 7c54c447f3 Add settings header 2015-05-20 17:55:40 +08:00
seven332 725b247974 Add ime action for sign in 2015-05-19 23:54:38 +08:00
seven332 97f73263bd Remove error JSON MediaType string 2015-05-19 23:36:29 +08:00
seven332 368f13190c Add generateRippleDrawable for RippleSalon 2015-05-19 23:35:15 +08:00
seven332 96f37016f4 Add selector for EasyRecyclerView 2015-05-19 23:32:12 +08:00
seven332 65624d5efc wait enough time after add items to RecyclerView 2015-05-18 20:05:01 +08:00
seven332 b7f8cda304 Use OkHttpClient 2015-05-18 19:53:59 +08:00
seven332 08d0794fe8 Add sign in scene 2015-05-18 00:15:49 +08:00
seven332 3c3dd4a7e2 Update 2015-05-17 00:51:58 +08:00
seven332 d528a9fbdc Adjust user panel 2015-05-16 20:26:43 +08:00
seven332 ff9f1d3fbd Keep get gallery listener after scene restart 2015-05-16 18:24:59 +08:00
seven332 e4a4d7fb43 Fresco version bump 2015-05-16 04:27:26 +08:00
seven332 4837079563 Remove useless stuff 2015-05-16 04:18:37 +08:00
seven332 8572665ce3 Add left drawer 2015-05-16 03:45:37 +08:00
seven332 7b21001af0 Show readable error string 2015-05-16 14:11:28 +08:00
seven332 0489ef2c39 Update 2015-05-15 21:15:07 +08:00
seven332 a7a66a9043 Proguard for fresco 2015-05-15 19:31:26 +08:00
seven332 7260d50432 Gradle and android plugin version bump 2015-05-15 18:35:18 +08:00
seven332 ccc298ac1e Fix normal preview image crop area totally out of original image 2015-05-13 12:26:46 +08:00
seven332 16e4a41fbe Improve search 2015-05-13 12:12:28 +08:00
seven332 903373a625 Add scrollToPositionProperly 2015-05-12 20:18:32 +08:00
seven332 dae22d0284 Make RecyclerView smooth scroll speed customizable 2015-05-12 19:35:29 +08:00
seven332 224760abf6 Create new scene after Activity recreate 2015-05-12 13:33:21 +08:00
seven332 a5bcad9296 Update 2015-05-12 01:10:09 +08:00
seven332 4ef644837f Adjust shown stats 2015-05-12 01:09:36 +08:00
seven332 965d5c0ef5 Add get center position in ancestor 2015-05-12 01:04:17 +08:00
seven332 8f7fafcf7d Add button click listener and custom view for SimpleDialog 2015-05-12 01:03:26 +08:00
seven332 001baad933 Hide soft keyboard after Scene close 2015-05-12 01:02:19 +08:00
seven332 0222dcd727 Improve gallery list refresh 2015-05-10 16:12:48 +08:00
seven332 fc03b967b3 Update 2015-05-10 15:32:29 +08:00
seven332 71217857f1 Add current page change while scroll in ContentLayout 2015-05-10 14:53:33 +08:00
seven332 d617ef402d Add RenderNodeAnimator support check 2015-05-10 02:41:13 +08:00
seven332 056df13e66 Fix SimpleAnimatorListener for RenderNodeAnimator in CheckTextView 2015-05-10 02:27:08 +08:00
seven332 4800f99529 Add ViewTransition for ContentLayout 2015-05-10 02:25:06 +08:00
seven332 bc800b5a1b Fix SimpleAnimatorListener for RenderNodeAnimator in CheckTextView 2015-05-10 01:58:47 +08:00
seven332 d06922cb08 ViewTransition support multiple View 2015-05-10 01:53:08 +08:00
seven332 96f3b027e5 Update 2015-05-09 22:23:40 +08:00
seven332 755354a8fe Update ContentLayout 2015-05-09 00:15:44 +08:00
seven332 fbced66a4e Add StatsActivity 2015-05-08 16:27:53 +08:00
seven332 8da847ebc8 Update ContentLayout 2015-05-07 23:59:51 +08:00
seven332 37651f8d4b Fix list in SearchBar error 2015-05-07 23:35:49 +08:00
seven332 d9f8dca4c3 Add application hiden trigger 2015-05-07 23:20:16 +08:00
seven332 9df2cca9c1 Adjust help icon size 2015-05-07 20:42:16 +08:00
seven332 027c73f460 Add StatsActivity 2015-05-07 20:34:37 +08:00
seven332 28553ce453 Add hardware draw for CheckTextView 2015-05-07 19:09:42 +08:00
seven332 95a724e5d4 Add InterpolatorUtils 2015-05-07 14:22:57 +08:00
seven332 a20565f1b2 Improve view state saving 2015-05-06 10:37:48 +08:00
seven332 5da51bd984 Remove useless stuff in SearchLayout 2015-05-03 22:52:49 +08:00
seven332 fe7f7529d1 SaveInstanceState for FabLayout 2015-05-03 20:05:59 +08:00
seven332 401ccf036b Add Interpolator for FabLayout 2015-05-03 16:21:43 +08:00
seven332 c7f0c0c215 Add auto cancel for FabLayout 2015-05-03 16:00:57 +08:00
seven332 bac2bd933b Rename SimpleDialogView to SceneDialogView 2015-05-03 13:59:54 +08:00
seven332 2ccb1d521d Adjust AddDeleteDrawable 2015-05-02 22:56:18 +08:00
seven332 bab22977f2 Add FloatingActionButtonLayout 2015-05-02 22:42:58 +08:00
seven332 5916e57bc8 Fix scene back press inherit 2015-05-02 15:29:24 +08:00
seven332 b0a21d8487 0.6.16.2 2015-05-01 19:16:47 +08:00
seven332 662f81e07d Fix search crash in Meizu Lollipop 2015-05-01 19:11:10 +08:00
seven332 1f03e05424 0.6.16.1 2015-05-01 17:56:20 +08:00
seven332 2da8ebe75f Fix pattern protection no more retry first time 2015-05-01 16:41:27 +08:00
seven332 3578477121 Add fab animate, fix screen rotate fit padding bottom zero 2015-05-01 16:20:05 +08:00
seven332 6eb8fe3c71 Fix fit padding bottom zero for scene 2015-05-01 15:53:37 +08:00
seven332 0ca00aab9b Add Interpolator for SimpleDialogCurtain 2015-05-01 02:09:13 +08:00
seven332 2092171440 0.6.16 2015-04-30 23:20:22 +08:00
seven332 9ba87db1f0 Keep status bar black for SecretActivity 2015-04-30 23:01:05 +08:00
seven332 447ef9a510 Show suggestion name when add quick search 2015-04-30 22:36:01 +08:00
seven332 23936ff844 Scroll to current downloading gallery 2015-04-30 22:19:40 +08:00
seven332 29f2723919 Update string.xml 2015-04-29 23:26:37 +08:00
seven332 65feff57c0 Add pattern protection 2015-04-29 23:00:24 +08:00
seven332 e6d4dc6e2e Add some TODO 2015-04-29 18:28:04 +08:00
seven332 00189740b2 Hide or show search bar while recycler view scroll 2015-04-29 13:34:26 +08:00
seven332 894cf61d67 Fix tag help dialog start position 2015-04-28 20:41:18 +08:00
seven332 75d830d137 A better way to color status bar and fix screen mess sometimes in Lollipop 2015-04-28 20:39:00 +08:00
seven332 4b88ab5d92 Show more info for log 2015-04-28 20:21:11 +08:00
seven332 586806dd8e A better way to color status bar 2015-04-28 20:18:25 +08:00
seven332 017ee1c538 Merge pull request #65 from HybridGlucose/dev-AS
Fixes zh-rTW Translation
2015-04-28 08:09:21 +08:00
HybridGlucose 0059edd194 Update strings.xml 2015-04-28 00:26:35 +08:00
HybridGlucose 88a22b8545 修正簡繁用語差異 2015-04-28 00:01:48 +08:00
seven332 e0713bdfec Set curtain animate time to 300ms 2015-04-27 23:57:25 +08:00
seven332 05a9f2aa12 Use drawableHotspotChanged for Lollipop 2015-04-27 23:54:58 +08:00
seven332 dd23537302 Add simple dialog curtain 2015-04-27 23:51:33 +08:00
seven332 09cda0ce06 Update scene dialog 2015-04-27 16:46:25 +08:00
seven332 5cc9acc365 Support library version bump 2015-04-26 21:11:19 +08:00
seven332 ab861c932a Add scene dialog 2015-04-26 21:10:16 +08:00
seven332 024511c249 Merge pull request #63 from fython/dev-AS
Add elevation for ActionBar
2015-04-26 15:01:47 +08:00
fython 7b763a4f2a Add elevation for ActionBar
Signed-off-by: fython <fython@163.com>
2015-04-26 13:32:31 +08:00
seven332 5bfc033d2d Merge remote-tracking branch 'origin/dev-AS' into dev-AS 2015-04-26 02:12:42 +08:00
seven332 101b1cf256 Maybe fix cache issue 2015-04-26 02:12:21 +08:00
seven332 84b8c41173 Add hint to search bar 2015-04-25 19:19:22 +08:00
seven332 fbeffe53f6 Update search in gallery list 2015-04-25 14:36:13 +08:00
seven332 10ca8b352c Update 2015-04-24 17:09:25 +08:00
seven332 00dbd94c84 Compatible with appcompat-v7 22.1.0 2015-04-24 14:59:37 +08:00
seven332 ec8ad7a5a1 Merge remote-tracking branch 'origin/dev0121' into dev0121 2015-04-24 10:10:50 +08:00
seven332 38bd1e1f37 Support library version bump 2015-04-24 10:10:02 +08:00
seven332 3abda5fde2 Support library version bump 2015-04-24 10:07:09 +08:00
seven332 5a9aa2a2db Keep VectorResources in proguard 2015-04-22 18:23:58 +08:00
seven332 cfe8ec30d6 Use xml color resources 2015-04-22 15:19:56 +08:00
seven332 be8ab2fcb2 Add search history 2015-04-22 12:52:06 +08:00
seven332 beec5d8776 Add SearchBar list animation 2015-04-21 18:58:52 +08:00
seven332 58b34a4bb2 What if it crashes when generating crash report 2015-04-21 14:21:58 +08:00
seven332 00b7feab69 0.6.15.2 2015-04-21 14:01:27 +08:00
seven332 c69715d866 Fix torrent name 2015-04-21 13:58:30 +08:00
seven332 c8b347eed2 0.6.15.1 2015-04-21 11:31:24 +08:00
seven332 41b160227f Add current gallery information in crash report 2015-04-21 11:23:50 +08:00
seven332 697e0026c5 Get more information for crash report 2015-04-21 10:01:57 +08:00
seven332 0f9bec5645 Maybe fix NullPointerException for torrent 2015-04-21 10:00:48 +08:00
seven332 40784ea5a5 0.6.15 2015-04-20 12:17:30 +08:00
seven332 708ba3a3e9 Adjust search bar action 2015-04-19 23:31:10 +08:00
seven332 6fcbdc284d Remove cache pause 2015-04-19 22:18:26 +08:00
seven332 dbbcebab67 Update 2015-04-19 14:57:54 +08:00
seven332 4084dc26df Clang3.5 for NDK build 2015-04-18 15:03:02 +08:00
seven332 c71a8fc468 Closes #59; fixes year in change_log. 2015-04-18 14:59:54 +08:00
seven332 4133bb4e7b Update 2015-04-18 04:06:49 +08:00
seven332 525ce72ec1 Update TransitionCurtain 2015-04-17 21:55:30 +08:00
seven332 35df91190a Fix download filename again 2015-04-16 19:02:00 +08:00
seven332 5c44251762 Fix download filename 2015-04-16 17:44:49 +08:00
seven332 75a6ffdd13 Update HttpHelper 2015-04-16 12:35:30 +08:00
seven332 4ddf33b4c1 Add keyboard control for gallery 2015-04-15 19:28:28 +08:00
seven332 2d97cd375c Adjust set cookie 2015-04-15 17:55:47 +08:00
seven332 01cf1a8be4 Add login via cookie 2015-04-15 16:18:17 +08:00
seven332 2fdc42acc4 Closes #3; show different icon for different favorite state. 2015-04-14 21:49:34 +08:00
seven332 85ea7550f4 Add gallery favorite status parse 2015-04-14 17:26:36 +08:00
seven332 68d17c3ca8 Update readme 2015-04-13 14:24:45 +08:00
seven332 409e8a093b Add readme 2015-04-13 14:14:31 +08:00
seven332 f7e63ca386 Build *.so from source code 2015-04-13 14:05:24 +08:00
seven332 4e185a9b44 Move AppConfig 2015-04-13 10:31:02 +08:00
seven332 77403b3032 ' to \' in string.xml 2015-04-13 10:24:14 +08:00
seven332 3b7673c14e Add sharing gallery 2015-04-13 10:19:58 +08:00
seven332 7ecac0db9e Add ic_torrent 2015-04-13 09:28:08 +08:00
seven332 aedadff3a7 Try to adapt to small screen 2015-04-12 22:21:59 +08:00
seven332 7b5cd5df9b Add save torrent, resolve #55 2015-04-12 22:12:05 +08:00
seven332 6918a8776e Remove useless stuff 2015-04-11 22:11:39 +08:00
seven332 9b821e875e Fix miss crash info 2015-04-11 16:02:17 +08:00
seven332 29fadae5ab Fix volume page error 2015-04-11 15:57:31 +08:00
seven332 3d329979d4 Merge remote-tracking branch 'origin/dev-AS' into dev-AS 2015-04-11 15:39:01 +08:00
seven332 2027b806df Page turning via volume key 2015-04-10 16:43:58 +08:00
seven332 b18cdd04ce Avoid IllegalStateException about CookieSyncManager 2015-04-10 13:36:37 +08:00
seven332 281eb12f0c Get url domain name for cookie 2015-04-09 23:48:57 +08:00
seven332 5022ce2b54 Improve crash collection 2015-04-07 14:45:36 +08:00
seven332 fa8cd69bf5 Fix EasyRecyclerView ActionMode 2015-04-05 18:49:24 +08:00
seven332 fbfc98b98d EasyRecyclerView SavedState 2015-04-05 14:37:45 +08:00
seven332 30038a8f3e Update EasyRecyclerView item view checked state 2015-04-05 14:06:08 +08:00
seven332 063fa658f2 History swipe to dismiss 2015-04-05 01:42:12 +08:00
seven332 59dccfa513 Merge remote-tracking branch 'origin/dev-AS' into dev-AS
Conflicts:
	app/src/main/java/com/hippo/ehviewer/widget/recyclerview/EasyRecyclerView.java
2015-04-05 01:06:40 +08:00
seven332 471919682e Improve EasyRecyclerView item click 2015-04-05 01:05:14 +08:00
seven332 8810249fc7 Improve EasyRecyclerView item click 2015-04-05 00:24:31 +08:00
seven332 f2588cc71a Enhance Log 2015-04-03 23:11:52 +08:00
seven332 0335e4338b Avoid unknown error in EasyRecyclerView 2015-04-02 19:11:38 +08:00
seven332 857366f8d6 Avoid SparseArray error for multi thread 2015-04-02 19:09:22 +08:00
seven332 3d32fd7bcc Fix omitted 509 url 2015-04-01 09:22:12 +08:00
seven332 6c200bfbf5 Update 2015-03-31 16:34:48 +08:00
seven332 f4aae2a027 Remove useless lock in AnyCache 2015-03-30 21:10:21 +08:00
seven332 69330a2fec Update 2015-03-30 20:57:27 +08:00
seven332 a69be45099 Fix disk cache key 2015-03-30 18:01:52 +08:00
seven332 4985945dcb Update cache 2015-03-30 17:57:22 +08:00
seven332 e197ce3fe2 0.6.14 2015-03-27 21:42:11 +08:00
seven332 02e1185ebe Fix parsing gallery image url error 2015-03-27 21:13:58 +08:00
seven332 b992602b2d Merge remote-tracking branch 'origin/dev-AS' into dev-AS 2015-03-27 19:01:44 +08:00
seven332 0782469760 Add H@H proxy switch enable 2015-03-27 19:01:19 +08:00
seven332 938c1a2e88 Add warning before cleaning redundancy 2015-03-27 10:42:19 +08:00
seven332 0a2c442b75 Add H@H support 2015-03-26 23:36:23 +08:00
seven332 6b6c50f8cc Enable js in login webview 2015-03-26 19:59:14 +08:00
seven332 fd7ea32942 getAllocationByteCount might fail in kitkat-release 2015-03-26 19:31:22 +08:00
seven332 b9f0a6c70c Update scene 2015-03-26 17:26:38 +08:00
seven332 a74fb52c9a Use PropertyValuesHolder 2015-03-26 15:33:03 +08:00
seven332 de7a5b6395 Update vector 2015-03-26 14:06:33 +08:00
seven332 d02e211ee3 Fix theme.xml syntax 2015-03-26 13:43:06 +08:00
seven332 be9d051d39 Re hide scene after restore 2015-03-25 23:25:28 +08:00
seven332 6d8d16d1f8 Adjust cache 2015-03-25 19:44:50 +08:00
seven332 29f003724b Update Scene 2015-03-25 15:25:49 +08:00
seven332 e2d16df66a Update Scene 2015-03-24 23:23:20 +08:00
seven332 0ce081512d Update Scene 2015-03-24 16:46:50 +08:00
seven332 e8d1d92bfb Update Scene 2015-03-24 14:16:42 +08:00
seven332 781bf86ef1 Update Scene 2015-03-23 16:40:06 +08:00
seven332 a95e708144 Update Scene 2015-03-23 16:25:46 +08:00
seven332 af8c480588 0.6.13.2 2015-03-22 20:48:22 +08:00
seven332 5d0e035b35 Fix android.content.ActivityNotFoundException when sending email 2015-03-22 20:43:30 +08:00
seven332 f8e51c3ff7 Fix comment parse 2015-03-22 20:00:49 +08:00
seven332 9cb7d20dfc Fix parse 2015-03-22 03:59:05 +08:00
seven332 245bdc14ce Fix parse error 2015-03-22 02:54:32 +08:00
seven332 9c3c0e929a Add material progress bar 2015-03-21 18:24:33 +08:00
seven332 3b31fbc1fb Add path for PathInterpolator 2015-03-21 16:51:08 +08:00
seven332 182d7b2b96 Update proguard 2015-03-21 16:43:22 +08:00
seven332 f29090ee12 Update proguard 2015-03-18 11:04:38 +08:00
seven332 1488163e8f Update 2015-03-17 20:43:36 +08:00
seven332 1d40c9d873 Use vector 2015-03-17 19:54:04 +08:00
seven332 b3d2310950 Add obtain for EhHttpHelper 2015-03-16 22:50:49 +08:00
seven332 f4389afb30 Add vector support 2015-03-15 23:30:59 +08:00
seven332 d137151e7a Move ic_launcher from drawable to mipmap 2015-03-15 16:26:17 +08:00
seven332 f1d4540558 Move ic_launcher from drawable to mipmap 2015-03-15 02:26:01 +08:00
seven332 8bda985782 Update 2015-03-15 02:05:56 +08:00
seven332 5dc7611ce6 Move ic_launcher from mipmap to drawable 2015-03-13 22:37:16 +08:00
seven332 871e9ea7ab Update Gradle Plugin to 1.1.3 2015-03-13 22:34:12 +08:00
seven332 497438c0a1 Adjust cache 2015-03-13 22:26:09 +08:00
seven332 b407e38733 Move ic_launcher from mipmap to drawable 2015-03-12 16:30:18 +08:00
seven332 0fd27bf7fa Update Gradle Plugin to 1.1.3 2015-03-12 12:50:30 +08:00
seven332 1d202bb229 Update target SDK version to 22 2015-03-12 10:41:47 +08:00
seven332 45a9906731 Update target SDK version to 22 2015-03-12 10:38:14 +08:00
seven332 7ee2dfc581 0.6.12 2015-03-09 15:25:46 +08:00
seven332 1c2aff9bbb Add login via WebView 2015-03-09 15:17:17 +08:00
seven332 ea1861ee34 Update 2015-03-08 21:47:41 +08:00
seven332 795682f31f Rename RippleOldDrawable to RippleDrawable 2015-03-07 18:39:14 +08:00
seven332 fd5d07b2f2 Init 2015-03-07 15:56:43 +08:00
seven332 111cee1299 Add state save for AdvanceSearchTable 2015-03-01 15:40:36 +08:00
seven332 5ff56140fe Add state save for CategoryTable 2015-03-01 15:08:48 +08:00
seven332 e1b463314d Leave some space for nav bar in KK and above 2015-03-01 14:58:10 +08:00
seven332 4fccbefdd2 Update 2015-03-01 01:32:53 +08:00
seven332 ae7c8199bf Remove useless file 2015-02-28 21:43:46 +08:00
seven332 86d42dd283 Avoid NullPointerException 2015-02-28 15:54:43 +08:00
seven332 3d71e08272 Update 2015-02-28 15:52:04 +08:00
seven332 7480b8f168 Fixes #37 mdpi/ic_drawer_search color 2015-02-27 18:52:54 +08:00
seven332 ba106d76b4 0.6.11.1 2015-02-27 11:41:02 +08:00
seven332 6040e0966a Fix thumb 403 2015-02-27 11:24:18 +08:00
seven332 7375b1ca24 Update 2015-02-22 23:49:20 +08:00
seven332 40cfddb348 Fix SelectSearchImageLayout orientaion 2015-02-21 21:32:21 +08:00
seven332 2558a3770a Update gradle to 1.1.0 2015-02-20 14:19:21 +08:00
seven332 4f9cbeeb0f Remove unnecessary blank line 2015-02-18 15:37:31 +08:00
seven332 96ca3155e7 Update strings.xml 2015-02-17 16:14:56 +08:00
seven332 bd1956a89f Rename RippleOldBackground to RippleBackground 2015-02-17 15:49:47 +08:00
seven332 023887dfac Add proguard-rules 2015-02-17 15:48:52 +08:00
seven332 a5d9c2fd4a Update 2015-02-17 15:26:24 +08:00
seven332 940d135057 Make minimum size work for FixedAspectImageView 2015-02-17 10:38:09 +08:00
seven332 852db378b0 Update 2015-02-16 17:53:27 +08:00
seven332 52e76c22cb Adjust for sw600dp-land 2015-02-12 23:11:47 +08:00
seven332 26467a64fa Fix ERROR: v22 -> v21 2015-02-12 22:52:03 +08:00
seven332 d1dc607bed Add shadow 2015-02-12 21:58:37 +08:00
seven332 b63ea27415 Update 2015-02-12 20:43:25 +08:00
seven332 ccc1032ecb Avoid StartActivity creating ContentActivity more than once 2015-02-10 20:41:24 +08:00
seven332 c3b5313ddc Update 2015-02-10 20:24:34 +08:00
seven332 d3bfd987b0 Improve ChekTextView 2015-02-10 12:55:14 +08:00
seven332 9495b026b6 Improve save 2015-02-09 23:48:11 +08:00
seven332 f785848fe0 Add animation for CheckTextView 2015-02-09 00:00:28 +08:00
seven332 b6654f09af Improve search 2015-02-08 22:26:01 +08:00
seven332 cde8aa7f62 Improve search 2015-02-08 14:06:30 +08:00
seven332 19e70aacdf Add log with default tag 2015-02-06 10:26:11 +08:00
seven332 f5551e4e0c Adjust the shadow of FloatingActionButton 2015-02-04 14:05:53 +08:00
seven332 0198a4eba4 Adjust FloatLabelEditText 2015-02-02 23:32:01 +08:00
seven332 c476241ce2 Fix Space for Pre-Lollipop 2015-02-02 23:30:18 +08:00
seven332 19e09c2dbe Add FloatLabelEditText 2015-02-02 23:26:18 +08:00
seven332 82a6afa239 Adjust CheckTextView draw mask 2015-02-02 16:04:11 +08:00
seven332 089aaf79bc Add source 2015-02-02 00:28:27 +08:00
seven332 9817a3c74d Update 2015-01-29 23:11:01 +08:00
seven332 0804bfc88d Add RefreshLayout 2015-01-28 18:45:09 +08:00
seven332 7cb04f39b3 Update HttpHelper.java 2015-01-28 14:28:50 +08:00
seven332 a6f278c3ca Adjust FloatingActionButton for Lollipop 2015-01-28 00:48:32 +08:00
seven332 f09b2ec1fa Add source 2015-01-27 20:10:48 +08:00
seven332 43d71e8813 Add RTL support for LinearDividerItemDecoration 2015-01-27 20:10:48 +08:00
seven332 2a7e905bac Improve scene 2015-01-27 20:10:48 +08:00
seven332 0f0079dea0 Improve scene 2015-01-27 20:10:47 +08:00
seven332 0eed2f7332 Add source 2015-01-27 20:10:47 +08:00
seven332 afe2915a5c Add source 2015-01-27 20:10:47 +08:00
seven332 a836c6bef6 Add source 2015-01-27 20:10:46 +08:00
seven332 6ae4fa1506 Add ResponseCodeException 2015-01-27 20:10:46 +08:00
seven332 b1f952d722 Add source 2015-01-27 20:10:46 +08:00
seven332 b7df7f60a3 Add readme 2015-01-27 20:10:45 +08:00
seven332 fe8021a512 Add source 2015-01-27 20:10:45 +08:00
seven332 6004602ab3 Add source 2015-01-27 20:10:45 +08:00
seven332 08bca4dabf Initial commit 2015-01-27 20:10:44 +08:00
seven332 dbba4c663e 参数写反了 2015-01-15 15:44:16 +08:00
seven332 4fd3d6a966 添加 mips64 支持 2015-01-11 22:47:58 +08:00
seven332 14211dc087 添加 x86_64 支持 2015-01-11 15:03:59 +08:00
seven332 72a3bfad74 Update libpng to 1.6.16 2015-01-09 22:48:56 +08:00
seven332 976527865d Add libjpeg-turbo config.h 2015-01-09 22:18:26 +08:00
seven332 a1de079224 Update giflib to 5.1.1 2015-01-09 22:16:46 +08:00
seven332 9b932bcef0 添加 x86 支持,修正链接错误 2015-01-09 21:57:49 +08:00
seven332 a57a472f70 update 2015-01-03 03:52:27 +08:00
seven332 5af5ad927f 调整 ripple 效果,调整评论布局 2015-01-03 03:40:37 +08:00
seven332 d6aa3174fd update 2014-12-31 22:07:25 +08:00
seven332 bddd55c42a update MathUtils 2014-12-30 23:30:52 +08:00
seven332 4ac50aad60 Update strings.xml 2014-12-29 18:44:57 +08:00
seven332 8ceecb5be2 update readme 2014-12-29 14:04:29 +08:00
seven332 376c332120 添加 Google+ 入口 2014-12-27 14:57:25 +08:00
seven332 3ed95dbdfc 避免多次刷新 Notification 2014-12-27 13:54:46 +08:00
seven332 690874b6a9 修正无限 update sercet image 2014-12-27 13:16:46 +08:00
seven332 b90e2b242a changelog 2014-12-27 13:14:24 +08:00
seven332 ce6a8b4323 从服务器获取 sercet image 2014-12-27 12:20:33 +08:00
seven332 e7a6c3bb85 update string.xml 2014-12-26 23:31:36 +08:00
seven332 15b6b0a627 区分是否已加入下载列表 2014-12-26 21:43:05 +08:00
seven332 af4398cecd 调整缩略图模式布局 2014-12-25 21:32:02 +08:00
seven332 f90bd465fb 调整列表图片加载 2014-12-25 19:59:19 +08:00
seven332 fbf3cf2527 移除无用资源 2014-12-25 19:27:51 +08:00
seven332 0847ef8693 调整字体 2014-12-25 18:50:51 +08:00
seven332 fecfd7b26e 使用 TextView 绘制 rating 2014-12-25 17:02:49 +08:00
seven332 1701054e25 调整启动界面 2014-12-25 15:07:40 +08:00
seven332 7d24529831 调整启动界面 2014-12-25 14:23:53 +08:00
seven332 20e2314560 优化 DrawableTransition 2014-12-23 16:20:42 +08:00
seven332 ddbb85837a update thanks 2014-12-23 15:55:49 +08:00
seven332 4b9f872cf6 update 2014-12-23 15:48:14 +08:00
seven332 76bee4db76 调整图像加载过渡效果 2014-12-23 15:46:27 +08:00
seven332 7aa87e81d9 FixedAspectImageView 避免使用反射 2014-12-23 00:53:43 +08:00
seven332 3110679308 调整 EasyRecycleView 点击,长按,选择模式的实现方式 2014-12-22 00:27:38 +08:00
seven332 58769e5e8c 调整 openGL ES 本版获取方式,使用默认 EGLConfigChooser 2014-12-21 22:19:13 +08:00
seven332 1d1cfeec54 可能修正 No configs match configSpec 2014-12-21 15:26:17 +08:00
seven332 74afaa1d4c 调整图标 2014-12-21 13:50:25 +08:00
seven332 af417dc192 列表列数读取配置 2014-12-20 22:12:11 +08:00
seven332 df294cd717 修正无法刷新图片链接 2014-12-20 12:37:26 +08:00
seven332 0b07256c9b 避免 EBUSY (Device or resource busy) 错误 2014-12-20 03:52:21 +08:00
seven332 fa3d55d341 允许下载原图 2014-12-20 03:47:09 +08:00
seven332 a9363487be 完善 509 识别 2014-12-20 00:43:09 +08:00
seven332 0531a1849c 修正阅读时下一页覆盖当前页 2014-12-19 21:30:54 +08:00
seven332 93aef77259 字符串移至 string.xml 2014-12-19 19:35:12 +08:00
seven332 0bd6352c85 update 2014-12-19 18:56:57 +08:00
seven332 0827705cdf update 2014-12-19 18:47:13 +08:00
seven332 a76f8a56a7 返回键关闭阅读快速设置面板,若要隐藏 navigation bar 则延迟全屏 2014-12-19 17:52:46 +08:00
seven332 9f94a9142a 调整阅读快速设置滑动效果 2014-12-19 16:07:26 +08:00
seven332 ee4761268e 完善阅读快速设置 2014-12-19 15:16:14 +08:00
seven332 172c415ddd 调整阅读界面快速设置 2014-12-18 22:51:21 +08:00
seven332 bc80fa125f update 2014-12-16 15:04:41 +08:00
seven332 797869f14f 调整下载服务 2014-12-16 14:34:21 +08:00
seven332 7cd258d7c9 优化代码 2014-12-16 00:32:50 +08:00
seven332 fab6870470 优化下载服务 2014-12-16 00:28:45 +08:00
seven332 890f1e6937 修正错别字“再”->“在” 2014-12-15 15:53:57 +08:00
seven332 01463b60da 调整图标 2014-12-14 22:14:39 +08:00
seven332 6185f1b6a5 调整 RecyclerView 可见项识别 2014-12-14 19:23:48 +08:00
seven332 1d6f92bbae 避免列表 overscroll 不覆盖宽度 2014-12-07 22:55:01 +08:00
seven332 241dc25291 调整 GalleryListView item margin 机制,避免 item 大小不一 2014-12-07 22:45:34 +08:00
seven332 ad59fb5666 为 EasyRecyclerView 添加鼠标滚动响应 2014-12-07 21:49:39 +08:00
seven332 f47d7c1209 用 RecyclerView 替代 StaggeredGridView 2014-12-07 21:20:25 +08:00
seven332 f938f1639b 修正列表模式存储错误 2014-12-05 21:38:30 +08:00
seven332 c21d3b6ea4 避免下载 509 图片 2014-12-04 23:32:17 +08:00
seven332 b86bd5d95b 调整 Battery 的绘制方法以便适应大部分设备 2014-12-04 22:43:38 +08:00
seven332 d27d3a89fa 修正 JellyBean MR2 一下版本 TextClock 24时格式 小时无法显示问题(HH->kk) 2014-12-04 21:41:58 +08:00
seven332 f6b1df3e43 调整启动界面 2014-12-03 19:11:07 +08:00
seven332 3dc363b2dc 移除无用资源 2014-12-03 18:44:39 +08:00
seven332 08834a20f7 调整 BatteryDrawable 绘制 2014-12-03 15:59:03 +08:00
seven332 56c367fe53 调整分类颜色 2014-12-03 12:38:08 +08:00
seven332 038a67a60f changelog 2014-12-02 21:12:57 +08:00
seven332 f469c8b3d9 修正 ListPreference 不显示显示 summary 2014-12-02 21:03:59 +08:00
seven332 dfe290fd3e 修正 proguard 问题 2014-12-02 20:14:46 +08:00
seven332 783db367e8 changlog 2014-12-02 19:47:09 +08:00
seven332 9fe24403de 调整颜色 2014-12-02 19:40:47 +08:00
seven332 89d51e557b update string.xml 2014-12-02 19:12:32 +08:00
seven332 76bbae9663 允许用户添加错误描述 2014-12-02 18:59:07 +08:00
seven332 f653151acb 修正气泡位置计算错误 2014-12-02 16:53:11 +08:00
seven332 03837d4ea4 提前将图片资源传至 GPU 2014-12-02 16:36:20 +08:00
seven332 0da225c36c 添加卡页方向设置 2014-12-02 15:53:46 +08:00
seven332 851eaeb201 调整搜索记录提示 2014-11-30 23:01:10 +08:00
seven332 26a1e82c8d 添加搜索栏内容恢复 2014-11-30 19:03:22 +08:00
seven332 95cffb60aa changelog 2014-11-30 16:11:03 +08:00
seven332 f96f29ec68 update string.xml 2014-11-30 15:35:27 +08:00
seven332 0ee1eca811 调整主题 2014-11-30 14:50:03 +08:00
seven332 178b7c8ee3 调整主题颜色 2014-11-30 00:21:14 +08:00
seven332 dcfdd31bc4 update 2014-11-29 23:08:59 +08:00
seven332 083e7007af update 2014-11-29 15:02:09 +08:00
seven332 a1f8e3b97f update copyright 2014-11-29 14:13:27 +08:00
seven332 afece72b58 调整启动界面与默认头像 2014-11-29 04:54:19 +08:00
seven332 b61699a9e2 添加更多调试信息 2014-11-29 03:30:34 +08:00
seven332 749b55671d -j4 2014-11-28 19:49:07 +08:00
seven332 727433aa75 修正更新服务器默认值错误 2014-11-28 19:45:27 +08:00
seven332 0a0dae8b28 调整 Drawer 宽度 2014-11-28 16:39:04 +08:00
seven332 23f430dfd1 阅读界面添加快速设置 2014-11-28 15:25:16 +08:00
seven332 7ddcb2b94c 调整阅读亮度控制触控范围 2014-11-27 01:15:34 +08:00
seven332 80f602c184 修正阅读界面屏幕方向错误 2014-11-26 22:37:39 +08:00
seven332 855e39007c update 2014-11-26 19:33:52 +08:00
seven332 c0acbe816a 阅读界面添加亮度控制 2014-11-26 17:57:18 +08:00
seven332 2dcbdb2e12 添加 arm64 支持 2014-11-26 02:43:51 +08:00
seven332 7a5236c06a 调整资源 2014-11-26 02:30:15 +08:00
seven332 dfd3ba150a 添加 SlidingDrawerLayout 打开 drawer 时主界面变暗效果 2014-11-26 01:43:33 +08:00
seven332 0ff6890df4 调整左侧栏,优化平板显示 2014-11-25 23:07:55 +08:00
seven332 cdcfb65622 调整界面 2014-11-23 14:12:38 +08:00
seven332 24a2ec3fe8 允许应用被强制关闭后重启下载服务 2014-11-23 13:36:43 +08:00
seven332 ab6cc26c21 调整 Drawer 宽度 2014-11-22 22:36:34 +08:00
seven332 694e0e7746 调整界面以适应 lollipop 与平板 2014-11-22 16:55:06 +08:00
seven332 8be2ba7b7c 调整图标 2014-11-19 20:49:49 +08:00
seven332 6be2c8ba33 更换图标字体 2014-11-18 20:26:02 +08:00
seven332 6d72b05717 调整图标 2014-11-18 18:39:12 +08:00
seven332 a66ec83295 更新图标 2014-11-18 16:24:45 +08:00
seven332 d9924bad66 调整图标 2014-11-17 23:38:56 +08:00
seven332 f8be4189d4 update 2014-11-17 20:57:24 +08:00
seven332 57d80224a3 调整默认颜色 2014-11-17 19:47:51 +08:00
seven332 b487fc4335 调整 style 2014-11-16 23:59:45 +08:00
seven332 33cd67bd70 调整文件下载 2014-11-16 18:51:47 +08:00
seven332 b7b4aaa0b8 调整阅读滑条 2014-11-16 18:09:24 +08:00
seven332 f855ab1d12 update readme and thanks 2014-11-16 03:14:57 +08:00
seven332 13a9b1780c 调整 FloatingActionButton 2014-11-15 19:26:19 +08:00
seven332 1d22d78e48 调整 SlidingDrawerLayout 2014-11-15 14:24:35 +08:00
seven332 1b7de271dd 调整 SlidingDrawerLayout 触摸控制,修正 TagListView 在 lollipop 下的错误 2014-11-15 13:19:40 +08:00
seven332 b35cdf806a 调整以适应 material 主题 2014-11-15 01:06:32 +08:00
seven332 3bc67cc9b3 避免由于多指导致的崩溃 2014-11-13 10:50:42 +08:00
seven332 0631c2925a 调整阅读界面滑调消失显示动画 2014-11-12 23:55:11 +08:00
seven332 fbd9e93560 在阅读界面初次启动对话框关闭后再次全屏显示 2014-11-12 19:32:51 +08:00
seven332 8b49cfe89c changelog 2014-11-12 19:01:48 +08:00
seven332 8e91fdaffe 调整全屏方式,可能避免部分机型部分系统由于 fitSystemWindows 效果而产生的显示问题 2014-11-12 18:54:46 +08:00
seven332 ea3e246f5b 修正 proguard 导致的错误 2014-11-11 23:53:57 +08:00
seven332 51f79d71ad 修正首次启动识别 2014-11-11 23:05:52 +08:00
seven332 d430a6ddec 更新 string.xml 2014-11-11 22:59:31 +08:00
seven332 feb8788065 changelog 2014-11-11 22:46:01 +08:00
seven332 35095326cd 调整 GalleryActivity 全屏 2014-11-11 22:38:57 +08:00
seven332 c88d7a526e SlidingDrawerLayout 添加 LockMode 2014-11-11 17:42:30 +08:00
seven332 f6b64bc01c 修正 SlidingDrawerLayout 开启状态错误 2014-11-11 15:31:43 +08:00
seven332 2bac87cc9f SlidingDrawerLayout 及时取消打开任务 2014-11-11 08:57:21 +08:00
seven332 d34056eefb SlidingDrawerLayout 使用 ZInterpolator 2014-11-10 22:08:20 +08:00
seven332 72e0b2e9e9 调整 SlidingDrawerLayout 2014-11-10 21:59:18 +08:00
seven332 6d7e638613 update 2014-11-10 19:35:55 +08:00
seven332 cec2b5c490 删除不必要的内容 2014-11-10 19:35:22 +08:00
seven332 4eaea80281 添加 SlidingDrawerLayout 2014-11-10 19:26:53 +08:00
seven332 41a5a423b4 删除多余函数 2014-11-10 14:17:58 +08:00
seven332 a721b3d6a8 调整 actionbar icon 2014-11-09 01:15:10 +08:00
seven332 dccdd2b095 使用 material-menu 2014-11-08 00:31:22 +08:00
seven332 cd393530cb 完善 setting 界面 2014-11-07 22:21:18 +08:00
seven332 7684dbeee7 Merge branch 'dev' of github.com:seven332/EhViewer into dev 2014-11-07 16:36:05 +08:00
seven332 e20100ff74 使用 DrawerLayout 2014-11-07 16:28:42 +08:00
seven332 935ec55745 调整界面 2014-11-06 23:32:30 +08:00
seven332 c88848d829 添加当前状态至快速搜索 2014-11-06 12:09:42 +08:00
seven332 8df82dc573 调整界面 2014-11-04 22:56:14 +08:00
seven332 688e1f0ed2 使用 proguard 以减小 apk 体积 2014-11-04 14:31:11 +08:00
seven332 3a7bc14c01 创建 Hisroty 表 2014-11-04 12:42:03 +08:00
seven332 d23623ac16 update 2014-11-03 20:52:25 +08:00
seven332 432ab6b045 update 2014-11-03 17:04:37 +08:00
seven332 c578cefeea update 2014-11-03 15:17:39 +08:00
seven332 ffdd42851c update 2014-11-03 12:21:41 +08:00
seven332 5c66172bb9 update .gitignore 2014-11-03 11:20:25 +08:00
seven332 415a973a97 调整下载界面 2014-11-03 11:19:38 +08:00
seven332 8149257c27 renameTo 后要等一会儿? 2014-11-02 23:47:16 +08:00
seven332 3bd56377c9 添加单张图像重新下载功能 2014-11-02 23:24:22 +08:00
seven332 9d070fbdf9 更换 clear 图标 2014-11-02 20:14:21 +08:00
seven332 52b62cefee 添加历史过滤 2014-11-02 19:47:18 +08:00
seven332 61992ed2a2 调整侧边栏禁用效果 2014-11-01 21:38:41 +08:00
seven332 71f1077241 添加历史记录显示 2014-11-01 21:32:26 +08:00
seven332 ffe4eb0fa1 调整标题韩文识别 2014-10-31 13:44:53 +08:00
seven332 018b176541 EditTextPreference 添加数值边界判断 2014-10-30 18:36:04 +08:00
seven332 c406f71578 添加历史记录 2014-10-30 16:34:26 +08:00
seven332 133a6dc400 添加gif播放指定index 2014-10-28 20:18:44 +08:00
seven332 0d7e39168e 添加设置屏幕常亮 2014-10-26 21:18:08 +08:00
seven332 f82cfb0540 修正可能的 NullPointerException 2014-10-26 20:40:15 +08:00
seven332 4b4aaa982f Merge branch 'dev' of github.com:seven332/EhViewer into dev 2014-10-25 13:17:17 +08:00
seven332 ba21d1dc7c 调整标题中文识别 2014-10-25 12:29:43 +08:00
seven332 b405c92a6f 添加修改过标题的资源的路径的识别 2014-10-23 15:02:04 +08:00
seven332 1760d16c43 添加 Google Analytics 内容 2014-10-23 12:35:43 +08:00
seven332 329246e155 添加 MaterialProgressDialog 2014-10-22 23:23:28 +08:00
seven332 d54ffee6d2 移除不必要的文件 2014-10-21 22:02:38 +08:00
seven332 4ca72e498b 修正版本号 2014-10-21 16:58:33 +08:00
seven332 0564b5c657 对话框信息居中 2014-10-21 16:36:19 +08:00
seven332 b33817bcc9 完善对话框风格 2014-10-21 16:26:56 +08:00
seven332 4998dd2e86 调整阅读界面控制面板显示隐藏方式 2014-10-20 12:13:16 +08:00
seven332 2f30c23e30 调整阅读效果 2014-10-19 19:28:05 +08:00
seven332 42ae15e3f7 update for 64 2014-10-18 20:35:17 +08:00
seven332 aa04c8cfe7 target=android-21 2014-10-18 14:20:18 +08:00
seven332 16c847b669 滑动时暂停 gif 播放 2014-10-16 18:08:39 +08:00
seven332 a75bb29315 移除不必要的文件 2014-10-15 16:49:13 +08:00
seven332 788631b6ee 避免安装低版本后重新升级导致的下载记录错误 2014-10-14 23:18:27 +08:00
seven332 09229546c6 log 2014-10-14 21:52:47 +08:00
seven332 03582eb9da 自动调整 gallery list item 高度 2014-10-14 21:49:00 +08:00
seven332 e2e794b85c 计算 gallery list item 高度 2014-10-14 17:14:01 +08:00
seven332 ab949d5567 卧槽 2014-10-14 14:29:06 +08:00
seven332 f340279e57 update 2014-10-14 07:43:22 +08:00
seven332 ddb1edb7d1 log 2014-10-13 22:34:52 +08:00
seven332 a7f29a3cd5 更新 string.xml 2014-10-13 22:25:36 +08:00
seven332 d09e4a9215 更新 string.xml 2014-10-13 21:58:17 +08:00
seven332 07335ba49c 自动修正下载文件夹名 2014-10-12 23:54:56 +08:00
seven332 b55d5a1538 添加 twitter 入口 2014-10-12 23:43:05 +08:00
seven332 97fc40a69c 避免大量的 Notification 2014-10-12 23:26:02 +08:00
seven332 cc73666475 update 2014-10-12 22:44:24 +08:00
seven332 0ed34f2eca 添加修改下载文件夹为 gid-title 入口 2014-10-12 22:43:53 +08:00
seven332 a7a3d56c91 添加边界提示控制 2014-10-08 23:22:38 +08:00
seven332 748c5cb812 update 2014-10-07 13:32:30 +08:00
seven332 f5318cf6d3 update 2014-10-07 02:35:17 +08:00
seven332 082dc2e3f5 修正 file select 对话框 2014-10-07 01:54:28 +08:00
seven332 c4ed7a034a 默认为继续阅读 2014-10-07 01:30:04 +08:00
seven332 28f548e565 调整主题 2014-10-07 01:13:06 +08:00
seven332 20927eea63 由服务器获取代理地址 2014-10-07 00:52:06 +08:00
seven332 1a302e5157 修改 checkbox button 2014-10-06 00:07:06 +08:00
seven332 92417cb7b4 避免线程冲突 2014-10-05 21:29:46 +08:00
seven332 1dab2722dd 修正 MaterialAlertDialog 列表显示错误 2014-10-05 19:23:34 +08:00
seven332 3a59e3eaae 修正继续阅读时图片未加载问题 2014-10-05 03:31:01 +08:00
seven332 d56c4e5386 调整下载信息存储,记录阅读位置 2014-10-05 02:37:51 +08:00
seven332 0c3a7301cc 修正当前页面索引错误 2014-10-04 23:35:36 +08:00
seven332 6878de9175 保持下载列表顺序 2014-10-04 22:17:27 +08:00
seven332 97956b98df 调整滑动效果 2014-10-04 01:37:56 +08:00
seven332 52bf4ac74d 使用 L 风格 Dialog 2014-10-04 01:17:21 +08:00
seven332 b53e8b49e0 替换 Notification 图标 2014-09-29 22:42:10 +08:00
seven332 51d648ac6b 添加 Notification 图标 2014-09-29 22:37:37 +08:00
seven332 03a5b75648 使用 L 风格 Dialog 2014-09-29 22:32:27 +08:00
seven332 bea31278a7 重命名下载中间文件 2014-09-24 16:05:14 +08:00
seven332 3bec2e47e3 获取更多错误 2014-09-23 23:53:22 +08:00
seven332 13eb3d291d 在清理冗余时删除 gid 文件 2014-09-23 14:19:44 +08:00
seven332 23225bdb56 搜索显示 suggestion 2014-09-23 14:03:39 +08:00
seven332 8ba3d11c11 添加解码格式选择 2014-09-19 10:35:09 +08:00
seven332 d519179ae2 添加清理阅读冗余 2014-09-19 00:55:51 +08:00
seven332 e8aa39d66d 修正 cmyk_gray_convert 2014-09-18 01:38:13 +08:00
seven332 ee231382f5 修正 cmyk_gray_convert 2014-09-18 01:32:58 +08:00
seven332 0324b87ad6 对 jpeg 解码添加 cmyk->gray 与 cmyk->rgb 2014-09-18 01:24:06 +08:00
seven332 855e4cc61c 修正 armv7 而无 neon 而导致的解码错误 2014-09-17 14:51:24 +08:00
seven332 b759ee0997 update 2014-09-17 11:58:41 +08:00
seven332 f2a1ad7df4 修正 ExpandingListView 计算错误 2014-09-15 16:10:35 +08:00
seven332 33999a317e 修正 ExpandingListView collapse 时的错误 2014-09-15 15:23:48 +08:00
seven332 2d9a54bc0e 修正 onStartCommand 可能的 NullPointerException 2014-09-15 15:09:43 +08:00
seven332 8d1ad9697b ListView 添加 expand 动画效果 2014-09-15 15:01:22 +08:00
seven332 39d9701c75 更新 string.xml 2014-09-14 03:19:36 +08:00
seven332 d886cbe391 update 2014-09-14 03:05:07 +08:00
seven332 5afb351fcc Update 2014-09-14 02:52:02 +08:00
seven332 7f5569a8d9 修正磁吸充电时重新载入问题 2014-09-10 20:57:51 +08:00
seven332 9df26b94c7 通知添加全部停止 2014-09-10 13:16:30 +08:00
seven332 103cfe1749 当搜索栏失去焦点时隐藏 2014-09-10 00:29:07 +08:00
seven332 006a8684ff 下载通知添加停止按钮 2014-09-10 00:12:42 +08:00
seven332 645f0df208 添加清除搜索记录 2014-09-08 23:50:23 +08:00
seven332 60dc0a7f72 添加最近搜索建议 2014-09-08 23:29:36 +08:00
seven332 4c7c06e8dc 修正 ripple 中心不居中 2014-09-07 11:32:42 +08:00
seven332 d361eaf63d 修正自定义解码默认值显示错误 2014-09-07 10:32:44 +08:00
seven332 b44fdcfeec 添加下载链接 2014-09-06 21:26:22 +08:00
seven332 51f050ae7e Release 时 LOG 不显示 2014-09-06 20:53:17 +08:00
seven332 d59685588b 更新 string.xml 2014-09-06 20:15:00 +08:00
seven332 2e188a2cc3 添加解码选择 2014-09-06 19:40:18 +08:00
seven332 b562ec2b50 调整图标 2014-09-06 18:53:53 +08:00
seven332 dab0b0cbfb 添加下载项全部开始下载或停止 2014-09-06 16:17:52 +08:00
seven332 68aea866e1 将部分字符串移动至 string.xml 2014-09-06 14:22:15 +08:00
seven332 82c0208ac8 添加 EH 站点连接最小间隔设置 2014-09-06 03:37:42 +08:00
seven332 0285f82f52 添加 Http 设置 2014-09-06 03:01:14 +08:00
seven332 3d88928ed3 添加下载线程数设置 2014-09-06 02:20:08 +08:00
seven332 f05d123da7 添加 UrlBuilder,release 时不显示 Log 2014-09-03 20:23:58 +08:00
seven332 dcc45c5d81 修正可能出现的除数为零 2014-09-02 01:22:49 +08:00
seven332 d25caafc8b 修正 g 的解析错误 2014-08-30 00:12:59 +08:00
seven332 290c60adab 添加日志文件输出 2014-08-29 21:50:52 +08:00
seven332 3c7a61a863 添加 mips 支持,修正解析判断错误 2014-08-29 11:24:58 +08:00
seven332 5a3b152110 添加 libjpeg-turbo 解码 2014-08-29 00:03:27 +08:00
seven332 446e0aadd1 添加 libpng 解码 2014-08-28 10:40:50 +08:00
seven332 62675a3dd2 gif 解码添加文件路径入口 2014-08-27 15:39:40 +08:00
seven332 6e97c23dda 阅读界面添加电量显示 2014-08-26 16:09:16 +08:00
seven332 d08598ab71 修正由于图片宽度而导致的错位 2014-08-26 09:59:54 +08:00
seven332 007330112e 添加 GL_RGBA GL_LUMINANCE_ALPHA 2014-08-26 00:00:07 +08:00
seven332 eb33529980 update 2014-08-25 22:27:42 +08:00
seven332 22ff864844 update 2014-08-25 16:19:58 +08:00
seven332 51f2ea5bf8 使用 giflib 对 gif 解码 2014-08-25 16:09:39 +08:00
seven332 8f611c5a27 update 2014-08-24 21:06:46 +08:00
seven332 5413b8e40e update 2014-08-24 21:04:23 +08:00
seven332 b1cf11e2bc 修正一些错误 2014-08-24 12:05:44 +08:00
seven332 fb8bc2c364 更新 Gallery2 部分 2014-08-23 13:39:48 +08:00
seven332 570796a610 fix date 2014-08-23 12:00:16 +08:00
seven332 3a1fe8da1d 修正可能的布局错误 2014-08-23 11:32:15 +08:00
seven332 5259f2173d 重用 Notification.Builder 避免可能的闪烁 2014-08-22 23:26:40 +08:00
seven332 5b6f458c60 update 2014-08-22 19:55:43 +08:00
seven332 1998af3d0b update 2014-08-22 19:54:47 +08:00
seven332 e3b5ed840e 详情界面的 Activity 跳转不关闭自身 2014-08-22 16:53:47 +08:00
seven332 e96d91184f string.xml 2014-08-22 16:03:00 +08:00
seven332 5822e58984 完善下载界面 2014-08-22 13:52:08 +08:00
seven332 da90150233 够快关闭免费外链了... 2014-08-20 23:44:54 +08:00
seven332 62d6609b15 添加双击缩放 2014-08-20 22:24:54 +08:00
seven332 e451db6032 完善阅读界面 2014-08-20 17:16:43 +08:00
seven332 a2bbe855e8 完善阅读下载策略 2014-08-19 16:24:36 +08:00
seven332 374ed3a515 新的阅读下载策略 2014-08-17 22:20:43 +08:00
seven332 6f0af8b6ec 允许 Http 请求重试 2014-08-14 15:19:38 +08:00
seven332 a98cd0bc79 使用原生 Toast 样式 2014-08-13 23:06:20 +08:00
seven332 0e125738e2 优化列表 2014-08-12 21:28:05 +08:00
seven332 055fd5e8ae 调整网页分析 2014-08-11 12:14:06 +08:00
seven332 10ba81f5cc 完善详情界面 2014-08-10 22:00:01 +08:00
seven332 08d79aa204 根据网页调整分析方法 2014-08-09 23:05:04 +08:00
seven332 d0e1b4cfee 添加 ResponedScrollView 2014-08-09 00:00:08 +08:00
seven332 90d95c6552 完善详情界面 2014-08-08 16:10:21 +08:00
seven332 53a7cc84a2 完善详情界面 2014-08-08 00:15:13 +08:00
seven332 129b70e15c 修正屏幕转动后 padding 错误 2014-08-07 16:12:58 +08:00
seven332 80282ffd04 完善详情界面 2014-08-06 22:56:46 +08:00
seven332 e3209cd2c0 为 WindowsAnimate 添加 Sprite 2014-08-06 14:39:31 +08:00
seven332 3681bd1dd4 利用 Bitmap 显示过渡动画 2014-08-06 00:35:10 +08:00
seven332 a6fea77b15 完善详情界面与 Ripple 效果 2014-08-05 23:18:21 +08:00
seven332 e08a9bfdfa 部分改善详情界面,添加 Ripple 效果 2014-08-04 22:38:31 +08:00
seven332 ee229b11da 更新 CardView 2014-08-02 11:49:43 +08:00
seven332 dfa5998483 修正 AutoWrapLayout 不完全显示问题 2014-08-01 10:11:41 +08:00
seven332 b743bdb581 添加 SuperButton 2014-07-31 21:28:48 +08:00
seven332 fa5d8380c9 添加图片搜索入口 2014-07-30 14:55:56 +08:00
seven332 79ffce2f3e 添加文件搜索 2014-07-29 23:21:06 +08:00
seven332 d89db7754f 尝试在列表缩略图上显示语言 2014-07-29 11:28:18 +08:00
seven332 ef154867a6 添加快速搜索提示 2014-07-29 09:24:01 +08:00
seven332 8abe21c536 NumberOfColumnsPreference 添加 summary 2014-07-28 23:43:37 +08:00
seven332 333c783a0d 添加列表缩略图与预览图列数设置 2014-07-28 20:24:10 +08:00
seven332 eae2375560 更新感谢 2014-07-28 10:34:06 +08:00
seven332 0a3adfb06b 添加 FixedAspectImageView 与 SimpleGridLayout 2014-07-28 10:28:43 +08:00
seven332 5fda8b792c 添加列表缩略图模式 2014-07-27 13:17:46 +08:00
seven332 0ea49f593b 横屏时移除 WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION 2014-07-26 13:11:10 +08:00
seven332 6331c3c86d 修正拼写错误 2014-07-26 11:34:54 +08:00
seven332 99df5be760 修正 FilterDialog 未关闭问题 2014-07-26 10:25:54 +08:00
seven332 53f8f6defc 移除 CardViewDelegate 2014-07-26 10:08:03 +08:00
seven332 c1d39de57c 更愉快的 CardView 2014-07-26 10:02:48 +08:00
seven332 f0c8c14918 调整 CardView 2014-07-25 23:33:06 +08:00
seven332 5b0b1b1614 使用 CardView 2014-07-25 16:29:59 +08:00
seven332 8ffa54dc25 调整代码 2014-07-25 15:54:01 +08:00
seven332 ae4714aa48 不显示 count 2014-07-25 14:30:43 +08:00
seven332 802c11bed1 重命名 2014-07-25 14:26:34 +08:00
seven332 ff2ed3205d 使用预设颜色,避免随机生成的奇怪颜色 2014-07-24 23:06:11 +08:00
seven332 ba7f1a5aed 添加 API 源选择 2014-07-24 17:13:18 +08:00
seven332 43903adcc4 修正 lofi 时收藏夹解析错误 2014-07-24 15:43:13 +08:00
seven332 703fc5f44d 更新翻译 2014-07-24 13:14:31 +08:00
seven332 485f4ba9f2 添加 exclude language 2014-07-24 13:11:25 +08:00
seven332 1d6e6277d8 添加 Exculde Tag Group 2014-07-24 10:19:54 +08:00
seven332 2ed2c08183 添加列表默认分类显示 2014-07-23 17:26:24 +08:00
seven332 eaae310f05 添加 CategoryTable 2014-07-23 16:06:09 +08:00
seven332 ab9b7e59d9 添加 lofi 列表分析 2014-07-23 11:15:22 +08:00
seven332 07614fecef AppHandler 2014-07-20 23:12:09 +08:00
seven332 fae86c1782 显示纯文本错误提示 2014-07-20 23:04:43 +08:00
seven332 b0fc8f4c58 添加 RefreshTextView 2014-07-20 16:58:47 +08:00
seven332 5cdc004829 不显示 tag value 2014-07-13 18:09:25 +08:00
seven332 7efed23ddf 修正横屏下新建 Activity 出现卡顿的问题 2014-07-13 18:04:53 +08:00
seven332 251ed9b687 调整布局 2014-07-13 17:42:19 +08:00
seven332 1b017250a5 使用 AppHandler 2014-07-13 17:25:37 +08:00
seven332 5e9097b1bf 添加 zh-rHK zh-rTW 翻译 2014-07-13 11:47:06 +08:00
seven332 62858aa5d2 添加圆角矩形背景 2014-07-13 11:15:30 +08:00
seven332 8ceb7ca912 允许查看 gallery 上传者的其他上传 2014-07-12 11:06:44 +08:00
seven332 4ce0a60397 由 url 进入详情页,初始仅显示加载等待控件 2014-07-12 00:27:03 +08:00
seven332 75731d5600 修正详情页面切换 gallery 时 title 无变化的问题 2014-07-11 23:48:07 +08:00
seven332 7ddeef682a 调整 user panel 2014-07-11 23:07:34 +08:00
seven332 da076be7fb 第一次启动显示左侧栏 2014-07-11 22:34:06 +08:00
seven332 7235e3abd5 完善下载功能 2014-07-11 21:41:36 +08:00
seven332 05cfabae10 添加 gid token 错误识别 2014-06-29 02:37:26 +08:00
seven332 32e345f9f0 修正 ListActivity 未启动时由 DetailActivity 跳至其会出现的错误 2014-06-28 21:44:33 +08:00
seven332 6b7f314e9f 完善 Activity 跳转 2014-06-28 20:24:18 +08:00
seven332 db3fe7e446 完善 HttpHelper 2014-06-28 02:36:15 +08:00
seven332 d7e42a760c 添加注释,修改函数名 2014-06-26 13:59:15 +08:00
seven332 f90588e79e SetMinimumWidth for modeSpinner 2014-06-26 13:51:20 +08:00
seven332 deefd9b9e3 移除错误的提示 2014-06-26 02:45:46 +08:00
seven332 e01ef1abff 添加默认 cookie,默认模式改为EX 2014-06-26 01:48:51 +08:00
seven332 facb17eac2 修正由于没有显式 host 而导致的头像获取错误 2014-06-25 23:04:38 +08:00
seven332 151c16ad83 修正带有链接的评论无选中反应,长按仍会打开链接的问题 2014-06-25 21:12:13 +08:00
seven332 07d1cc6bf6 Dialog 添加 setMessageAutoLink 2014-06-25 19:16:32 +08:00
seven332 e9bb78ebfc preview num per row 可以被禁用,限制文件名长度 2014-06-25 16:19:45 +08:00
seven332 c154f9b73a 添加 &#039; 至 ‘ 的转换 2014-06-23 23:12:22 +08:00
seven332 51266d4c3b 移除 OlScollView, OnLayoutListener, 使用 addOnLayoutChangeListener 2014-06-23 23:06:15 +08:00
seven332 f02998b917 添加 StableBitmapDrawable 避免预览图加载后位置大幅变化 2014-06-23 22:49:36 +08:00
seven332 b6f89741ee 添加大预览图模式 2014-06-23 22:13:28 +08:00
seven332 2498be6850 gallery list 使用简易 RatingView 以便更快加载 2014-06-23 02:02:19 +08:00
seven332 ce2907610a 更换 cache,更换图片获取方式,建立 previewlist 类,移除不需要的类 2014-06-23 00:44:20 +08:00
seven332 4e266c160c 获取并显示登陆时的错误 2014-06-22 01:45:53 +08:00
seven332 3e76680aeb 调整 Gallery Detail 获取 2014-06-22 01:28:03 +08:00
seven332 8ad331af60 移除 commons-lang 包 2014-06-22 00:55:30 +08:00
seven332 90a41a1d6b 更改登陆登出方式,可以显示头像 2014-06-22 00:21:46 +08:00
seven332 ce786f4e41 重新 HttpHelper 2014-06-21 18:20:43 +08:00
seven332 3f099969d1 调整 popular 获取与显示 2014-06-19 01:58:01 +08:00
seven332 e0acfa55eb 调整 Analytics 2014-06-18 15:06:49 +08:00
seven332 f4472005b5 修正点击次数显示错误 2014-06-17 18:42:56 +08:00
seven332 1c2263c001 添加列表模式选择 2014-06-16 21:19:41 +08:00
seven332 6f93bb5b88 添加热门点击数显示 2014-06-15 22:42:56 +08:00
seven332 1d2978952b 添加更新时间显示 2014-06-15 21:15:24 +08:00
seven332 937fc619dd 移除不必要的资源 2014-06-15 03:51:17 +08:00
seven332 30c46bd0a2 调整类别识别 2014-06-15 02:46:08 +08:00
seven332 ae90c1b2b1 changlog 2014-06-15 02:28:18 +08:00
seven332 e6e85dc8d4 添加收藏统计 2014-06-15 02:24:43 +08:00
seven332 1a1242cc47 修正翻译 2014-06-15 02:03:34 +08:00
seven332 9b34b561d8 修正时间显示 2014-06-15 02:01:20 +08:00
seven332 ee5cc24a4d 添加 popular 提示 2014-06-15 01:59:04 +08:00
seven332 6ebc172783 Add popular 2014-06-14 23:43:16 +08:00
seven332 a6237f0dc5 规范统计 2014-06-14 20:20:10 +08:00
seven332 66e2727acb 添加阅读信息获取 2014-06-14 02:14:27 +08:00
seven332 78bcb037ac 添加 Google Analytics 2014-06-14 01:49:40 +08:00
seven332 9aecbf9e66 添加默认收藏设置 2014-06-14 00:29:31 +08:00
seven332 bcba2f556b 字符串移至 string.xml 2014-06-13 22:47:24 +08:00
seven332 148f03a175 添加主题颜色设定 2014-06-13 22:01:37 +08:00
seven332 f39cfc7875 随机主题配色 2014-06-13 18:14:41 +08:00
seven332 5bc166d3da Translucent 移至 themes.xml 2014-06-13 00:15:25 +08:00
seven332 7e5a844246 修正收藏切换显示问题 2014-06-12 23:17:53 +08:00
seven332 8cecf200eb 完成账户收藏管理 2014-06-12 23:12:32 +08:00
seven332 535a6297af 注释掉关闭应用时删除文件 2014-06-11 20:19:17 +08:00
seven332 5ea2fdb651 抽象 AbstractGalleryActivity 2014-06-11 20:12:32 +08:00
seven332 bfe9044fda 更名 2014-06-10 23:41:39 +08:00
seven332 d277066d34 更改 Toast 颜色 2014-06-10 23:39:45 +08:00
seven332 cbbe1478ae 收藏界面添加返回键隐藏 ActionableToastBar 2014-06-10 22:52:22 +08:00
seven332 8848e712cc 调整 SuperToast 布局,使其不会横向占满屏幕 2014-06-10 12:50:15 +08:00
seven332 ed693d1742 更新 SuperSwipeRefreshLayout 对 paddingTop 判断方式,并修正其对滑动判断错误 2014-06-10 11:18:04 +08:00
seven332 626def198c 修正以匹配服务器的 json 格式 2014-06-10 08:31:43 +08:00
seven332 b9fc9b054b 更新检查地址改为 http://www.ehviewer.com/API 2014-06-10 08:23:59 +08:00
seven332 602f68e88b dialog 中 message 居中 2014-06-10 00:45:04 +08:00
seven332 dfa00b7605 将 Toast 换为 SuperToast 2014-06-10 00:34:58 +08:00
seven332 27cb0aa260 添加 SuperToast 2014-06-07 02:57:09 +08:00
seven332 416d080eb4 添加 ActionableToastBar 2014-06-07 02:03:26 +08:00
seven332 386c98575d 允许 HfListView 启用或禁用 Header 或 Footer 2014-06-05 23:06:09 +08:00
seven332 84f9aef856 使 SwipeProgressBar 在 paddingTop 不为 0 时正确显示 2014-06-05 20:17:25 +08:00
seven332 13cbb7507e 初步完成收藏 2014-06-05 19:18:59 +08:00
seven332 4a1594f982 调整 list 获取 2014-05-30 20:10:05 +08:00
seven332 761ce507f1 简化字符串 2014-05-30 15:27:01 +08:00
seven332 67884ed9d3 修正媒体扫描错误 2014-05-30 14:40:16 +08:00
seven332 12412d67fb 添加新的缓存管理 2014-05-30 12:29:25 +08:00
seven332 2c58f6c9ae 添加收藏夹批处理 2014-05-30 00:22:57 +08:00
seven332 65e908546b 修正 sad panda 识别 2014-05-29 22:01:40 +08:00
seven332 ea18b8c090 调整 List 获取 2014-05-29 20:39:03 +08:00
seven332 6c182f3bba 添加 ex test 2014-05-28 23:28:52 +08:00
seven332 807c49eea1 Detail Activity ActionBar Translucent 2014-05-28 22:33:38 +08:00
seven332 50dd19222e 添加 Detail Info 显示 2014-05-28 21:33:32 +08:00
seven332 b5bbf19a65 扩充 DetailParser 2014-05-28 20:43:46 +08:00
seven332 9ed06be68b 预先获取 density 2014-05-28 01:19:26 +08:00
seven332 9da0c76da6 调整 preview panel button 背景 2014-05-26 18:01:58 +08:00
seven332 1b06d19059 增加添加至服务器收藏 2014-05-25 23:30:05 +08:00
seven332 e258617c23 Add idear 2014-05-25 22:29:15 +08:00
seven332 839a7227ab 移除可能产生卡顿的不必要操作 2014-05-25 20:27:39 +08:00
seven332 f49b111e15 调整 action bar tag 背景 2014-05-25 17:12:51 +08:00
seven332 d5d6b6fb4c 添加一种列表搜索方式 2014-05-25 15:03:45 +08:00
seven332 7cc794d614 修正 changelog 错误 2014-05-25 14:46:03 +08:00
seven332 f209f5f157 解决 Custom Dialog 标题过长时与 Action Drawable 的冲突 2014-05-24 22:12:54 +08:00
seven332 ca4be438c5 changelog 2014-05-24 22:06:36 +08:00
seven332 d9411b190c 修正无法取消内容警告的错误 2014-05-24 21:49:09 +08:00
seven332 ec2cb356c1 添加 AbstractActivity 2014-05-24 17:55:59 +08:00
seven332 15a2db978c 添加自动更新设置 2014-05-24 17:44:26 +08:00
seven332 a9506b1f53 修正设置中检查更新的 key 错误 2014-05-24 16:32:23 +08:00
seven332 1a8f6752c7 SettingActivity actionbar 添加返回 2014-05-24 01:50:34 +08:00
seven332 637579db5c SettingActivity 为不同 fragment 设置不同 actionbar icon 2014-05-24 00:52:45 +08:00
seven332 534c5506e6 com.hippo.ehviewer.activity 改为 com.hippo.ehviewer.ui 2014-05-23 23:44:08 +08:00
seven332 a2182e0f05 添加 AbstractActivity 2014-05-23 23:34:27 +08:00
seven332 0d0153c6e8 添加 github 入口 2014-05-23 20:17:40 +08:00
seven332 ca6281bf72 调整 SettingActivity 中 padding bottom 2014-05-23 19:06:50 +08:00
seven332 a50df7308f 添加 Copyright 2014-05-23 18:43:48 +08:00
seven332 d31a51ab9a 添加 Copyright 2014-05-23 16:38:32 +08:00
seven332 91aa31503b 删除历史代码 2014-05-23 15:28:21 +08:00
seven332 a5e07a0ebe 选择路径中允许添加路径 2014-05-23 15:02:25 +08:00
seven332 cfa51276bd 调整 FileExplorerView item 布局 2014-05-23 14:25:50 +08:00
seven332 148470e4be SettingsActivity 使用 fragment 2014-05-23 14:18:40 +08:00
seven332 fd72fbf9bd 调整搜索面板类别选择布局 2014-05-21 21:14:32 +08:00
seven332 b37087a69d FileExplorerView 排序忽略大小写 2014-05-20 12:57:56 +08:00
seven332 ec1694347a 部分完成下载路径设置 2014-05-20 12:52:23 +08:00
seven332 a89b001370 替换 settings 图标 2014-05-19 22:43:55 +08:00
seven332 867a0f4ef7 修正标签存储错误 2014-05-19 17:09:20 +08:00
seven332 fee7d87a21 添加小尺寸图标 2014-05-18 21:40:55 +08:00
seven332 ffd0ca0cec change log 2014-05-18 16:17:18 +08:00
seven332 7d819d4ac6 完善 strings.xml 2014-05-18 16:15:54 +08:00
seven332 e08ee26991 change log 2014-05-18 16:10:22 +08:00
seven332 599649200c 未完成的功能添加提示 2014-05-18 16:05:57 +08:00
seven332 4e4c670c97 完成由 comment 搜索发言用户上传 2014-05-18 16:01:48 +08:00
seven332 1def607a80 添加标签跳转搜索 2014-05-18 15:47:31 +08:00
seven332 5bee5d6663 换行符总出错 2014-05-18 15:09:55 +08:00
seven332 834b9b7a2a 修正 GalleryView 中在 onLayout 之前触摸可产生的错误 2014-05-18 14:52:12 +08:00
seven332 4e7bb7aec3 修正登陆窗口弹出 2014-05-18 14:39:41 +08:00
seven332 f4c73e3b32 完善 Detail 界面下载 2014-05-18 14:25:01 +08:00
seven332 bb6f8ded7f 完成 Data 中对 ListUrls tag 模式的支持 2014-05-18 03:27:48 +08:00
seven332 e7753fddec 修正 ModifyTag 时新加 advance 时显示错误 2014-05-18 03:04:05 +08:00
seven332 29e77faec9 DialogBuild 添加 Action,ListUrls 添加 tag 模式 2014-05-18 02:42:23 +08:00
seven332 e0cc198d96 添加更加 uploader 搜索 2014-05-17 23:53:03 +08:00
seven332 cc9d194ddd 修正预览图翻页错误 2014-05-17 21:13:37 +08:00
seven332 0735fa2425 comment 使用 Linkify 2014-05-17 16:04:38 +08:00
seven332 d8fc3f0a51 移动部分 String 至 strings.xml 2014-05-17 15:18:39 +08:00
seven332 c47f124854 完善模式选择 2014-05-17 15:06:12 +08:00
seven332 7dba58b1aa 调整列表界面菜单 2014-05-16 22:50:52 +08:00
seven332 5f34b5aeb0 完善用户面板 2014-05-16 22:27:48 +08:00
seven332 7470a25cbe CheckTextView 替换 CheckImage 2014-05-16 21:12:26 +08:00
seven332 28b31d3439 AutoWrapLayout 的 baseline 属性改名为 alignment 2014-05-16 16:55:39 +08:00
seven332 97d855b546 移除不必要的文件 2014-05-16 16:43:59 +08:00
seven332 711564a0ab 将 FswView 的 visibility 默认设为 gone 2014-05-15 22:13:56 +08:00
seven332 f20bc2c954 修改换行符为 LF 2014-05-15 20:23:11 +08:00
seven332 ed0702068c 调整 refresh color 顺序,使其更自然 2014-05-15 20:15:17 +08:00
seven332 b568082c2d 将 ActionBarPullToRefresh 替换为 SwipRefreshLayout 2014-05-15 19:59:51 +08:00
seven332 f89ae0d1b1 调整 ActionBarPull 参数,更便于操作 2014-05-15 13:49:47 +08:00
seven332 d2c4cf598a 添加 README.md 2014-05-14 21:41:45 +08:00
seven332 f9ceddfabf just fix 2014-05-14 20:18:07 +08:00
seven332 cec40a8f89 更新 changelog 2014-05-12 22:42:15 +08:00
seven332 4a4ec2312a 部分完善用户面板 2014-05-12 20:38:39 +08:00
seven332 5417918382 使用 TextSwitcher 替代 ProgressiveTextView 2014-05-12 02:17:19 +08:00
seven332 f8b2b46172 删除不必要的文件 2014-05-12 01:02:49 +08:00
seven332 d0f07ae62b 修正 preview 自动 2014-05-11 23:24:39 +08:00
seven332 5d7b99e328 修正返回图标 2014-05-11 16:56:13 +08:00
seven332 ae563a7950 comment dialog 中使用更好的 layout 2014-05-11 02:15:49 +08:00
seven332 1f6668cd8c 当 preview 信息已有时也跳至 preview 顶部 2014-05-11 01:08:04 +08:00
seven332 24a384eed7 当获取新 preview 大小时,自动使其最大显示 2014-05-11 00:17:57 +08:00
seven332 b5eeee9b73 完善 ActionBarTab style 2014-05-10 23:27:14 +08:00
seven332 1bd32d97de 初步完成 detail url 接管 2014-05-10 14:52:44 +08:00
seven332 5e6d771dad 调整菜单 2014-05-10 02:58:04 +08:00
seven332 9b80be453c 添加评论查看与发送功能,评论按发布时间排序 2014-05-10 00:08:34 +08:00
seven332 7d0bfc1aa7 添加评论显示 2014-05-09 17:07:50 +08:00
seven332 3d31c32d40 修正由于 Activity 正在关闭后再对 view 修改可能造成的错误 2014-05-09 11:20:27 +08:00
seven332 087a6ee305 添加 详情 tab 2014-05-09 11:17:21 +08:00
seven332 9056d7ced0 搜索标签移至右侧栏 2014-05-08 23:41:40 +08:00
seven332 4a8e01caec 修正语言搜索,完善 search bar 资源 2014-05-08 21:55:59 +08:00
seven332 1088729269 优化 list_item 布局 2014-05-08 20:42:29 +08:00
seven332 21ac176f5f 改用及时响应的 ratingbar,初步添加用户面板 2014-05-08 19:33:50 +08:00
seven332 b3cc1dec4b 创建 ProgressiveTextView,用来简易的显示 TextView 的字符串替换效果 2014-05-08 00:18:15 +08:00
seven332 3da180beb0 添加 tag 投票数显示 2014-05-07 21:41:54 +08:00
seven332 acec30ae5a 完善 vote 功能 2014-05-07 20:29:44 +08:00
seven332 8229007710 完善 gallery 评分 view 2014-05-07 19:16:04 +08:00
seven332 80e0432c73 修正 ratingbar 2014-05-07 16:59:03 +08:00
seven332 c97dccaf04 添加 vote 2014-05-07 01:23:46 +08:00
seven332 f4bdbe1ed1 修正 search bar style 2014-05-07 01:01:49 +08:00
seven332 75a67ae54e 修正列表 2014-05-06 18:28:20 +08:00
seven332 61c3144a48 修正列表 2014-05-06 18:26:09 +08:00
seven332 8158bae9d5 优化列表 2014-05-06 16:45:09 +08:00
seven332 9615aa0b7c 完善界面,修正列表显示 2014-05-06 00:41:35 +08:00
seven332 870153ef88 Just project 2014-05-05 20:00:56 +08:00
seven332 741203ab81 Remove duplicated directory 2014-05-05 19:56:26 +08:00
seven332 0b74bf3fc3 完善界面 2014-05-05 19:28:29 +08:00
seven332 f5f7489093 改用 ActionBar Pull 2014-05-04 22:24:23 +08:00
seven332 05dae37a28 修正 pullListView 2014-05-03 13:48:31 +08:00
seven332 1384a05830 部分优化 2014-05-03 00:10:49 +08:00
seven332 256b4896cb 完善界面 2014-05-01 20:05:09 +08:00
seven332 c44011402f 部分调整详情界面 2014-04-30 00:37:20 +08:00
seven332 eff24ca4b3 部分规范化界面 2014-04-28 22:37:32 +08:00
seven332 8f16044c6b check curShowItem null 2014-04-26 16:02:06 +08:00
seven332 7c46027bd6 dev 2014-04-26 15:47:15 +08:00
seven332 5f7b677db7 wocaocao 2014-04-26 15:45:15 +08:00
seven332 b27e02fed1 unknown 2014-04-26 15:28:42 +08:00
seven332 abe2189acd 调整文件位置 2014-04-14 22:37:07 +08:00
seven332 721659d959 Download sql 2014-04-14 22:32:45 +08:00
seven332 d2e083922e 使用数据库存储 local favourite 2014-04-13 15:49:23 +08:00
seven332 34181ce370 略 2014-04-12 14:13:21 +08:00
seven332 a939c505f9 添加 ActionBar 效果 2014-04-10 23:28:39 +08:00
seven332 5de9fc8134 添加封面图片渐进效果显示 2014-04-08 22:51:40 +08:00
seven332 0c45ddf04d 添加 够快 更新服务器 2014-04-08 22:03:39 +08:00
seven332 74e37ea72d 修改手势,字符串 2014-04-07 11:23:46 +08:00
seven332 c6c060b5e2 0.4.4 2014-04-06 13:49:54 +08:00
seven332 def283de08 添加 charset 识别 2014-04-06 13:45:52 +08:00
seven332 be3d3189ec 学习使用 ProGuard 2014-04-06 11:30:40 +08:00
seven332 0581b7cc53 使用更安全的 Log 2014-04-06 11:11:57 +08:00
seven332 79b75e5de1 0.4.3 2014-04-05 23:57:52 +08:00
seven332 f7be9dec18 添加更新服务器选择 2014-04-05 23:51:48 +08:00
seven332 566226958f 临时解决 endIndex 大于 size 的问题 2014-04-05 23:15:07 +08:00
seven332 e45db97a54 用 json 检查更新 2014-04-05 22:28:45 +08:00
seven332 ea58ffed74 用 json 检查更新 2014-04-05 22:28:11 +08:00
seven332 eb1e49e7c7 更丰富的错误提示 2014-04-05 00:08:10 +08:00
seven332 b69c71a54b 0.4.2 2014-04-04 23:26:37 +08:00
seven332 3aff219639 修正由于 gif 格式图片导致的崩溃 2014-04-04 23:13:33 +08:00
seven332 e1edd00fb0 继续 2014-04-03 20:16:34 +08:00
seven332 70e0aada25 调整EhClient 2014-04-03 19:28:57 +08:00
seven332 1c11ac38ea 添加内置存储空间或 Sd Card 检测 2014-04-02 19:56:49 +08:00
seven332 7ac8878f83 修正网络错误时进入详情界面应用崩溃 2014-04-02 13:05:22 +08:00
seven332 a48a18ba84 0.4.1 2014-04-02 12:54:21 +08:00
seven332 8a2a2061a9 添加断点下载 2014-04-01 21:37:27 +08:00
seven332 b1f772eb2f 修正单点触控缩放错误 2014-04-01 11:39:02 +08:00
1092 changed files with 81574 additions and 30619 deletions

No files matched your search

-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
@@ -0,0 +1,20 @@
---
name: 功能申请 / Feature request
about: 有个想法 / Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**这个功能是用来解决问题的吗? / Is your feature request related to a problem? Please describe.**
描述这个问题。
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**描述你想要的解决方法 / Describe the solution you'd like**
描述应通过何种行为来解决这个问题。
A clear and concise description of what you want to happen.
**备注 / Additional context**
还有别的想说的吗?
Add any other context or screenshots about the feature request here.
@@ -0,0 +1,41 @@
---
name: Bug 反馈 / Bug report
about: 出问题了 / Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**简略描述 / Describe the bug**
大概说下是什么问题。
A clear and concise description of what the bug is.
**如何重现 / To Reproduce**
重现的步骤:
1. 打开什么什么
2. 点击什么什么
3. 出现什么什么问题
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**预期行为 / Expected behavior**
应该是什么样子的?
A clear and concise description of what you expected to happen.
**截图 / Screenshots**
能截图的话就发截图,请注意风序良俗。
If applicable, add screenshots to help explain your problem.
**设备型号与 Android 版本 / Device model and Android version**
- 设备型号:【比如 Pixel 6 XXXL】
- Android 版本:【比如 Android 12.1】
- Device model: [e.g. Pixel 6 XXXL]
- Android version: [e.g. Android 12.1]
**备注 / Additional context**
还有什么想说的?
Add any other context about the problem here.
@@ -0,0 +1,11 @@
---
name: Sad Panda / 下载太慢 / Slow download speed
about: 所有其他问题 / All other questions
title: ''
labels: ''
assignees: ''
---
加入我们的 Telegram 群组,[https://t.me/ehviewer](https://t.me/ehviewer)。温柔[大小]姐姐手把手帮你解决问题。
Join our Telegram group, [https://t.me/ehviewer](https://t.me/ehviewer). Administrators will help you solve the problem.
+10
View File
@@ -0,0 +1,10 @@
.gradle
/local.properties
.DS_Store
/build
/src
*.iml
.idea
/captures
release
google-services.json
-33
View File
@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>EhViewer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
-4
View File
@@ -1,4 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
-100
View File
@@ -1,100 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hippo.ehviewer"
android:versionCode="10"
android:versionName="0.4.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".CrashApplication"
android:allowBackup="true"
android:largeHeap="false"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".StartActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar.Transparent"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.MangaListActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".activity.MangaDetailActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|adjustUnspecified|stateHidden"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name=".activity.MangaActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name=".activity.SettingsActivity"
android:label="@string/preference_settings_title"
android:icon="@drawable/ic_action_settings"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name=".activity.FavouriteActivity"
android:label="@string/favourite"
android:icon="@drawable/ic_action_favourite"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name=".activity.DownloadActivity"
android:label="@string/download"
android:icon="@drawable/ic_action_download"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask" >
</activity>
<activity
android:name=".activity.MangaDownloadActivity"
android:label="@string/download"
android:icon="@drawable/ic_action_download"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize" >
</activity>
<service
android:name=".service.DownloadService"
android:label="DownloadService" />
</application>
</manifest>
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+7
View File
@@ -0,0 +1,7 @@
EhViewer
Copyright 2014-2016 Hippo Seven
An Unofficial E-Hentai Application for Android.
香风智乃是最可爱的女孩子。
chino kafuu is the cutest girl.
+1840
View File
File diff suppressed because it is too large. Load diff
+83
View File
@@ -0,0 +1,83 @@
# DEPRECATED
[![Telegram](https://img.shields.io/badge/chat-Telegram-blue.svg)](https://t.me/ehviewer)
# EhViewer
![Icon](art/launcher_icon-web.png)
这是一个 E-Hentai Android 平台的浏览器。
An E-Hentai Application for Android.
# Screenshot
![screenshot-01](art/screenshot-01.png)
# Build
Windows
> git clone https://github.com/seven332/EhViewer
> cd EhViewer
> gradlew app:assembleDebug
Linux
$ git clone https://github.com/seven332/EhViewer
$ cd EhViewer
$ ./gradlew app:assembleDebug
生成的 apk 文件在 app\build\outputs\apk 目录下
The apk is in app\build\outputs\apk
# Download
[下载](https://github.com/seven332/EhViewer/releases)
[Download](https://github.com/seven332/EhViewer/releases)
# Thanks
本项目受到了诸多开源项目的帮助
Here is the libraries
- [AOSP](http://source.android.com/)
- [android-advancedrecyclerview](https://github.com/h6ah4i/android-advancedrecyclerview)
- [Apache Commons Lang](https://commons.apache.org/proper/commons-lang/)
- [apng](http://apng.sourceforge.net/)
- [giflib](http://giflib.sourceforge.net)
- [greenDAO](https://github.com/greenrobot/greenDAO)
- [jsoup](https://github.com/jhy/jsoup)
- [libjpeg-turbo](http://libjpeg-turbo.virtualgl.org/)
- [libpng](http://www.libpng.org/pub/png/libpng.html)
- [okhttp](https://github.com/square/okhttp)
- [roaster](https://github.com/forge/roaster)
- [ShowcaseView](https://github.com/amlcurran/ShowcaseView)
- [Slabo](https://github.com/TiroTypeworks/Slabo)
- [TagSoup](http://home.ccil.org/~cowan/tagsoup/)
# License
Copyright (C) 2014-2019 Hippo Seven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
ic_launcher 图标为 Hippo Seven 所有,所有权利保留
+9
View File
@@ -0,0 +1,9 @@
/src/main/assets/NOTICE.html
/build
/src/main/java-gen
manifest-merger-release-report.txt
/src/main/libs
/src/main/obj
# Intellij
*.iml
+119
View File
@@ -0,0 +1,119 @@
apply plugin: 'com.android.application'
if (file('google-services.json').exists()) {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hippo.ehviewer"
minSdkVersion 14
targetSdkVersion 28
versionCode 104
versionName "1.7.3"
vectorDrawables.useSupportLibrary = true
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW",
"es", "ja", "ko", "fr", "de", "th"
testOptions.unitTests.includeAndroidResources = true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
disable 'MissingTranslation'
abortOnError true
checkReleaseBuilds true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', '"com.hippo.ehviewer.fileprovider"'
}
debug {
applicationIdSuffix ".debug"
buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', '"com.hippo.ehviewer.debug.fileprovider"'
}
}
sourceSets {
main {
java.srcDirs += 'src/main/java-gen'
}
}
}
task copyNotice(type: Copy) {
from '../NOTICE.html'
into './src/main/assets'
finalizedBy ":daogenerator:executeDaoGenerator"
}
tasks.withType(JavaCompile) {
task -> task.dependsOn copyNotice
}
clean {
delete file('src/main/assets/NOTICE.html').absolutePath
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.getkeepsafe.relinker:relinker:1.3.1'
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
implementation 'com.github.seven332.a7zip:extract-lite:d4ddec5793'
implementation 'com.github.seven332:android-recaptcha:2bbb3459a8'
implementation 'com.github.seven332:android-resource:0.1.0'
implementation 'com.github.seven332:animator:0.1.0'
implementation 'com.github.seven332:beerbelly:0.1.4'
implementation 'com.github.seven332:conaco:0.1.5-eh'
implementation 'com.github.seven332:drawerlayout:ea2bb388f0'
implementation 'com.github.seven332:easyrecyclerview:0.1.1'
implementation 'com.github.seven332:glgallery:0.1.2'
implementation 'com.github.seven332:glview:0.1.0'
implementation 'com.github.seven332:glview-image:0.1.0'
implementation 'com.github.seven332:hotspot:0.1.0'
implementation 'com.github.seven332:image:0.1.12'
implementation 'com.github.seven332:refreshlayout:0.1.0'
implementation 'com.github.seven332:ripple:0.1.2'
implementation 'com.github.seven332:streampipe:0.1.0'
implementation 'com.github.seven332:tuxiang:0.1.6'
implementation 'com.github.seven332:unifile:9ec57bcd8f'
implementation 'com.github.seven332:yorozuya:0.1.2'
implementation 'com.github.seven332:yorozuya-thread:0.1.1'
implementation 'com.github.seven332:yorozuya-collect:0.1.4'
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
implementation 'org.greenrobot:greendao:2.2.1'
implementation 'org.jsoup:jsoup:1.12.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.2.1'
testImplementation 'org.jooq:joor:0.9.6'
}
configurations.all {
resolutionStrategy {
force 'com.github.seven332:glgallery:25893283ca'
force 'com.github.seven332:glview:ba6aee61d7'
force 'com.github.seven332:glview-image:68d94b0fc2'
force 'com.github.seven332:image:09b43c0c68'
exclude group: 'com.github.seven332', module: 'okhttp'
}
}
+3 -6
View File
@@ -1,11 +1,8 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
# in E:\Android\android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
@@ -0,0 +1,13 @@
package com.hippo.ehviewer;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
@@ -0,0 +1,164 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.os.Environment;
import junit.framework.TestCase;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
public class CardBgTest extends TestCase {
private static final float[] TOP_ALPHA = {
0f, // Dump
0.12f,
0.16f,
0.19f,
0.25f,
0.30f,
};
private static final float[] TOP_OFFSET = {
0f, // Dump
1f,
3f,
10f,
14f,
19f,
};
private static final float[] TOP_BLUR = {
0f, // Dump
1.5f,
3f,
10f,
14f,
19f,
};
private static final float[] BOTTOM_ALPHA = {
0f, // Dump
0.24f,
0.23f,
0.23f,
0.22f,
0.22f,
};
private static final float[] BOTTOM_OFFSET = {
0f, // Dump
1f,
3f,
6f,
10f,
15f,
};
private static final float[] BOTTOM_BLUR = {
0f, // Dump
1f,
3f,
3f,
5f,
6f,
};
private static final int MAX_SIZE = 200;
public void testGen() throws FileNotFoundException {
genCardBg(Color.WHITE, 2, 2);
}
private Path getPath(float radius, float base) {
RectF rectF = new RectF();
Path path = new Path();
path.moveTo(base / 2, -base / 2 - radius);
rectF.set(base / 2 - radius, -base / 2 - radius, base / 2 + radius, -base / 2 + radius);
path.arcTo(rectF, -90, 90);
path.lineTo(base / 2 + radius, base / 2);
rectF.set(base / 2 - radius, base / 2 - radius, base / 2 + radius, base / 2 + radius);
path.arcTo(rectF, 0, 90);
path.lineTo(-base / 2, base / 2 + radius);
rectF.set(-base / 2 - radius, base / 2 - radius, -base / 2 + radius, base / 2 + radius);
path.arcTo(rectF, 90, 90);
path.lineTo(-base / 2 - radius, -base / 2);
rectF.set(-base / 2 - radius, -base / 2 - radius, -base / 2 + radius, -base / 2 + radius);
path.arcTo(rectF, 180, 90);
path.close();
return path;
}
private void genCardBg(int color, float radius, int elevation) throws FileNotFoundException {
float base = 4;
float topAlpha = TOP_ALPHA[elevation];
float topOffset = TOP_OFFSET[elevation];
float topBlur = TOP_BLUR[elevation];
float bottomAlpha = BOTTOM_ALPHA[elevation];
float bottomOffset = BOTTOM_OFFSET[elevation];
float bottomBlur = BOTTOM_BLUR[elevation];
float ratio = 3;
doGenCardBg(new FileOutputStream(new File(Environment.getExternalStorageDirectory(), "test.png")),
color, radius * ratio, base * ratio,
topAlpha, topOffset * ratio, topBlur * ratio,
bottomAlpha, bottomOffset * ratio, bottomBlur * ratio);
}
private int getColor(float alpha) {
return Color.argb((int) (alpha * 0xff), 0, 0, 0);
}
private void doGenCardBg(OutputStream os, int color, float radius, float base,
float topAlpha, float topOffset, float topBlur,
float bottomAlpha, float bottomOffset, float bottomBlur) throws FileNotFoundException {
Path path = getPath(radius, base);
path.offset(MAX_SIZE / 2, MAX_SIZE / 2);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
paint.setColor(color);
Bitmap bitmap = Bitmap.createBitmap(MAX_SIZE, MAX_SIZE, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
// Draw bottom
paint.setShadowLayer(bottomBlur, 0, bottomOffset, getColor(bottomAlpha));
canvas.drawPath(path, paint);
// Draw top
paint.setShadowLayer(topBlur, 0, topOffset, getColor(topAlpha));
canvas.drawPath(path, paint);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
}
}
@@ -0,0 +1,22 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import junit.framework.TestCase;
public class CookieDBTest extends TestCase {
}
@@ -0,0 +1,50 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import junit.framework.TestCase;
import java.net.MalformedURLException;
import java.net.URL;
public class DumpTest extends TestCase {
public void testDump() {
String str = "M12.1,18.55L12,18.65L11.89,18.55C7.14,14.24 4,11.39 4,8.5C4,6.5 5.5,5 7.5,5C9.04,5 10.54,6 11.07,7.36H12.93C13.46,6 14.96,5 16.5,5C18.5,5 20,6.5 20,8.5C20,11.39 16.86,14.24 12.1,18.55";
System.out.println(str.replaceAll("\\d+(\\.\\d+)?", "12"));
}
public void testDumpURL() {
String str1 = "http://exhentai.org/?f_doujinshi=1&f_manga=0&f_artistcg=0&f_gamecg=1&f_western=1&f_non-h=1&f_imageset=0&f_cosplay=0&f_asianporn=1&f_misc=1&f_search=&f_apply=Apply+Filter";
String str2 = "http://exhentai.org/3?f_search=hentai&f_apply=Apply+Filter";
try {
URL url = new URL(str2);
System.out.println(url.getHost());
System.out.println(url.getPath());
System.out.println(url.getQuery());
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest
package="com.hippo.ehviewer"
xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name="com.hippo.ehviewer.ui.GalleryActivity"
android:exported="true"/>
</application>
</manifest>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer Debug</string>
</resources>
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="start_all"
android:enabled="true"
android:icon="@drawable/ic_shortcut_start"
android:shortcutShortLabel="@string/download_start_all"
android:shortcutLongLabel="@string/download_start_all"
android:shortcutDisabledMessage="@string/download_start_all">
<intent
android:action="start_all"
android:targetPackage="com.hippo.ehviewer.debug"
android:targetClass="com.hippo.ehviewer.shortcuts.ShortcutsActivity"/>
<categories android:name="android.shortcut.conversation" />
</shortcut>
<shortcut
android:shortcutId="stop_all"
android:enabled="true"
android:icon="@drawable/ic_shortcut_stop"
android:shortcutShortLabel="@string/download_stop_all"
android:shortcutLongLabel="@string/download_stop_all"
android:shortcutDisabledMessage="@string/download_stop_all">
<intent
android:action="stop_all"
android:targetPackage="com.hippo.ehviewer.debug"
android:targetClass="com.hippo.ehviewer.shortcuts.ShortcutsActivity" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
</shortcuts>
+211
View File
@@ -0,0 +1,211 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest
package="com.hippo.ehviewer"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:name="com.hippo.ehviewer.EhApplication"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_scheme"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config">
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<meta-data android:name="android.max_aspect" android:value="2.1"/>
<activity
android:name="com.hippo.ehviewer.ui.MainActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Main"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="exhentai.org"/>
<data android:host="e-hentai.org"/>
<data android:host="g.e-hentai.org"/>
<data android:host="lofi.e-hentai.org"/>
</intent-filter>
<intent-filter android:label="@string/keyword_search">
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
<intent-filter android:label="@string/image_search">
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*"/>
</intent-filter>
</activity>
<activity
android:name="com.hippo.ehviewer.ui.GalleryActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Gallery"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/>
<data android:scheme="content"/>
<data android:host="*"/>
<data android:mimeType="application/octet-stream"/>
<data android:mimeType="application/7z"/>
<data android:mimeType="application/rar"/>
<data android:mimeType="application/zip"/>
<data android:mimeType="application/x-7z-compressed"/>
<data android:mimeType="application/x-rar-compressed"/>
<data android:mimeType="application/x-zip-compressed"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/>
<data android:scheme="content"/>
<data android:host="*"/>
<data android:pathPattern=".*\\.7z"/>
<data android:pathPattern=".*\\.rar"/>
<data android:pathPattern=".*\\.zip"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/>
<data android:scheme="content"/>
<data android:host="*"/>
<data android:mimeType="*/*"/>
<data android:pathPattern=".*\\.7z"/>
<data android:pathPattern=".*\\.rar"/>
<data android:pathPattern=".*\\.zip"/>
</intent-filter>
</activity>
<activity
android:name="com.hippo.ehviewer.ui.SettingsActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Settings"/>
<activity
android:name="com.hippo.ehviewer.ui.ExcludedLanguagesActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/excluded_languages"/>
<activity
android:name="com.hippo.ehviewer.ui.DirPickerActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/dir_picker"/>
<activity
android:name="com.hippo.ehviewer.ui.LicenseActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/license"/>
<activity
android:name="com.hippo.ehviewer.ui.FilterActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/filter"/>
<activity
android:name="com.hippo.ehviewer.ui.SetSecurityActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/set_pattern_protection"/>
<activity
android:name="com.hippo.ehviewer.ui.UConfigActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/u_config"/>
<activity
android:name="com.hippo.ehviewer.ui.MyTagsActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/my_tags"/>
<activity
android:name="com.hippo.ehviewer.ui.HostsActivity"
android:configChanges="screenSize|uiMode"
android:theme="@style/AppTheme.Toolbar"
android:label="@string/hosts"/>
<activity
android:name="com.hippo.ehviewer.shortcuts.ShortcutsActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents="true"
android:taskAffinity=""
android:launchMode="singleTask">
</activity>
<service
android:name="com.hippo.ehviewer.download.DownloadService"
android:label="@string/download_service_label"/>
<provider
android:name="com.hippo.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="com.hippo.content.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"/>
</provider>
</application>
</manifest>
@@ -0,0 +1,28 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.METHOD})
public @interface Implemented {
Class value();
}
@@ -0,0 +1,570 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.CallSuper;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatCallback;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.view.ActionMode;
import androidx.appcompat.widget.Toolbar;
import androidx.appcompat.widget.VectorEnabledTintResources;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NavUtils;
import androidx.core.app.TaskStackBuilder;
public abstract class AppCompatPreferenceActivity extends PreferenceActivity implements AppCompatCallback,
TaskStackBuilder.SupportParentable, ActionBarDrawerToggle.DelegateProvider {
private AppCompatDelegate mDelegate;
private int mThemeId = 0;
private Resources mResources;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
final AppCompatDelegate delegate = getDelegate();
delegate.installViewFactory();
delegate.onCreate(savedInstanceState);
if (delegate.applyDayNight() && mThemeId != 0) {
// If DayNight has been applied, we need to re-apply the theme for
// the changes to take effect. On API 23+, we should bypass
// setTheme(), which will no-op if the theme ID is identical to the
// current theme ID.
if (Build.VERSION.SDK_INT >= 23) {
onApplyThemeResource(getTheme(), mThemeId, false);
} else {
setTheme(mThemeId);
}
}
super.onCreate(savedInstanceState);
}
@Override
public void setTheme(@StyleRes final int resid) {
super.setTheme(resid);
// Keep hold of the theme id so that we can re-set it later if needed
mThemeId = resid;
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
/**
* Support library version of {@link android.app.Activity#getActionBar}.
*
* <p>Retrieve a reference to this activity's ActionBar.
*
* @return The Activity's ActionBar, or null if it does not have one.
*/
@Nullable
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
/**
* Set a {@link android.widget.Toolbar Toolbar} to act as the
* {@link androidx.appcompat.app.ActionBar} for this Activity window.
*
* <p>When set to a non-null value the {@link #getActionBar()} method will return
* an {@link androidx.appcompat.app.ActionBar} object that can be used to control the given
* toolbar as if it were a traditional window decor action bar. The toolbar's menu will be
* populated with the Activity's options menu and the navigation button will be wired through
* the standard {@link android.R.id#home home} menu select action.</p>
*
* <p>In order to use a Toolbar within the Activity's window content the application
* must not request the window feature
* {@link android.view.Window#FEATURE_ACTION_BAR FEATURE_SUPPORT_ACTION_BAR}.</p>
*
* @param toolbar Toolbar to set as the Activity's action bar, or {@code null} to clear it
*/
public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}
@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
if (mResources != null) {
// The real (and thus managed) resources object was already updated
// by ResourcesManager, so pull the current metrics from there.
final DisplayMetrics newMetrics = super.getResources().getDisplayMetrics();
mResources.updateConfiguration(newConfig, newMetrics);
}
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
protected void onStart() {
super.onStart();
getDelegate().onStart();
}
@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}
@SuppressWarnings("TypeParameterUnusedInFormals")
@Override
public <T extends View> T findViewById(@IdRes int id) {
return getDelegate().findViewById(id);
}
@Override
public final boolean onMenuItemSelected(int featureId, android.view.MenuItem item) {
if (super.onMenuItemSelected(featureId, item)) {
return true;
}
final ActionBar ab = getSupportActionBar();
if (item.getItemId() == android.R.id.home && ab != null &&
(ab.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
return onSupportNavigateUp();
}
return false;
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}
@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}
/**
* Enable extended support library window features.
* <p>
* This is a convenience for calling
* {@link android.view.Window#requestFeature getWindow().requestFeature()}.
* </p>
*
* @param featureId The desired feature as defined in
* {@link android.view.Window} or {@link androidx.core.view.WindowCompat}.
* @return Returns true if the requested feature is supported and now enabled.
*
* @see android.app.Activity#requestWindowFeature
* @see android.view.Window#requestFeature
*/
public boolean supportRequestWindowFeature(int featureId) {
return getDelegate().requestWindowFeature(featureId);
}
public void supportInvalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
@Override
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
/**
* Notifies the Activity that a support action mode has been started.
* Activity subclasses overriding this method should call the superclass implementation.
*
* @param mode The new action mode.
*/
@Override
@CallSuper
public void onSupportActionModeStarted(@NonNull ActionMode mode) {
}
/**
* Notifies the activity that a support action mode has finished.
* Activity subclasses overriding this method should call the superclass implementation.
*
* @param mode The action mode that just finished.
*/
@Override
@CallSuper
public void onSupportActionModeFinished(@NonNull ActionMode mode) {
}
/**
* Called when a support action mode is being started for this window. Gives the
* callback an opportunity to handle the action mode in its own unique and
* beautiful way. If this method returns null the system can choose a way
* to present the mode or choose not to start the mode at all.
*
* @param callback Callback to control the lifecycle of this action mode
* @return The ActionMode that was started, or null if the system should present it
*/
@Nullable
@Override
public ActionMode onWindowStartingSupportActionMode(@NonNull ActionMode.Callback callback) {
return null;
}
/**
* Start an action mode.
*
* @param callback Callback that will manage lifecycle events for this context mode
* @return The ContextMode that was started, or null if it was canceled
*/
@Nullable
public ActionMode startSupportActionMode(@NonNull ActionMode.Callback callback) {
return getDelegate().startSupportActionMode(callback);
}
/**
* @deprecated Progress bars are no longer provided in AppCompat.
*/
@Deprecated
public void setSupportProgressBarVisibility(boolean visible) {
}
/**
* @deprecated Progress bars are no longer provided in AppCompat.
*/
@Deprecated
public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
}
/**
* @deprecated Progress bars are no longer provided in AppCompat.
*/
@Deprecated
public void setSupportProgressBarIndeterminate(boolean indeterminate) {
}
/**
* @deprecated Progress bars are no longer provided in AppCompat.
*/
@Deprecated
public void setSupportProgress(int progress) {
}
/**
* Support version of {@link #onCreateNavigateUpTaskStack(android.app.TaskStackBuilder)}.
* This method will be called on all platform versions.
*
* Define the synthetic task stack that will be generated during Up navigation from
* a different task.
*
* <p>The default implementation of this method adds the parent chain of this activity
* as specified in the manifest to the supplied {@link androidx.core.app.TaskStackBuilder}. Applications
* may choose to override this method to construct the desired task stack in a different
* way.</p>
*
* <p>This method will be invoked by the default implementation of {@link #onNavigateUp()}
* if {@link #shouldUpRecreateTask(android.content.Intent)} returns true when supplied with the intent
* returned by {@link #getParentActivityIntent()}.</p>
*
* <p>Applications that wish to supply extra Intent parameters to the parent stack defined
* by the manifest should override
* {@link #onPrepareSupportNavigateUpTaskStack(androidx.core.app.TaskStackBuilder)}.</p>
*
* @param builder An empty TaskStackBuilder - the application should add intents representing
* the desired task stack
*/
public void onCreateSupportNavigateUpTaskStack(@NonNull TaskStackBuilder builder) {
builder.addParentStack(this);
}
/**
* Support version of {@link #onPrepareNavigateUpTaskStack(android.app.TaskStackBuilder)}.
* This method will be called on all platform versions.
*
* Prepare the synthetic task stack that will be generated during Up navigation
* from a different task.
*
* <p>This method receives the {@link androidx.core.app.TaskStackBuilder} with the constructed series of
* Intents as generated by {@link #onCreateSupportNavigateUpTaskStack(androidx.core.app.TaskStackBuilder)}.
* If any extra data should be added to these intents before launching the new task,
* the application should override this method and add that data here.</p>
*
* @param builder A TaskStackBuilder that has been populated with Intents by
* onCreateNavigateUpTaskStack.
*/
public void onPrepareSupportNavigateUpTaskStack(@NonNull TaskStackBuilder builder) {
}
/**
* This method is called whenever the user chooses to navigate Up within your application's
* activity hierarchy from the action bar.
*
* <p>If a parent was specified in the manifest for this activity or an activity-alias to it,
* default Up navigation will be handled automatically. See
* {@link #getSupportParentActivityIntent()} for how to specify the parent. If any activity
* along the parent chain requires extra Intent arguments, the Activity subclass
* should override the method {@link #onPrepareSupportNavigateUpTaskStack(androidx.core.app.TaskStackBuilder)}
* to supply those arguments.</p>
*
* <p>See <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and
* Back Stack</a> from the developer guide and
* <a href="{@docRoot}design/patterns/navigation.html">Navigation</a> from the design guide
* for more information about navigating within your app.</p>
*
* <p>See the {@link androidx.core.app.TaskStackBuilder} class and the Activity methods
* {@link #getSupportParentActivityIntent()}, {@link #supportShouldUpRecreateTask(android.content.Intent)}, and
* {@link #supportNavigateUpTo(android.content.Intent)} for help implementing custom Up navigation.</p>
*
* @return true if Up navigation completed successfully and this Activity was finished,
* false otherwise.
*/
public boolean onSupportNavigateUp() {
Intent upIntent = getSupportParentActivityIntent();
if (upIntent != null) {
if (supportShouldUpRecreateTask(upIntent)) {
TaskStackBuilder b = TaskStackBuilder.create(this);
onCreateSupportNavigateUpTaskStack(b);
onPrepareSupportNavigateUpTaskStack(b);
b.startActivities();
try {
ActivityCompat.finishAffinity(this);
} catch (IllegalStateException e) {
// This can only happen on 4.1+, when we don't have a parent or a result set.
// In that case we should just finish().
finish();
}
} else {
// This activity is part of the application's task, so simply
// navigate up to the hierarchical parent activity.
supportNavigateUpTo(upIntent);
}
return true;
}
return false;
}
/**
* Obtain an {@link android.content.Intent} that will launch an explicit target activity
* specified by sourceActivity's {@link androidx.core.app.NavUtils#PARENT_ACTIVITY} &lt;meta-data&gt;
* element in the application's manifest. If the device is running
* Jellybean or newer, the android:parentActivityName attribute will be preferred
* if it is present.
*
* @return a new Intent targeting the defined parent activity of sourceActivity
*/
@Nullable
@Override
public Intent getSupportParentActivityIntent() {
return NavUtils.getParentActivityIntent(this);
}
/**
* Returns true if sourceActivity should recreate the task when navigating 'up'
* by using targetIntent.
*
* <p>If this method returns false the app can trivially call
* {@link #supportNavigateUpTo(android.content.Intent)} using the same parameters to correctly perform
* up navigation. If this method returns false, the app should synthesize a new task stack
* by using {@link androidx.core.app.TaskStackBuilder} or another similar mechanism to perform up navigation.</p>
*
* @param targetIntent An intent representing the target destination for up navigation
* @return true if navigating up should recreate a new task stack, false if the same task
* should be used for the destination
*/
public boolean supportShouldUpRecreateTask(@NonNull Intent targetIntent) {
return NavUtils.shouldUpRecreateTask(this, targetIntent);
}
/**
* Navigate from sourceActivity to the activity specified by upIntent, finishing sourceActivity
* in the process. upIntent will have the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP} set
* by this method, along with any others required for proper up navigation as outlined
* in the Android Design Guide.
*
* <p>This method should be used when performing up navigation from within the same task
* as the destination. If up navigation should cross tasks in some cases, see
* {@link #supportShouldUpRecreateTask(android.content.Intent)}.</p>
*
* @param upIntent An intent representing the target destination for up navigation
*/
public void supportNavigateUpTo(@NonNull Intent upIntent) {
NavUtils.navigateUpTo(this, upIntent);
}
@Nullable
@Override
public ActionBarDrawerToggle.Delegate getDrawerToggleDelegate() {
return getDelegate().getDrawerToggleDelegate();
}
/**
* {@inheritDoc}
*
* <p>Please note: AppCompat uses its own feature id for the action bar:
* {@link AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR FEATURE_SUPPORT_ACTION_BAR}.</p>
*/
@Override
public boolean onMenuOpened(int featureId, Menu menu) {
return super.onMenuOpened(featureId, menu);
}
/**
* {@inheritDoc}
*
* <p>Please note: AppCompat uses its own feature id for the action bar:
* {@link AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR FEATURE_SUPPORT_ACTION_BAR}.</p>
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
super.onPanelClosed(featureId, menu);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
getDelegate().onSaveInstanceState(outState);
}
/**
* @return The {@link AppCompatDelegate} being used by this Activity.
*/
@NonNull
public AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, this);
}
return mDelegate;
}
@SuppressLint("RestrictedApi")
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Let support action bars open menus in response to the menu key prioritized over
// the window handling it
final int keyCode = event.getKeyCode();
final ActionBar actionBar = getSupportActionBar();
if (keyCode == KeyEvent.KEYCODE_MENU
&& actionBar != null && actionBar.onMenuKeyEvent(event)) {
return true;
}
return super.dispatchKeyEvent(event);
}
@SuppressLint("RestrictedApi")
@Override
public Resources getResources() {
if (mResources == null && VectorEnabledTintResources.shouldBeUsed()) {
mResources = new VectorEnabledTintResources(this, super.getResources());
}
return mResources == null ? super.getResources() : mResources;
}
/**
* KeyEvents with non-default modifiers are not dispatched to menu's performShortcut in API 25
* or lower. Here, we check if the keypress corresponds to a menuitem's shortcut combination
* and perform the corresponding action.
*/
private boolean performMenuItemShortcut(int keycode, KeyEvent event) {
if (!(Build.VERSION.SDK_INT >= 26) && !event.isCtrlPressed()
&& !KeyEvent.metaStateHasNoModifiers(event.getMetaState())
&& event.getRepeatCount() == 0
&& !KeyEvent.isModifierKey(event.getKeyCode())) {
final Window currentWindow = getWindow();
if (currentWindow != null && currentWindow.getDecorView() != null) {
final View decorView = currentWindow.getDecorView();
if (decorView.dispatchKeyShortcutEvent(event)) {
return true;
}
}
}
return false;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (performMenuItemShortcut(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
@SuppressLint("RestrictedApi")
@Override
public void openOptionsMenu() {
ActionBar actionBar = getSupportActionBar();
if (getWindow().hasFeature(Window.FEATURE_OPTIONS_PANEL)
&& (actionBar == null || !actionBar.openOptionsMenu())) {
super.openOptionsMenu();
}
}
@SuppressLint("RestrictedApi")
@Override
public void closeOptionsMenu() {
ActionBar actionBar = getSupportActionBar();
if (getWindow().hasFeature(Window.FEATURE_OPTIONS_PANEL)
&& (actionBar == null || !actionBar.closeOptionsMenu())) {
super.closeOptionsMenu();
}
}
}
@@ -0,0 +1,47 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.hippo.ehviewer.R;
public class CheckBoxDialogBuilder extends AlertDialog.Builder {
private final CheckBox mCheckBox;
@SuppressLint("InflateParams")
public CheckBoxDialogBuilder(Context context, String message, String checkText, boolean checked) {
super(context);
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_checkbox_builder, null);
setView(view);
TextView messageView = (TextView) view.findViewById(R.id.message);
mCheckBox = (CheckBox) view.findViewById(R.id.checkbox);
messageView.setText(message);
mCheckBox.setText(checkText);
mCheckBox.setChecked(checked);
}
public boolean isChecked() {
return mCheckBox.isChecked();
}
}
@@ -0,0 +1,81 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.google.android.material.textfield.TextInputLayout;
import com.hippo.ehviewer.R;
public class EditTextDialogBuilder extends AlertDialog.Builder implements EditText.OnEditorActionListener {
private final TextInputLayout mTextInputLayout;
private final EditText mEditText;
private AlertDialog mDialog;
@SuppressLint("InflateParams")
public EditTextDialogBuilder(Context context, String text, String hint) {
super(context);
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_edittext_builder, null);
setView(view);
mTextInputLayout = (TextInputLayout) view;
mEditText = (EditText) view.findViewById(R.id.edit_text);
mEditText.setText(text);
mEditText.setSelection(mEditText.getText().length());
mEditText.setOnEditorActionListener(this);
mTextInputLayout.setHint(hint);
}
public EditText getEditText() {
return mEditText;
}
public String getText() {
return mEditText.getText().toString();
}
public void setError(CharSequence error) {
mTextInputLayout.setError(error);
}
@Override
public AlertDialog create() {
mDialog = super.create();
return mDialog;
}
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (mDialog != null) {
Button button = mDialog.getButton(DialogInterface.BUTTON_POSITIVE);
if (button != null) {
button.performClick();
}
return true;
} else {
return false;
}
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ListView;
import androidx.appcompat.app.AlertDialog;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.ViewUtils;
public class ListCheckBoxDialogBuilder extends AlertDialog.Builder {
private final CheckBox mCheckBox;
private AlertDialog mDialog;
@SuppressLint("InflateParams")
public ListCheckBoxDialogBuilder(Context context, CharSequence[] items,
final OnItemClickListener listener, String checkText, boolean checked) {
super(context);
View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_list_checkbox_builder, null);
setView(view);
ListView listView = (ListView) ViewUtils.$$(view, R.id.list_view);
mCheckBox = (CheckBox) ViewUtils.$$(view, R.id.checkbox);
listView.setAdapter(new ArrayAdapter<>(getContext(), R.layout.item_select_dialog, items));
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (listener != null) {
listener.onItemClick(ListCheckBoxDialogBuilder.this, mDialog, position);
}
mDialog.dismiss();
}
});
mCheckBox.setText(checkText);
mCheckBox.setChecked(checked);
}
public boolean isChecked() {
return mCheckBox.isChecked();
}
@Override
public AlertDialog create() {
mDialog = super.create();
return mDialog;
}
public interface OnItemClickListener {
void onItemClick(ListCheckBoxDialogBuilder builder, AlertDialog dialog, int position);
}
}
@@ -0,0 +1,113 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.content.Context;
import android.preference.PreferenceActivity;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.hippo.ehviewer.R;
import java.util.ArrayList;
import java.util.List;
public abstract class PrettyPreferenceActivity extends AppCompatPreferenceActivity {
@Override
public void setListAdapter(ListAdapter adapter) {
if (adapter == null) {
super.setListAdapter(null);
return;
}
int count = adapter.getCount();
List<PreferenceActivity.Header> headers = new ArrayList<>(count);
for (int i = 0; i < count; ++i) {
headers.add((PreferenceActivity.Header) adapter.getItem(i));
}
super.setListAdapter(new HeaderAdapter(this, headers, R.layout.item_preference_header, true));
}
private static class HeaderAdapter extends ArrayAdapter<PreferenceActivity.Header> {
private static class HeaderViewHolder {
ImageView icon;
TextView title;
TextView summary;
}
private LayoutInflater mInflater;
private int mLayoutResId;
private boolean mRemoveIconIfEmpty;
private HeaderAdapter(Context context, List<PreferenceActivity.Header> objects, int layoutResId,
boolean removeIconBehavior) {
super(context, 0, objects);
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mLayoutResId = layoutResId;
mRemoveIconIfEmpty = removeIconBehavior;
}
@NonNull
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
HeaderViewHolder holder;
View view;
if (convertView == null) {
view = mInflater.inflate(mLayoutResId, parent, false);
holder = new HeaderViewHolder();
holder.icon = view.findViewById(android.R.id.icon);
holder.title = view.findViewById(android.R.id.title);
holder.summary = view.findViewById(android.R.id.summary);
view.setTag(holder);
} else {
view = convertView;
holder = (HeaderViewHolder) view.getTag();
}
// All view fields must be updated every time, because the view may be recycled
PreferenceActivity.Header header = getItem(position);
if (mRemoveIconIfEmpty) {
if (header.iconRes == 0) {
holder.icon.setVisibility(View.GONE);
} else {
holder.icon.setVisibility(View.VISIBLE);
holder.icon.setImageResource(header.iconRes);
}
} else {
holder.icon.setImageResource(header.iconRes);
}
holder.title.setText(header.getTitle(getContext().getResources()));
CharSequence summary = header.getSummary(getContext().getResources());
if (!TextUtils.isEmpty(summary)) {
holder.summary.setVisibility(View.VISIBLE);
holder.summary.setText(summary);
} else {
holder.summary.setVisibility(View.GONE);
}
return view;
}
}
}
@@ -0,0 +1,350 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.app;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.StyleSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.hippo.ehviewer.R;
import java.text.NumberFormat;
/**
* <p>A dialog showing a progress indicator and an optional text message or view.
* Only a text message or a view can be used at the same time.</p>
* <p>The dialog can be made cancelable on back key press.</p>
* <p>The progress range is 0..10000.</p>
*/
public class ProgressDialog extends AlertDialog {
/** Creates a ProgressDialog with a circular, spinning progress
* bar. This is the default.
*/
public static final int STYLE_SPINNER = 0;
/** Creates a ProgressDialog with a horizontal progress bar.
*/
public static final int STYLE_HORIZONTAL = 1;
private ProgressBar mProgress;
private TextView mMessageView;
private int mProgressStyle = STYLE_SPINNER;
private TextView mProgressNumber;
private String mProgressNumberFormat;
private TextView mProgressPercent;
private NumberFormat mProgressPercentFormat;
private int mMax;
private int mProgressVal;
private int mSecondaryProgressVal;
private int mIncrementBy;
private int mIncrementSecondaryBy;
private Drawable mProgressDrawable;
private Drawable mIndeterminateDrawable;
private CharSequence mMessage;
private boolean mIndeterminate;
private boolean mHasStarted;
private Handler mViewUpdateHandler;
public ProgressDialog(Context context) {
super(context);
initFormats();
}
public ProgressDialog(Context context, int theme) {
super(context, theme);
initFormats();
}
private void initFormats() {
mProgressNumberFormat = "%1d/%2d";
mProgressPercentFormat = NumberFormat.getPercentInstance();
mProgressPercentFormat.setMaximumFractionDigits(0);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message) {
return show(context, title, message, false);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate) {
return show(context, title, message, indeterminate, false, null);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate, boolean cancelable) {
return show(context, title, message, indeterminate, cancelable, null);
}
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message, boolean indeterminate,
boolean cancelable, OnCancelListener cancelListener) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setTitle(title);
dialog.setMessage(message);
dialog.setIndeterminate(indeterminate);
dialog.setCancelable(cancelable);
dialog.setOnCancelListener(cancelListener);
dialog.show();
return dialog;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
LayoutInflater inflater = LayoutInflater.from(getContext());
if (mProgressStyle == STYLE_HORIZONTAL) {
/* Use a separate handler to update the text views as they
* must be updated on the same thread that created them.
*/
mViewUpdateHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
/* Update the number and percent */
int progress = mProgress.getProgress();
int max = mProgress.getMax();
if (mProgressNumberFormat != null) {
String format = mProgressNumberFormat;
mProgressNumber.setText(String.format(format, progress, max));
} else {
mProgressNumber.setText("");
}
if (mProgressPercentFormat != null) {
double percent = (double) progress / (double) max;
SpannableString tmp = new SpannableString(mProgressPercentFormat.format(percent));
tmp.setSpan(new StyleSpan(android.graphics.Typeface.BOLD),
0, tmp.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
mProgressPercent.setText(tmp);
} else {
mProgressPercent.setText("");
}
}
};
View view = inflater.inflate(R.layout.alert_dialog_progress_material, null);
mProgress = (ProgressBar) view.findViewById(R.id.progress);
mProgressNumber = (TextView) view.findViewById(R.id.progress_number);
mProgressPercent = (TextView) view.findViewById(R.id.progress_percent);
setView(view);
} else {
View view = inflater.inflate(R.layout.progress_dialog_material, null);
mProgress = (ProgressBar) view.findViewById(R.id.progress);
mMessageView = (TextView) view.findViewById(R.id.message);
setView(view);
}
if (mMax > 0) {
setMax(mMax);
}
if (mProgressVal > 0) {
setProgress(mProgressVal);
}
if (mSecondaryProgressVal > 0) {
setSecondaryProgress(mSecondaryProgressVal);
}
if (mIncrementBy > 0) {
incrementProgressBy(mIncrementBy);
}
if (mIncrementSecondaryBy > 0) {
incrementSecondaryProgressBy(mIncrementSecondaryBy);
}
if (mProgressDrawable != null) {
setProgressDrawable(mProgressDrawable);
}
if (mIndeterminateDrawable != null) {
setIndeterminateDrawable(mIndeterminateDrawable);
}
if (mMessage != null) {
setMessage(mMessage);
}
setIndeterminate(mIndeterminate);
onProgressChanged();
super.onCreate(savedInstanceState);
}
@Override
public void onStart() {
super.onStart();
mHasStarted = true;
}
@Override
protected void onStop() {
super.onStop();
mHasStarted = false;
}
public void setProgress(int value) {
if (mHasStarted) {
mProgress.setProgress(value);
onProgressChanged();
} else {
mProgressVal = value;
}
}
public void setSecondaryProgress(int secondaryProgress) {
if (mProgress != null) {
mProgress.setSecondaryProgress(secondaryProgress);
onProgressChanged();
} else {
mSecondaryProgressVal = secondaryProgress;
}
}
public int getProgress() {
if (mProgress != null) {
return mProgress.getProgress();
}
return mProgressVal;
}
public int getSecondaryProgress() {
if (mProgress != null) {
return mProgress.getSecondaryProgress();
}
return mSecondaryProgressVal;
}
public int getMax() {
if (mProgress != null) {
return mProgress.getMax();
}
return mMax;
}
public void setMax(int max) {
if (mProgress != null) {
mProgress.setMax(max);
onProgressChanged();
} else {
mMax = max;
}
}
public void incrementProgressBy(int diff) {
if (mProgress != null) {
mProgress.incrementProgressBy(diff);
onProgressChanged();
} else {
mIncrementBy += diff;
}
}
public void incrementSecondaryProgressBy(int diff) {
if (mProgress != null) {
mProgress.incrementSecondaryProgressBy(diff);
onProgressChanged();
} else {
mIncrementSecondaryBy += diff;
}
}
public void setProgressDrawable(Drawable d) {
if (mProgress != null) {
mProgress.setProgressDrawable(d);
} else {
mProgressDrawable = d;
}
}
public void setIndeterminateDrawable(Drawable d) {
if (mProgress != null) {
mProgress.setIndeterminateDrawable(d);
} else {
mIndeterminateDrawable = d;
}
}
public void setIndeterminate(boolean indeterminate) {
if (mProgress != null) {
mProgress.setIndeterminate(indeterminate);
} else {
mIndeterminate = indeterminate;
}
}
public boolean isIndeterminate() {
if (mProgress != null) {
return mProgress.isIndeterminate();
}
return mIndeterminate;
}
@Override
public void setMessage(CharSequence message) {
if (mProgress != null) {
if (mProgressStyle == STYLE_HORIZONTAL) {
super.setMessage(message);
} else {
mMessageView.setText(message);
}
} else {
mMessage = message;
}
}
public void setProgressStyle(int style) {
mProgressStyle = style;
}
/**
* Change the format of the small text showing current and maximum units
* of progress. The default is "%1d/%2d".
* Should not be called during the number is progressing.
* @param format A string passed to {@link String#format String.format()};
* use "%1d" for the current number and "%2d" for the maximum. If null,
* nothing will be shown.
*/
public void setProgressNumberFormat(String format) {
mProgressNumberFormat = format;
onProgressChanged();
}
/**
* Change the format of the small text showing the percentage of progress.
* The default is
* {@link NumberFormat#getPercentInstance() NumberFormat.getPercentageInstnace().}
* Should not be called during the number is progressing.
* @param format An instance of a {@link NumberFormat} to generate the
* percentage text. If null, nothing will be shown.
*/
public void setProgressPercentFormat(NumberFormat format) {
mProgressPercentFormat = format;
onProgressChanged();
}
private void onProgressChanged() {
if (mProgressStyle == STYLE_HORIZONTAL) {
if (mViewUpdateHandler != null && !mViewUpdateHandler.hasMessages(0)) {
mViewUpdateHandler.sendEmptyMessage(0);
}
}
}
}
@@ -0,0 +1,61 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.content;
/*
* Created by Hippo on 2018/3/27.
*/
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.LocaleList;
import java.util.Locale;
public class ContextLocalWrapper extends ContextWrapper {
public ContextLocalWrapper(Context base) {
super(base);
}
public static ContextLocalWrapper wrap(Context context, Locale newLocale) {
Resources res = context.getResources();
Configuration configuration = res.getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
configuration.setLocale(newLocale);
LocaleList localeList = new LocaleList(newLocale);
LocaleList.setDefault(localeList);
configuration.setLocales(localeList);
context = context.createConfigurationContext(configuration);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
configuration.setLocale(newLocale);
context = context.createConfigurationContext(configuration);
} else {
configuration.locale = newLocale;
res.updateConfiguration(configuration, res.getDisplayMetrics());
}
return new ContextLocalWrapper(context);
}
}
@@ -0,0 +1,814 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.content;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
import android.content.ClipData;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import androidx.core.content.ContextCompat;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.xmlpull.v1.XmlPullParserException;
/**
* FileProvider is a special subclass of {@link ContentProvider} that facilitates secure sharing
* of files associated with an app by creating a <code>content://</code> {@link Uri} for a file
* instead of a <code>file:///</code> {@link Uri}.
* <p>
* A content URI allows you to grant read and write access using
* temporary access permissions. When you create an {@link Intent} containing
* a content URI, in order to send the content URI
* to a client app, you can also call {@link Intent#setFlags(int) Intent.setFlags()} to add
* permissions. These permissions are available to the client app for as long as the stack for
* a receiving {@link android.app.Activity} is active. For an {@link Intent} going to a
* {@link android.app.Service}, the permissions are available as long as the
* {@link android.app.Service} is running.
* <p>
* In comparison, to control access to a <code>file:///</code> {@link Uri} you have to modify the
* file system permissions of the underlying file. The permissions you provide become available to
* <em>any</em> app, and remain in effect until you change them. This level of access is
* fundamentally insecure.
* <p>
* The increased level of file access security offered by a content URI
* makes FileProvider a key part of Android's security infrastructure.
* <p>
* This overview of FileProvider includes the following topics:
* </p>
* <ol>
* <li><a href="#ProviderDefinition">Defining a FileProvider</a></li>
* <li><a href="#SpecifyFiles">Specifying Available Files</a></li>
* <li><a href="#GetUri">Retrieving the Content URI for a File</li>
* <li><a href="#Permissions">Granting Temporary Permissions to a URI</a></li>
* <li><a href="#ServeUri">Serving a Content URI to Another App</a></li>
* </ol>
* <h3 id="ProviderDefinition">Defining a FileProvider</h3>
* <p>
* Since the default functionality of FileProvider includes content URI generation for files, you
* don't need to define a subclass in code. Instead, you can include a FileProvider in your app
* by specifying it entirely in XML. To specify the FileProvider component itself, add a
* <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
* element to your app manifest. Set the <code>android:name</code> attribute to
* <code>android.support.v4.content.FileProvider</code>. Set the <code>android:authorities</code>
* attribute to a URI authority based on a domain you control; for example, if you control the
* domain <code>mydomain.com</code> you should use the authority
* <code>com.mydomain.fileprovider</code>. Set the <code>android:exported</code> attribute to
* <code>false</code>; the FileProvider does not need to be public. Set the
* <a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn"
* >android:grantUriPermissions</a> attribute to <code>true</code>, to allow you
* to grant temporary access to files. For example:
* <pre class="prettyprint">
*&lt;manifest&gt;
* ...
* &lt;application&gt;
* ...
* &lt;provider
* android:name="android.support.v4.content.FileProvider"
* android:authorities="com.mydomain.fileprovider"
* android:exported="false"
* android:grantUriPermissions="true"&gt;
* ...
* &lt;/provider&gt;
* ...
* &lt;/application&gt;
*&lt;/manifest&gt;</pre>
* <p>
* If you want to override any of the default behavior of FileProvider methods, extend
* the FileProvider class and use the fully-qualified class name in the <code>android:name</code>
* attribute of the <code>&lt;provider&gt;</code> element.
* <h3 id="SpecifyFiles">Specifying Available Files</h3>
* A FileProvider can only generate a content URI for files in directories that you specify
* beforehand. To specify a directory, specify the its storage area and path in XML, using child
* elements of the <code>&lt;paths&gt;</code> element.
* For example, the following <code>paths</code> element tells FileProvider that you intend to
* request content URIs for the <code>images/</code> subdirectory of your private file area.
* <pre class="prettyprint">
*&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
* &lt;files-path name="my_images" path="images/"/&gt;
* ...
*&lt;/paths&gt;
*</pre>
* <p>
* The <code>&lt;paths&gt;</code> element must contain one or more of the following child elements:
* </p>
* <dl>
* <dt>
* <pre class="prettyprint">
*&lt;files-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the <code>files/</code> subdirectory of your app's internal storage
* area. This subdirectory is the same as the value returned by {@link Context#getFilesDir()
* Context.getFilesDir()}.
* </dd>
* <dt>
* <pre>
*&lt;cache-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* <dt>
* <dd>
* Represents files in the cache subdirectory of your app's internal storage area. The root path
* of this subdirectory is the same as the value returned by {@link Context#getCacheDir()
* getCacheDir()}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of the external storage area. The root path of this subdirectory
* is the same as the value returned by
* {@link Environment#getExternalStorageDirectory() Environment.getExternalStorageDirectory()}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-files-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of your app's external storage area. The root path of this
* subdirectory is the same as the value returned by
* {@code Context#getExternalFilesDir(String) Context.getExternalFilesDir(null)}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-cache-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of your app's external cache area. The root path of this
* subdirectory is the same as the value returned by
* {@link Context#getExternalCacheDir() Context.getExternalCacheDir()}.
* </dd>
* </dl>
* <p>
* These child elements all use the same attributes:
* </p>
* <dl>
* <dt>
* <code>name="<i>name</i>"</code>
* </dt>
* <dd>
* A URI path segment. To enforce security, this value hides the name of the subdirectory
* you're sharing. The subdirectory name for this value is contained in the
* <code>path</code> attribute.
* </dd>
* <dt>
* <code>path="<i>path</i>"</code>
* </dt>
* <dd>
* The subdirectory you're sharing. While the <code>name</code> attribute is a URI path
* segment, the <code>path</code> value is an actual subdirectory name. Notice that the
* value refers to a <b>subdirectory</b>, not an individual file or files. You can't
* share a single file by its file name, nor can you specify a subset of files using
* wildcards.
* </dd>
* </dl>
* <p>
* You must specify a child element of <code>&lt;paths&gt;</code> for each directory that contains
* files for which you want content URIs. For example, these XML elements specify two directories:
* <pre class="prettyprint">
*&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
* &lt;files-path name="my_images" path="images/"/&gt;
* &lt;files-path name="my_docs" path="docs/"/&gt;
*&lt;/paths&gt;
*</pre>
* <p>
* Put the <code>&lt;paths&gt;</code> element and its children in an XML file in your project.
* For example, you can add them to a new file called <code>res/xml/file_paths.xml</code>.
* To link this file to the FileProvider, add a
* <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a> element
* as a child of the <code>&lt;provider&gt;</code> element that defines the FileProvider. Set the
* <code>&lt;meta-data&gt;</code> element's "android:name" attribute to
* <code>android.support.FILE_PROVIDER_PATHS</code>. Set the element's "android:resource" attribute
* to <code>&#64;xml/file_paths</code> (notice that you don't specify the <code>.xml</code>
* extension). For example:
* <pre class="prettyprint">
*&lt;provider
* android:name="android.support.v4.content.FileProvider"
* android:authorities="com.mydomain.fileprovider"
* android:exported="false"
* android:grantUriPermissions="true"&gt;
* &lt;meta-data
* android:name="android.support.FILE_PROVIDER_PATHS"
* android:resource="&#64;xml/file_paths" /&gt;
*&lt;/provider&gt;
*</pre>
* <h3 id="GetUri">Generating the Content URI for a File</h3>
* <p>
* To share a file with another app using a content URI, your app has to generate the content URI.
* To generate the content URI, create a new {@link File} for the file, then pass the {@link File}
* to {@link #getUriForFile(Context, String, File) getUriForFile()}. You can send the content URI
* returned by {@link #getUriForFile(Context, String, File) getUriForFile()} to another app in an
* {@link android.content.Intent}. The client app that receives the content URI can open the file
* and access its contents by calling
* {@link android.content.ContentResolver#openFileDescriptor(Uri, String)
* ContentResolver.openFileDescriptor} to get a {@link ParcelFileDescriptor}.
* <p>
* For example, suppose your app is offering files to other apps with a FileProvider that has the
* authority <code>com.mydomain.fileprovider</code>. To get a content URI for the file
* <code>default_image.jpg</code> in the <code>images/</code> subdirectory of your internal storage
* add the following code:
* <pre class="prettyprint">
*File imagePath = new File(Context.getFilesDir(), "images");
*File newFile = new File(imagePath, "default_image.jpg");
*Uri contentUri = getUriForFile(getContext(), "com.mydomain.fileprovider", newFile);
*</pre>
* As a result of the previous snippet,
* {@link #getUriForFile(Context, String, File) getUriForFile()} returns the content URI
* <code>content://com.mydomain.fileprovider/my_images/default_image.jpg</code>.
* <h3 id="Permissions">Granting Temporary Permissions to a URI</h3>
* To grant an access permission to a content URI returned from
* {@link #getUriForFile(Context, String, File) getUriForFile()}, do one of the following:
* <ul>
* <li>
* Call the method
* {@link Context#grantUriPermission(String, Uri, int)
* Context.grantUriPermission(package, Uri, mode_flags)} for the <code>content://</code>
* {@link Uri}, using the desired mode flags. This grants temporary access permission for the
* content URI to the specified package, according to the value of the
* the <code>mode_flags</code> parameter, which you can set to
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}, {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}
* or both. The permission remains in effect until you revoke it by calling
* {@link Context#revokeUriPermission(Uri, int) revokeUriPermission()} or until the device
* reboots.
* </li>
* <li>
* Put the content URI in an {@link Intent} by calling {@link Intent#setData(Uri) setData()}.
* </li>
* <li>
* Next, call the method {@link Intent#setFlags(int) Intent.setFlags()} with either
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} or
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION} or both.
* </li>
* <li>
* Finally, send the {@link Intent} to
* another app. Most often, you do this by calling
* {@link android.app.Activity#setResult(int, android.content.Intent) setResult()}.
* <p>
* Permissions granted in an {@link Intent} remain in effect while the stack of the receiving
* {@link android.app.Activity} is active. When the stack finishes, the permissions are
* automatically removed. Permissions granted to one {@link android.app.Activity} in a client
* app are automatically extended to other components of that app.
* </p>
* </li>
* </ul>
* <h3 id="ServeUri">Serving a Content URI to Another App</h3>
* <p>
* There are a variety of ways to serve the content URI for a file to a client app. One common way
* is for the client app to start your app by calling
* {@link android.app.Activity#startActivityForResult(Intent, int, Bundle) startActivityResult()},
* which sends an {@link Intent} to your app to start an {@link android.app.Activity} in your app.
* In response, your app can immediately return a content URI to the client app or present a user
* interface that allows the user to pick a file. In the latter case, once the user picks the file
* your app can return its content URI. In both cases, your app returns the content URI in an
* {@link Intent} sent via {@link android.app.Activity#setResult(int, Intent) setResult()}.
* </p>
* <p>
* You can also put the content URI in a {@link android.content.ClipData} object and then add the
* object to an {@link Intent} you send to a client app. To do this, call
* {@link Intent#setClipData(ClipData) Intent.setClipData()}. When you use this approach, you can
* add multiple {@link android.content.ClipData} objects to the {@link Intent}, each with its own
* content URI. When you call {@link Intent#setFlags(int) Intent.setFlags()} on the {@link Intent}
* to set temporary access permissions, the same permissions are applied to all of the content
* URIs.
* </p>
* <p class="note">
* <strong>Note:</strong> The {@link Intent#setClipData(ClipData) Intent.setClipData()} method is
* only available in platform version 16 (Android 4.1) and later. If you want to maintain
* compatibility with previous versions, you should send one content URI at a time in the
* {@link Intent}. Set the action to {@link Intent#ACTION_SEND} and put the URI in data by calling
* {@link Intent#setData setData()}.
* </p>
* <h3 id="">More Information</h3>
* <p>
* To learn more about FileProvider, see the Android training class
* <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files Securely with URIs</a>.
* </p>
*/
public class FileProvider extends ContentProvider {
private static final String[] COLUMNS = {
MediaStore.MediaColumns.DISPLAY_NAME,
MediaStore.MediaColumns.SIZE,
MediaStore.MediaColumns.DATA
};
private static final String
META_DATA_FILE_PROVIDER_PATHS = "com.hippo.content.FILE_PROVIDER_PATHS";
private static final String TAG_ROOT_PATH = "root-path";
private static final String TAG_FILES_PATH = "files-path";
private static final String TAG_CACHE_PATH = "cache-path";
private static final String TAG_EXTERNAL = "external-path";
private static final String TAG_EXTERNAL_FILES = "external-files-path";
private static final String TAG_EXTERNAL_CACHE = "external-cache-path";
private static final String ATTR_NAME = "name";
private static final String ATTR_PATH = "path";
private static final File DEVICE_ROOT = new File("/");
// @GuardedBy("sCache")
private static HashMap<String, PathStrategy> sCache = new HashMap<String, PathStrategy>();
private PathStrategy mStrategy;
/**
* The default FileProvider implementation does not need to be initialized. If you want to
* override this method, you must provide your own subclass of FileProvider.
*/
@Override
public boolean onCreate() {
return true;
}
/**
* After the FileProvider is instantiated, this method is called to provide the system with
* information about the provider.
*
* @param context A {@link Context} for the current component.
* @param info A {@link ProviderInfo} for the new provider.
*/
@Override
public void attachInfo(Context context, ProviderInfo info) {
super.attachInfo(context, info);
// Sanity check our security
if (info.exported) {
throw new SecurityException("Provider must not be exported");
}
if (!info.grantUriPermissions) {
throw new SecurityException("Provider must grant uri permissions");
}
mStrategy = getPathStrategy(context, info.authority);
}
/**
* Return a content URI for a given {@link File}. Specific temporary
* permissions for the content URI can be set with
* {@link Context#grantUriPermission(String, Uri, int)}, or added
* to an {@link Intent} by calling {@link Intent#setData(Uri) setData()} and then
* {@link Intent#setFlags(int) setFlags()}; in both cases, the applicable flags are
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} and
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}. A FileProvider can only return a
* <code>content</code> {@link Uri} for file paths defined in their <code>&lt;paths&gt;</code>
* meta-data element. See the Class Overview for more information.
*
* @param context A {@link Context} for the current component.
* @param authority The authority of a {@link FileProvider} defined in a
* {@code <provider>} element in your app's manifest.
* @param file A {@link File} pointing to the filename for which you want a
* <code>content</code> {@link Uri}.
* @return A content URI for the file.
* @throws IllegalArgumentException When the given {@link File} is outside
* the paths supported by the provider.
*/
public static Uri getUriForFile(Context context, String authority, File file) {
final PathStrategy strategy = getPathStrategy(context, authority);
return strategy.getUriForFile(file);
}
/**
* Use a content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
* managed by the FileProvider.
* FileProvider reports the column names defined in {@link android.provider.MediaStore.MediaColumns}:
* <ul>
* <li>{@link android.provider.MediaStore.MediaColumns#DISPLAY_NAME}</li>
* <li>{@link android.provider.MediaStore.MediaColumns#SIZE}</li>
* <li>{@link android.provider.MediaStore.MediaColumns#DATA}</li>
* </ul>
* For more information, see
* {@link ContentProvider#query(Uri, String[], String, String[], String)
* ContentProvider.query()}.
*
* @param uri A content URI returned by {@link #getUriForFile}.
* @param projection The list of columns to put into the {@link Cursor}. If null all columns are
* included.
* @param selection Selection criteria to apply. If null then all data that matches the content
* URI is returned.
* @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
* the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
* right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
* <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
* values are bound to <i>selection</i> as {@link java.lang.String} values.
* @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort
* the resulting {@link Cursor}.
* @return A {@link Cursor} containing the results of the query.
*
*/
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
if (projection == null) {
projection = COLUMNS;
}
String[] cols = new String[projection.length];
Object[] values = new Object[projection.length];
int i = 0;
for (String col : projection) {
if (MediaStore.MediaColumns.DISPLAY_NAME.equals(col)) {
cols[i] = MediaStore.MediaColumns.DISPLAY_NAME;
values[i++] = file.getName();
} else if (MediaStore.MediaColumns.SIZE.equals(col)) {
cols[i] = MediaStore.MediaColumns.SIZE;
values[i++] = file.length();
} else if (MediaStore.MediaColumns.DATA.equals(col)) {
cols[i] = MediaStore.MediaColumns.DATA;
values[i++] = file.getPath();
}
}
cols = copyOf(cols, i);
values = copyOf(values, i);
final MatrixCursor cursor = new MatrixCursor(cols, 1);
cursor.addRow(values);
return cursor;
}
/**
* Returns the MIME type of a content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
*
* @param uri A content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @return If the associated file has an extension, the MIME type associated with that
* extension; otherwise <code>application/octet-stream</code>.
*/
@Override
public String getType(Uri uri) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
final int lastDot = file.getName().lastIndexOf('.');
if (lastDot >= 0) {
final String extension = file.getName().substring(lastDot + 1);
final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mime != null) {
return mime;
}
}
return "application/octet-stream";
}
/**
* By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must
* subclass FileProvider if you want to provide different functionality.
*/
@Override
public Uri insert(Uri uri, ContentValues values) {
throw new UnsupportedOperationException("No external inserts");
}
/**
* By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must
* subclass FileProvider if you want to provide different functionality.
*/
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException("No external updates");
}
/**
* Deletes the file associated with the specified content URI, as
* returned by {@link #getUriForFile(Context, String, File) getUriForFile()}. Notice that this
* method does <b>not</b> throw an {@link java.io.IOException}; you must check its return value.
*
* @param uri A content URI for a file, as returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @param selection Ignored. Set to {@code null}.
* @param selectionArgs Ignored. Set to {@code null}.
* @return 1 if the delete succeeds; otherwise, 0.
*/
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
return file.delete() ? 1 : 0;
}
/**
* By default, FileProvider automatically returns the
* {@link ParcelFileDescriptor} for a file associated with a <code>content://</code>
* {@link Uri}. To get the {@link ParcelFileDescriptor}, call
* {@link android.content.ContentResolver#openFileDescriptor(Uri, String)
* ContentResolver.openFileDescriptor}.
*
* To override this method, you must provide your own subclass of FileProvider.
*
* @param uri A content URI associated with a file, as returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @param mode Access mode for the file. May be "r" for read-only access, "rw" for read and
* write access, or "rwt" for read and write access that truncates any existing file.
* @return A new {@link ParcelFileDescriptor} with which you can access the file.
*/
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
final int fileMode = modeToMode(mode);
return ParcelFileDescriptor.open(file, fileMode);
}
/**
* Return {@link PathStrategy} for given authority, either by parsing or
* returning from cache.
*/
private static PathStrategy getPathStrategy(Context context, String authority) {
PathStrategy strat;
synchronized (sCache) {
strat = sCache.get(authority);
if (strat == null) {
try {
strat = parsePathStrategy(context, authority);
} catch (IOException e) {
throw new IllegalArgumentException(
"Failed to parse " + META_DATA_FILE_PROVIDER_PATHS + " meta-data", e);
} catch (XmlPullParserException e) {
throw new IllegalArgumentException(
"Failed to parse " + META_DATA_FILE_PROVIDER_PATHS + " meta-data", e);
}
sCache.put(authority, strat);
}
}
return strat;
}
/**
* Parse and return {@link PathStrategy} for given authority as defined in
* {@link #META_DATA_FILE_PROVIDER_PATHS} {@code <meta-data>}.
*
* @see #getPathStrategy(Context, String)
*/
private static PathStrategy parsePathStrategy(Context context, String authority)
throws IOException, XmlPullParserException {
final SimplePathStrategy strat = new SimplePathStrategy(authority);
final ProviderInfo info = context.getPackageManager()
.resolveContentProvider(authority, PackageManager.GET_META_DATA);
final XmlResourceParser in = info.loadXmlMetaData(
context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);
if (in == null) {
throw new IllegalArgumentException(
"Missing " + META_DATA_FILE_PROVIDER_PATHS + " meta-data");
}
int type;
while ((type = in.next()) != END_DOCUMENT) {
if (type == START_TAG) {
final String tag = in.getName();
final String name = in.getAttributeValue(null, ATTR_NAME);
String path = in.getAttributeValue(null, ATTR_PATH);
File target = null;
if (TAG_ROOT_PATH.equals(tag)) {
target = DEVICE_ROOT;
} else if (TAG_FILES_PATH.equals(tag)) {
target = context.getFilesDir();
} else if (TAG_CACHE_PATH.equals(tag)) {
target = context.getCacheDir();
} else if (TAG_EXTERNAL.equals(tag)) {
target = Environment.getExternalStorageDirectory();
} else if (TAG_EXTERNAL_FILES.equals(tag)) {
File[] externalFilesDirs = ContextCompat.getExternalFilesDirs(context, null);
if (externalFilesDirs.length > 0) {
target = externalFilesDirs[0];
}
} else if (TAG_EXTERNAL_CACHE.equals(tag)) {
File[] externalCacheDirs = ContextCompat.getExternalCacheDirs(context);
if (externalCacheDirs.length > 0) {
target = externalCacheDirs[0];
}
}
if (target != null) {
strat.addRoot(name, buildPath(target, path));
}
}
}
return strat;
}
/**
* Strategy for mapping between {@link File} and {@link Uri}.
* <p>
* Strategies must be symmetric so that mapping a {@link File} to a
* {@link Uri} and then back to a {@link File} points at the original
* target.
* <p>
* Strategies must remain consistent across app launches, and not rely on
* dynamic state. This ensures that any generated {@link Uri} can still be
* resolved if your process is killed and later restarted.
*
* @see SimplePathStrategy
*/
interface PathStrategy {
/**
* Return a {@link Uri} that represents the given {@link File}.
*/
public Uri getUriForFile(File file);
/**
* Return a {@link File} that represents the given {@link Uri}.
*/
public File getFileForUri(Uri uri);
}
/**
* Strategy that provides access to files living under a narrow whitelist of
* filesystem roots. It will throw {@link SecurityException} if callers try
* accessing files outside the configured roots.
* <p>
* For example, if configured with
* {@code addRoot("myfiles", context.getFilesDir())}, then
* {@code context.getFileStreamPath("foo.txt")} would map to
* {@code content://myauthority/myfiles/foo.txt}.
*/
static class SimplePathStrategy implements PathStrategy {
private final String mAuthority;
private final HashMap<String, File> mRoots = new HashMap<String, File>();
public SimplePathStrategy(String authority) {
mAuthority = authority;
}
/**
* Add a mapping from a name to a filesystem root. The provider only offers
* access to files that live under configured roots.
*/
public void addRoot(String name, File root) {
if (TextUtils.isEmpty(name)) {
throw new IllegalArgumentException("Name must not be empty");
}
try {
// Resolve to canonical path to keep path checking fast
root = root.getCanonicalFile();
} catch (IOException e) {
throw new IllegalArgumentException(
"Failed to resolve canonical path for " + root, e);
}
mRoots.put(name, root);
}
@Override
public Uri getUriForFile(File file) {
String path;
try {
path = file.getCanonicalPath();
} catch (IOException e) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
}
// Find the most-specific root path
Map.Entry<String, File> mostSpecific = null;
for (Map.Entry<String, File> root : mRoots.entrySet()) {
final String rootPath = root.getValue().getPath();
if (path.startsWith(rootPath) && (mostSpecific == null
|| rootPath.length() > mostSpecific.getValue().getPath().length())) {
mostSpecific = root;
}
}
if (mostSpecific == null) {
throw new IllegalArgumentException(
"Failed to find configured root that contains " + path);
}
// Start at first char of path under root
final String rootPath = mostSpecific.getValue().getPath();
if (rootPath.endsWith("/")) {
path = path.substring(rootPath.length());
} else {
path = path.substring(rootPath.length() + 1);
}
// Encode the tag and path separately
path = Uri.encode(mostSpecific.getKey()) + '/' + Uri.encode(path, "/");
return new Uri.Builder().scheme("content")
.authority(mAuthority).encodedPath(path).build();
}
@Override
public File getFileForUri(Uri uri) {
String path = uri.getEncodedPath();
final int splitIndex = path.indexOf('/', 1);
final String tag = Uri.decode(path.substring(1, splitIndex));
path = Uri.decode(path.substring(splitIndex + 1));
final File root = mRoots.get(tag);
if (root == null) {
throw new IllegalArgumentException("Unable to find configured root for " + uri);
}
File file = new File(root, path);
try {
file = file.getCanonicalFile();
} catch (IOException e) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
}
if (!file.getPath().startsWith(root.getPath())) {
throw new SecurityException("Resolved path jumped beyond configured root");
}
return file;
}
}
/**
* Copied from ContentResolver.java
*/
private static int modeToMode(String mode) {
int modeBits;
if ("r".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_ONLY;
} else if ("w".equals(mode) || "wt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else if ("wa".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_APPEND;
} else if ("rw".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE;
} else if ("rwt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else {
throw new IllegalArgumentException("Invalid mode: " + mode);
}
return modeBits;
}
private static File buildPath(File base, String... segments) {
File cur = base;
for (String segment : segments) {
if (segment != null) {
cur = new File(cur, segment);
}
}
return cur;
}
private static String[] copyOf(String[] original, int newLength) {
final String[] result = new String[newLength];
System.arraycopy(original, 0, result, 0, newLength);
return result;
}
private static Object[] copyOf(Object[] original, int newLength) {
final Object[] result = new Object[newLength];
System.arraycopy(original, 0, result, 0, newLength);
return result;
}
}
@@ -0,0 +1,90 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.content;
/*
* Created by Hippo on 2018/3/27.
*/
import android.app.Activity;
import android.os.Bundle;
import com.hippo.scene.SceneApplication;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public abstract class RecordingApplication extends SceneApplication {
private List<WeakReference<Activity>> list = new LinkedList<>();
@Override
public void onCreate() {
super.onCreate();
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
list.add(new java.lang.ref.WeakReference<>(activity));
}
@Override
public void onActivityDestroyed(Activity activity) {
Iterator<WeakReference<Activity>> iterator = list.iterator();
while (iterator.hasNext()) {
WeakReference<Activity> reference = iterator.next();
Activity a = reference.get();
// Remove current activity and null
if (a == null || a == activity) {
iterator.remove();
}
}
}
@Override
public void onActivityStarted(Activity activity) {}
@Override
public void onActivityResumed(Activity activity) {}
@Override
public void onActivityPaused(Activity activity) {}
@Override
public void onActivityStopped(Activity activity) {}
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {}
});
}
public void recreate() {
// Copy list
ArrayList<Activity> listCopy = new ArrayList<>(list.size());
for (WeakReference<Activity> reference: list) {
Activity activity = reference.get();
if (activity == null) continue;
listCopy.add(activity);
}
// Finish all activities
for (int i = listCopy.size() - 1; i >= 0; --i) {
listCopy.get(i).recreate();
}
}
}
@@ -0,0 +1,130 @@
/*
* Copyright 2017 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.database;
/*
* Created by Hippo on 2017/9/3.
*/
import android.content.Context;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.SparseArray;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MSQLiteBuilder {
public static final String COLUMN_ID = "_id";
private static final Map<Class, String> JAVA_TYPE_TO_SQLITE_TYPE = new HashMap<>();
static {
JAVA_TYPE_TO_SQLITE_TYPE.put(boolean.class, "INTEGER NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(byte.class, "INTEGER NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(short.class, "INTEGER NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(int.class, "INTEGER NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(long.class, "INTEGER NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(float.class, "REAL NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(double.class, "REAL NOT NULL DEFAULT 0");
JAVA_TYPE_TO_SQLITE_TYPE.put(String.class, "TEXT");
}
private static String javaTypeToSQLiteType(Class clazz) {
String type = JAVA_TYPE_TO_SQLITE_TYPE.get(clazz);
if (type == null) {
throw new IllegalStateException("Unknown type: " + clazz);
}
return type;
}
private int version = 0;
private List<String> statements;
private SparseArray<List<String>> statementsMap = new SparseArray<>();
/**
* Bump database version.
*/
public MSQLiteBuilder version(int version) {
if (version <= this.version) {
throw new IllegalStateException("New version must be bigger than current version. "
+ "current version: " + this.version + ", new version: " + version + ".");
}
this.version = version;
this.statements = new ArrayList<>();
this.statementsMap.put(version, this.statements);
return this;
}
/**
* Creates a table with int {@link #COLUMN_ID} primary key.
*/
public MSQLiteBuilder createTable(String table) {
return createTable(table, COLUMN_ID, int.class);
}
/**
* Creates a table.
*/
public MSQLiteBuilder createTable(String table, String column, Class clazz) {
return statement("CREATE TABLE " + table + " (" + column + " " + javaTypeToSQLiteType(clazz) + " PRIMARY KEY);");
}
/**
* Drops a table.
*/
public MSQLiteBuilder dropTable(String table) {
return statement("DROP TABLE " + table + ";");
}
/**
* Inserts a column to the table.
*/
public MSQLiteBuilder insertColumn(String table, String column, Class clazz) {
return statement("ALTER TABLE " + table + " ADD COLUMN " + column + " " + javaTypeToSQLiteType(clazz) + ";");
}
/**
* Add a statement.
*/
public MSQLiteBuilder statement(String statement) {
if (version == 0 || statements == null) {
throw new IllegalStateException("Call version() first!");
}
statements.add(statement);
return this;
}
/**
* Build a SQLiteOpenHelper from it.
*/
public SQLiteOpenHelper build(Context context, String name, int version) {
return new MSQLiteOpenHelper(context, name, version, this);
}
List<String> getStatements(int oldVersion, int newVersion) {
List<String> result = new ArrayList<>();
for (int i = oldVersion + 1; i <= newVersion; ++i) {
List<String> list = statementsMap.get(i);
if (list != null) {
result.addAll(list);
}
}
return result;
}
}
@@ -0,0 +1,56 @@
/*
* Copyright 2017 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.database;
/*
* Created by Hippo on 2017/9/4.
*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.hippo.util.SqlUtils;
class MSQLiteOpenHelper extends SQLiteOpenHelper {
private final int version;
private final MSQLiteBuilder builder;
public MSQLiteOpenHelper(Context context, String name, int version, MSQLiteBuilder builder) {
super(context, name, null, version);
this.version = version;
this.builder = builder;
}
@Override
public void onCreate(SQLiteDatabase db) {
onUpgrade(db, 0, version);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
for (String command : builder.getStatements(oldVersion, newVersion)) {
db.execSQL(command);
}
}
@Override
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
SqlUtils.dropAllTable(db);
onCreate(db);
}
}
@@ -0,0 +1,167 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.MathUtils;
public class AddDeleteDrawable extends Drawable {
private final Paint mPaint = new Paint();
private final Path mPath = new Path();
private final int mSize;
private float mProgress;
private boolean mAutoUpdateMirror = false;
private boolean mVerticalMirror = false;
/**
* @param context used to get the configuration for the drawable from
*/
public AddDeleteDrawable(Context context, int color) {
Resources resources = context.getResources();
mSize = resources.getDimensionPixelSize(R.dimen.add_size);
float barThickness = Math.round(resources.getDimension(R.dimen.add_thickness));
mPaint.setColor(color);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.MITER);
mPaint.setStrokeCap(Paint.Cap.BUTT);
mPaint.setStrokeWidth(barThickness);
float halfSize = mSize / 2;
mPath.moveTo(0f, -halfSize);
mPath.lineTo(0, halfSize);
mPath.moveTo(-halfSize, 0);
mPath.lineTo(halfSize, 0);
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
float canvasRotate;
if (mVerticalMirror) {
canvasRotate = MathUtils.lerp(270, 135f, mProgress);
} else {
canvasRotate = MathUtils.lerp(0f, 135f, mProgress);
}
canvas.save();
canvas.translate(bounds.centerX(), bounds.centerY());
canvas.rotate(canvasRotate);
canvas.drawPath(mPath, mPaint);
canvas.restore();
}
public void setColor(int color) {
mPaint.setColor(color);
invalidateSelf();
}
@Override
public void setAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter cf) {
mPaint.setColorFilter(cf);
}
@Override
public int getIntrinsicHeight() {
return mSize * 6 / 5;
}
@Override
public int getIntrinsicWidth() {
return mSize * 6 / 5;
}
/**
* If set, canvas is flipped when progress reached to end and going back to start.
*/
protected void setVerticalMirror(boolean verticalMirror) {
mVerticalMirror = verticalMirror;
}
public void setAutoUpdateMirror(boolean autoUpdateMirror) {
mAutoUpdateMirror = autoUpdateMirror;
}
@SuppressWarnings("unused")
public float getProgress() {
return mProgress;
}
@SuppressWarnings("unused")
public void setProgress(float progress) {
if (mAutoUpdateMirror) {
if (progress == 1f) {
setVerticalMirror(true);
} else if (progress == 0f) {
setVerticalMirror(false);
}
}
mProgress = progress;
invalidateSelf();
}
public void setAdd(long duration) {
setShape(false, duration);
}
public void setDelete(long duration) {
setShape(true, duration);
}
public void setShape(boolean delete, long duration) {
if (!((!delete && mProgress == 0f) || (delete && mProgress == 1f))) {
float endProgress = delete ? 1f : 0f;
if (duration <= 0) {
setProgress(endProgress);
} else {
ObjectAnimator oa = ObjectAnimator.ofFloat(this, "progress", endProgress);
oa.setDuration(duration);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
oa.setAutoCancel(true);
}
oa.start();
}
}
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
@@ -0,0 +1,179 @@
/*
* Copyright (C) 2014 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import com.hippo.yorozuya.MathUtils;
public class BatteryDrawable extends Drawable {
@SuppressWarnings("unused")
private static final String TAG = BatteryDrawable.class.getSimpleName();
public static final int WARN_LIMIT = 15;
private int mColor = Color.WHITE;
private int mWarningColor = Color.RED;
private int mElect = -1;
private final Paint mPaint;
private final Rect mTopRect;
private final Rect mBottomRect;
private final Rect mRightRect;
private final Rect mHeadRect;
private final Rect mElectRect;
private int mStart;
private int mStop;
public BatteryDrawable() {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
mPaint.setStyle(Paint.Style.FILL);
mTopRect = new Rect();
mBottomRect = new Rect();
mRightRect = new Rect();
mHeadRect = new Rect();
mElectRect = new Rect();
updatePaint();
}
@Override
@SuppressWarnings("SuspiciousNameCombination")
protected void onBoundsChange(Rect bounds) {
int width = bounds.width();
int height = bounds.height();
int strokeWidth = (int) (Math.sqrt(width * width + height * height) * 0.06f);
int turn1 = width * 6 / 7;
int turn2 = height / 3;
int secBottom = height - strokeWidth;
mStart = strokeWidth;
mStop = turn1 - strokeWidth;
mTopRect.set(0, 0, turn1, strokeWidth);
mBottomRect.set(0, secBottom, turn1, height);
mRightRect.set(turn1 - strokeWidth, strokeWidth, turn1, secBottom);
mHeadRect.set(turn1, turn2, width, height - turn2);
mElectRect.set(0, strokeWidth, mStop, secBottom);
}
/**
* How to draw:<br>
* |------------------------------|<br>
* |\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|<br>
* |------------------------------|---|<br>
* |/////////////////| |//|\\\|<br>
* |/////////////////| |//|\\\|<br>
* |------------------------------|---|<br>
* |\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|<br>
* |------------------------------|
*/
@Override
public void draw(Canvas canvas) {
if (mElect == -1) {
return;
}
mElectRect.right = MathUtils.lerp(mStart, mStop, mElect / 100.0f);
canvas.drawRect(mTopRect, mPaint);
canvas.drawRect(mBottomRect, mPaint);
canvas.drawRect(mRightRect, mPaint);
canvas.drawRect(mHeadRect, mPaint);
canvas.drawRect(mElectRect, mPaint);
}
private boolean isWarn() {
return mElect <= WARN_LIMIT;
}
public void setColor(int color) {
if (mColor == color) {
return;
}
mColor = color;
if (!isWarn()) {
mPaint.setColor(mColor);
invalidateSelf();
}
}
public void setWarningColor(int color) {
if (mWarningColor == color) {
return;
}
mWarningColor = color;
if (isWarn()) {
mPaint.setColor(mWarningColor);
invalidateSelf();
}
}
public void setElect(int elect) {
if (mElect == elect) {
return;
}
mElect = elect;
updatePaint();
}
public void setElect(int elect, boolean warn) {
if (mElect == elect) {
return;
}
mElect = elect;
updatePaint(warn);
}
private void updatePaint() {
updatePaint(isWarn());
}
private void updatePaint(boolean warn) {
if (warn) {
mPaint.setColor(mWarningColor);
} else {
mPaint.setColor(mColor);
}
invalidateSelf();
}
@Override
public void setAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter cf) {
mPaint.setColorFilter(cf);
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
}
@@ -0,0 +1,66 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Bitmap;
import android.util.Log;
import androidx.annotation.Nullable;
import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
class BitmapPool {
private static final String TAG = BitmapPool.class.getSimpleName();
private final Set<WeakReference<Bitmap>> mReusableBitmapSet = new LinkedHashSet<>();
public synchronized void put(@Nullable Bitmap bitmap) {
if (bitmap != null) {
mReusableBitmapSet.add(new WeakReference<>(bitmap));
}
}
@Nullable
public synchronized Bitmap get(int width, int height) {
final Iterator<WeakReference<Bitmap>> iterator = mReusableBitmapSet.iterator();
Bitmap item;
while (iterator.hasNext()) {
item = iterator.next().get();
if (item != null) {
if (item.getWidth() == width && item.getHeight() == height) {
// Remove from reusable set so it can't be used again.
iterator.remove();
return item;
}
} else {
// Remove from the set if the reference has been cleared or
// it can't be used.
iterator.remove();
}
}
// Can not find reusable bitmap
try {
return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
} catch (OutOfMemoryError e) {
Log.e(TAG, "Out of memory");
return null;
}
}
}
@@ -0,0 +1,180 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import androidx.core.graphics.drawable.DrawableCompat;
public class DrawableWrapper extends Drawable implements Drawable.Callback {
private Drawable mDrawable;
public DrawableWrapper(Drawable drawable) {
this.setWrappedDrawable(drawable);
}
public void draw(@NonNull Canvas canvas) {
this.mDrawable.draw(canvas);
}
protected void onBoundsChange(Rect bounds) {
this.mDrawable.setBounds(bounds);
}
public void setChangingConfigurations(int configs) {
this.mDrawable.setChangingConfigurations(configs);
}
public int getChangingConfigurations() {
return this.mDrawable.getChangingConfigurations();
}
public void setDither(boolean dither) {
this.mDrawable.setDither(dither);
}
public void setFilterBitmap(boolean filter) {
this.mDrawable.setFilterBitmap(filter);
}
public void setAlpha(int alpha) {
this.mDrawable.setAlpha(alpha);
}
public void setColorFilter(ColorFilter cf) {
this.mDrawable.setColorFilter(cf);
}
public boolean isStateful() {
return this.mDrawable.isStateful();
}
public boolean setState(@NonNull int[] stateSet) {
return this.mDrawable.setState(stateSet);
}
@NonNull
public int[] getState() {
return this.mDrawable.getState();
}
public void jumpToCurrentState() {
this.mDrawable.jumpToCurrentState();
}
@NonNull
public Drawable getCurrent() {
return this.mDrawable.getCurrent();
}
public boolean setVisible(boolean visible, boolean restart) {
return super.setVisible(visible, restart) || this.mDrawable.setVisible(visible, restart);
}
public int getOpacity() {
return this.mDrawable.getOpacity();
}
public Region getTransparentRegion() {
return this.mDrawable.getTransparentRegion();
}
public int getIntrinsicWidth() {
return this.mDrawable.getIntrinsicWidth();
}
public int getIntrinsicHeight() {
return this.mDrawable.getIntrinsicHeight();
}
public int getMinimumWidth() {
return this.mDrawable.getMinimumWidth();
}
public int getMinimumHeight() {
return this.mDrawable.getMinimumHeight();
}
public boolean getPadding(@NonNull Rect padding) {
return this.mDrawable.getPadding(padding);
}
public void invalidateDrawable(@NonNull Drawable who) {
this.invalidateSelf();
}
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
this.scheduleSelf(what, when);
}
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
this.unscheduleSelf(what);
}
protected boolean onLevelChange(int level) {
return this.mDrawable.setLevel(level);
}
public void setAutoMirrored(boolean mirrored) {
DrawableCompat.setAutoMirrored(this.mDrawable, mirrored);
}
public boolean isAutoMirrored() {
return DrawableCompat.isAutoMirrored(this.mDrawable);
}
public void setTint(int tint) {
DrawableCompat.setTint(this.mDrawable, tint);
}
public void setTintList(ColorStateList tint) {
DrawableCompat.setTintList(this.mDrawable, tint);
}
public void setTintMode(@NonNull PorterDuff.Mode tintMode) {
DrawableCompat.setTintMode(this.mDrawable, tintMode);
}
public void setHotspot(float x, float y) {
DrawableCompat.setHotspot(this.mDrawable, x, y);
}
public void setHotspotBounds(int left, int top, int right, int bottom) {
DrawableCompat.setHotspotBounds(this.mDrawable, left, top, right, bottom);
}
public Drawable getWrappedDrawable() {
return this.mDrawable;
}
public void setWrappedDrawable(Drawable drawable) {
if (this.mDrawable != null) {
this.mDrawable.setCallback(null);
}
this.mDrawable = drawable;
if (drawable != null) {
drawable.setCallback(this);
}
}
}
@@ -0,0 +1,216 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import androidx.annotation.ColorInt;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.MathUtils;
/**
* A drawable that can draw a "Drawer hamburger" menu or an Arrow and animate between them.
*/
public class DrawerArrowDrawable extends Drawable {
private final Paint mPaint = new Paint();
// The angle in degrees that the arrow head is inclined at.
private static final float ARROW_HEAD_ANGLE = (float) Math.toRadians(45);
private final float mBarThickness;
// The length of top and bottom bars when they merge into an arrow
private final float mTopBottomArrowSize;
// The length of middle bar
private final float mBarSize;
// The length of the middle bar when arrow is shaped
private final float mMiddleArrowSize;
// The space between bars when they are parallel
private final float mBarGap;
// Whether bars should spin or not during progress
private final boolean mSpin;
// Use Path instead of canvas operations so that if color has transparency, overlapping sections
// wont look different
private final Path mPath = new Path();
// The reported intrinsic size of the drawable.
private final int mSize;
// Whether we should mirror animation when animation is reversed.
private boolean mVerticalMirror = false;
// The interpolated version of the original progress
private float mProgress;
// the amount that overlaps w/ bar size when rotation is max
private final float mMaxCutForBarSize;
/**
* @param context used to get the configuration for the drawable from
*/
public DrawerArrowDrawable(Context context, int color) {
Resources resources = context.getResources();
mPaint.setAntiAlias(true);
mPaint.setColor(color);
mSize = resources.getDimensionPixelSize(R.dimen.dad_drawable_size);
// round this because having this floating may cause bad measurements
mBarSize = Math.round(resources.getDimension(R.dimen.dad_bar_size));
// round this because having this floating may cause bad measurements
mTopBottomArrowSize = Math.round(resources.getDimension(R.dimen.dad_top_bottom_bar_arrow_size));
mBarThickness = resources.getDimension(R.dimen.dad_thickness);
// round this because having this floating may cause bad measurements
mBarGap = Math.round(resources.getDimension(R.dimen.dad_gap_between_bars));
mSpin = resources.getBoolean(R.bool.dad_spin_bars);
mMiddleArrowSize = resources.getDimension(R.dimen.dad_middle_bar_arrow_size);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.MITER);
mPaint.setStrokeCap(Paint.Cap.BUTT);
mPaint.setStrokeWidth(mBarThickness);
mMaxCutForBarSize = (float) (mBarThickness / 2 * Math.cos(ARROW_HEAD_ANGLE));
}
/**
* If set, canvas is flipped when progress reached to end and going back to start.
*/
protected void setVerticalMirror(boolean verticalMirror) {
mVerticalMirror = verticalMirror;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
// Interpolated widths of arrow bars
final float arrowSize = MathUtils.lerp(mBarSize, mTopBottomArrowSize, mProgress);
final float middleBarSize = MathUtils.lerp(mBarSize, mMiddleArrowSize, mProgress);
// Interpolated size of middle bar
final float middleBarCut = Math.round(MathUtils.lerp(0, mMaxCutForBarSize, mProgress));
// The rotation of the top and bottom bars (that make the arrow head)
final float rotation = MathUtils.lerp(0, ARROW_HEAD_ANGLE, mProgress);
// The whole canvas rotates as the transition happens
final float canvasRotate = MathUtils.lerp(-180, 0, mProgress);
final float arrowWidth = Math.round(arrowSize * Math.cos(rotation));
final float arrowHeight = Math.round(arrowSize * Math.sin(rotation));
mPath.rewind();
final float topBottomBarOffset = MathUtils.lerp(mBarGap + mBarThickness, -mMaxCutForBarSize,
mProgress);
final float arrowEdge = -middleBarSize / 2;
// draw middle bar
mPath.moveTo(arrowEdge + middleBarCut, 0);
mPath.rLineTo(middleBarSize - middleBarCut * 2, 0);
// bottom bar
mPath.moveTo(arrowEdge, topBottomBarOffset);
mPath.rLineTo(arrowWidth, arrowHeight);
// top bar
mPath.moveTo(arrowEdge, -topBottomBarOffset);
mPath.rLineTo(arrowWidth, -arrowHeight);
mPath.close();
canvas.save();
// Rotate the whole canvas if spinning, if not, rotate it 180 to get
// the arrow pointing the other way for RTL.
canvas.translate(bounds.centerX(), bounds.centerY());
if (mSpin) {
canvas.rotate(canvasRotate * (mVerticalMirror ? -1 : 1));
}
canvas.drawPath(mPath, mPaint);
canvas.restore();
}
public void setColor(@ColorInt int color) {
mPaint.setColor(color);
invalidateSelf();
}
@Override
public void setAlpha(int i) {
mPaint.setAlpha(i);
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
mPaint.setColorFilter(colorFilter);
}
@Override
public int getIntrinsicHeight() {
return mSize;
}
@Override
public int getIntrinsicWidth() {
return mSize;
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@SuppressWarnings("unused")
public float getProgress() {
return mProgress;
}
@SuppressWarnings("unused")
public void setProgress(float progress) {
if (progress == 1f) {
setVerticalMirror(true);
} else if (progress == 0f) {
setVerticalMirror(false);
}
mProgress = progress;
invalidateSelf();
}
public void setMenu(long duration) {
setShape(false, duration);
}
public void setArrow(long duration) {
setShape(true, duration);
}
public void setShape(boolean arrow, long duration) {
if (!((!arrow && mProgress == 0f) || (arrow && mProgress == 1f))) {
float endProgress = arrow ? 1f : 0f;
if (duration <= 0) {
setProgress(endProgress);
} else {
ObjectAnimator oa = ObjectAnimator.ofFloat(this, "progress", endProgress);
oa.setDuration(duration);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
oa.setAutoCancel(true);
}
oa.start();
}
}
}
}
@@ -0,0 +1,104 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import com.hippo.yorozuya.MathUtils;
/**
* Show a part of the original drawable
*/
public class PreciselyClipDrawable extends DrawableWrapper {
private final boolean mClip;
private RectF mScale;
private Rect mTemp;
public PreciselyClipDrawable(Drawable drawable, int offsetX, int offsetY, int width, int height) {
super(drawable);
float originWidth = drawable.getIntrinsicWidth();
float originHeight = drawable.getIntrinsicHeight();
if (originWidth <= 0 || originHeight <= 0) {
// Can not clip
mClip = false;
} else {
mClip = true;
mScale = new RectF();
mScale.set(MathUtils.clamp(offsetX / originWidth, 0.0f, 1.0f),
MathUtils.clamp(offsetY / originHeight, 0.0f, 1.0f),
MathUtils.clamp((offsetX + width) / originWidth, 0.0f, 1.0f),
MathUtils.clamp((offsetY + height) / originHeight, 0.0f, 1.0f));
mTemp = new Rect();
}
}
@Override
protected void onBoundsChange(Rect bounds) {
if (mClip) {
if (!mScale.isEmpty()) {
mTemp.left = (int) ((mScale.left * bounds.right - mScale.right * bounds.left) /
(mScale.left * (1 - mScale.right) - mScale.right * (1 - mScale.left)));
mTemp.right = (int) (((1 - mScale.right) * bounds.left - (1 - mScale.left) * bounds.right) /
(mScale.left * (1 - mScale.right) - mScale.right * (1 - mScale.left)));
mTemp.top = (int) ((mScale.top * bounds.bottom - mScale.bottom * bounds.top) /
(mScale.top * (1 - mScale.bottom) - mScale.bottom * (1 - mScale.top)));
mTemp.bottom = (int) (((1 - mScale.bottom) * bounds.top - (1 - mScale.top) * bounds.bottom) /
(mScale.top * (1 - mScale.bottom) - mScale.bottom * (1 - mScale.top)));
super.onBoundsChange(mTemp);
}
} else {
super.onBoundsChange(bounds);
}
}
@Override
public int getIntrinsicWidth() {
if (mClip) {
return (int) (super.getIntrinsicWidth() * mScale.width());
} else {
return super.getIntrinsicWidth();
}
}
@Override
public int getIntrinsicHeight() {
if (mClip) {
return (int) (super.getIntrinsicHeight() * mScale.height());
} else {
return super.getIntrinsicHeight();
}
}
@Override
public void draw(Canvas canvas) {
if (mClip) {
if (!mScale.isEmpty()) {
int saveCount = canvas.save();
canvas.clipRect(getBounds());
super.draw(canvas);
canvas.restoreToCount(saveCount);
}
} else {
super.draw(canvas);
}
}
}
@@ -0,0 +1,68 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
public class RoundDrawable extends Drawable {
private final Paint mPaint;
private final RectF mRectF;
public RoundDrawable(int color) {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
mPaint.setColor(color);
mRectF = new RectF();
}
public void setColor(int color) {
mPaint.setColor(color);
invalidateSelf();
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
mRectF.set(bounds);
}
@Override
public void draw(Canvas canvas) {
canvas.drawOval(mRectF, mPaint);
}
@Override
public void setAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
mPaint.setColorFilter(colorFilter);
}
@Override
public int getOpacity() {
return PixelFormat.OPAQUE;
}
}
@@ -0,0 +1,84 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
public class RoundSideRectDrawable extends Drawable {
private final Paint mPaint;
private final Path mPath;
private final RectF mTempRectF;
public RoundSideRectDrawable(int color) {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
mPaint.setColor(color);
mPath = new Path();
mTempRectF = new RectF();
}
@Override
protected void onBoundsChange(Rect bounds) {
int width = bounds.width();
int height = bounds.height();
RectF rectF = mTempRectF;
Path path = mPath;
path.reset();
if (width > height) {
int radius = height / 2;
path.moveTo(bounds.right - radius, bounds.top);
rectF.set(bounds.right - height, bounds.top, bounds.right, bounds.bottom);
path.arcTo(rectF, -90.0f, 180.0f, false);
path.lineTo(bounds.left + radius, bounds.bottom);
rectF.set(bounds.left, bounds.top, bounds.left + height, bounds.bottom);
path.arcTo(rectF, 90.0f, 180.0f, false);
path.lineTo(bounds.right - radius, bounds.top);
} else if (width == height) {
path.addCircle(bounds.centerX(), bounds.centerY(), width / 2, Path.Direction.CW);
} else {
// TODO
}
}
@Override
public void draw(Canvas canvas) {
canvas.drawPath(mPath, mPaint);
}
@Override
public void setAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
mPaint.setColorFilter(colorFilter);
}
@Override
public int getOpacity() {
return PixelFormat.OPAQUE;
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
public class TriangleDrawable extends Drawable {
private final Paint mPaint;
private final Path mPath;
public TriangleDrawable(int color) {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
mPaint.setColor(color);
mPath = new Path();
}
public void setColor(int color) {
mPaint.setColor(color);
invalidateSelf();
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
mPath.reset();
mPath.moveTo(bounds.left, bounds.top);
mPath.lineTo(bounds.right, bounds.top);
mPath.lineTo(bounds.right, bounds.bottom);
mPath.close();
}
@Override
public void draw(Canvas canvas) {
canvas.drawPath(mPath, mPaint);
}
@Override
public void setAlpha(int alpha) {
mPaint.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
mPaint.setColorFilter(colorFilter);
}
@Override
public int getOpacity() {
return PixelFormat.OPAQUE;
}
}
@@ -0,0 +1,148 @@
/*
* Copyright 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import androidx.annotation.NonNull;
import com.hippo.conaco.Conaco;
import com.hippo.conaco.ConacoTask;
import com.hippo.conaco.Unikery;
import com.hippo.image.ImageBitmap;
import com.hippo.image.ImageDrawable;
import com.hippo.image.RecycledException;
import com.hippo.widget.ObservedTextView;
public class UnikeryDrawable extends WrapDrawable implements Unikery<ImageBitmap>,
ObservedTextView.OnWindowAttachListener {
private static final String TAG = UnikeryDrawable.class.getSimpleName();
private int mTaskId = Unikery.INVALID_ID;
private final ObservedTextView mTextView;
private final Conaco<ImageBitmap> mConaco;
private String mUrl;
public UnikeryDrawable(ObservedTextView textView, Conaco<ImageBitmap> conaco) {
mTextView = textView;
mTextView.setOnWindowAttachListener(this);
mConaco = conaco;
}
@Override
public void onAttachedToWindow() {
load(mUrl);
}
@Override
public void onDetachedFromWindow() {
mConaco.cancel(this);
clearDrawable();
}
public void load(String url) {
if (url != null) {
mUrl = url;
mConaco.load(new ConacoTask.Builder<ImageBitmap>().setUnikery(this).setUrl(url).setKey(url));
}
}
private void clearDrawable() {
Drawable drawable = getDrawable();
if (drawable instanceof ImageDrawable) {
((ImageDrawable) drawable).recycle();
}
setDrawable(null);
}
@Override
public void setDrawable(Drawable drawable) {
// Remove old callback
Drawable oldDrawable = getDrawable();
if (oldDrawable != null) {
oldDrawable.setCallback(null);
}
super.setDrawable(drawable);
if (drawable != null) {
drawable.setCallback(mTextView);
}
updateBounds();
if (drawable != null) {
invalidateSelf();
}
}
@Override
public void setTaskId(int id) {
mTaskId = id;
}
@Override
public int getTaskId() {
return mTaskId;
}
@Override
public void invalidateSelf() {
CharSequence cs = mTextView.getText();
mTextView.setText(cs);
}
@Override
public void onMiss(int source) {}
@Override
public void onRequest() {}
@Override
public void onProgress(long singleReceivedSize, long receivedSize, long totalSize) {}
@Override
public void onWait() {}
@Override
public boolean onGetValue(@NonNull ImageBitmap value, int source) {
ImageDrawable drawable;
try {
drawable = new ImageDrawable(value);
} catch (RecycledException e) {
Log.d(TAG, "The ImageBitmap is recycled", e);
return false;
}
clearDrawable();
setDrawable(drawable);
drawable.start();
return true;
}
@Override
public void onFailure() {
// Empty
}
@Override
public void onCancel() {
// Empty
}
}
@@ -0,0 +1,143 @@
/*
* Copyright 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.drawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
public class WrapDrawable extends Drawable {
private Drawable mDrawable;
public void setDrawable(Drawable drawable) {
mDrawable = drawable;
}
public Drawable getDrawable() {
return mDrawable;
}
public void updateBounds() {
setBounds(0, 0, getIntrinsicWidth(), getIntrinsicHeight());
}
@Override
public void draw(Canvas canvas) {
if (mDrawable != null) {
mDrawable.draw(canvas);
}
}
@Override
public void setBounds(int left, int top, int right, int bottom) {
super.setBounds(left, top, right, bottom);
if (mDrawable != null) {
mDrawable.setBounds(left, top, right, bottom);
}
}
@Override
public void setBounds(Rect bounds) {
super.setBounds(bounds);
if (mDrawable != null) {
mDrawable.setBounds(bounds);
}
}
@Override
public void setChangingConfigurations(int configs) {
super.setChangingConfigurations(configs);
if (mDrawable != null) {
mDrawable.setChangingConfigurations(configs);
}
}
@Override
public int getChangingConfigurations() {
if (mDrawable != null) {
return mDrawable.getChangingConfigurations();
} else {
return super.getChangingConfigurations();
}
}
@Override
public void setDither(boolean dither) {
super.setDither(dither);
if (mDrawable != null) {
mDrawable.setDither(dither);
}
}
@Override
public void setFilterBitmap(boolean filter) {
super.setFilterBitmap(filter);
if (mDrawable != null) {
mDrawable.setFilterBitmap(filter);
}
}
@Override
public void setAlpha(int alpha) {
if (mDrawable != null) {
mDrawable.setAlpha(alpha);
}
}
@Override
public void setColorFilter(ColorFilter cf) {
if (mDrawable != null) {
mDrawable.setColorFilter(cf);
}
}
@Override
public int getOpacity() {
if (mDrawable != null) {
return mDrawable.getOpacity();
} else {
return PixelFormat.UNKNOWN;
}
}
@Override
public int getIntrinsicWidth() {
if (mDrawable != null) {
return mDrawable.getIntrinsicWidth();
} else {
return super.getIntrinsicWidth();
}
}
@Override
public int getIntrinsicHeight() {
if (mDrawable != null) {
return mDrawable.getIntrinsicHeight();
} else {
return super.getIntrinsicHeight();
}
}
}
@@ -0,0 +1,63 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.hippo.scene.SceneFragment;
import java.util.Locale;
public final class Analytics {
private static final String DEVICE_LANGUAGE = "device_language";
private static FirebaseAnalytics analytics;
private Analytics() {}
public static void start(Context context) {
analytics = FirebaseAnalytics.getInstance(context);
analytics.setUserId(Settings.getUserID());
Locale locale = Locale.getDefault();
String language = locale.getLanguage();
if (TextUtils.isEmpty(language)) {
language = "none";
}
String country = locale.getCountry();
if (!TextUtils.isEmpty(country)) {
language = language + "-" + country;
}
language = language.toLowerCase();
analytics.setUserProperty(DEVICE_LANGUAGE, language);
}
public static boolean isEnabled() {
return analytics != null && Settings.getEnableAnalytics();
}
public static void onSceneView(SceneFragment scene) {
if (isEnabled()) {
Bundle bundle = new Bundle();
bundle.putString("scene_simple_class", scene.getClass().getSimpleName());
bundle.putString("scene_class", scene.getClass().getName());
analytics.logEvent("scene_view", bundle);
}
}
}
@@ -0,0 +1,178 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.content.Context;
import android.os.Environment;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.client.exception.ParseException;
import com.hippo.util.ReadableTime;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IOUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class AppConfig {
private static final String APP_DIRNAME = "EhViewer";
private static final String DOWNLOAD = "download";
private static final String TEMP = "temp";
private static final String IMAGE = "image";
private static final String PARSE_ERROR = "parse_error";
private static final String LOGCAT = "logcat";
private static final String DATA = "data";
private static final String CRASH = "crash";
private static Context sContext;
public static void initialize(Context context) {
sContext = context.getApplicationContext();
}
@Nullable
public static File getExternalAppDir() {
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
File dir = new File(Environment.getExternalStorageDirectory(), APP_DIRNAME);
return FileUtils.ensureDirectory(dir) ? dir : null;
}
return null;
}
/**
* mkdirs and get
*/
@Nullable
public static File getDirInExternalAppDir(String filename) {
File appFolder = getExternalAppDir();
if (appFolder != null) {
File dir = new File(appFolder, filename);
return FileUtils.ensureDirectory(dir) ? dir : null;
}
return null;
}
@Nullable
public static File getFileInExternalAppDir(String filename) {
File appFolder = getExternalAppDir();
if (appFolder != null) {
File file = new File(appFolder, filename);
return FileUtils.ensureFile(file) ? file : null;
}
return null;
}
@Nullable
public static File getDefaultDownloadDir() {
return getDirInExternalAppDir(DOWNLOAD);
}
@Nullable
public static File getExternalTempDir() {
return getDirInExternalAppDir(TEMP);
}
@Nullable
public static File getExternalImageDir() {
return getDirInExternalAppDir(IMAGE);
}
@Nullable
public static File getExternalParseErrorDir() {
return getDirInExternalAppDir(PARSE_ERROR);
}
@Nullable
public static File getExternalLogcatDir() {
return getDirInExternalAppDir(LOGCAT);
}
@Nullable
public static File getExternalDataDir() {
return getDirInExternalAppDir(DATA);
}
@Nullable
public static File getExternalCrashDir() {
return getDirInExternalAppDir(CRASH);
}
@Nullable
public static File createExternalTempFile() {
return FileUtils.createTempFile(getExternalTempDir(), null);
}
@Nullable
public static File getTempDir() {
File dir = sContext.getCacheDir();
File file;
if (null != dir && FileUtils.ensureDirectory(file = new File(dir, TEMP))) {
return file;
} else {
return null;
}
}
@Nullable
public static File createTempFile() {
return FileUtils.createTempFile(getTempDir(), null);
}
public static void saveParseErrorBody(ParseException e) {
File dir = getExternalParseErrorDir();
if (null == dir) {
return;
}
File file = new File(dir, ReadableTime.getFilenamableTime(System.currentTimeMillis()) + ".txt");
OutputStream os = null;
try {
os = new FileOutputStream(file);
String message = e.getMessage();
String body = e.getBody();
if (null != message) {
os.write(message.getBytes("utf-8"));
os.write('\n');
}
if (null != body) {
os.write(body.getBytes("utf-8"));
}
os.flush();
} catch (IOException e1) {
// Ignore
} finally {
IOUtils.closeQuietly(os);
}
}
@Nullable
public static File getFilesDir(String name) {
File dir = sContext.getFilesDir();
if (dir == null) {
return null;
}
dir = new File(dir, name);
if (dir.isDirectory() || dir.mkdirs()) {
return dir;
} else {
return null;
}
}
}
@@ -0,0 +1,156 @@
/*
* Copyright 2019 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Debug;
import androidx.annotation.NonNull;
import com.hippo.scene.StageActivity;
import com.hippo.util.PackageUtils;
import com.hippo.util.ReadableTime;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IOUtils;
import com.hippo.yorozuya.OSUtils;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public final class Crash {
private Crash() {}
@NonNull
private static String avoidNull(String str) {
return null != str ? str : "null";
}
private static void collectInfo(Context context, FileWriter fw) throws IOException {
try {
PackageManager pm = context.getPackageManager();
PackageInfo pi = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES);
if (pi != null) {
String versionName = pi.versionName == null ? "null" : pi.versionName;
String versionCode = String.valueOf(pi.versionCode);
fw.write("======== PackageInfo ========\r\n");
fw.write("PackageName=");fw.write(pi.packageName);fw.write("\r\n");
fw.write("VersionName=");fw.write(versionName);fw.write("\r\n");
fw.write("VersionCode=");fw.write(versionCode);fw.write("\r\n");
String signature = PackageUtils.getSignature(context, pi.packageName);
fw.write("Signature=");fw.write(null != signature ? signature : "null");fw.write("\r\n");
fw.write("\r\n");
}
} catch (PackageManager.NameNotFoundException e) {
fw.write("======== PackageInfo ========\r\n");
fw.write("Can't get package information\r\n");
fw.write("\r\n");
}
// Runtime
String topActivityClazzName = "null";
String topSceneClazzName = "null";
try {
Activity topActivity = ((EhApplication) context.getApplicationContext()).getTopActivity();
if (null != topActivity) {
topActivityClazzName = topActivity.getClass().getName();
if (topActivity instanceof StageActivity) {
Class<?> clazz = ((StageActivity) topActivity).getTopSceneClass();
if (clazz != null) {
topSceneClazzName = clazz.getName();
}
}
}
} catch (Throwable e) {
// Ignore
}
fw.write("======== Runtime ========\r\n");
fw.write("TopActivity=");fw.write(avoidNull(topActivityClazzName));fw.write("\r\n");
fw.write("TopScene=");fw.write(avoidNull(topSceneClazzName));fw.write("\r\n");
fw.write("\r\n");
// Device info
fw.write("======== DeviceInfo ========\r\n");
fw.write("BOARD=");fw.write(Build.BOARD);fw.write("\r\n");
fw.write("BOOTLOADER=");fw.write(Build.BOOTLOADER);fw.write("\r\n");
fw.write("CPU_ABI=");fw.write(Build.CPU_ABI);fw.write("\r\n");
fw.write("CPU_ABI2=");fw.write(Build.CPU_ABI2);fw.write("\r\n");
fw.write("DEVICE=");fw.write(Build.DEVICE);fw.write("\r\n");
fw.write("DISPLAY=");fw.write(Build.DISPLAY);fw.write("\r\n");
fw.write("FINGERPRINT=");fw.write(Build.FINGERPRINT);fw.write("\r\n");
fw.write("HARDWARE=");fw.write(Build.HARDWARE);fw.write("\r\n");
fw.write("HOST=");fw.write(Build.HOST);fw.write("\r\n");
fw.write("ID=");fw.write(Build.ID);fw.write("\r\n");
fw.write("MANUFACTURER=");fw.write(Build.MANUFACTURER);fw.write("\r\n");
fw.write("MODEL=");fw.write(Build.MODEL);fw.write("\r\n");
fw.write("PRODUCT=");fw.write(Build.PRODUCT);fw.write("\r\n");
fw.write("RADIO=");fw.write(Build.getRadioVersion());fw.write("\r\n");
fw.write("SERIAL=");fw.write(Build.SERIAL);fw.write("\r\n");
fw.write("TAGS=");fw.write(Build.TAGS);fw.write("\r\n");
fw.write("TYPE=");fw.write(Build.TYPE);fw.write("\r\n");
fw.write("USER=");fw.write(Build.USER);fw.write("\r\n");
fw.write("CODENAME=");fw.write(Build.VERSION.CODENAME);fw.write("\r\n");
fw.write("INCREMENTAL=");fw.write(Build.VERSION.INCREMENTAL);fw.write("\r\n");
fw.write("RELEASE=");fw.write(Build.VERSION.RELEASE);fw.write("\r\n");
fw.write("SDK=");fw.write(Integer.toString(Build.VERSION.SDK_INT));fw.write("\r\n");
fw.write("MEMORY=");fw.write(
FileUtils.humanReadableByteCount(OSUtils.getAppAllocatedMemory(), false));fw.write("\r\n");
fw.write("MEMORY_NATIVE=");fw.write(FileUtils.humanReadableByteCount(Debug.getNativeHeapAllocatedSize(), false));fw.write("\r\n");
fw.write("MEMORY_MAX=");fw.write(FileUtils.humanReadableByteCount(OSUtils.getAppMaxMemory(), false));fw.write("\r\n");
fw.write("MEMORY_TOTAL=");fw.write(FileUtils.humanReadableByteCount(OSUtils.getTotalMemory(), false));fw.write("\r\n");
fw.write("\r\n");
}
private static void getThrowableInfo(Throwable t, FileWriter fw) {
PrintWriter printWriter = new PrintWriter(fw);
t.printStackTrace(printWriter);
Throwable cause = t.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
}
public static void saveCrashLog(Context context, Throwable t) {
File dir = AppConfig.getExternalCrashDir();
if (dir == null) {
return;
}
String nowString = ReadableTime.getFilenamableTime(System.currentTimeMillis());
String fileName = "crash-" + nowString + ".log";
File file = new File(dir, fileName);
FileWriter fw = null;
try {
fw = new FileWriter(file);
fw.write("TIME=");fw.write(nowString);fw.write("\r\n");
fw.write("\r\n");
collectInfo(context, fw);
fw.write("======== CrashInfo ========\r\n");
getThrowableInfo(t, fw);
fw.write("\r\n");
fw.flush();
} catch (Exception e) {
file.delete();
} finally {
IOUtils.closeQuietly(fw);
}
}
}
@@ -0,0 +1,461 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Debug;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.collection.LruCache;
import com.getkeepsafe.relinker.ReLinker;
import com.hippo.a7zip.A7Zip;
import com.hippo.a7zip.A7ZipExtractLite;
import com.hippo.beerbelly.SimpleDiskCache;
import com.hippo.conaco.Conaco;
import com.hippo.content.RecordingApplication;
import com.hippo.ehviewer.client.EhClient;
import com.hippo.ehviewer.client.EhCookieStore;
import com.hippo.ehviewer.client.EhDns;
import com.hippo.ehviewer.client.EhEngine;
import com.hippo.ehviewer.client.data.GalleryDetail;
import com.hippo.ehviewer.download.DownloadManager;
import com.hippo.ehviewer.spider.SpiderDen;
import com.hippo.ehviewer.ui.CommonOperations;
import com.hippo.image.Image;
import com.hippo.image.ImageBitmap;
import com.hippo.network.StatusCodeException;
import com.hippo.text.Html;
import com.hippo.unifile.UniFile;
import com.hippo.util.BitmapUtils;
import com.hippo.util.ExceptionUtils;
import com.hippo.util.IoThreadPoolExecutor;
import com.hippo.util.ReadableTime;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IntIdGenerator;
import com.hippo.yorozuya.OSUtils;
import com.hippo.yorozuya.SimpleHandler;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
public class EhApplication extends RecordingApplication {
private static final String TAG = EhApplication.class.getSimpleName();
private static final String KEY_GLOBAL_STUFF_NEXT_ID = "global_stuff_next_id";
public static final boolean BETA = false;
private static final boolean DEBUG_CONACO = false;
private static final boolean DEBUG_PRINT_NATIVE_MEMORY = false;
private static final boolean DEBUG_PRINT_IMAGE_COUNT = false;
private static final long DEBUG_PRINT_INTERVAL = 3000L;
private static EhApplication instance;
private final IntIdGenerator mIdGenerator = new IntIdGenerator();
private final HashMap<Integer, Object> mGlobalStuffMap = new HashMap<>();
private EhCookieStore mEhCookieStore;
private EhClient mEhClient;
private EhProxySelector mEhProxySelector;
private OkHttpClient mOkHttpClient;
private ImageBitmapHelper mImageBitmapHelper;
private Conaco<ImageBitmap> mConaco;
private LruCache<Long, GalleryDetail> mGalleryDetailCache;
private SimpleDiskCache mSpiderInfoCache;
private DownloadManager mDownloadManager;
private Hosts mHosts;
private FavouriteStatusRouter mFavouriteStatusRouter;
private final List<Activity> mActivityList = new ArrayList<>();
private boolean initialized = false;
public static EhApplication getInstance() {
return instance;
}
@SuppressLint("StaticFieldLeak")
@Override
public void onCreate() {
instance = this;
Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
try {
// Always save crash file if onCreate() is not done
if (!initialized || Settings.getSaveCrashLog()) {
Crash.saveCrashLog(instance, e);
}
} catch (Throwable ignored) { }
if (handler != null) {
handler.uncaughtException(t, e);
}
});
super.onCreate();
GetText.initialize(this);
StatusCodeException.initialize(this);
Settings.initialize(this);
ReadableTime.initialize(this);
Html.initialize(this);
AppConfig.initialize(this);
SpiderDen.initialize(this);
EhDB.initialize(this);
EhEngine.initialize();
BitmapUtils.initialize(this);
Image.initialize(this);
A7Zip.loadLibrary(A7ZipExtractLite.LIBRARY, libname -> ReLinker.loadLibrary(EhApplication.this, libname));
if (EhDB.needMerge()) {
EhDB.mergeOldDB(this);
}
if (Settings.getEnableAnalytics()) {
Analytics.start(this);
}
// Do io tasks in new thread
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
// Check no media file
try {
UniFile downloadLocation = Settings.getDownloadLocation();
if (Settings.getMediaScan()) {
CommonOperations.removeNoMediaFile(downloadLocation);
} else {
CommonOperations.ensureNoMediaFile(downloadLocation);
}
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
}
// Clear temp files
try {
clearTempDir();
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
}
return null;
}
}.executeOnExecutor(IoThreadPoolExecutor.getInstance());
// Check app update
update();
// Update version code
try {
PackageInfo pi= getPackageManager().getPackageInfo(getPackageName(), 0);
Settings.putVersionCode(pi.versionCode);
} catch (PackageManager.NameNotFoundException e) {
// Ignore
}
mIdGenerator.setNextId(Settings.getInt(KEY_GLOBAL_STUFF_NEXT_ID, 0));
if (DEBUG_PRINT_NATIVE_MEMORY || DEBUG_PRINT_IMAGE_COUNT) {
debugPrint();
}
initialized = true;
}
private void clearTempDir() {
File dir = AppConfig.getTempDir();
if (null != dir) {
FileUtils.deleteContent(dir);
}
dir = AppConfig.getExternalTempDir();
if (null != dir) {
FileUtils.deleteContent(dir);
}
// Add .nomedia to external temp dir
CommonOperations.ensureNoMediaFile(UniFile.fromFile(AppConfig.getExternalTempDir()));
}
private void update() {
int version = Settings.getVersionCode();
if (version < 52) {
Settings.putGuideGallery(true);
}
}
public void clearMemoryCache() {
if (null != mConaco) {
mConaco.getBeerBelly().clearMemory();
}
if (null != mGalleryDetailCache) {
mGalleryDetailCache.evictAll();
}
}
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW) {
clearMemoryCache();
}
}
private void debugPrint() {
new Runnable() {
@Override
public void run() {
if (DEBUG_PRINT_NATIVE_MEMORY) {
Log.i(TAG, "Native memory: " + FileUtils.humanReadableByteCount(
Debug.getNativeHeapAllocatedSize(), false));
}
if (DEBUG_PRINT_IMAGE_COUNT) {
Log.i(TAG, "Image count: " + Image.getImageCount());
}
SimpleHandler.getInstance().postDelayed(this, DEBUG_PRINT_INTERVAL);
}
}.run();
}
public int putGlobalStuff(@NonNull Object o) {
int id = mIdGenerator.nextId();
mGlobalStuffMap.put(id, o);
Settings.putInt(KEY_GLOBAL_STUFF_NEXT_ID, mIdGenerator.nextId());
return id;
}
public boolean containGlobalStuff(int id) {
return mGlobalStuffMap.containsKey(id);
}
public Object getGlobalStuff(int id) {
return mGlobalStuffMap.get(id);
}
public Object removeGlobalStuff(int id) {
return mGlobalStuffMap.remove(id);
}
public boolean removeGlobalStuff(Object o) {
return mGlobalStuffMap.values().removeAll(Collections.singleton(o));
}
public static EhCookieStore getEhCookieStore(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mEhCookieStore == null) {
application.mEhCookieStore = new EhCookieStore(context);
}
return application.mEhCookieStore;
}
@NonNull
public static EhClient getEhClient(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mEhClient == null) {
application.mEhClient = new EhClient(application);
}
return application.mEhClient;
}
@NonNull
public static EhProxySelector getEhProxySelector(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mEhProxySelector == null) {
application.mEhProxySelector = new EhProxySelector();
}
return application.mEhProxySelector;
}
@NonNull
public static OkHttpClient getOkHttpClient(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mOkHttpClient == null) {
application.mOkHttpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.cookieJar(getEhCookieStore(application))
.dns(new EhDns(application))
.proxySelector(getEhProxySelector(application))
.build();
}
return application.mOkHttpClient;
}
@NonNull
public static ImageBitmapHelper getImageBitmapHelper(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mImageBitmapHelper == null) {
application.mImageBitmapHelper = new ImageBitmapHelper();
}
return application.mImageBitmapHelper;
}
private static int getMemoryCacheMaxSize() {
return Math.min(20 * 1024 * 1024, (int) OSUtils.getAppMaxMemory());
}
@NonNull
public static Conaco<ImageBitmap> getConaco(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mConaco == null) {
Conaco.Builder<ImageBitmap> builder = new Conaco.Builder<>();
builder.hasMemoryCache = true;
builder.memoryCacheMaxSize = getMemoryCacheMaxSize();
builder.hasDiskCache = true;
builder.diskCacheDir = new File(context.getCacheDir(), "thumb");
builder.diskCacheMaxSize = 80 * 1024 * 1024; // 80MB
builder.okHttpClient = getOkHttpClient(context);
builder.objectHelper = getImageBitmapHelper(context);
builder.debug = DEBUG_CONACO;
application.mConaco = builder.build();
}
return application.mConaco;
}
@NonNull
public static LruCache<Long, GalleryDetail> getGalleryDetailCache(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mGalleryDetailCache == null) {
// Max size 25, 3 min timeout
application.mGalleryDetailCache = new LruCache<>(25);
getFavouriteStatusRouter().addListener((gid, slot) -> {
GalleryDetail gd = application.mGalleryDetailCache.get(gid);
if (gd != null) {
gd.favoriteSlot = slot;
}
});
}
return application.mGalleryDetailCache;
}
@NonNull
public static SimpleDiskCache getSpiderInfoCache(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (null == application.mSpiderInfoCache) {
application.mSpiderInfoCache = new SimpleDiskCache(
new File(context.getCacheDir(), "spider_info"), 5 * 1024 * 1024); // 5M
}
return application.mSpiderInfoCache;
}
@NonNull
public static DownloadManager getDownloadManager() {
return getDownloadManager(instance);
}
@NonNull
public static DownloadManager getDownloadManager(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mDownloadManager == null) {
application.mDownloadManager = new DownloadManager(application);
}
return application.mDownloadManager;
}
@NonNull
public static Hosts getHosts(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mHosts == null) {
application.mHosts = new Hosts(application, "hosts.db");
}
return application.mHosts;
}
@NonNull
public static FavouriteStatusRouter getFavouriteStatusRouter() {
return getFavouriteStatusRouter(getInstance());
}
@NonNull
public static FavouriteStatusRouter getFavouriteStatusRouter(@NonNull Context context) {
EhApplication application = ((EhApplication) context.getApplicationContext());
if (application.mFavouriteStatusRouter == null) {
application.mFavouriteStatusRouter = new FavouriteStatusRouter();
}
return application.mFavouriteStatusRouter;
}
@NonNull
public static String getDeveloperEmail() {
return "ehviewersu$gmail.com".replace('$', '@');
}
public void registerActivity(Activity activity) {
mActivityList.add(activity);
}
public void unregisterActivity(Activity activity) {
mActivityList.remove(activity);
}
@Nullable
public Activity getTopActivity() {
if (!mActivityList.isEmpty()) {
return mActivityList.get(mActivityList.size() - 1);
} else {
return null;
}
}
// Avoid crash on some "energy saving" devices
@Override
public ComponentName startService(Intent service) {
try {
return super.startService(service);
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
return null;
}
}
// Avoid crash on some "energy saving" devices
@Override
public boolean bindService(Intent service, ServiceConnection conn, int flags) {
try {
return super.bindService(service, conn, flags);
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
return false;
}
}
// Avoid crash on some "energy saving" devices
@Override
public void unbindService(ServiceConnection conn) {
try {
super.unbindService(conn);
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
}
}
}
@@ -0,0 +1,791 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.client.data.ListUrlBuilder;
import com.hippo.ehviewer.dao.DaoMaster;
import com.hippo.ehviewer.dao.DaoSession;
import com.hippo.ehviewer.dao.DownloadDirname;
import com.hippo.ehviewer.dao.DownloadDirnameDao;
import com.hippo.ehviewer.dao.DownloadInfo;
import com.hippo.ehviewer.dao.DownloadLabel;
import com.hippo.ehviewer.dao.DownloadLabelDao;
import com.hippo.ehviewer.dao.DownloadsDao;
import com.hippo.ehviewer.dao.Filter;
import com.hippo.ehviewer.dao.FilterDao;
import com.hippo.ehviewer.dao.HistoryDao;
import com.hippo.ehviewer.dao.HistoryInfo;
import com.hippo.ehviewer.dao.LocalFavoriteInfo;
import com.hippo.ehviewer.dao.LocalFavoritesDao;
import com.hippo.ehviewer.dao.QuickSearch;
import com.hippo.ehviewer.dao.QuickSearchDao;
import com.hippo.ehviewer.download.DownloadManager;
import com.hippo.util.ExceptionUtils;
import com.hippo.util.SqlUtils;
import com.hippo.yorozuya.IOUtils;
import com.hippo.yorozuya.ObjectUtils;
import com.hippo.yorozuya.collect.SparseJLArray;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.query.CloseableListIterator;
import de.greenrobot.dao.query.LazyList;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class EhDB {
private static final String TAG = EhDB.class.getSimpleName();
private static final int MAX_HISTORY_COUNT = 100;
private static DaoSession sDaoSession;
private static boolean sHasOldDB;
private static boolean sNewDB;
private static class DBOpenHelper extends DaoMaster.OpenHelper {
public DBOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
super(context, name, factory);
}
@Override
public void onCreate(SQLiteDatabase db) {
super.onCreate(db);
sNewDB = true;
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
upgradeDB(db, oldVersion);
}
}
private static void upgradeDB(SQLiteDatabase db, int oldVersion) {
switch (oldVersion) {
case 1: // 1 to 2, add FILTER
FilterDao.createTable(db, true);
case 2: // 2 to 3, add ENABLE column to table FILTER
db.execSQL("CREATE TABLE " + "\"FILTER2\" (" +
"\"_id\" INTEGER PRIMARY KEY ," +
"\"MODE\" INTEGER NOT NULL ," +
"\"TEXT\" TEXT," +
"\"ENABLE\" INTEGER);");
db.execSQL("INSERT INTO \"FILTER2\" (" +
"_id, MODE, TEXT, ENABLE)" +
"SELECT _id, MODE, TEXT, 1 FROM FILTER;");
db.execSQL("DROP TABLE FILTER");
db.execSQL("ALTER TABLE FILTER2 RENAME TO FILTER");
case 3: // 3 to 4, add PAGE_FROM and PAGE_TO column to QUICK_SEARCH
db.execSQL("CREATE TABLE " + "\"QUICK_SEARCH2\" (" +
"\"_id\" INTEGER PRIMARY KEY ," +
"\"NAME\" TEXT," +
"\"MODE\" INTEGER NOT NULL ," +
"\"CATEGORY\" INTEGER NOT NULL ," +
"\"KEYWORD\" TEXT," +
"\"ADVANCE_SEARCH\" INTEGER NOT NULL ," +
"\"MIN_RATING\" INTEGER NOT NULL ," +
"\"PAGE_FROM\" INTEGER NOT NULL ," +
"\"PAGE_TO\" INTEGER NOT NULL ," +
"\"TIME\" INTEGER NOT NULL );");
db.execSQL("INSERT INTO \"QUICK_SEARCH2\" (" +
"_id, NAME, MODE, CATEGORY, KEYWORD, ADVANCE_SEARCH, MIN_RATING, PAGE_FROM, PAGE_TO, TIME)" +
"SELECT _id, NAME, MODE, CATEGORY, KEYWORD, ADVANCE_SEARCH, MIN_RATING, -1, -1, TIME FROM QUICK_SEARCH;");
db.execSQL("DROP TABLE QUICK_SEARCH");
db.execSQL("ALTER TABLE QUICK_SEARCH2 RENAME TO QUICK_SEARCH");
}
}
private static class OldDBHelper extends SQLiteOpenHelper {
private static final String DB_NAME = "data";
private static final int VERSION = 4;
private static final String TABLE_GALLERY = "gallery";
private static final String TABLE_LOCAL_FAVOURITE = "local_favourite";
private static final String TABLE_TAG = "tag";
private static final String TABLE_DOWNLOAD = "download";
private static final String TABLE_HISTORY = "history";
public OldDBHelper(Context context) {
super(context, DB_NAME, null, VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
public static void initialize(Context context) {
sHasOldDB = context.getDatabasePath("data").exists();
DBOpenHelper helper = new DBOpenHelper(
context.getApplicationContext(), "eh.db", null);
SQLiteDatabase db = helper.getWritableDatabase();
DaoMaster daoMaster = new DaoMaster(db);
sDaoSession = daoMaster.newSession();
}
public static boolean needMerge() {
return sNewDB && sHasOldDB;
}
public static void mergeOldDB(Context context) {
sNewDB = false;
OldDBHelper oldDBHelper = new OldDBHelper(context);
SQLiteDatabase oldDB;
try {
oldDB = oldDBHelper.getReadableDatabase();
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
return;
}
// Get GalleryInfo list
SparseJLArray<GalleryInfo> map = new SparseJLArray<>();
try {
Cursor cursor = oldDB.rawQuery("select * from " + OldDBHelper.TABLE_GALLERY, null);
if (cursor != null) {
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
GalleryInfo gi = new GalleryInfo();
gi.gid = cursor.getInt(0);
gi.token = cursor.getString(1);
gi.title = cursor.getString(2);
gi.posted = cursor.getString(3);
gi.category = cursor.getInt(4);
gi.thumb = cursor.getString(5);
gi.uploader = cursor.getString(6);
try {
// In 0.6.x version, NaN is stored
gi.rating = cursor.getFloat(7);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
gi.rating = -1.0f;
}
map.put(gi.gid, gi);
cursor.moveToNext();
}
}
cursor.close();
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
// Merge local favorites
try {
Cursor cursor = oldDB.rawQuery("select * from " + OldDBHelper.TABLE_LOCAL_FAVOURITE, null);
if (cursor != null) {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
if (cursor.moveToFirst()) {
long i = 0L;
while (!cursor.isAfterLast()) {
// Get GalleryInfo first
long gid = cursor.getInt(0);
GalleryInfo gi = map.get(gid);
if (gi == null) {
Log.e(TAG, "Can't get GalleryInfo with gid: " + gid);
cursor.moveToNext();
continue;
}
LocalFavoriteInfo info = new LocalFavoriteInfo(gi);
info.setTime(i);
dao.insert(info);
cursor.moveToNext();
i++;
}
}
cursor.close();
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
// Merge quick search
try {
Cursor cursor = oldDB.rawQuery("select * from " + OldDBHelper.TABLE_TAG, null);
if (cursor != null) {
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
QuickSearch quickSearch = new QuickSearch();
int mode = cursor.getInt(2);
String search = cursor.getString(4);
String tag = cursor.getString(7);
if (mode == ListUrlBuilder.MODE_UPLOADER && search != null &&
search.startsWith("uploader:")) {
search = search.substring("uploader:".length());
}
quickSearch.setTime((long) cursor.getInt(0));
quickSearch.setName(cursor.getString(1));
quickSearch.setMode(mode);
quickSearch.setCategory(cursor.getInt(3));
quickSearch.setKeyword(mode == ListUrlBuilder.MODE_TAG ? tag : search);
quickSearch.setAdvanceSearch(cursor.getInt(5));
quickSearch.setMinRating(cursor.getInt(6));
dao.insert(quickSearch);
cursor.moveToNext();
}
}
cursor.close();
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
// Merge download info
try {
Cursor cursor = oldDB.rawQuery("select * from " + OldDBHelper.TABLE_DOWNLOAD, null);
if (cursor != null) {
DownloadsDao dao = sDaoSession.getDownloadsDao();
if (cursor.moveToFirst()) {
long i = 0L;
while (!cursor.isAfterLast()) {
// Get GalleryInfo first
long gid = cursor.getInt(0);
GalleryInfo gi = map.get(gid);
if (gi == null) {
Log.e(TAG, "Can't get GalleryInfo with gid: " + gid);
cursor.moveToNext();
continue;
}
DownloadInfo info = new DownloadInfo(gi);
int state = cursor.getInt(2);
int legacy = cursor.getInt(3);
if (state == DownloadInfo.STATE_FINISH && legacy > 0) {
state = DownloadInfo.STATE_FAILED;
}
info.setState(state);
info.setLegacy(legacy);
if (cursor.getColumnCount() == 5) {
info.setTime(cursor.getLong(4));
} else {
info.setTime(i);
}
dao.insert(info);
cursor.moveToNext();
i++;
}
}
cursor.close();
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
try {
// Merge history info
Cursor cursor = oldDB.rawQuery("select * from " + OldDBHelper.TABLE_HISTORY, null);
if (cursor != null) {
HistoryDao dao = sDaoSession.getHistoryDao();
if (cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
// Get GalleryInfo first
long gid = cursor.getInt(0);
GalleryInfo gi = map.get(gid);
if (gi == null) {
Log.e(TAG, "Can't get GalleryInfo with gid: " + gid);
cursor.moveToNext();
continue;
}
HistoryInfo info = new HistoryInfo(gi);
info.setMode(cursor.getInt(1));
info.setTime(cursor.getLong(2));
dao.insert(info);
cursor.moveToNext();
}
}
cursor.close();
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
try {
oldDBHelper.close();
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
}
}
public static synchronized List<DownloadInfo> getAllDownloadInfo() {
DownloadsDao dao = sDaoSession.getDownloadsDao();
List<DownloadInfo> list = dao.queryBuilder().orderDesc(DownloadsDao.Properties.Time).list();
// Fix state
for (DownloadInfo info: list) {
if (info.state == DownloadInfo.STATE_WAIT || info.state == DownloadInfo.STATE_DOWNLOAD) {
info.state = DownloadInfo.STATE_NONE;
}
}
return list;
}
// Insert or update
public static synchronized void putDownloadInfo(DownloadInfo downloadInfo) {
DownloadsDao dao = sDaoSession.getDownloadsDao();
if (null != dao.load(downloadInfo.gid)) {
// Update
dao.update(downloadInfo);
} else {
// Insert
dao.insert(downloadInfo);
}
}
public static synchronized void removeDownloadInfo(long gid) {
sDaoSession.getDownloadsDao().deleteByKey(gid);
}
@Nullable
public static synchronized String getDownloadDirname(long gid) {
DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
DownloadDirname raw = dao.load(gid);
if (raw != null) {
return raw.getDirname();
} else {
return null;
}
}
/**
* Insert or update
*/
public static synchronized void putDownloadDirname(long gid, String dirname) {
DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
DownloadDirname raw = dao.load(gid);
if (raw != null) { // Update
raw.setDirname(dirname);
dao.update(raw);
} else { // Insert
raw = new DownloadDirname();
raw.setGid(gid);
raw.setDirname(dirname);
dao.insert(raw);
}
}
public static synchronized void removeDownloadDirname(long gid) {
DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
dao.deleteByKey(gid);
}
public static synchronized void clearDownloadDirname() {
DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
dao.deleteAll();
}
@NonNull
public static synchronized List<DownloadLabel> getAllDownloadLabelList() {
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
return dao.queryBuilder().orderAsc(DownloadLabelDao.Properties.Time).list();
}
public static synchronized DownloadLabel addDownloadLabel(String label) {
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
DownloadLabel raw = new DownloadLabel();
raw.setLabel(label);
raw.setTime(System.currentTimeMillis());
raw.setId(dao.insert(raw));
return raw;
}
public static synchronized DownloadLabel addDownloadLabel(DownloadLabel raw) {
// Reset id
raw.setId(null);
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
raw.setId(dao.insert(raw));
return raw;
}
public static synchronized void updateDownloadLabel(DownloadLabel raw) {
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
dao.update(raw);
}
public static synchronized void moveDownloadLabel(int fromPosition, int toPosition) {
if (fromPosition == toPosition) {
return;
}
boolean reverse = fromPosition > toPosition;
int offset = reverse ? toPosition : fromPosition;
int limit = reverse ? fromPosition - toPosition + 1 : toPosition - fromPosition + 1;
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
List<DownloadLabel> list = dao.queryBuilder().orderAsc(DownloadLabelDao.Properties.Time)
.offset(offset).limit(limit).list();
int step = reverse ? 1 : -1;
int start = reverse ? limit - 1 : 0;
int end = reverse ? 0 : limit - 1;
long toTime = list.get(end).getTime();
for (int i = end; reverse ? i < start : i > start; i += step) {
list.get(i).setTime(list.get(i + step).getTime());
}
list.get(start).setTime(toTime);
dao.updateInTx(list);
}
public static synchronized void removeDownloadLabel(DownloadLabel raw) {
DownloadLabelDao dao = sDaoSession.getDownloadLabelDao();
dao.delete(raw);
}
public static synchronized List<GalleryInfo> getAllLocalFavorites() {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
List<LocalFavoriteInfo> list = dao.queryBuilder().orderDesc(LocalFavoritesDao.Properties.Time).list();
List<GalleryInfo> result = new ArrayList<>();
result.addAll(list);
return result;
}
public static synchronized List<GalleryInfo> searchLocalFavorites(String query) {
query = SqlUtils.sqlEscapeString("%" + query+ "%");
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
List<LocalFavoriteInfo> list = dao.queryBuilder().orderDesc(LocalFavoritesDao.Properties.Time)
.where(LocalFavoritesDao.Properties.Title.like(query)).list();
List<GalleryInfo> result = new ArrayList<>();
result.addAll(list);
return result;
}
public static synchronized void removeLocalFavorites(long gid) {
sDaoSession.getLocalFavoritesDao().deleteByKey(gid);
}
public static synchronized void removeLocalFavorites(long[] gidArray) {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
for (long gid: gidArray) {
dao.deleteByKey(gid);
}
}
public static synchronized boolean containLocalFavorites(long gid) {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
return null != dao.load(gid);
}
public static synchronized void putLocalFavorites(GalleryInfo galleryInfo) {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
if (null == dao.load(galleryInfo.gid)) {
LocalFavoriteInfo info;
if (galleryInfo instanceof LocalFavoriteInfo) {
info = (LocalFavoriteInfo) galleryInfo;
} else {
info = new LocalFavoriteInfo(galleryInfo);
info.time = System.currentTimeMillis();
}
dao.insert(info);
}
}
public static synchronized void putLocalFavorites(List<GalleryInfo> galleryInfoList) {
for (GalleryInfo gi: galleryInfoList) {
putLocalFavorites(gi);
}
}
public static synchronized List<QuickSearch> getAllQuickSearch() {
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
return dao.queryBuilder().orderAsc(QuickSearchDao.Properties.Time).list();
}
public static synchronized void insertQuickSearch(QuickSearch quickSearch) {
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
quickSearch.id = null;
quickSearch.time = System.currentTimeMillis();
quickSearch.id = dao.insert(quickSearch);
}
public static synchronized void updateQuickSearch(QuickSearch quickSearch) {
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
dao.update(quickSearch);
}
public static synchronized void deleteQuickSearch(QuickSearch quickSearch) {
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
dao.delete(quickSearch);
}
public static synchronized void moveQuickSearch(int fromPosition, int toPosition) {
if (fromPosition == toPosition) {
return;
}
boolean reverse = fromPosition > toPosition;
int offset = reverse ? toPosition : fromPosition;
int limit = reverse ? fromPosition - toPosition + 1 : toPosition - fromPosition + 1;
QuickSearchDao dao = sDaoSession.getQuickSearchDao();
List<QuickSearch> list = dao.queryBuilder().orderAsc(QuickSearchDao.Properties.Time)
.offset(offset).limit(limit).list();
int step = reverse ? 1 : -1;
int start = reverse ? limit - 1 : 0;
int end = reverse ? 0 : limit - 1;
long toTime = list.get(end).getTime();
for (int i = end; reverse ? i < start : i > start; i += step) {
list.get(i).setTime(list.get(i + step).getTime());
}
list.get(start).setTime(toTime);
dao.updateInTx(list);
}
public static synchronized LazyList<HistoryInfo> getHistoryLazyList() {
return sDaoSession.getHistoryDao().queryBuilder().orderDesc(HistoryDao.Properties.Time).listLazy();
}
public static synchronized void putHistoryInfo(GalleryInfo galleryInfo) {
HistoryDao dao = sDaoSession.getHistoryDao();
HistoryInfo info = dao.load(galleryInfo.gid);
if (null != info) {
// Update time
info.time = System.currentTimeMillis();
dao.update(info);
} else {
// New history
info = new HistoryInfo(galleryInfo);
info.time = System.currentTimeMillis();
dao.insert(info);
List<HistoryInfo> list = dao.queryBuilder().orderDesc(HistoryDao.Properties.Time)
.limit(-1).offset(MAX_HISTORY_COUNT).list();
dao.deleteInTx(list);
}
}
public static synchronized void putHistoryInfo(List<HistoryInfo> historyInfoList) {
HistoryDao dao = sDaoSession.getHistoryDao();
for (HistoryInfo info: historyInfoList) {
if (null == dao.load(info.gid)) {
dao.insert(info);
}
}
List<HistoryInfo> list = dao.queryBuilder().orderDesc(HistoryDao.Properties.Time)
.limit(-1).offset(MAX_HISTORY_COUNT).list();
dao.deleteInTx(list);
}
public static synchronized void deleteHistoryInfo(HistoryInfo info) {
HistoryDao dao = sDaoSession.getHistoryDao();
dao.delete(info);
}
public static synchronized void clearHistoryInfo() {
HistoryDao dao = sDaoSession.getHistoryDao();
dao.deleteAll();
}
public static synchronized List<Filter> getAllFilter() {
return sDaoSession.getFilterDao().queryBuilder().list();
}
public static synchronized void addFilter(Filter filter) {
filter.setId(null);
filter.setId(sDaoSession.getFilterDao().insert(filter));
}
public static synchronized void deleteFilter(Filter filter) {
sDaoSession.getFilterDao().delete(filter);
}
public static synchronized void triggerFilter(Filter filter) {
filter.setEnable(!filter.enable);
sDaoSession.getFilterDao().update(filter);
}
private static <T> boolean copyDao(AbstractDao<T, ?> from, AbstractDao<T, ?> to) {
try (CloseableListIterator<T> iterator = from.queryBuilder().listIterator()) {
while (iterator.hasNext()) {
to.insert(iterator.next());
}
} catch (IOException e) {
return false;
}
return true;
}
public static synchronized boolean exportDB(Context context, File file) {
final String ehExportName = "eh.export.db";
// Delete old export db
context.deleteDatabase(ehExportName);
DBOpenHelper helper = new DBOpenHelper(context.getApplicationContext(), ehExportName, null);
try {
// Copy data to a export db
try (SQLiteDatabase db = helper.getWritableDatabase()) {
DaoMaster daoMaster = new DaoMaster(db);
DaoSession exportSession = daoMaster.newSession();
if (!copyDao(sDaoSession.getDownloadsDao(), exportSession.getDownloadsDao())) return false;
if (!copyDao(sDaoSession.getDownloadLabelDao(), exportSession.getDownloadLabelDao())) return false;
if (!copyDao(sDaoSession.getDownloadDirnameDao(), exportSession.getDownloadDirnameDao())) return false;
if (!copyDao(sDaoSession.getHistoryDao(), exportSession.getHistoryDao())) return false;
if (!copyDao(sDaoSession.getQuickSearchDao(), exportSession.getQuickSearchDao())) return false;
if (!copyDao(sDaoSession.getLocalFavoritesDao(), exportSession.getLocalFavoritesDao())) return false;
if (!copyDao(sDaoSession.getBookmarksBao(), exportSession.getBookmarksBao())) return false;
if (!copyDao(sDaoSession.getFilterDao(), exportSession.getFilterDao())) return false;
}
// Copy export db to data dir
File dbFile = context.getDatabasePath(ehExportName);
if (dbFile == null || !dbFile.isFile()) {
return false;
}
InputStream is = null;
OutputStream os = null;
try {
is = new FileInputStream(dbFile);
os = new FileOutputStream(file);
IOUtils.copy(is, os);
return true;
} catch (IOException e) {
e.printStackTrace();
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(os);
}
// Delete failed file
file.delete();
return false;
} finally {
context.deleteDatabase(ehExportName);
}
}
/**
* @param file The db file
* @return error string, null for no error
*/
public static synchronized String importDB(Context context, File file) {
try {
SQLiteDatabase db = SQLiteDatabase.openDatabase(
file.getPath(), null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
int newVersion = DaoMaster.SCHEMA_VERSION;
int oldVersion = db.getVersion();
if (oldVersion < newVersion) {
upgradeDB(db, oldVersion);
db.setVersion(newVersion);
} else if (oldVersion > newVersion) {
return context.getString(R.string.cant_read_the_file);
}
DaoMaster daoMaster = new DaoMaster(db);
DaoSession session = daoMaster.newSession();
// Downloads
DownloadManager manager = EhApplication.getDownloadManager(context);
List<DownloadInfo> downloadInfoList = session.getDownloadsDao().queryBuilder().list();
manager.addDownload(downloadInfoList);
// Download label
List<DownloadLabel> downloadLabelList = session.getDownloadLabelDao().queryBuilder().list();
manager.addDownloadLabel(downloadLabelList);
// Download dirname
List<DownloadDirname> downloadDirnameList = session.getDownloadDirnameDao().queryBuilder().list();
for (DownloadDirname dirname: downloadDirnameList) {
putDownloadDirname(dirname.getGid(), dirname.getDirname());
}
// History
List<HistoryInfo> historyInfoList = session.getHistoryDao().queryBuilder().list();
putHistoryInfo(historyInfoList);
// QuickSearch
List<QuickSearch> quickSearchList = session.getQuickSearchDao().queryBuilder().list();
List<QuickSearch> currentQuickSearchList = sDaoSession.getQuickSearchDao().queryBuilder().list();
for (QuickSearch quickSearch: quickSearchList) {
String name = quickSearch.name;
for (QuickSearch q: currentQuickSearchList) {
if (ObjectUtils.equal(q.name, name)) {
// The same name
name = null;
break;
}
}
if (null == name) {
continue;
}
insertQuickSearch(quickSearch);
}
// LocalFavorites
List<LocalFavoriteInfo> localFavoriteInfoList = session.getLocalFavoritesDao().queryBuilder().list();
for (LocalFavoriteInfo info: localFavoriteInfoList) {
putLocalFavorites(info);
}
// Bookmarks
// TODO
// Filter
List<Filter> filterList = session.getFilterDao().queryBuilder().list();
List<Filter> currentFilterList = sDaoSession.getFilterDao().queryBuilder().list();
for (Filter filter: filterList) {
if (!currentFilterList.contains(filter)) {
addFilter(filter);
}
}
return null;
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
// Ignore
return context.getString(R.string.cant_read_the_file);
}
}
}
@@ -0,0 +1,106 @@
/*
* Copyright 2019 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.text.TextUtils;
import com.hippo.network.InetValidator;
import com.hippo.util.ExceptionUtils;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.SocketAddress;
import java.net.URI;
import java.util.Collections;
import java.util.List;
public class EhProxySelector extends ProxySelector {
public static final int TYPE_DIRECT = 0;
public static final int TYPE_SYSTEM = 1;
public static final int TYPE_HTTP = 2;
public static final int TYPE_SOCKS = 3;
private ProxySelector delegation;
private ProxySelector alternative;
EhProxySelector() {
alternative = ProxySelector.getDefault();
if (alternative == null) {
alternative = new NullProxySelector();
}
updateProxy();
}
public void updateProxy() {
switch (Settings.getProxyType()) {
case TYPE_DIRECT:
delegation = new NullProxySelector();
break;
default:
case TYPE_SYSTEM:
delegation = alternative;
break;
case TYPE_HTTP:
case TYPE_SOCKS:
delegation = null;
break;
}
}
@Override
public List<Proxy> select(URI uri) {
int type = Settings.getProxyType();
if (type == TYPE_HTTP || type == TYPE_SOCKS) {
try {
String ip = Settings.getProxyIp();
int port = Settings.getProxyPort();
if (!TextUtils.isEmpty(ip) && InetValidator.isValidInetPort(port)) {
InetAddress inetAddress = InetAddress.getByName(ip);
SocketAddress socketAddress = new InetSocketAddress(inetAddress, port);
return Collections.singletonList(new Proxy(type == TYPE_HTTP ? Proxy.Type.HTTP : Proxy.Type.SOCKS, socketAddress));
}
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
}
}
if (delegation != null) {
return delegation.select(uri);
}
return alternative.select(uri);
}
@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
if (delegation != null) {
delegation.select(uri);
}
}
private static class NullProxySelector extends ProxySelector {
@Override
public List<Proxy> select(URI uri) {
return Collections.singletonList(Proxy.NO_PROXY);
}
@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { }
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2019 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.annotation.SuppressLint;
import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.yorozuya.IntIdGenerator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FavouriteStatusRouter {
private static final String KEY_DATA_MAP_NEXT_ID = "data_map_next_id";
private final IntIdGenerator idGenerator = new IntIdGenerator(Settings.getInt(KEY_DATA_MAP_NEXT_ID, 0));
@SuppressLint("UseSparseArrays")
private final HashMap<Integer, Map<Long, GalleryInfo>> maps = new HashMap<>();
private List<Listener> listeners = new ArrayList<>();
public int saveDataMap(Map<Long, GalleryInfo> map) {
int id = idGenerator.nextId();
maps.put(id, map);
Settings.putInt(KEY_DATA_MAP_NEXT_ID, idGenerator.nextId());
return id;
}
public Map<Long, GalleryInfo> restoreDataMap(int id) {
return maps.remove(id);
}
public void modifyFavourites(long gid, int slot) {
for (Map<Long, GalleryInfo> map : maps.values()) {
GalleryInfo info = map.get(gid);
if (info != null) {
info.favoriteSlot = slot;
}
}
for (Listener listener : listeners) {
listener.onModifyFavourites(gid, slot);
}
}
public void addListener(Listener listener) {
listeners.add(listener);
}
public void removeListener(Listener listener) {
listeners.remove(listener);
}
public interface Listener {
void onModifyFavourites(long gid, int slot);
}
}
@@ -0,0 +1,41 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.content.Context;
import android.content.res.Resources;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
public class GetText {
private static Resources sResources;
public static void initialize(Context context) {
sResources = context.getApplicationContext().getResources();
}
@NonNull
public static String getString(@StringRes int id) {
return sResources.getString(id);
}
@NonNull
public static String getString(@StringRes int id, Object... formatArgs) {
return sResources.getString(id, formatArgs);
}
}
@@ -0,0 +1,350 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
/*
* Created by Hippo on 2018/3/21.
*/
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Pair;
import androidx.annotation.Nullable;
import com.hippo.database.MSQLiteBuilder;
import com.hippo.util.SqlUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
public class Hosts {
private static final int VERSION_1 = 1;
private static final String TABLE_HOSTS = "HOSTS";
private static final String COLUMN_HOST = "HOST";
private static final String COLUMN_IP = "IP";
private static final int DB_VERSION = VERSION_1;
private final SQLiteOpenHelper helper;
private final SQLiteDatabase db;
public Hosts(Context context, String name) {
helper = new MSQLiteBuilder()
.version(VERSION_1)
.createTable(TABLE_HOSTS)
.insertColumn(TABLE_HOSTS, COLUMN_HOST, String.class)
.insertColumn(TABLE_HOSTS, COLUMN_IP, String.class)
.build(context, name, DB_VERSION);
db = helper.getWritableDatabase();
}
/**
* Gets a InetAddress with the host.
*/
@Nullable
public InetAddress get(String host) {
if (!isValidHost(host)) {
return null;
}
Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_HOSTS + " WHERE " + COLUMN_HOST + " = ?;", new String[] {host});
try {
if (cursor.moveToNext()) {
String ip = SqlUtils.getString(cursor, COLUMN_IP, null);
return toInetAddress(host, ip);
} else {
return null;
}
} finally {
cursor.close();
}
}
private boolean contains(String host) {
Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_HOSTS + " WHERE " + COLUMN_HOST + " = ?;", new String[] {host});
try {
return cursor.moveToNext();
} finally {
cursor.close();
}
}
/**
* Puts the host-ip pair into this hosts.
*/
public boolean put(String host, String ip) {
if (!isValidHost(host) || !isValidIp(ip)) {
return false;
}
ContentValues values = new ContentValues();
values.put(COLUMN_HOST, host);
values.put(COLUMN_IP, ip);
if (contains(host)) {
db.update(TABLE_HOSTS, values, COLUMN_HOST + " = ?", new String[] { host });
} else {
db.insert(TABLE_HOSTS, null, values);
}
return true;
}
/**
* Puts delete the entry with the host.
*/
public void delete(String host) {
db.delete(TABLE_HOSTS, COLUMN_HOST + " = ?", new String[] { host });
}
/**
* Get all data from this host.
*/
public List<Pair<String, String>> getAll() {
List<Pair<String, String>> result = new ArrayList<>();
Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_HOSTS + ";", null);
try {
while (cursor.moveToNext()) {
String host = SqlUtils.getString(cursor, COLUMN_HOST, null);
String ip = SqlUtils.getString(cursor, COLUMN_IP, null);
InetAddress inetAddress = toInetAddress(host, ip);
if (inetAddress == null) {
continue;
}
result.add(new Pair<>(host, ip));
}
} finally {
cursor.close();
}
return result;
}
@Nullable
public static InetAddress toInetAddress(String host, String ip) {
if (!isValidHost(host)) {
return null;
}
if (ip == null) {
return null;
}
byte[] bytes = parseV4(ip);
if (bytes == null) {
bytes = parseV6(ip);
}
if (bytes == null) {
return null;
}
try {
return InetAddress.getByAddress(host, bytes);
} catch (UnknownHostException e) {
return null;
}
}
/**
* Returns true if the host is valid.
*/
public static boolean isValidHost(String host) {
if (host == null) {
return false;
}
if (host.length() > 253) {
return false;
}
int labelLength = 0;
for (int i = 0, n = host.length(); i < n; i++) {
char ch = host.charAt(i);
if (ch == '.') {
if (labelLength < 1 || labelLength > 63) {
return false;
}
labelLength = 0;
} else {
labelLength++;
}
if ((ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '-' && ch != '.') {
return false;
}
}
if (labelLength < 1 || labelLength > 63) {
return false;
}
return true;
}
/**
* Returns true if the ip is valid.
*/
public static boolean isValidIp(String ip) {
return ip != null && (parseV4(ip) != null || parseV6(ip) != null);
}
// org.xbill.DNS.Address.parseV4
@Nullable
private static byte[] parseV4(String s) {
int numDigits;
int currentOctet;
byte [] values = new byte[4];
int currentValue;
int length = s.length();
currentOctet = 0;
currentValue = 0;
numDigits = 0;
for (int i = 0; i < length; i++) {
char c = s.charAt(i);
if (c >= '0' && c <= '9') {
/* Can't have more than 3 digits per octet. */
if (numDigits == 3)
return null;
/* Octets shouldn't start with 0, unless they are 0. */
if (numDigits > 0 && currentValue == 0)
return null;
numDigits++;
currentValue *= 10;
currentValue += (c - '0');
/* 255 is the maximum value for an octet. */
if (currentValue > 255)
return null;
} else if (c == '.') {
/* Can't have more than 3 dots. */
if (currentOctet == 3)
return null;
/* Two consecutive dots are bad. */
if (numDigits == 0)
return null;
values[currentOctet++] = (byte) currentValue;
currentValue = 0;
numDigits = 0;
} else
return null;
}
/* Must have 4 octets. */
if (currentOctet != 3)
return null;
/* The fourth octet can't be empty. */
if (numDigits == 0)
return null;
values[currentOctet] = (byte) currentValue;
return values;
}
// org.xbill.DNS.Address.parseV6
@Nullable
private static byte[] parseV6(String s) {
int range = -1;
byte [] data = new byte[16];
String [] tokens = s.split(":", -1);
int first = 0;
int last = tokens.length - 1;
if (tokens[0].length() == 0) {
// If the first two tokens are empty, it means the string
// started with ::, which is fine. If only the first is
// empty, the string started with :, which is bad.
if (last - first > 0 && tokens[1].length() == 0)
first++;
else
return null;
}
if (tokens[last].length() == 0) {
// If the last two tokens are empty, it means the string
// ended with ::, which is fine. If only the last is
// empty, the string ended with :, which is bad.
if (last - first > 0 && tokens[last - 1].length() == 0)
last--;
else
return null;
}
if (last - first + 1 > 8)
return null;
int i, j;
for (i = first, j = 0; i <= last; i++) {
if (tokens[i].length() == 0) {
if (range >= 0)
return null;
range = j;
continue;
}
if (tokens[i].indexOf('.') >= 0) {
// An IPv4 address must be the last component
if (i < last)
return null;
// There can't have been more than 6 components.
if (i > 6)
return null;
byte [] v4addr = parseV4(tokens[i]);
if (v4addr == null)
return null;
for (int k = 0; k < 4; k++)
data[j++] = v4addr[k];
break;
}
try {
for (int k = 0; k < tokens[i].length(); k++) {
char c = tokens[i].charAt(k);
if (Character.digit(c, 16) < 0)
return null;
}
int x = Integer.parseInt(tokens[i], 16);
if (x > 0xFFFF || x < 0)
return null;
data[j++] = (byte)(x >>> 8);
data[j++] = (byte)(x & 0xFF);
}
catch (NumberFormatException e) {
return null;
}
}
if (j < 16 && range < 0)
return null;
if (range >= 0) {
int empty = 16 - j;
System.arraycopy(data, range, data, range + empty, j - range);
for (i = range; i < range + empty; i++)
data[i] = 0;
}
return data;
}
}
@@ -0,0 +1,70 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.hippo.conaco.ValueHelper;
import com.hippo.image.ImageBitmap;
import com.hippo.streampipe.InputStreamPipe;
import java.io.IOException;
public class ImageBitmapHelper implements ValueHelper<ImageBitmap> {
private static final int MAX_CACHE_SIZE = 512 * 512;
@Nullable
@Override
public ImageBitmap decode(@NonNull InputStreamPipe isPipe) {
try {
isPipe.obtain();
return ImageBitmap.decode(isPipe.open());
} catch (OutOfMemoryError e) {
return null;
} catch (IOException e) {
return null;
} finally {
isPipe.close();
isPipe.release();
}
}
@Override
public int sizeOf(@NonNull String key, @NonNull ImageBitmap value) {
return value.getWidth() * value.getHeight() * 4 /* value.getByteCount() TODO Update Image */;
}
@Override
public void onAddToMemoryCache(@NonNull ImageBitmap oldValue) {
oldValue.obtain();
}
@Override
public void onRemoveFromMemoryCache(@NonNull String key, @NonNull ImageBitmap oldValue) {
oldValue.release();
}
@Override
public boolean useMemoryCache(@NonNull String key, ImageBitmap value) {
if (value != null) {
return value.getWidth() * value.getHeight() <= MAX_CACHE_SIZE
/* value.getByteCount() <= MAX_CACHE_BYTE_COUNT TODO Update Image */;
} else {
return true;
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,68 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Browser;
import android.text.TextUtils;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.hippo.ehviewer.client.EhUrlOpener;
import com.hippo.ehviewer.ui.MainActivity;
import com.hippo.scene.Announcer;
import com.hippo.scene.StageActivity;
import com.hippo.util.ExceptionUtils;
public final class UrlOpener {
private UrlOpener() {
}
public static void openUrl(@NonNull Context context, String url, boolean ehUrl) {
if (TextUtils.isEmpty(url)) {
return;
}
Intent intent;
Uri uri = Uri.parse(url);
if (ehUrl) {
Announcer announcer = EhUrlOpener.parseUrl(url);
if (null != announcer) {
intent = new Intent(context, MainActivity.class);
intent.setAction(StageActivity.ACTION_START_SCENE);
intent.putExtra(StageActivity.KEY_SCENE_NAME, announcer.getClazz().getName());
intent.putExtra(StageActivity.KEY_SCENE_ARGS, announcer.getArgs());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return;
}
}
// Intent.ACTION_VIEW
intent = new Intent(Intent.ACTION_VIEW, uri);
intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
try {
context.startActivity(intent);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
Toast.makeText(context, R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();
}
}
}
@@ -0,0 +1,40 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
public class EhCacheKeyFactory {
public static String getThumbKey(long gid) {
return "preview:large:" + gid + ":" + 0; // "thumb:" + gid;
}
public static String getNormalPreviewKey(long gid, int index) {
return "preview:normal:" + gid + ":" + index;
}
public static String getLargePreviewKey(long gid, int index) {
return "preview:large:" + gid + ":" + index;
}
public static String getLargePreviewSetKey(long gid, int index) {
return "large_preview_set:" + gid + ":" + index;
}
public static String getImageKey(long gid, int index) {
return "image:" + gid + ":" + index;
}
}
@@ -0,0 +1,214 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.content.Context;
import android.os.AsyncTask;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.client.exception.CancelledException;
import com.hippo.util.ExceptionUtils;
import com.hippo.util.IoThreadPoolExecutor;
import com.hippo.yorozuya.SimpleHandler;
import java.io.File;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import okhttp3.Call;
import okhttp3.OkHttpClient;
public class EhClient {
public static final String TAG = EhClient.class.getSimpleName();
public static final int METHOD_SIGN_IN = 0;
public static final int METHOD_GET_GALLERY_LIST = 1;
public static final int METHOD_GET_GALLERY_DETAIL = 3;
public static final int METHOD_GET_PREVIEW_SET = 4;
public static final int METHOD_GET_RATE_GALLERY = 5;
public static final int METHOD_GET_COMMENT_GALLERY = 6;
public static final int METHOD_GET_GALLERY_TOKEN = 7;
public static final int METHOD_GET_FAVORITES = 8;
public static final int METHOD_ADD_FAVORITES = 9;
public static final int METHOD_ADD_FAVORITES_RANGE = 10;
public static final int METHOD_MODIFY_FAVORITES = 11;
public static final int METHOD_GET_TORRENT_LIST = 12;
public static final int METHOD_GET_PROFILE = 14;
public static final int METHOD_VOTE_COMMENT = 15;
public static final int METHOD_IMAGE_SEARCH = 16;
public static final int METHOD_ARCHIVE_LIST = 17;
public static final int METHOD_DOWNLOAD_ARCHIVE = 18;
private final ThreadPoolExecutor mRequestThreadPool;
private final OkHttpClient mOkHttpClient;
public EhClient(Context context) {
mRequestThreadPool = IoThreadPoolExecutor.getInstance();
mOkHttpClient = EhApplication.getOkHttpClient(context);
}
public void execute(EhRequest request) {
if (!request.isCancelled()) {
Task task = new Task(request.getMethod(), request.getCallback(), request.getEhConfig());
task.executeOnExecutor(mRequestThreadPool, request.getArgs());
request.task = task;
} else {
request.getCallback().onCancel();
}
}
public class Task extends AsyncTask<Object, Void, Object> {
private final int mMethod;
private Callback mCallback;
private EhConfig mEhConfig;
private final AtomicReference<Call> mCall = new AtomicReference<>();
private final AtomicBoolean mStop = new AtomicBoolean();
public Task(int method, Callback callback, EhConfig ehConfig) {
mMethod = method;
mCallback = callback;
mEhConfig = ehConfig;
}
// Called in Job thread
public void setCall(Call call) throws CancelledException {
if (mStop.get()) {
// Stopped Job thread
throw new CancelledException();
} else {
mCall.lazySet(call);
}
}
public EhConfig getEhConfig() {
return mEhConfig;
}
public void stop() {
if (!mStop.get()) {
mStop.lazySet(true);
if (mCallback != null) {
// TODO Avoid new runnable
final Callback finalCallback = mCallback;
SimpleHandler.getInstance().post(new Runnable() {
@Override
public void run() {
finalCallback.onCancel();
}
});
}
Status status = getStatus();
if (status == Status.PENDING) {
cancel(false);
} else if (status == Status.RUNNING) {
// It is running, cancel call if it is created
Call call = mCall.get();
if (call != null) {
call.cancel();
}
}
// Clear
mCallback = null;
mEhConfig = null;
mCall.lazySet(null);
}
}
@Override
@SuppressWarnings("unchecked")
protected Object doInBackground(Object... params) {
try {
switch (mMethod) {
case METHOD_SIGN_IN:
return EhEngine.signIn(this, mOkHttpClient, (String) params[0], (String) params[1]);
case METHOD_GET_GALLERY_LIST:
return EhEngine.getGalleryList(this, mOkHttpClient, (String) params[0]);
case METHOD_GET_GALLERY_DETAIL:
return EhEngine.getGalleryDetail(this, mOkHttpClient, (String) params[0]);
case METHOD_GET_PREVIEW_SET:
return EhEngine.getPreviewSet(this, mOkHttpClient, (String) params[0]);
case METHOD_GET_RATE_GALLERY:
return EhEngine.rateGallery(this, mOkHttpClient, (Long) params[0], (String) params[1], (Long) params[2], (String) params[3], (Float) params[4]);
case METHOD_GET_COMMENT_GALLERY:
return EhEngine.commentGallery(this, mOkHttpClient, (String) params[0], (String) params[1], (String) params[2]);
case METHOD_GET_GALLERY_TOKEN:
return EhEngine.getGalleryToken(this, mOkHttpClient, (Long) params[0], (String) params[1], (Integer) params[2]);
case METHOD_GET_FAVORITES:
return EhEngine.getFavorites(this, mOkHttpClient, (String) params[0], (Boolean) params[1]);
case METHOD_ADD_FAVORITES:
return EhEngine.addFavorites(this, mOkHttpClient, (Long) params[0], (String) params[1], (Integer) params[2], (String) params[3]);
case METHOD_ADD_FAVORITES_RANGE:
return EhEngine.addFavoritesRange(this, mOkHttpClient, (long[]) params[0], (String[]) params[1], (Integer) params[2]);
case METHOD_MODIFY_FAVORITES:
return EhEngine.modifyFavorites(this, mOkHttpClient, (String) params[0], (long[]) params[1], (Integer) params[2], (Boolean) params[3]);
case METHOD_GET_TORRENT_LIST:
return EhEngine.getTorrentList(this, mOkHttpClient, (String) params[0], (Long) params[1], (String) params[2]);
case METHOD_GET_PROFILE:
return EhEngine.getProfile(this, mOkHttpClient);
case METHOD_VOTE_COMMENT:
return EhEngine.voteComment(this, mOkHttpClient, (Long) params[0], (String) params[1], (Long) params[2], (String) params[3], (Long) params[4], (Integer) params[5]);
case METHOD_IMAGE_SEARCH:
return EhEngine.imageSearch(this, mOkHttpClient, (File) params[0], (Boolean) params[1], (Boolean) params[2], (Boolean) params[3]);
case METHOD_ARCHIVE_LIST:
return EhEngine.getArchiveList(this, mOkHttpClient, (String) params[0], (Long) params[1], (String) params[2]);
case METHOD_DOWNLOAD_ARCHIVE:
return EhEngine.downloadArchive(this, mOkHttpClient, (Long) params[0], (String) params[1], (String) params[2], (String) params[3]);
default:
return new IllegalStateException("Can't detect method " + mMethod);
}
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
return e;
}
}
@SuppressWarnings("unchecked")
@Override
protected void onPostExecute(Object result) {
if (mCallback != null) {
//noinspection StatementWithEmptyBody
if (!(result instanceof CancelledException)) {
if (result instanceof Exception) {
mCallback.onFailure((Exception) result);
} else {
mCallback.onSuccess(result);
}
} else {
// onCancel is called in stop
}
}
// Clear
mCallback = null;
mEhConfig = null;
mCall.lazySet(null);
}
}
public interface Callback<E> {
void onSuccess(E result);
void onFailure(Exception e);
void onCancel();
}
}
@@ -0,0 +1,818 @@
/*
* Copyright 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import com.hippo.network.InetValidator;
/**
* Some configurable stuff about EH. It ends up cookie.
*/
public class EhConfig implements Cloneable {
/**
* The Cookie key of uconfig
*/
public static final String KEY_UCONFIG = "uconfig";
/**
* The key of load images through the Hentai@Home Network
* @see #LOAD_FROM_HAH_YES
* @see #LOAD_FROM_HAH_NO
*/
private static final String KEY_LOAD_FROM_HAH = "uh";
/**
* The key of Image Size Settings
* @see #IMAGE_SIZE_AUTO
* @see #IMAGE_SIZE_780X
* @see #IMAGE_SIZE_980X
* @see #IMAGE_SIZE_1280X
* @see #IMAGE_SIZE_1600X
* @see #IMAGE_SIZE_2400X
*/
private static final String KEY_IMAGE_SIZE = "xr";
/**
* The key of scale images width
*/
private static final String KEY_SCALE_WIDTH = "rx";
/**
* The key of scale images height
*/
private static final String KEY_SCALE_HEIGHT = "ry";
/**
* The key of Gallery Name Display
* @see #GALLERY_TITLE_DEFAULT
* @see #GALLERY_TITLE_JAPANESE
*/
private static final String KEY_GALLERY_TITLE = "tl";
/**
* The key of the behavior for downloading archiver
* @see #ARCHIVER_DOWNLOAD_MAMS
* @see #ARCHIVER_DOWNLOAD_MAAS
* @see #ARCHIVER_DOWNLOAD_AAMS
* @see #ARCHIVER_DOWNLOAD_AAAS
*/
private static final String KEY_ARCHIVER_DOWNLOAD = "ar";
/**
* The key of display mode would you like to use on the front and search pages
* @see #LAYOUT_MODE_LIST
* @see #LAYOUT_MODE_THUMB
*/
private static final String KEY_LAYOUT_MODE = "dm";
/**
* The key for show popular
* @see #POPULAR_YES
* @see #POPULAR_NO
*/
private static final String KEY_POPULAR = "prn";
/**
* The key of categories would you like to view as default on the front page
*/
private static final String KEY_DEFAULT_CATEGORIES = "cats";
/**
* The key for favorites sort
* @see #FAVORITES_SORT_GALLERY_UPDATE_TIME
* @see #FAVORITES_SORT_FAVORITED_TIME
*/
private static final String KEY_FAVORITES_SORT = "fs";
/**
* The key of exclude certain namespaces from a default tag search
*/
private static final String KEY_EXCLUDED_NAMESPACES = "xns";
/**
* The key of hide galleries in certain languages from the gallery list and searches
*/
private static final String KEY_EXCLUDED_LANGUAGES = "xl";
/**
* The key of how many results would you like per page for the index/search page and torrent search pages
* @see #RESULT_COUNT_25
* @see #RESULT_COUNT_50
* @see #RESULT_COUNT_100
* @see #RESULT_COUNT_200
*/
private static final String KEY_RESULT_COUNT = "rc";
/**
* The key of mouse-over thumb
* @see #MOUSE_OVER_YES
* @see #MOUSE_OVER_NO
*/
private static final String KEY_MOUSE_OVER = "lt";
/**
* The key of preview size
* @see #PREVIEW_SIZE_NORMAL
* @see #PREVIEW_SIZE_LARGE
*/
private static final String KEY_PREVIEW_SIZE = "ts";
/**
* The key of preview row per page
* @see #PREVIEW_ROW_4
* @see #PREVIEW_ROW_10
* @see #PREVIEW_ROW_20
* @see #PREVIEW_ROW_40
*/
private static final String KEY_PREVIEW_ROW = "tr";
/**
* The key of sort order for gallery comments
* @see #COMMENTS_SORT_OLDEST_FIRST
* @see #COMMENTS_SORT_RECENT_FIRST
* @see #COMMENTS_SORT_HIGHEST_SCORE_FIRST
*/
private static final String KEY_COMMENTS_SORT = "cs";
/**
* The key of show gallery comment votes
* @see #COMMENTS_VOTES_POP
* @see #COMMENTS_VOTES_ALWAYS
*/
private static final String KEY_COMMENTS_VOTES = "sc";
/**
* The key of sort order for gallery tags
* @see #TAGS_SORT_ALPHABETICAL
* @see #TAGS_SORT_POWER
*/
private static final String KEY_TAGS_SORT = "to";
/**
* The key of show gallery page numbers
* @see #SHOW_GALLERY_INDEX_NO
* @see #SHOW_GALLERY_INDEX_YES
*/
private static final String KEY_SHOW_GALLERY_INDEX = "pn";
/**
* The key of the IP:Port of a proxy-enabled Hentai@Home Client
* to load all images
*/
private static final String KEY_HAH_CLIENT_IP_PORT = "hp";
/**
* The key of the passkey of a proxy-enabled Hentai@Home Client
* to load all images
*/
private static final String KEY_HAH_CLIENT_PASSKEY = "hk";
/**
* The key of enable Tag Flagging
* @see #ENABLE_TAG_FLAGGING_NO
* @see #ENABLE_TAG_FLAGGING_YES
*/
private static final String KEY_ENABLE_TAG_FLAGGING = "tf";
/**
* The key of always display the original images instead of the resampled versions
* @see #ALWAYS_ORIGINAL_NO
* @see #ALWAYS_ORIGINAL_YES
*/
private static final String KEY_ALWAYS_ORIGINAL = "oi";
/**
* The key of enable the multi-Page Viewer
* @see #MULTI_PAGE_NO
* @see #MULTI_PAGE_YES
*/
private static final String KEY_MULTI_PAGE = "qb";
/**
* The key of multi-Page Viewer Display Style
* @see #MULTI_PAGE_STYLE_C
* @see #MULTI_PAGE_STYLE_N
* @see #MULTI_PAGE_STYLE_Y
*/
private static final String KEY_MULTI_PAGE_STYLE = "ms";
/**
* The key of multi-Page Viewer Thumbnail Pane
* @see #MULTI_PAGE_THUMB_HIDE
* @see #MULTI_PAGE_THUMB_SHOW
*/
private static final String KEY_MULTI_PAGE_THUMB = "mt";
/**
* The Cookie key of lofi resolution
*/
public static final String KEY_LOFI_RESOLUTION = "xres";
/**
* The Cookie key of show warning
*/
public static final String KEY_CONTENT_WARNING = "nw";
/**
* load images through the Hentai@Home Network
*/
public static final String LOAD_FROM_HAH_YES = "y";
/**
* do not load images through the Hentai@Home Network
*/
public static final String LOAD_FROM_HAH_NO = "n";
/**
* Image Size Auto
*/
public static final String IMAGE_SIZE_AUTO = "a";
/**
* Image Size 780x
*/
public static final String IMAGE_SIZE_780X = "780";
/**
* Image Size 980x
*/
public static final String IMAGE_SIZE_980X = "980";
/**
* Image Size 1280x
*/
public static final String IMAGE_SIZE_1280X = "1280";
/**
* Image Size 1600x
*/
public static final String IMAGE_SIZE_1600X = "1600";
/**
* Image Size 2400x
*/
public static final String IMAGE_SIZE_2400X = "2400";
/**
* Default gallery title
*/
private static final String GALLERY_TITLE_DEFAULT = "r";
/**
* Japanese gallery title
*/
private static final String GALLERY_TITLE_JAPANESE = "j";
/**
* Manual Accept, Manual Start
*/
public static final String ARCHIVER_DOWNLOAD_MAMS = "0";
/**
* >Manual Accept, Auto Start
*/
public static final String ARCHIVER_DOWNLOAD_AAMS = "1";
/**
* Auto Accept, Manual Start
*/
public static final String ARCHIVER_DOWNLOAD_MAAS = "2";
/**
* Auto Accept, Auto Start
*/
public static final String ARCHIVER_DOWNLOAD_AAAS = "3";
/**
* List View on the front and search pages
*/
public static final String LAYOUT_MODE_LIST = "l";
/**
* Thumbnail View on the front and search pages
*/
public static final String LAYOUT_MODE_THUMB = "t";
/**
* Show popular
*/
private static final String POPULAR_YES = "y";
/**
* Don't show popular
*/
private static final String POPULAR_NO = "n";
public static final int MISC = 0x1;
public static final int DOUJINSHI = 0x2;
public static final int MANGA = 0x4;
public static final int ARTIST_CG = 0x8;
public static final int GAME_CG = 0x10;
public static final int IMAGE_SET = 0x20;
public static final int COSPLAY = 0x40;
public static final int ASIAN_PORN = 0x80;
public static final int NON_H = 0x100;
public static final int WESTERN = 0x200;
public static final int ALL_CATEGORY = 0x3ff;
public static final int NAMESPACES_RECLASS = 0x1;
public static final int NAMESPACES_LANGUAGE = 0x2;
public static final int NAMESPACES_PARODY = 0x4;
public static final int NAMESPACES_CHARACTER = 0x8;
public static final int NAMESPACES_GROUP = 0x10;
public static final int NAMESPACES_ARTIST = 0x20;
public static final int NAMESPACES_MALE = 0x40;
public static final int NAMESPACES_FEMALE = 0x80;
public static final String JAPANESE_ORIGINAL = "0";
public static final String JAPANESE_TRANSLATED = "1024";
public static final String JAPANESE_REWRITE = "2048";
public static final String ENGLISH_ORIGINAL = "1";
public static final String ENGLISH_TRANSLATED = "1025";
public static final String ENGLISH_REWRITE = "2049";
public static final String CHINESE_ORIGINAL = "10";
public static final String CHINESE_TRANSLATED = "1034";
public static final String CHINESE_REWRITE = "2058";
public static final String DUTCH_ORIGINAL = "20";
public static final String DUTCH_TRANSLATED = "1044";
public static final String DUTCH_REWRITE = "2068";
public static final String FRENCH_ORIGINAL = "30";
public static final String FRENCH_TRANSLATED = "1054";
public static final String FRENCH_REWRITE = "2078";
public static final String GERMAN_ORIGINAL = "40";
public static final String GERMAN_TRANSLATED = "1064";
public static final String GERMAN_REWRITE = "2088";
public static final String HUNGARIAN_ORIGINAL = "50";
public static final String HUNGARIAN_TRANSLATED = "1074";
public static final String HUNGARIAN_REWRITE = "2098";
public static final String ITALIAN_ORIGINAL = "60";
public static final String ITALIAN_TRANSLATED = "1084";
public static final String ITALIAN_REWRITE = "2108";
public static final String KOREAN_ORIGINAL = "70";
public static final String KOREAN_TRANSLATED = "1094";
public static final String KOREAN_REWRITE = "2118";
public static final String POLISH_ORIGINAL = "80";
public static final String POLISH_TRANSLATED = "1104";
public static final String POLISH_REWRITE = "2128";
public static final String PORTUGUESE_ORIGINAL = "90";
public static final String PORTUGUESE_TRANSLATED = "1114";
public static final String PORTUGUESE_REWRITE = "2138";
public static final String RUSSIAN_ORIGINAL = "100";
public static final String RUSSIAN_TRANSLATED = "1124";
public static final String RUSSIAN_REWRITE = "2148";
public static final String SPANISH_ORIGINAL = "110";
public static final String SPANISH_TRANSLATED = "1134";
public static final String SPANISH_REWRITE = "2158";
public static final String THAI_ORIGINAL = "120";
public static final String THAI_TRANSLATED = "1144";
public static final String THAI_REWRITE = "2168";
public static final String VIETNAMESE_ORIGINAL = "130";
public static final String VIETNAMESE_TRANSLATED = "1154";
public static final String VIETNAMESE_REWRITE = "2178";
public static final String NA_ORIGINAL = "254";
public static final String NA_TRANSLATED = "1278";
public static final String NA_REWRITE = "2302";
public static final String OTHER_ORIGINAL = "255";
public static final String OTHER_TRANSLATED = "1279";
public static final String OTHER_REWRITE = "2303";
/**
* Sort favorites by last gallery update time
*/
private static final String FAVORITES_SORT_GALLERY_UPDATE_TIME = "p";
/**
* Sort favorites by favorited time
*/
private static final String FAVORITES_SORT_FAVORITED_TIME = "f";
/**
* 25 results per page for the index/search page and torrent search pages
*/
public static final String RESULT_COUNT_25 = "0";
/**
* 50 results per page for the index/search page and torrent search pages
*/
public static final String RESULT_COUNT_50 = "1";
/**
* 100 results per page for the index/search page and torrent search pages
*/
public static final String RESULT_COUNT_100 = "2";
/**
* 200 results per page for the index/search page and torrent search pages
*/
public static final String RESULT_COUNT_200 = "3";
/**
* On mouse-over
*/
public static final String MOUSE_OVER_YES = "m";
/**
* On page load
*/
public static final String MOUSE_OVER_NO = "p";
/**
* Preview normal size
*/
public static final String PREVIEW_SIZE_NORMAL = "m";
/**
* Preview large size
*/
public static final String PREVIEW_SIZE_LARGE = "l";
/**
* 4 row preview per page
*/
public static final String PREVIEW_ROW_4 = "2";
/**
* 10 row preview per page
*/
public static final String PREVIEW_ROW_10 = "5";
/**
* 20 row preview per page
*/
public static final String PREVIEW_ROW_20 = "10";
/**
* 40 row preview per page
*/
public static final String PREVIEW_ROW_40 = "20";
/**
* Oldest comments first
*/
public static final String COMMENTS_SORT_OLDEST_FIRST = "a";
/**
* Recent comments first
*/
public static final String COMMENTS_SORT_RECENT_FIRST = "d";
/**
* By highest score
*/
public static final String COMMENTS_SORT_HIGHEST_SCORE_FIRST = "s";
/**
* Show gallery comment votes On score hover or click
*/
public static final String COMMENTS_VOTES_POP = "0";
/**
* Always show gallery comment votes
*/
public static final String COMMENTS_VOTES_ALWAYS = "1";
/**
* Sort order for gallery tags alphabetically
*/
public static final String TAGS_SORT_ALPHABETICAL = "a";
/**
* Sort order for gallery tags by tag power
*/
public static final String TAGS_SORT_POWER = "p";
/**
* Show gallery page numbers
*/
public static final String SHOW_GALLERY_INDEX_YES = "1";
/**
* Do not show gallery page numbers
*/
public static final String SHOW_GALLERY_INDEX_NO = "0";
/**
* Enable Tag Flagging
*/
public static final String ENABLE_TAG_FLAGGING_YES = "y";
/**
* Do not enable Tag Flagging
*/
public static final String ENABLE_TAG_FLAGGING_NO = "n";
/**
* Always display the original images
*/
public static final String ALWAYS_ORIGINAL_YES = "y";
/**
* Do not Always display the original images
*/
public static final String ALWAYS_ORIGINAL_NO = "n";
/**
* Enable the Multi-Page Viewe
*/
public static final String MULTI_PAGE_YES = "y";
/**
* Do not enable the Multi-Page Viewe
*/
public static final String MULTI_PAGE_NO = "n";
/**
* Align left, only scale if image is larger than browser width
*/
public static final String MULTI_PAGE_STYLE_N = "n";
/**
* Align center, only scale if image is larger than browser width
*/
public static final String MULTI_PAGE_STYLE_C = "c";
/**
* Align center, Always scale images to fit browser width
*/
public static final String MULTI_PAGE_STYLE_Y = "y";
/**
* Show Multi-Page Viewer Thumbnail Pane
*/
public static final String MULTI_PAGE_THUMB_SHOW = "n";
/**
* Hide Multi-Page Viewer Thumbnail Pane
*/
public static final String MULTI_PAGE_THUMB_HIDE = "y";
/**
* 460x for lofi resolution
*/
public static final String LOFI_RESOLUTION_460X = "1";
/**
* 780X for lofi resolution
*/
public static final String LOFI_RESOLUTION_780X = "2";
/**
* 980X for lofi resolution
*/
public static final String LOFI_RESOLUTION_980X = "3";
/**
* show warning
*/
public static final String CONTENT_WARNING_SHOW = "0";
/**
* not show warning
*/
public static final String CONTENT_WARNING_NOT_SHOW = "1";
/**
* Load images through the Hentai@Home Network<br/>
* key: {@link #KEY_LOAD_FROM_HAH}<br/>
* value: {@link #LOAD_FROM_HAH_YES}, {@link #LOAD_FROM_HAH_NO}
*/
public String loadFromHAH = LOAD_FROM_HAH_YES;
/**
* Image Size<br/>
* key: {@link #KEY_IMAGE_SIZE}<br/>
* value: {@link #IMAGE_SIZE_AUTO}, {@link #IMAGE_SIZE_780X}, {@link #IMAGE_SIZE_980X},
* {@link #IMAGE_SIZE_1280X}, {@link #IMAGE_SIZE_1600X}, {@link #IMAGE_SIZE_2400X}
*/
public String imageSize = IMAGE_SIZE_AUTO;
/**
* Scale width<br/>
* key: {@link #KEY_SCALE_WIDTH}<br/>
* value: 0 for no limit
*/
public int scaleWidth = 0;
/**
* Scale height<br/>
* key: {@link #KEY_SCALE_HEIGHT}<br/>
* value: 0 for no limit
*/
public int scaleHeight = 0;
/**
* Gallery title<br/>
* key: {@link #KEY_GALLERY_TITLE}<br/>
* value: {@link #GALLERY_TITLE_DEFAULT}, {@link #GALLERY_TITLE_JAPANESE}
*/
public String galleryTitle = GALLERY_TITLE_DEFAULT;
/**
* The default behavior for downloading an archiver<br/>
* key: {@link #KEY_ARCHIVER_DOWNLOAD}<br/>
* value: {@link #ARCHIVER_DOWNLOAD_MAMS}, {@link #ARCHIVER_DOWNLOAD_AAMS},
* {@link #ARCHIVER_DOWNLOAD_MAAS}, {@link #ARCHIVER_DOWNLOAD_AAAS}
*/
public String archiverDownload = ARCHIVER_DOWNLOAD_MAMS;
/**
* Display mode used on the front and search pages<br/>
* false for list, true for thumb<br/>
* key: {@link #KEY_LAYOUT_MODE}<br/>
* value: {@link #LAYOUT_MODE_LIST}, {@link #LAYOUT_MODE_THUMB}
*/
public String layoutMode = LAYOUT_MODE_LIST;
/**
* Show popular or not<br/>
* key: {@link #KEY_POPULAR}<br/>
* value: {@link #POPULAR_YES}, {@link #POPULAR_NO}
*/
public String popular = POPULAR_YES;
/**
* Default categories on the front page<br/>
* key: {@link #KEY_DEFAULT_CATEGORIES}<br/>
* value: the value of categories, for multiple use & operation,
* 0 for none
*/
public int defaultCategories = 0;
/**
* <br/>
* key: {@link #KEY_FAVORITES_SORT}<br/>
* value: {@link #FAVORITES_SORT_GALLERY_UPDATE_TIME}, {@link #FAVORITES_SORT_FAVORITED_TIME}
*/
public String favoritesSort = FAVORITES_SORT_FAVORITED_TIME;
/**
* Certain namespaces excluded from a default tag search<br/>
* key: {@link #KEY_EXCLUDED_NAMESPACES}<br/>
* value: the value of namespaces, for multiple use & operation,
* 0 for none
*/
public int excludedNamespaces = 0;
/**
* Certain languages excluded from list and searches<br/>
* key: {@link #KEY_EXCLUDED_LANGUAGES}<br/>
* value: {@link #JAPANESE_TRANSLATED}, {@link #JAPANESE_REWRITE} ...
* For multiple languages, use <code>x<code/> to combine them, like 1x1024x2048
*/
public String excludedLanguages = "";
/**
* How many results would you like per page for the index/search page
* and torrent search pages<br/>
* key: {@link #KEY_RESULT_COUNT}<br/>
* value: {@link #RESULT_COUNT_25}, {@link #RESULT_COUNT_50},
* {@link #RESULT_COUNT_100}, {@link #RESULT_COUNT_200}<br/>
* Require <code>Hath Perk:Paging Enlargement</code>
*/
public String resultCount = RESULT_COUNT_25;
/**
* mouse-over thumb<br/>
* key: {@link #KEY_MOUSE_OVER}<br/>
* value: {@link #MOUSE_OVER_YES}, {@link #MOUSE_OVER_NO}
*/
public String mouseOver = MOUSE_OVER_YES;
/**
* Default preview mode<br/>
* key: {@link #KEY_PREVIEW_SIZE}<br/>
* value: {@link #PREVIEW_SIZE_NORMAL}, {@link #PREVIEW_SIZE_LARGE}
*/
public String previewSize = PREVIEW_SIZE_LARGE;
/**
* Preview row<br/>
* key: {@link #KEY_PREVIEW_ROW}<br/>
* value: {@link #PREVIEW_ROW_4}, {@link #PREVIEW_ROW_10},
* {@link #PREVIEW_ROW_20}, {@link #PREVIEW_ROW_40}
*/
public String previewRow = PREVIEW_ROW_4;
/**
* Sort order for gallery comments<br/>
* key: {@link #KEY_COMMENTS_SORT}<br/>
* value: {@link #COMMENTS_SORT_OLDEST_FIRST}, {@link #COMMENTS_SORT_RECENT_FIRST},
* {@link #COMMENTS_SORT_HIGHEST_SCORE_FIRST}
*/
public String commentSort = COMMENTS_SORT_OLDEST_FIRST;
/**
* Show gallery comment votes mode<br/>
* key: {@link #KEY_COMMENTS_VOTES}<br/>
* value: {@link #COMMENTS_VOTES_POP}, {@link #COMMENTS_VOTES_ALWAYS}
*/
public String commentVotes = COMMENTS_VOTES_POP;
/**
* Sort order for gallery tags<br/>
* key: {@link #KEY_TAGS_SORT}<br/>
* value: {@link #TAGS_SORT_ALPHABETICAL}, {@link #TAGS_SORT_POWER}
*/
public String tagSort = TAGS_SORT_ALPHABETICAL;
/**
* Show gallery page numbers<br/>
* key: {@link #KEY_SHOW_GALLERY_INDEX}<br/>
* value: {@link #SHOW_GALLERY_INDEX_YES}, {@link #SHOW_GALLERY_INDEX_NO}
*/
public String showGalleryIndex = SHOW_GALLERY_INDEX_YES;
/**
* The IP of a proxy-enabled Hentai@Home Client
* to load all images<br/>
* key: {@link #KEY_HAH_CLIENT_IP_PORT}<br/>
*/
public String hahClientIp = "";
/**
* The PORT of a proxy-enabled Hentai@Home Client
* to load all images<br/>
* key: {@link #KEY_HAH_CLIENT_IP_PORT}<br/>
*/
public int hahClientPort = -1;
/**
* The passkey of a proxy-enabled Hentai@Home Client
* to load all images<br/>
* key: {@link #KEY_HAH_CLIENT_PASSKEY}<br/>
*/
public String hahClientPasskey = "";
/**
* Enable tag flagging
* key: {@link #KEY_ENABLE_TAG_FLAGGING}<br/>
* value: {@link #ENABLE_TAG_FLAGGING_YES}, {@link #ENABLE_TAG_FLAGGING_NO}<br/>
* <code>Bronze Star</code> or <code>Hath Perk: Tag Flagging</code> Required
*/
public String enableTagFlagging = ENABLE_TAG_FLAGGING_NO;
/**
* Always display the original images instead of the resampled versions<br/>
* key: {@link #KEY_ALWAYS_ORIGINAL}<br/>
* value: {@link #ALWAYS_ORIGINAL_YES}, {@link #ALWAYS_ORIGINAL_NO}<br/>
* <code>Silver Star</code> or <code>Hath Perk: Source Nexus</code> Required
*/
public String alwaysOriginal = ALWAYS_ORIGINAL_NO;
/**
* Enable the multi-Page Viewer<br/>
* key: {@link #KEY_MULTI_PAGE}<br/>
* value: {@link #MULTI_PAGE_YES}, {@link #MULTI_PAGE_NO}<br/>
* <code>Gold Star</code> or <code>Hath Perk: Multi-Page Viewer</code> Required
*/
public String multiPage = MULTI_PAGE_NO;
/**
* Multi-Page Viewer Display Style<br/>
* key: {@link #KEY_MULTI_PAGE_STYLE}<br/>
* value: {@link #MULTI_PAGE_STYLE_N}, {@link #MULTI_PAGE_STYLE_C},
* {@link #MULTI_PAGE_STYLE_Y}<br/>
* <code>Gold Star</code> or <code>Hath Perk: Multi-Page Viewer</code> Required
*/
public String multiPageStyle = MULTI_PAGE_STYLE_N;
/**
* Multi-Page Viewer Thumbnail Pane<br/>
* key: {@link #KEY_MULTI_PAGE_THUMB}<br/>
* value: {@link #MULTI_PAGE_THUMB_SHOW}, {@link #MULTI_PAGE_THUMB_HIDE}<br/>
* <code>Gold Star</code> or <code>Hath Perk: Multi-Page Viewer</code> Required
*/
public String multiPageThumb = MULTI_PAGE_THUMB_SHOW;
/**
* Lofi resolution
* key: {@link #KEY_LOFI_RESOLUTION}<br/>
* value: {@link #LOFI_RESOLUTION_460X}, {@link #LOFI_RESOLUTION_780X},
* {@link #LOFI_RESOLUTION_980X}
*/
public String lofiResolution = LOFI_RESOLUTION_980X;
/**
* Show content warning
* key: {@link #KEY_CONTENT_WARNING}<br/>
* value: {@link #CONTENT_WARNING_SHOW}, {@link #CONTENT_WARNING_NOT_SHOW}
*/
public String contentWarning = CONTENT_WARNING_NOT_SHOW;
private String mUconfig;
private boolean mDirty = true;
@Override
public EhConfig clone() {
try {
return (EhConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(e);
}
}
public synchronized void setDirty() {
mDirty = true;
}
private void updateUconfig() {
String hahClientIpPort = (InetValidator.isValidInet4Address(hahClientIp) &&
InetValidator.isValidInetPort(hahClientPort)) ?
hahClientIp + "%3A" + hahClientPort : "";
String hahClientPasskey = null == this.hahClientPasskey ? "" : this.hahClientPasskey;
mUconfig = KEY_LOAD_FROM_HAH + "_" + loadFromHAH + "-" +
KEY_IMAGE_SIZE + "_" + imageSize + "-" +
KEY_SCALE_WIDTH + "_" + scaleWidth + "-" +
KEY_SCALE_HEIGHT + "_" + scaleHeight + "-" +
KEY_GALLERY_TITLE + "_" + galleryTitle + "-" +
KEY_ARCHIVER_DOWNLOAD + "_" + archiverDownload + "-" +
KEY_LAYOUT_MODE + "_" + layoutMode + "-" +
KEY_POPULAR + "_" + popular + "-" +
KEY_DEFAULT_CATEGORIES + "_" + defaultCategories + "-" +
KEY_FAVORITES_SORT + "_" + favoritesSort + "-" +
KEY_EXCLUDED_NAMESPACES + "_" + excludedNamespaces + "-" +
KEY_EXCLUDED_LANGUAGES + "_" + excludedLanguages + "-" +
KEY_RESULT_COUNT + "_" + resultCount + "-" +
KEY_MOUSE_OVER + "_" + mouseOver + "-" +
KEY_PREVIEW_SIZE + "_" + previewSize + "-" +
KEY_PREVIEW_ROW + "_" + previewRow + "-" +
KEY_COMMENTS_SORT + "_" + commentSort + "-" +
KEY_COMMENTS_VOTES + "_" + commentVotes + "-" +
KEY_TAGS_SORT + "_" + tagSort + "-" +
KEY_SHOW_GALLERY_INDEX + "_" + showGalleryIndex + "-" +
KEY_HAH_CLIENT_IP_PORT + "_" + hahClientIpPort + "-" +
KEY_HAH_CLIENT_PASSKEY + "_" + hahClientPasskey + "-" +
KEY_ENABLE_TAG_FLAGGING + "_" + enableTagFlagging + "-" +
KEY_ALWAYS_ORIGINAL + "_" + alwaysOriginal + "-" +
KEY_MULTI_PAGE + "_" + multiPage + "-" +
KEY_MULTI_PAGE_STYLE + "_" + multiPageStyle + "-" +
KEY_MULTI_PAGE_THUMB + "_" + multiPageThumb;
}
public synchronized String uconfig() {
if (mDirty) {
mDirty = false;
updateUconfig();
}
return mUconfig;
}
}
@@ -0,0 +1,113 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.content.Context;
import com.hippo.network.CookieRepository;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import okhttp3.Cookie;
import okhttp3.HttpUrl;
public class EhCookieStore extends CookieRepository {
public static final String KEY_IPD_MEMBER_ID = "ipb_member_id";
public static final String KEY_IPD_PASS_HASH = "ipb_pass_hash";
public static final String KEY_IGNEOUS = "igneous";
public static final Cookie sTipsCookie =
new Cookie.Builder()
.name(EhConfig.KEY_CONTENT_WARNING)
.value(EhConfig.CONTENT_WARNING_NOT_SHOW)
.domain(EhUrl.DOMAIN_E)
.path("/")
.expiresAt(Long.MAX_VALUE)
.build();
public EhCookieStore(Context context) {
super(context, "okhttp3-cookie.db");
}
public void signOut() {
clear();
}
public boolean hasSignedIn() {
HttpUrl url = HttpUrl.parse(EhUrl.HOST_E);
return contains(url, KEY_IPD_MEMBER_ID) &&
contains(url, KEY_IPD_PASS_HASH);
}
public static Cookie newCookie(Cookie cookie, String newDomain, boolean forcePersistent,
boolean forceLongLive, boolean forceNotHostOnly) {
Cookie.Builder builder = new Cookie.Builder();
builder.name(cookie.name());
builder.value(cookie.value());
if (forceLongLive) {
builder.expiresAt(Long.MAX_VALUE);
} else if (cookie.persistent()) {
builder.expiresAt(cookie.expiresAt());
} else if (forcePersistent) {
builder.expiresAt(Long.MAX_VALUE);
}
if (cookie.hostOnly() && !forceNotHostOnly) {
builder.hostOnlyDomain(newDomain);
} else {
builder.domain(newDomain);
}
builder.path(cookie.path());
if (cookie.secure()) {
builder.secure();
}
if (cookie.httpOnly()) {
builder.httpOnly();
}
return builder.build();
}
@Override
public List<Cookie> loadForRequest(HttpUrl url) {
List<Cookie> cookies = super.loadForRequest(url);
boolean checkTips = domainMatch(url, EhUrl.DOMAIN_E);
if (checkTips) {
List<Cookie> result = new ArrayList<>(cookies.size() + 1);
// Add all but skip some
for (Cookie cookie: cookies) {
String name = cookie.name();
if (EhConfig.KEY_CONTENT_WARNING.equals(name)) {
continue;
}
if (EhConfig.KEY_UCONFIG.equals(name)) {
continue;
}
result.add(cookie);
}
// Add some
result.add(sTipsCookie);
return Collections.unmodifiableList(result);
} else {
return cookies;
}
}
}
@@ -0,0 +1,90 @@
/*
* Copyright 2018 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
/*
* Created by Hippo on 2018/3/23.
*/
import android.content.Context;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.Hosts;
import com.hippo.ehviewer.Settings;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.Dns;
public class EhDns implements Dns {
private static final Map<String, InetAddress> builtInHosts;
static {
Map<String, InetAddress> map = new HashMap<>();
put(map, "e-hentai.org", "104.20.26.25");
put(map, "repo.e-hentai.org", "94.100.29.73");
put(map, "forums.e-hentai.org", "94.100.18.243");
put(map, "ehgt.org", "81.171.14.118");
put(map, "ul.ehgt.org", "94.100.24.82");
put(map, "github.com", "192.30.255.112");
put(map, "raw.githubusercontent.com", "151.101.0.133");
builtInHosts = map;
}
private static void put(Map<String, InetAddress> map, String host, String ip) {
InetAddress address = Hosts.toInetAddress(host, ip);
if (address != null) {
map.put(host, address);
}
}
private final Hosts hosts;
public EhDns(Context context) {
hosts = EhApplication.getHosts(context);
}
@Override
public List<InetAddress> lookup(String hostname) throws UnknownHostException {
if (hostname == null) throw new UnknownHostException("hostname == null");
InetAddress inetAddress = hosts.get(hostname);
if (inetAddress != null) {
return Collections.singletonList(inetAddress);
}
if (Settings.getBuiltInHosts()) {
inetAddress = builtInHosts.get(hostname);
if (inetAddress != null) {
return Collections.singletonList(inetAddress);
}
}
try {
return Arrays.asList(InetAddress.getAllByName(hostname));
} catch (NullPointerException e) {
UnknownHostException unknownHostException =
new UnknownHostException("Broken system behaviour for dns lookup of " + hostname);
unknownHostException.initCause(e);
throw unknownHostException;
}
}
}
@@ -0,0 +1,993 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.AppConfig;
import com.hippo.ehviewer.GetText;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.client.data.GalleryCommentList;
import com.hippo.ehviewer.client.data.GalleryDetail;
import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.client.data.PreviewSet;
import com.hippo.ehviewer.client.exception.CancelledException;
import com.hippo.ehviewer.client.exception.EhException;
import com.hippo.ehviewer.client.exception.NoHAtHClientException;
import com.hippo.ehviewer.client.exception.ParseException;
import com.hippo.ehviewer.client.parser.ArchiveParser;
import com.hippo.ehviewer.client.parser.FavoritesParser;
import com.hippo.ehviewer.client.parser.ForumsParser;
import com.hippo.ehviewer.client.parser.GalleryApiParser;
import com.hippo.ehviewer.client.parser.GalleryDetailParser;
import com.hippo.ehviewer.client.parser.GalleryListParser;
import com.hippo.ehviewer.client.parser.GalleryPageApiParser;
import com.hippo.ehviewer.client.parser.GalleryPageParser;
import com.hippo.ehviewer.client.parser.GalleryTokenApiParser;
import com.hippo.ehviewer.client.parser.ProfileParser;
import com.hippo.ehviewer.client.parser.RateGalleryParser;
import com.hippo.ehviewer.client.parser.SignInParser;
import com.hippo.ehviewer.client.parser.TorrentParser;
import com.hippo.ehviewer.client.parser.VoteCommentParser;
import com.hippo.network.StatusCodeException;
import com.hippo.util.ExceptionUtils;
import com.hippo.yorozuya.AssertUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.Call;
import okhttp3.FormBody;
import okhttp3.Headers;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.json.JSONArray;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class EhEngine {
private static final String TAG = EhEngine.class.getSimpleName();
private static final String SAD_PANDA_DISPOSITION = "inline; filename=\"sadpanda.jpg\"";
private static final String SAD_PANDA_TYPE = "image/gif";
private static final String SAD_PANDA_LENGTH = "9615";
private static final String KOKOMADE_URL = "https://exhentai.org/img/kokomade.jpg";
public static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
private static final MediaType MEDIA_TYPE_JPEG = MediaType.parse("image/jpeg");
private static final Pattern PATTERN_NEED_HATH_CLIENT = Pattern.compile("(You must have a H@H client assigned to your account to use this feature\\.)");
public static EhFilter sEhFilter;
public static void initialize() {
sEhFilter = EhFilter.getInstance();
}
private static void doThrowException(Call call, int code, @Nullable Headers headers,
@Nullable String body, Throwable e) throws Throwable {
if (call.isCanceled()) {
throw new CancelledException();
}
// Check sad panda
if (headers != null && SAD_PANDA_DISPOSITION.equals(headers.get("Content-Disposition")) &&
SAD_PANDA_TYPE.equals(headers.get("Content-Type")) &&
SAD_PANDA_LENGTH.equals(headers.get("Content-Length"))) {
throw new EhException("Sad Panda");
}
// Check kokomade
if (body != null && body.contains(KOKOMADE_URL)) {
throw new EhException("今回はここまで\n\n" + GetText.getString(R.string.kokomade_tip));
}
if (e instanceof ParseException) {
if (body != null && !body.contains("<")) {
throw new EhException(body);
} else if (TextUtils.isEmpty(body)) {
throw new EhException(GetText.getString(R.string.error_empty_html));
} else {
if (Settings.getSaveParseErrorBody()) {
AppConfig.saveParseErrorBody((ParseException) e);
}
throw new EhException(GetText.getString(R.string.error_parse_error));
}
}
if (code >= 400) {
throw new StatusCodeException(code);
}
if (e != null) {
throw e;
}
}
private static void throwException(Call call, int code, @Nullable Headers headers,
@Nullable String body, Throwable e) throws Throwable {
try {
doThrowException(call, code, headers, body, e);
} catch (Throwable error) {
error.printStackTrace();
throw error;
}
}
public static String signIn(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String username, String password) throws Throwable {
FormBody.Builder builder = new FormBody.Builder()
.add("UserName", username)
.add("PassWord", password)
.add("submit", "Log me in")
.add("CookieDate", "1")
.add("temporary_https", "off");
String url = EhUrl.API_SIGN_IN;
String referer = "https://forums.e-hentai.org/index.php?act=Login&CODE=00";
String origin = "https://forums.e-hentai.org";
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return SignInParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
private static void fillGalleryList(@Nullable EhClient.Task task, OkHttpClient okHttpClient, List<GalleryInfo> list, String url, boolean filter) throws Throwable {
// Filter title and uploader
if (filter) {
for (int i = 0, n = list.size(); i < n; i++) {
GalleryInfo info = list.get(i);
if (!sEhFilter.filterTitle(info) || !sEhFilter.filterUploader(info)) {
list.remove(i);
i--;
n--;
}
}
}
boolean hasTags = false;
boolean hasPages = false;
boolean hasRated = false;
for (GalleryInfo gi : list) {
if (gi.simpleTags != null) {
hasTags = true;
}
if (gi.pages != 0) {
hasPages = true;
}
if (gi.rated) {
hasRated = true;
}
}
boolean needApi = (filter && sEhFilter.needTags() && !hasTags) ||
(Settings.getShowGalleryPages() && !hasPages) ||
hasRated;
if (needApi) {
fillGalleryListByApi(task, okHttpClient, list, url);
}
// Filter tag
if (filter) {
for (int i = 0, n = list.size(); i < n; i++) {
GalleryInfo info = list.get(i);
// Thumbnail mode need filter uploader again
if (!sEhFilter.filterUploader(info) || !sEhFilter.filterTag(info) || !sEhFilter.filterTagNamespace(info)) {
list.remove(i);
i--;
n--;
}
}
}
for (GalleryInfo info : list) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
}
public static GalleryListParser.Result getGalleryList(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url) throws Throwable {
String referer = EhUrl.getReferer();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
GalleryListParser.Result result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = GalleryListParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
fillGalleryList(task, okHttpClient, result.galleryInfoList, url, true);
return result;
}
// At least, GalleryInfo contain valid gid and token
public static List<GalleryInfo> fillGalleryListByApi(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
List<GalleryInfo> galleryInfoList, String referer) throws Throwable {
// We can only request 25 items one time at most
final int MAX_REQUEST_SIZE = 25;
List<GalleryInfo> requestItems = new ArrayList<>(MAX_REQUEST_SIZE);
for (int i = 0, size = galleryInfoList.size(); i < size; i++) {
requestItems.add(galleryInfoList.get(i));
if (requestItems.size() == MAX_REQUEST_SIZE || i == size - 1) {
doFillGalleryListByApi(task, okHttpClient, requestItems, referer);
requestItems.clear();
}
}
return galleryInfoList;
}
private static void doFillGalleryListByApi(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
List<GalleryInfo> galleryInfoList, String referer) throws Throwable {
JSONObject json = new JSONObject();
json.put("method", "gdata");
JSONArray ja = new JSONArray();
for (int i = 0, size = galleryInfoList.size(); i < size; i++) {
GalleryInfo gi = galleryInfoList.get(i);
JSONArray g = new JSONArray();
g.put(gi.gid);
g.put(gi.token);
ja.put(g);
}
json.put("gidlist", ja);
json.put("namespace", 1);
String url = EhUrl.getApiUrl();
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(RequestBody.create(MEDIA_TYPE_JSON, json.toString()))
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
GalleryApiParser.parse(body, galleryInfoList);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static GalleryDetail getGalleryDetail(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url) throws Throwable {
String referer = EhUrl.getReferer();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryDetailParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static Pair<PreviewSet, Integer> getPreviewSet(
@Nullable EhClient.Task task, OkHttpClient okHttpClient, String url) throws Throwable {
String referer = EhUrl.getReferer();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return Pair.create(GalleryDetailParser.parsePreviewSet(body),
GalleryDetailParser.parsePreviewPages(body));
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static RateGalleryParser.Result rateGallery(@Nullable EhClient.Task task,
OkHttpClient okHttpClient, long apiUid, String apiKey, long gid,
String token, float rating) throws Throwable {
final JSONObject json = new JSONObject();
json.put("method", "rategallery");
json.put("apiuid", apiUid);
json.put("apikey", apiKey);
json.put("gid", gid);
json.put("token", token);
json.put("rating", (int) Math.ceil(rating * 2));
final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, json.toString());
String url = EhUrl.getApiUrl();
String referer = EhUrl.getGalleryDetailUrl(gid, token);
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return RateGalleryParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static GalleryCommentList commentGallery(@Nullable EhClient.Task task,
OkHttpClient okHttpClient, String url, String comment, String id) throws Throwable {
FormBody.Builder builder = new FormBody.Builder();
if (id == null) {
builder.add("commenttext_new", comment);
} else {
builder.add("commenttext_edit", comment);
builder.add("edit_comment", id);
}
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, url, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
Document document = Jsoup.parse(body);
Elements elements = document.select("#chd + p");
if (elements.size() > 0) {
throw new EhException(elements.get(0).text());
}
return GalleryDetailParser.parseComments(document);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static String getGalleryToken(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long gid, String gtoken, int page) throws Throwable {
JSONObject json = new JSONObject()
.put("method", "gtoken")
.put("pagelist", new JSONArray().put(
new JSONArray().put(gid).put(gtoken).put(page + 1)));
final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, json.toString());
String url = EhUrl.getApiUrl();
String referer = EhUrl.getReferer();
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryTokenApiParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static FavoritesParser.Result getFavorites(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url, boolean callApi) throws Throwable {
String referer = EhUrl.getReferer();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
FavoritesParser.Result result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = FavoritesParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
fillGalleryList(task, okHttpClient, result.galleryInfoList, url, false);
return result;
}
/**
* @param dstCat -1 for delete, 0 - 9 for cloud favorite, others throw Exception
* @param note max 250 characters
*/
public static Void addFavorites(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long gid, String token, int dstCat, String note) throws Throwable {
String catStr;
if (dstCat == -1) {
catStr = "favdel";
} else if (dstCat >= 0 && dstCat <= 9) {
catStr = String.valueOf(dstCat);
} else {
throw new EhException("Invalid dstCat: " + dstCat);
}
FormBody.Builder builder = new FormBody.Builder();
builder.add("favcat", catStr);
builder.add("favnote", note != null ? note : "");
// submit=Add+to+Favorites is not necessary, just use submit=Apply+Changes all the time
builder.add("submit", "Apply Changes");
builder.add("update", "1");
String url = EhUrl.getAddFavorites(gid, token);
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, url, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
throwException(call, code, headers, body, null);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
return null;
}
public static Void addFavoritesRange(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long[] gidArray, String[] tokenArray, int dstCat) throws Throwable {
AssertUtils.assertEquals(gidArray.length, tokenArray.length);
for (int i = 0, n = gidArray.length; i < n; i++) {
addFavorites(task, okHttpClient, gidArray[i], tokenArray[i], dstCat, null);
}
return null;
}
public static FavoritesParser.Result modifyFavorites(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url, long[] gidArray, int dstCat, boolean callApi) throws Throwable {
String catStr;
if (dstCat == -1) {
catStr = "delete";
} else if (dstCat >= 0 && dstCat <= 9) {
catStr = "fav" + dstCat;
} else {
throw new EhException("Invalid dstCat: " + dstCat);
}
FormBody.Builder builder = new FormBody.Builder();
builder.add("ddact", catStr);
for (long gid : gidArray) {
builder.add("modifygids[]", Long.toString(gid));
}
builder.add("apply", "Apply");
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, url, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
FavoritesParser.Result result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = FavoritesParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
fillGalleryList(task, okHttpClient, result.galleryInfoList, url, false);
return result;
}
public static Pair<String, String>[] getTorrentList(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url, long gid, String token) throws Throwable {
String referer = EhUrl.getGalleryDetailUrl(gid, token);
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
Pair<String, String>[] result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = TorrentParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
return result;
}
public static Pair<String, Pair<String, String>[]> getArchiveList(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url, long gid, String token) throws Throwable {
String referer = EhUrl.getGalleryDetailUrl(gid, token);
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
Pair<String, Pair<String, String>[]> result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = ArchiveParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
return result;
}
public static Void downloadArchive(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long gid, String token, String or, String res) throws Throwable {
if (or == null || or.length() == 0) {
throw new EhException("Invalid form param or: " + or);
}
if (res == null || res.length() == 0) {
throw new EhException("Invalid res: " + res);
}
FormBody.Builder builder = new FormBody.Builder();
builder.add("hathdl_xres", res);
String url = EhUrl.getDownloadArchive(gid, token, or);
String referer = EhUrl.getGalleryDetailUrl(gid, token);
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
throwException(call, code, headers, body, null);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
Matcher m = PATTERN_NEED_HATH_CLIENT.matcher(body);
if (m.find()) {
throw new NoHAtHClientException("No H@H client");
}
return null;
}
private static ProfileParser.Result getProfileInternal(@Nullable EhClient.Task task,
OkHttpClient okHttpClient, String url, String referer) throws Throwable {
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return ProfileParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static ProfileParser.Result getProfile(@Nullable EhClient.Task task,
OkHttpClient okHttpClient) throws Throwable {
String url = EhUrl.URL_FORUMS;
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return getProfileInternal(task, okHttpClient, ForumsParser.parse(body), url);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static VoteCommentParser.Result voteComment(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long apiUid, String apiKey, long gid, String token, long commentId, int commentVote) throws Throwable {
final JSONObject json = new JSONObject();
json.put("method", "votecomment");
json.put("apiuid", apiUid);
json.put("apikey", apiKey);
json.put("gid", gid);
json.put("token", token);
json.put("comment_id", commentId);
json.put("comment_vote", commentVote);
final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, json.toString());
String url = EhUrl.getApiUrl();
String referer = EhUrl.getReferer();
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return VoteCommentParser.parse(body, commentVote);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
/**
* @param image Must be jpeg
*/
public static GalleryListParser.Result imageSearch(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
File image, boolean uss, boolean osc, boolean se) throws Throwable {
MultipartBody.Builder builder = new MultipartBody.Builder();
builder.setType(MultipartBody.FORM);
builder.addPart(
Headers.of("Content-Disposition", "form-data; name=\"sfile\"; filename=\"a.jpg\""),
RequestBody.create(MEDIA_TYPE_JPEG, image)
);
if (uss) {
builder.addPart(
Headers.of("Content-Disposition", "form-data; name=\"fs_similar\""),
RequestBody.create(null, "on")
);
}
if (osc) {
builder.addPart(
Headers.of("Content-Disposition", "form-data; name=\"fs_covers\""),
RequestBody.create(null, "on")
);
}
if (se) {
builder.addPart(
Headers.of("Content-Disposition", "form-data; name=\"fs_exp\""),
RequestBody.create(null, "on")
);
}
builder.addPart(
Headers.of("Content-Disposition", "form-data; name=\"f_sfile\""),
RequestBody.create(null, "File Search")
);
String url = EhUrl.getImageSearchUrl();
String referer = EhUrl.getReferer();
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
GalleryListParser.Result result;
int code = -1;
try {
Response response = call.execute();
Log.d(TAG, "" + response.request().url().toString());
code = response.code();
headers = response.headers();
body = response.body().string();
result = GalleryListParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
fillGalleryList(task, okHttpClient, result.galleryInfoList, url, true);
return result;
}
public static GalleryPageParser.Result getGalleryPage(@Nullable EhClient.Task task,
OkHttpClient okHttpClient, String url, long gid, String token) throws Throwable {
String referer = EhUrl.getGalleryDetailUrl(gid, token);
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryPageParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
public static GalleryPageApiParser.Result getGalleryPageApi(@Nullable EhClient.Task task,
OkHttpClient okHttpClient, long gid, int index, String pToken, String showKey, String previousPToken) throws Throwable {
final JSONObject json = new JSONObject();
json.put("method", "showpage");
json.put("gid", gid);
json.put("page", index + 1);
json.put("imgkey", pToken);
json.put("showkey", showKey);
final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, json.toString());
String url = EhUrl.getApiUrl();
String referer = null;
if (index > 0 && previousPToken != null) {
referer = EhUrl.getPageUrl(gid, index - 1, previousPToken);
}
String origin = EhUrl.getOrigin();
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, referer, origin)
.post(requestBody)
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
return GalleryPageApiParser.parse(body);
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
throwException(call, code, headers, body, e);
throw e;
}
}
}
@@ -0,0 +1,281 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.util.Log;
import com.hippo.ehviewer.EhDB;
import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.dao.Filter;
import java.util.ArrayList;
import java.util.List;
public final class EhFilter {
private static final String TAG = EhFilter.class.getSimpleName();
public static final int MODE_TITLE = 0;
public static final int MODE_UPLOADER = 1;
public static final int MODE_TAG = 2;
public static final int MODE_TAG_NAMESPACE = 3;
private final List<Filter> mTitleFilterList = new ArrayList<>();
private final List<Filter> mUploaderFilterList = new ArrayList<>();
private final List<Filter> mTagFilterList = new ArrayList<>();
private final List<Filter> mTagNamespaceFilterList = new ArrayList<>();
private static EhFilter sInstance;
public static EhFilter getInstance() {
if (sInstance == null) {
sInstance = new EhFilter();
}
return sInstance;
}
private EhFilter() {
List<Filter> list = EhDB.getAllFilter();
for (int i = 0, n = list.size(); i < n; i++) {
Filter filter = list.get(i);
switch (filter.mode) {
case MODE_TITLE:
filter.text = filter.text.toLowerCase();
mTitleFilterList.add(filter);
break;
case MODE_UPLOADER:
mUploaderFilterList.add(filter);
break;
case MODE_TAG:
filter.text = filter.text.toLowerCase();
mTagFilterList.add(filter);
break;
case MODE_TAG_NAMESPACE:
filter.text = filter.text.toLowerCase();
mTagNamespaceFilterList.add(filter);
break;
default:
Log.d(TAG, "Unknown mode: " + filter.mode);
break;
}
}
}
public List<Filter> getTitleFilterList() {
return mTitleFilterList;
}
public List<Filter> getUploaderFilterList() {
return mUploaderFilterList;
}
public List<Filter> getTagFilterList() {
return mTagFilterList;
}
public List<Filter> getTagNamespaceFilterList() {
return mTagNamespaceFilterList;
}
public synchronized void addFilter(Filter filter) {
// enable filter by default before it is added to database
filter.enable = true;
EhDB.addFilter(filter);
switch (filter.mode) {
case MODE_TITLE:
filter.text = filter.text.toLowerCase();
mTitleFilterList.add(filter);
break;
case MODE_UPLOADER:
mUploaderFilterList.add(filter);
break;
case MODE_TAG:
filter.text = filter.text.toLowerCase();
mTagFilterList.add(filter);
break;
case MODE_TAG_NAMESPACE:
filter.text = filter.text.toLowerCase();
mTagNamespaceFilterList.add(filter);
break;
default:
Log.d(TAG, "Unknown mode: " + filter.mode);
break;
}
}
public synchronized void triggerFilter(Filter filter) {
EhDB.triggerFilter(filter);
}
public synchronized void deleteFilter(Filter filter) {
EhDB.deleteFilter(filter);
switch (filter.mode) {
case MODE_TITLE:
mTitleFilterList.remove(filter);
break;
case MODE_UPLOADER:
mUploaderFilterList.remove(filter);
break;
case MODE_TAG:
mTagFilterList.remove(filter);
break;
case MODE_TAG_NAMESPACE:
mTagNamespaceFilterList.remove(filter);
break;
default:
Log.d(TAG, "Unknown mode: " + filter.mode);
break;
}
}
public synchronized boolean needTags() {
return 0 != mTagFilterList.size() || 0 != mTagNamespaceFilterList.size();
}
public synchronized boolean filterTitle(GalleryInfo info) {
if (null == info) {
return false;
}
// Title
String title = info.title;
List<Filter> filters = mTitleFilterList;
if (null != title && filters.size() > 0) {
for (int i = 0, n = filters.size(); i < n; i++) {
if (filters.get(i).enable && title.toLowerCase().contains(filters.get(i).text)) {
return false;
}
}
}
return true;
}
public synchronized boolean filterUploader(GalleryInfo info) {
if (null == info) {
return false;
}
// Uploader
String uploader = info.uploader;
List<Filter> filters = mUploaderFilterList;
if (null != uploader && filters.size() > 0) {
for (int i = 0, n = filters.size(); i < n; i++) {
if (filters.get(i).enable && uploader.equals(filters.get(i).text)) {
return false;
}
}
}
return true;
}
private boolean matchTag(String tag, String filter) {
if (null == tag || null == filter) {
return false;
}
String tagNamespace;
String tagName;
String filterNamespace;
String filterName;
int index = tag.indexOf(':');
if (index < 0) {
tagNamespace = null;
tagName = tag;
} else {
tagNamespace = tag.substring(0, index);
tagName = tag.substring(index + 1);
}
index = filter.indexOf(':');
if (index < 0) {
filterNamespace = null;
filterName = filter;
} else {
filterNamespace = filter.substring(0, index);
filterName = filter.substring(index + 1);
}
if (null != tagNamespace && null != filterNamespace &&
!tagNamespace.equals(filterNamespace)) {
return false;
}
if (!tagName.equals(filterName)) {
return false;
}
return true;
}
public synchronized boolean filterTag(GalleryInfo info) {
if (null == info) {
return false;
}
// Tag
String[] tags = info.simpleTags;
List<Filter> filters = mTagFilterList;
if (null != tags && filters.size() > 0) {
for (String tag: tags) {
for (int i = 0, n = filters.size(); i < n; i++) {
if (filters.get(i).enable && matchTag(tag, filters.get(i).text)) {
return false;
}
}
}
}
return true;
}
private boolean matchTagNamespace(String tag, String filter) {
if (null == tag || null == filter) {
return false;
}
String tagNamespace;
int index = tag.indexOf(':');
if (index >= 0) {
tagNamespace = tag.substring(0, index);
return tagNamespace.equals(filter);
} else {
return false;
}
}
public synchronized boolean filterTagNamespace(GalleryInfo info) {
if (null == info) {
return false;
}
String[] tags = info.simpleTags;
List<Filter> filters = mTagNamespaceFilterList;
if (null != tags && filters.size() > 0) {
for (String tag: tags) {
for (int i = 0, n = filters.size(); i < n; i++) {
if (filters.get(i).enable && matchTagNamespace(tag, filters.get(i).text)) {
return false;
}
}
}
}
return true;
}
}
@@ -0,0 +1,81 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import com.hippo.ehviewer.Settings;
public class EhRequest {
private int mMethod;
private Object[] mArgs;
private EhClient.Callback mCallback;
private EhConfig mEhConfig;
EhClient.Task task;
private boolean mCancel = false;
public EhRequest setMethod(int method) {
mMethod = method;
return this;
}
public EhRequest setArgs(Object... args) {
mArgs = args;
return this;
}
public EhRequest setCallback(EhClient.Callback callback) {
mCallback = callback;
return this;
}
public EhRequest setEhConfig(EhConfig ehConfig) {
mEhConfig = ehConfig;
return this;
}
public int getMethod() {
return mMethod;
}
public Object[] getArgs() {
return mArgs;
}
public EhClient.Callback getCallback() {
return mCallback;
}
public EhConfig getEhConfig() {
return mEhConfig != null ? mEhConfig : Settings.getEhConfig();
}
public void cancel() {
if (!mCancel) {
mCancel = true;
if (task != null) {
task.stop();
task = null;
}
}
}
public boolean isCancelled() {
return mCancel;
}
}
@@ -0,0 +1,36 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import com.hippo.okhttp.ChromeRequestBuilder;
public class EhRequestBuilder extends ChromeRequestBuilder {
public EhRequestBuilder(String url, String referer) {
this(url, referer, null);
}
public EhRequestBuilder(String url, String referer, String origin) {
super(url);
if (referer != null) {
addHeader("Referer", referer);
}
if (origin != null) {
addHeader("Origin", origin);
}
}
}
@@ -0,0 +1,357 @@
/*
* Copyright 2019 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.content.Context;
import android.util.Base64;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.AppConfig;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.R;
import com.hippo.util.ExceptionUtils;
import com.hippo.util.IoThreadPoolExecutor;
import com.hippo.util.TextUrl;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IOUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okio.BufferedSource;
import okio.Okio;
public class EhTagDatabase {
private final String name;
private final byte[] tags;
public EhTagDatabase(String name, BufferedSource source) throws IOException {
this.name = name;
int totalBytes = source.readInt();
tags = new byte[totalBytes];
source.readFully(tags);
}
public String getTranslation(String tag) {
return search(tags, tag.getBytes(TextUrl.UTF_8));
}
@Nullable
private String search(byte[] tags, byte[] tag) {
int low = 0;
int high = tags.length;
while (low < high) {
int start = (low + high) / 2;
// Look for the starting '\n'
while (start > -1 && tags[start] != '\n') {
start--;
}
start++;
// Look for the middle '\r'.
int middle = 1;
while (tags[start + middle] != '\r') {
middle++;
}
// Look for the ending '\n'
int end = middle + 1;
while (tags[start + end] != '\n') {
end++;
}
int compare;
int tagIndex = 0;
int curIndex = start;
for (;;) {
int tagByte = tag[tagIndex] & 0xff;
int curByte = tags[curIndex] & 0xff;
compare = tagByte - curByte;
if (compare != 0) {
break;
}
tagIndex++;
curIndex++;
if (tagIndex == tag.length && curIndex == start + middle) {
break;
}
if (tagIndex == tag.length) {
compare = -1;
break;
}
if (curIndex == start + middle) {
compare = 1;
break;
}
}
if (compare < 0) {
high = start - 1;
} else if (compare > 0) {
low = start + end + 1;
} else {
byte[] bytes = Base64.decode(tags, start + middle + 1, end - middle - 1, Base64.DEFAULT);
return new String(bytes, TextUrl.UTF_8);
}
}
return null;
}
private static final Map<String, String> NAMESPACE_TO_PREFIX = new HashMap<>();
static {
NAMESPACE_TO_PREFIX.put("artist", "a:");
NAMESPACE_TO_PREFIX.put("character", "c:");
NAMESPACE_TO_PREFIX.put("female", "f:");
NAMESPACE_TO_PREFIX.put("group", "g:");
NAMESPACE_TO_PREFIX.put("language", "l:");
NAMESPACE_TO_PREFIX.put("male", "m:");
NAMESPACE_TO_PREFIX.put("misc", "");
NAMESPACE_TO_PREFIX.put("parody", "p:");
NAMESPACE_TO_PREFIX.put("reclass", "r:");
}
private static volatile EhTagDatabase instance;
// TODO more lock for different language
private static Lock lock = new ReentrantLock();
@Nullable
public static EhTagDatabase getInstance(Context context) {
if (isPossible(context)) {
return instance;
} else {
instance = null;
return null;
}
}
@Nullable
public static String namespaceToPrefix(String namespace) {
return NAMESPACE_TO_PREFIX.get(namespace);
}
private static String[] getMetadata(Context context) {
String[] metadata = context.getResources().getStringArray(R.array.tag_translation_metadata);
if (metadata.length == 4) {
return metadata;
} else {
return null;
}
}
public static boolean isPossible(Context context) {
return getMetadata(context) != null;
}
@Nullable
private static byte[] getFileContent(File file, int length) {
try (BufferedSource source = Okio.buffer(Okio.source(file))) {
byte[] content = new byte[length];
source.readFully(content);
return content;
} catch (IOException e) {
return null;
}
}
@Nullable
private static byte[] getFileSha1(File file) {
try (InputStream is = new FileInputStream(file)) {
MessageDigest digest = MessageDigest.getInstance("SHA-1");
int n;
byte[] buffer = new byte[4 * 1024];
while ((n = is.read(buffer)) != -1) {
digest.update(buffer, 0, n);
}
return digest.digest();
} catch (IOException e) {
return null;
} catch (NoSuchAlgorithmException e) {
return null;
}
}
private static boolean equals(byte[] b1, byte[] b2) {
if (b1 == null && b2 == null) {
return true;
}
if (b1 == null || b2 == null) {
return false;
}
if (b1.length != b2.length) {
return false;
}
for (int i = 0; i < b1.length; i++) {
if (b1[i] != b2[i]) {
return false;
}
}
return true;
}
private static boolean checkData(File sha1File, File dataFile) {
byte[] s1 = getFileContent(sha1File, 20);
if (s1 == null) {
return false;
}
byte[] s2 = getFileSha1(dataFile);
if (s2 == null) {
return false;
}
return equals(s1, s2);
}
private static boolean save(OkHttpClient client, String url, File file) {
Request request = new Request.Builder().url(url).build();
Call call = client.newCall(request);
try (Response response = call.execute()) {
if (!response.isSuccessful()) {
return false;
}
ResponseBody body = response.body();
if (body == null) {
return false;
}
try (InputStream is = body.byteStream(); OutputStream os = new FileOutputStream(file)) {
IOUtils.copy(is, os);
}
return true;
} catch (Throwable t) {
ExceptionUtils.throwIfFatal(t);
return false;
}
}
public static void update(Context context) {
String[] urls = getMetadata(context);
if (urls == null || urls.length != 4) {
// Clear tags if it's not possible
instance = null;
return;
}
String sha1Name = urls[0];
String sha1Url = urls[1];
String dataName = urls[2];
String dataUrl = urls[3];
// Clear tags if name if different
EhTagDatabase tmp = instance;
if (tmp != null && !tmp.name.equals(dataName)) {
instance = null;
}
IoThreadPoolExecutor.getInstance().execute(() -> {
if (!lock.tryLock()) {
return;
}
try {
File dir = AppConfig.getFilesDir("tag-translations");
if (dir == null) {
return;
}
// Check current sha1 and current data
File sha1File = new File(dir, sha1Name);
File dataFile = new File(dir, dataName);
if (!checkData(sha1File, dataFile)) {
FileUtils.delete(sha1File);
FileUtils.delete(dataFile);
}
// Read current EhTagDatabase
if (instance == null && dataFile.exists()) {
try (BufferedSource source = Okio.buffer(Okio.source(dataFile))) {
instance = new EhTagDatabase(dataName, source);
} catch (IOException e) {
FileUtils.delete(sha1File);
FileUtils.delete(dataFile);
}
}
OkHttpClient client = EhApplication.getOkHttpClient(EhApplication.getInstance());
// Save new sha1
File tempSha1File = new File(dir, sha1Name + ".tmp");
if (!save(client, sha1Url, tempSha1File)) {
FileUtils.delete(tempSha1File);
return;
}
// Check new sha1 and current data
if (checkData(tempSha1File, dataFile)) {
// The data is the same
FileUtils.delete(tempSha1File);
return;
}
// Save new data
File tempDataFile = new File(dir, dataName + ".tmp");
if (!save(client, dataUrl, tempDataFile)) {
FileUtils.delete(tempDataFile);
return;
}
// Check new sha1 and new data
if (!checkData(tempSha1File, tempDataFile)) {
FileUtils.delete(tempSha1File);
FileUtils.delete(tempDataFile);
return;
}
// Replace current sha1 and current data with new sha1 and new data
FileUtils.delete(sha1File);
FileUtils.delete(dataFile);
tempSha1File.renameTo(sha1File);
tempDataFile.renameTo(dataFile);
// Read new EhTagDatabase
try (BufferedSource source = Okio.buffer(Okio.source(dataFile))) {
instance = new EhTagDatabase(dataName, source);
} catch (IOException e) {
// Ignore
}
} finally {
lock.unlock();
}
});
}
}
@@ -0,0 +1,246 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import androidx.annotation.NonNull;
import com.hippo.ehviewer.Settings;
import com.hippo.network.UrlBuilder;
import java.util.List;
import java.util.ListIterator;
import okhttp3.HttpUrl;
public class EhUrl {
public static final int SITE_E = 0;
public static final int SITE_EX = 1;
public static final String DOMAIN_EX = "exhentai.org";
public static final String DOMAIN_E = "e-hentai.org";
public static final String DOMAIN_LOFI = "lofi.e-hentai.org";
public static final String HOST_EX = "https://" + DOMAIN_EX + "/";
public static final String HOST_E = "https://" + DOMAIN_E + "/";
public static final String API_SIGN_IN = "https://forums.e-hentai.org/index.php?act=Login&CODE=01";
public static final String API_E = HOST_E + "api.php";
public static final String API_EX = HOST_EX + "api.php";
public static final String URL_POPULAR_E = "https://e-hentai.org/popular";
public static final String URL_POPULAR_EX = "https://exhentai.org/popular";
public static final String URL_IMAGE_SEARCH_E = "https://upload.e-hentai.org/image_lookup.php";
public static final String URL_IMAGE_SEARCH_EX = "https://exhentai.org/upload/image_lookup.php";
public static final String URL_SIGN_IN = "https://forums.e-hentai.org/index.php?act=Login";
public static final String URL_REGISTER = "https://forums.e-hentai.org/index.php?act=Reg&CODE=00";
public static final String URL_FAVORITES_E = HOST_E + "favorites.php";
public static final String URL_FAVORITES_EX = HOST_EX + "favorites.php";
public static final String URL_FORUMS = "https://forums.e-hentai.org/";
public static final String REFERER_EX = "https://" + DOMAIN_EX;
public static final String REFERER_E = "https://" + DOMAIN_E;
public static final String ORIGIN_EX = REFERER_EX;
public static final String ORIGIN_E = REFERER_E;
public static final String URL_UCONFIG_E = HOST_E + "uconfig.php";
public static final String URL_UCONFIG_EX = HOST_EX + "uconfig.php";
public static final String URL_MY_TAGS_E = HOST_E + "mytags";
public static final String URL_MY_TAGS_EX = HOST_EX + "mytags";
public static final String URL_WATCHED_E = HOST_E + "watched";
public static final String URL_WATCHED_EX = HOST_EX + "watched";
private static final String URL_PREFIX_THUMB_E = "https://ehgt.org/";
private static final String URL_PREFIX_THUMB_EX = "https://exhentai.org/t/";
public static String getGalleryDetailUrl(long gid, String token) {
return getGalleryDetailUrl(gid, token, 0, false);
}
public static String getHost() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return HOST_E;
case SITE_EX:
return HOST_EX;
}
}
public static String getFavoritesUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_FAVORITES_E;
case SITE_EX:
return URL_FAVORITES_EX;
}
}
public static String getApiUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return API_E;
case SITE_EX:
return API_EX;
}
}
public static String getReferer() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return REFERER_E;
case SITE_EX:
return REFERER_EX;
}
}
public static String getOrigin() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return ORIGIN_E;
case SITE_EX:
return ORIGIN_EX;
}
}
public static String getUConfigUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_UCONFIG_E;
case SITE_EX:
return URL_UCONFIG_EX;
}
}
public static String getMyTagsUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_MY_TAGS_E;
case SITE_EX:
return URL_MY_TAGS_EX;
}
}
public static String getGalleryDetailUrl(long gid, String token, int index, boolean allComment) {
UrlBuilder builder = new UrlBuilder(getHost() + "g/" + gid + '/' + token + '/');
if (index != 0) {
builder.addQuery("p", index);
}
if (allComment) {
builder.addQuery("hc", 1);
}
return builder.build();
}
public static String getPageUrl(long gid, int index, String pToken) {
return getHost() + "s/" + pToken + '/' + gid + '-' + (index + 1);
}
public static String getAddFavorites(long gid, String token) {
return getHost() + "gallerypopups.php?gid=" + gid + "&t=" + token + "&act=addfav";
}
public static String getDownloadArchive(long gid, String token, String or) {
return getHost() + "archiver.php?gid=" + gid + "&token=" + token + "&or=" + or;
}
public static String getTagDefinitionUrl(String tag) {
return "https://ehwiki.org/wiki/" + tag.replace(' ', '_');
}
@NonNull
public static String getPopularUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_POPULAR_E;
case SITE_EX:
return URL_POPULAR_EX;
}
}
@NonNull
public static String getImageSearchUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_IMAGE_SEARCH_E;
case SITE_EX:
return URL_IMAGE_SEARCH_EX;
}
}
@NonNull
public static String getWatchedUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_E:
return URL_WATCHED_E;
case SITE_EX:
return URL_WATCHED_EX;
}
}
public static String getThumbUrlPrefix() {
switch (Settings.getGallerySite()) {
default:
//case SITE_E:
return URL_PREFIX_THUMB_E;
//case SITE_EX:
// return URL_PREFIX_THUMB_EX;
}
}
public static String getFixedPreviewThumbUrl(String originUrl) {
HttpUrl url = HttpUrl.parse(originUrl);
if (url == null) return originUrl;
List<String> pathSegments = url.pathSegments();
if (pathSegments == null || pathSegments.size() < 3) return originUrl;
ListIterator<String> iterator = pathSegments.listIterator(pathSegments.size());
// The last segments, like
// 317a1a254cd9c3269e71b2aa2671fe8d28c91097-260198-640-480-png_250.jpg
if (!iterator.hasPrevious()) return originUrl;
String lastSegment = iterator.previous();
// The second last segments, like
// 7a
if (!iterator.hasPrevious()) return originUrl;
String secondLastSegment = iterator.previous();
// The third last segments, like
// 31
if (!iterator.hasPrevious()) return originUrl;
String thirdLastSegment = iterator.previous();
// Check path segments
if (lastSegment != null && secondLastSegment != null
&& thirdLastSegment != null
&& lastSegment.startsWith(thirdLastSegment)
&& lastSegment.startsWith(secondLastSegment, thirdLastSegment.length())) {
return getThumbUrlPrefix() + thirdLastSegment + "/" + secondLastSegment + "/" + lastSegment;
} else {
return originUrl;
}
}
}
@@ -0,0 +1,73 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.client.data.ListUrlBuilder;
import com.hippo.ehviewer.client.parser.GalleryDetailUrlParser;
import com.hippo.ehviewer.client.parser.GalleryListUrlParser;
import com.hippo.ehviewer.client.parser.GalleryPageUrlParser;
import com.hippo.ehviewer.ui.scene.GalleryDetailScene;
import com.hippo.ehviewer.ui.scene.GalleryListScene;
import com.hippo.ehviewer.ui.scene.ProgressScene;
import com.hippo.scene.Announcer;
public class EhUrlOpener {
private static final String TAG = EhUrlOpener.class.getSimpleName();
@Nullable
public static Announcer parseUrl(String url) {
if (TextUtils.isEmpty(url)) {
return null;
}
ListUrlBuilder listUrlBuilder = GalleryListUrlParser.parse(url);
if (listUrlBuilder != null) {
Bundle args = new Bundle();
args.putString(GalleryListScene.KEY_ACTION, GalleryListScene.ACTION_LIST_URL_BUILDER);
args.putParcelable(GalleryListScene.KEY_LIST_URL_BUILDER, listUrlBuilder);
return new Announcer(GalleryListScene.class).setArgs(args);
}
GalleryDetailUrlParser.Result result1 = GalleryDetailUrlParser.parse(url);
if (result1 != null) {
Bundle args = new Bundle();
args.putString(GalleryDetailScene.KEY_ACTION, GalleryDetailScene.ACTION_GID_TOKEN);
args.putLong(GalleryDetailScene.KEY_GID, result1.gid);
args.putString(GalleryDetailScene.KEY_TOKEN, result1.token);
return new Announcer(GalleryDetailScene.class).setArgs(args);
}
GalleryPageUrlParser.Result result2 = GalleryPageUrlParser.parse(url);
if (result2 != null) {
Bundle args = new Bundle();
args.putString(ProgressScene.KEY_ACTION, ProgressScene.ACTION_GALLERY_TOKEN);
args.putLong(ProgressScene.KEY_GID, result2.gid);
args.putString(ProgressScene.KEY_PTOKEN, result2.pToken);
args.putInt(ProgressScene.KEY_PAGE, result2.page);
return new Announcer(ProgressScene.class).setArgs(args);
}
Log.i(TAG, "Can't parse url: " + url);
return null;
}
}
@@ -0,0 +1,196 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.client.data.GalleryInfo;
import java.util.regex.Pattern;
public class EhUtils {
public static final int NONE = -1; // Use it for homepage
public static final int UNKNOWN = 0x400;
public static final int ALL_CATEGORY = EhUtils.UNKNOWN - 1;
//DOUJINSHI|MANGA|ARTIST_CG|GAME_CG|WESTERN|NON_H|IMAGE_SET|COSPLAY|ASIAN_PORN|MISC;
public static final int BG_COLOR_DOUJINSHI = 0xfff44336;
public static final int BG_COLOR_MANGA = 0xffff9800;
public static final int BG_COLOR_ARTIST_CG = 0xfffbc02d;
public static final int BG_COLOR_GAME_CG = 0xff4caf50;
public static final int BG_COLOR_WESTERN = 0xff8bc34a;
public static final int BG_COLOR_NON_H = 0xff2196f3;
public static final int BG_COLOR_IMAGE_SET = 0xff3f51b5;
public static final int BG_COLOR_COSPLAY = 0xff9c27b0;
public static final int BG_COLOR_ASIAN_PORN = 0xff9575cd;
public static final int BG_COLOR_MISC = 0xfff06292;
public static final int BG_COLOR_UNKNOWN = Color.BLACK;
// Remove [XXX], (XXX), {XXX}, ~XXX~ stuff
public static final Pattern PATTERN_TITLE_PREFIX = Pattern.compile(
"^(?:(?:\\([^\\)]*\\))|(?:\\[[^\\]]*\\])|(?:\\{[^\\}]*\\})|(?:~[^~]*~)|\\s+)*");
// Remove [XXX], (XXX), {XXX}, ~XXX~ stuff and something like ch. 1-23
public static final Pattern PATTERN_TITLE_SUFFIX = Pattern.compile(
"(?:\\s+ch.[\\s\\d-]+)?(?:(?:\\([^\\)]*\\))|(?:\\[[^\\]]*\\])|(?:\\{[^\\}]*\\})|(?:~[^~]*~)|\\s+)*$",
Pattern.CASE_INSENSITIVE);
private static final int[] CATEGORY_VALUES = {
EhConfig.MISC,
EhConfig.DOUJINSHI,
EhConfig.MANGA,
EhConfig.ARTIST_CG,
EhConfig.GAME_CG,
EhConfig.IMAGE_SET,
EhConfig.COSPLAY,
EhConfig.ASIAN_PORN,
EhConfig.NON_H,
EhConfig.WESTERN,
UNKNOWN };
private static final String[][] CATEGORY_STRINGS = {
new String[] { "misc" },
new String[] { "doujinshi" },
new String[] { "manga" },
new String[] { "artistcg", "Artist CG Sets", "Artist CG" },
new String[] { "gamecg", "Game CG Sets", "Game CG" },
new String[] { "imageset", "Image Sets", "Image Set" },
new String[] { "cosplay" },
new String[] { "asianporn", "Asian Porn" },
new String[] { "non-h" },
new String[] { "western" },
new String[] { "unknown" }
};
public static int getCategory(String type) {
int i;
for (i = 0; i < CATEGORY_STRINGS.length - 1; i++) {
for (String str : CATEGORY_STRINGS[i])
if (str.equalsIgnoreCase(type))
return CATEGORY_VALUES[i];
}
return CATEGORY_VALUES[i];
}
public static String getCategory(int type) {
int i;
for (i = 0; i < CATEGORY_VALUES.length - 1; i++) {
if (CATEGORY_VALUES[i] == type)
break;
}
return CATEGORY_STRINGS[i][0];
}
public static int getCategoryColor(int category) {
switch (category) {
case EhConfig.DOUJINSHI:
return BG_COLOR_DOUJINSHI;
case EhConfig.MANGA:
return BG_COLOR_MANGA;
case EhConfig.ARTIST_CG:
return BG_COLOR_ARTIST_CG;
case EhConfig.GAME_CG:
return BG_COLOR_GAME_CG;
case EhConfig.WESTERN:
return BG_COLOR_WESTERN;
case EhConfig.NON_H:
return BG_COLOR_NON_H;
case EhConfig.IMAGE_SET:
return BG_COLOR_IMAGE_SET;
case EhConfig.COSPLAY:
return BG_COLOR_COSPLAY;
case EhConfig.ASIAN_PORN:
return BG_COLOR_ASIAN_PORN;
case EhConfig.MISC:
return BG_COLOR_MISC;
default:
return BG_COLOR_UNKNOWN;
}
}
public static void signOut(Context context) {
EhApplication.getEhCookieStore(context).signOut();
Settings.putAvatar(null);
Settings.putDisplayName(null);
Settings.putNeedSignIn(true);
}
public static boolean needSignedIn(Context context) {
return Settings.getNeedSignIn() && !EhApplication.getEhCookieStore(context).hasSignedIn();
}
public static String getSuitableTitle(GalleryInfo gi) {
if (Settings.getShowJpnTitle()) {
return TextUtils.isEmpty(gi.titleJpn) ? gi.title : gi.titleJpn;
} else {
return TextUtils.isEmpty(gi.title) ? gi.titleJpn : gi.title;
}
}
@Nullable
public static String extractTitle(String title) {
if (null == title) {
return null;
}
title = PATTERN_TITLE_PREFIX.matcher(title).replaceFirst("");
title = PATTERN_TITLE_SUFFIX.matcher(title).replaceFirst("");
// Sometimes title is combined by romaji and english translation.
// Only need romaji.
// TODO But not sure every '|' means that
int index = title.indexOf('|');
if (index >= 0) {
title = title.substring(0, index);
}
if (title.isEmpty()) {
return null;
} else {
return title;
}
}
public static String handleThumbUrlResolution(String url) {
if (null == url) {
return null;
}
String resolution;
switch (Settings.getThumbResolution()) {
default:
case 0: // Auto
return url;
case 1: // 250
resolution = "250";
break;
case 2: // 300
resolution = "300";
break;
}
int index1 = url.lastIndexOf('_');
int index2 = url.lastIndexOf('.');
if (index1 >= 0 && index2 >= 0 && index1 < index2) {
return url.substring(0, index1 + 1) + resolution + url.substring(index2);
} else {
return url;
}
}
}
@@ -0,0 +1,127 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import com.hippo.ehviewer.client.EhUrl;
import com.hippo.network.UrlBuilder;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class FavListUrlBuilder implements Parcelable {
private static final String TAG = FavListUrlBuilder.class.getSimpleName();
public static final int FAV_CAT_ALL = -1;
public static final int FAV_CAT_LOCAL = -2;
private int mIndex;
private String mKeyword;
private int mFavCat = FAV_CAT_ALL;
public void setIndex(int index) {
mIndex = index;
}
public void setKeyword(String keyword) {
mKeyword = keyword;
}
public void setFavCat(int favCat) {
mFavCat = favCat;
}
public String getKeyword() {
return mKeyword;
}
public int getFavCat() {
return mFavCat;
}
public static boolean isValidFavCat(int favCat) {
return favCat >= 0 && favCat <= 9;
}
public boolean isLocalFavCat() {
return mFavCat == FAV_CAT_LOCAL;
}
public String build() {
UrlBuilder ub = new UrlBuilder(EhUrl.getFavoritesUrl());
if (isValidFavCat(mFavCat)) {
ub.addQuery("favcat", Integer.toString(mFavCat));
} else if (mFavCat == FAV_CAT_ALL) {
ub.addQuery("favcat", "all");
}
if (!TextUtils.isEmpty(mKeyword)) {
try {
ub.addQuery("f_search", URLEncoder.encode(mKeyword, "UTF-8"));
// Name
ub.addQuery("sn", "on");
// Tags
ub.addQuery("st", "on");
// Note
ub.addQuery("sf", "on");
} catch (UnsupportedEncodingException e) {
Log.e(TAG, "Can't URLEncoder.encode " + mKeyword);
}
}
if (mIndex > 0) {
ub.addQuery("page", Integer.toString(mIndex));
}
return ub.build();
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.mIndex);
dest.writeString(this.mKeyword);
dest.writeInt(this.mFavCat);
}
public FavListUrlBuilder() {
}
protected FavListUrlBuilder(Parcel in) {
this.mIndex = in.readInt();
this.mKeyword = in.readString();
this.mFavCat = in.readInt();
}
public static final Parcelable.Creator<FavListUrlBuilder> CREATOR = new Parcelable.Creator<FavListUrlBuilder>() {
@Override
public FavListUrlBuilder createFromParcel(Parcel source) {
return new FavListUrlBuilder(source);
}
@Override
public FavListUrlBuilder[] newArray(int size) {
return new FavListUrlBuilder[size];
}
};
}
@@ -0,0 +1,98 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
public class GalleryApiInfo implements Parcelable {
public long gid;
public String token;
public String archiverKey;
public String title;
public String titleJpn;
public int category;
public String thumb;
public String uploader;
public long posted;
public int filecount;
public long filesize;
public boolean expunged;
public float rating;
public int torrentcount;
@Nullable
public String[] tags;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(this.gid);
dest.writeString(this.token);
dest.writeString(this.archiverKey);
dest.writeString(this.title);
dest.writeString(this.titleJpn);
dest.writeInt(this.category);
dest.writeString(this.thumb);
dest.writeString(this.uploader);
dest.writeLong(this.posted);
dest.writeInt(this.filecount);
dest.writeLong(this.filesize);
dest.writeByte(expunged ? (byte) 1 : (byte) 0);
dest.writeFloat(this.rating);
dest.writeInt(this.torrentcount);
dest.writeStringArray(this.tags);
}
public GalleryApiInfo() {
}
protected GalleryApiInfo(Parcel in) {
this.gid = in.readLong();
this.token = in.readString();
this.archiverKey = in.readString();
this.title = in.readString();
this.titleJpn = in.readString();
this.category = in.readInt();
this.thumb = in.readString();
this.uploader = in.readString();
this.posted = in.readLong();
this.filecount = in.readInt();
this.filesize = in.readLong();
this.expunged = in.readByte() != 0;
this.rating = in.readFloat();
this.torrentcount = in.readInt();
this.tags = in.createStringArray();
}
public static final Parcelable.Creator<GalleryApiInfo> CREATOR = new Parcelable.Creator<GalleryApiInfo>() {
@Override
public GalleryApiInfo createFromParcel(Parcel source) {
return new GalleryApiInfo(source);
}
@Override
public GalleryApiInfo[] newArray(int size) {
return new GalleryApiInfo[size];
}
};
}
@@ -0,0 +1,88 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
public class GalleryComment implements Parcelable {
// 0 for uploader comment. can't vote
public long id;
public int score;
public boolean editable;
public boolean voteUpAble;
public boolean voteUpEd;
public boolean voteDownAble;
public boolean voteDownEd;
public String voteState;
public long time;
public String user;
public String comment;
public long lastEdited;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(this.id);
dest.writeInt(this.score);
dest.writeByte(editable ? (byte) 1 : (byte) 0);
dest.writeByte(voteUpAble ? (byte) 1 : (byte) 0);
dest.writeByte(voteUpEd ? (byte) 1 : (byte) 0);
dest.writeByte(voteDownAble ? (byte) 1 : (byte) 0);
dest.writeByte(voteDownEd ? (byte) 1 : (byte) 0);
dest.writeString(this.voteState);
dest.writeLong(this.time);
dest.writeString(this.user);
dest.writeString(this.comment);
dest.writeLong(this.lastEdited);
}
public GalleryComment() {
}
protected GalleryComment(Parcel in) {
this.id = in.readLong();
this.score = in.readInt();
this.editable = in.readByte() != 0;
this.voteUpAble = in.readByte() != 0;
this.voteUpEd = in.readByte() != 0;
this.voteDownAble = in.readByte() != 0;
this.voteDownEd = in.readByte() != 0;
this.voteState = in.readString();
this.time = in.readLong();
this.user = in.readString();
this.comment = in.readString();
this.lastEdited = in.readLong();
}
public static final Creator<GalleryComment> CREATOR = new Creator<GalleryComment>() {
@Override
public GalleryComment createFromParcel(Parcel source) {
return new GalleryComment(source);
}
@Override
public GalleryComment[] newArray(int size) {
return new GalleryComment[size];
}
};
}
@@ -0,0 +1,65 @@
/*
* Copyright 2019 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;
public class GalleryCommentList implements Parcelable {
public GalleryComment[] comments;
public boolean hasMore;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeParcelableArray(comments, flags);
dest.writeByte(hasMore ? (byte) 1 : (byte) 0);
}
public GalleryCommentList(GalleryComment[] comments, boolean hasMore) {
this.comments = comments;
this.hasMore = hasMore;
}
protected GalleryCommentList(Parcel in) {
Parcelable[] array = in.readParcelableArray(getClass().getClassLoader());
if (array != null) {
comments = Arrays.copyOf(array, array.length, GalleryComment[].class);
} else {
comments = null;
}
hasMore = in.readByte() != 0;
}
public static final Creator<GalleryCommentList> CREATOR = new Creator<GalleryCommentList>() {
@Override
public GalleryCommentList createFromParcel(Parcel in) {
return new GalleryCommentList(in);
}
@Override
public GalleryCommentList[] newArray(int size) {
return new GalleryCommentList[size];
}
};
}
@@ -0,0 +1,107 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;
public class GalleryDetail extends GalleryInfo {
public long apiUid = -1L;
public String apiKey;
public int torrentCount;
public String torrentUrl;
public String archiveUrl;
public String parent;
public String visible;
public String language;
public String size;
public int pages;
public int favoriteCount;
public boolean isFavorited;
public int ratingCount;
public GalleryTagGroup[] tags;
public GalleryCommentList comments;
public int previewPages;
public PreviewSet previewSet;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(this.torrentCount);
dest.writeString(this.torrentUrl);
dest.writeString(this.archiveUrl);
dest.writeString(this.parent);
dest.writeString(this.visible);
dest.writeString(this.language);
dest.writeString(this.size);
dest.writeInt(this.pages);
dest.writeInt(this.favoriteCount);
dest.writeByte(isFavorited ? (byte) 1 : (byte) 0);
dest.writeInt(this.ratingCount);
dest.writeParcelableArray(this.tags, flags);
dest.writeParcelable(this.comments, flags);
dest.writeInt(this.previewPages);
dest.writeParcelable(previewSet, flags);
}
public GalleryDetail() {
}
protected GalleryDetail(Parcel in) {
super(in);
this.torrentCount = in.readInt();
this.torrentUrl = in.readString();
this.archiveUrl = in.readString();
this.parent = in.readString();
this.visible = in.readString();
this.language = in.readString();
this.size = in.readString();
this.pages = in.readInt();
this.favoriteCount = in.readInt();
this.isFavorited = in.readByte() != 0;
this.ratingCount = in.readInt();
Parcelable[] array = in.readParcelableArray(GalleryTagGroup.class.getClassLoader());
if (array != null) {
this.tags = Arrays.copyOf(array, array.length, GalleryTagGroup[].class);
} else {
this.tags = null;
}
this.comments = in.readParcelable(getClass().getClassLoader());
this.previewPages = in.readInt();
this.previewSet = in.readParcelable(PreviewSet.class.getClassLoader());
}
public static final Creator<GalleryDetail> CREATOR = new Creator<GalleryDetail>() {
@Override
public GalleryDetail createFromParcel(Parcel source) {
return new GalleryDetail(source);
}
@Override
public GalleryDetail[] newArray(int size) {
return new GalleryDetail[size];
}
};
}
@@ -0,0 +1,221 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import java.util.regex.Pattern;
public class GalleryInfo implements Parcelable {
/**
* ISO 639-1
*/
@SuppressWarnings("unused")
public static final String S_LANG_JA = "JA";
public static final String S_LANG_EN = "EN";
public static final String S_LANG_ZH = "ZH";
public static final String S_LANG_NL = "NL";
public static final String S_LANG_FR = "FR";
public static final String S_LANG_DE = "DE";
public static final String S_LANG_HU = "HU";
public static final String S_LANG_IT = "IT";
public static final String S_LANG_KO = "KO";
public static final String S_LANG_PL = "PL";
public static final String S_LANG_PT = "PT";
public static final String S_LANG_RU = "RU";
public static final String S_LANG_ES = "ES";
public static final String S_LANG_TH = "TH";
public static final String S_LANG_VI = "VI";
public static final String[] S_LANGS = {
S_LANG_EN,
S_LANG_ZH,
S_LANG_ES,
S_LANG_KO,
S_LANG_RU,
S_LANG_FR,
S_LANG_PT,
S_LANG_TH,
S_LANG_DE,
S_LANG_IT,
S_LANG_VI,
S_LANG_PL,
S_LANG_HU,
S_LANG_NL,
};
public static final Pattern[] S_LANG_PATTERNS = {
Pattern.compile("[(\\[]eng(?:lish)?[)\\]]|英訳", Pattern.CASE_INSENSITIVE),
// [((\[]ch(?:inese)?[))\]]|[汉漢]化|中[国國][语語]|中文|中国翻訳
Pattern.compile("[(\uFF08\\[]ch(?:inese)?[)\uFF09\\]]|[汉漢]化|中[国國][语語]|中文|中国翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]spanish[)\\]]|[(\\[]Español[)\\]]|スペイン翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]korean?[)\\]]|韓国翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]rus(?:sian)?[)\\]]|ロシア翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]fr(?:ench)?[)\\]]|フランス翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]portuguese|ポルトガル翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]thai(?: ภาษาไทย)?[)\\]]|แปลไทย|タイ翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]german[)\\]]|ドイツ翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]italiano?[)\\]]|イタリア翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]vietnamese(?: Tiếng Việt)?[)\\]]|ベトナム翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]polish[)\\]]|ポーランド翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]hun(?:garian)?[)\\]]|ハンガリー翻訳", Pattern.CASE_INSENSITIVE),
Pattern.compile("[(\\[]dutch[)\\]]|オランダ翻訳", Pattern.CASE_INSENSITIVE),
};
public static final String[] S_LANG_TAGS = {
"language:english",
"language:chinese",
"language:spanish",
"language:korean",
"language:russian",
"language:french",
"language:portuguese",
"language:thai",
"language:german",
"language:italian",
"language:vietnamese",
"language:polish",
"language:hungarian",
"language:dutch",
};
public long gid ;
public String token;
public String title;
public String titleJpn;
public String thumb;
public int category;
public String posted;
public String uploader;
public float rating;
public boolean rated;
@Nullable
public String[] simpleTags;
public int pages;
public int thumbWidth;
public int thumbHeight;
public int spanSize;
public int spanIndex;
public int spanGroupIndex;
/**
* language from title
*/
public String simpleLanguage;
public int favoriteSlot = -2;
public String favoriteName;
public final void generateSLang() {
if (simpleTags != null) {
generateSLangFromTags();
}
if (simpleLanguage == null && title != null) {
generateSLangFromTitle();
}
}
private void generateSLangFromTags() {
for (String tag : simpleTags) {
for (int i = 0; i < S_LANGS.length; i++) {
if (S_LANG_TAGS[i].equals(tag)) {
simpleLanguage = S_LANGS[i];
return;
}
}
}
}
private void generateSLangFromTitle() {
for (int i = 0; i < S_LANGS.length; i++) {
if (S_LANG_PATTERNS[i].matcher(title).find()) {
simpleLanguage = S_LANGS[i];
return;
}
}
simpleLanguage = null;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(this.gid);
dest.writeString(this.token);
dest.writeString(this.title);
dest.writeString(this.titleJpn);
dest.writeString(this.thumb);
dest.writeInt(this.category);
dest.writeString(this.posted);
dest.writeString(this.uploader);
dest.writeFloat(this.rating);
dest.writeByte(this.rated ? (byte) 1 : (byte) 0);
dest.writeString(this.simpleLanguage);
dest.writeStringArray(this.simpleTags);
dest.writeInt(this.thumbWidth);
dest.writeInt(this.thumbHeight);
dest.writeInt(this.spanSize);
dest.writeInt(this.spanIndex);
dest.writeInt(this.spanGroupIndex);
dest.writeInt(this.favoriteSlot);
dest.writeString(this.favoriteName);
}
public GalleryInfo() {}
protected GalleryInfo(Parcel in) {
this.gid = in.readLong();
this.token = in.readString();
this.title = in.readString();
this.titleJpn = in.readString();
this.thumb = in.readString();
this.category = in.readInt();
this.posted = in.readString();
this.uploader = in.readString();
this.rating = in.readFloat();
this.rated = in.readByte() != 0;
this.simpleLanguage = in.readString();
this.simpleTags = in.createStringArray();
this.thumbWidth = in.readInt();
this.thumbHeight = in.readInt();
this.spanSize = in.readInt();
this.spanIndex = in.readInt();
this.spanGroupIndex = in.readInt();
this.favoriteSlot = in.readInt();
this.favoriteName = in.readString();
}
public static final Parcelable.Creator<GalleryInfo> CREATOR = new Parcelable.Creator<GalleryInfo>() {
@Override
public GalleryInfo createFromParcel(Parcel source) {
return new GalleryInfo(source);
}
@Override
public GalleryInfo[] newArray(int size) {
return new GalleryInfo[size];
}
};
}
@@ -0,0 +1,84 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import com.hippo.widget.LoadImageView;
public class GalleryPreview implements Parcelable {
String imageKey;
String imageUrl;
String pageUrl;
int position;
int offsetX = Integer.MIN_VALUE;
int offsetY = Integer.MIN_VALUE;
int clipWidth = Integer.MIN_VALUE;
int clipHeight = Integer.MIN_VALUE;
public int getPosition() {
return position;
}
public void load(LoadImageView view) {
view.setClip(offsetX, offsetY, clipWidth, clipHeight);
view.load(imageKey, imageUrl);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.imageUrl);
dest.writeString(this.pageUrl);
dest.writeInt(this.position);
dest.writeInt(this.offsetX);
dest.writeInt(this.offsetY);
dest.writeInt(this.clipWidth);
dest.writeInt(this.clipHeight);
}
public GalleryPreview() {
}
protected GalleryPreview(Parcel in) {
this.imageUrl = in.readString();
this.pageUrl = in.readString();
this.position = in.readInt();
this.offsetX = in.readInt();
this.offsetY = in.readInt();
this.clipWidth = in.readInt();
this.clipHeight = in.readInt();
}
public static final Parcelable.Creator<GalleryPreview> CREATOR = new Parcelable.Creator<GalleryPreview>() {
@Override
public GalleryPreview createFromParcel(Parcel source) {
return new GalleryPreview(source);
}
@Override
public GalleryPreview[] newArray(int size) {
return new GalleryPreview[size];
}
};
}
@@ -0,0 +1,73 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
// TODO Add url field?
public class GalleryTagGroup implements Parcelable {
public String groupName;
private final ArrayList<String> mTagList;
public void addTag(String tag) {
mTagList.add(tag);
}
public int size() {
return mTagList.size();
}
public String getTagAt(int position) {
return mTagList.get(position);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.groupName);
dest.writeStringList(this.mTagList);
}
public GalleryTagGroup() {
mTagList = new ArrayList<>();
}
protected GalleryTagGroup(Parcel in) {
this.groupName = in.readString();
this.mTagList = in.createStringArrayList();
}
public static final Parcelable.Creator<GalleryTagGroup> CREATOR = new Parcelable.Creator<GalleryTagGroup>() {
@Override
public GalleryTagGroup createFromParcel(Parcel source) {
return new GalleryTagGroup(source);
}
@Override
public GalleryTagGroup[] newArray(int size) {
return new GalleryTagGroup[size];
}
};
}
@@ -0,0 +1,107 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import com.hippo.ehviewer.client.EhCacheKeyFactory;
import com.hippo.widget.LoadImageView;
import com.hippo.yorozuya.collect.IntList;
import java.util.ArrayList;
public class LargePreviewSet extends PreviewSet {
private final IntList mPositionList;
private final ArrayList<String> mImageUrlList;
private final ArrayList<String> mPageUrlList;
public void addItem(int index, String imageUrl, String pageUrl) {
mPositionList.add(index);
mImageUrlList.add(imageUrl);
mPageUrlList.add(pageUrl);
}
@Override
public int size() {
return mImageUrlList.size();
}
@Override
public int getPosition(int index) {
return mPositionList.get(index);
}
@Override
public String getPageUrlAt(int index) {
return mPageUrlList.get(index);
}
@Override
public GalleryPreview getGalleryPreview(long gid, int index) {
GalleryPreview galleryPreview = new GalleryPreview();
galleryPreview.position = mPositionList.get(index);
galleryPreview.imageKey = EhCacheKeyFactory.getLargePreviewKey(gid, galleryPreview.position);
galleryPreview.imageUrl = mImageUrlList.get(index);
galleryPreview.pageUrl = mPageUrlList.get(index);
return galleryPreview;
}
@Override
public void load(LoadImageView view, long gid, int index) {
view.resetClip();
view.load(EhCacheKeyFactory.getLargePreviewKey(gid, mPositionList.get(index)),
mImageUrlList.get(index));
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeParcelable(this.mPositionList, flags);
dest.writeStringList(this.mImageUrlList);
dest.writeStringList(this.mPageUrlList);
}
public LargePreviewSet() {
mPositionList = new IntList();
mImageUrlList = new ArrayList<>();
mPageUrlList = new ArrayList<>();
}
protected LargePreviewSet(Parcel in) {
this.mPositionList = in.readParcelable(IntList.class.getClassLoader());
this.mImageUrlList = in.createStringArrayList();
this.mPageUrlList = in.createStringArrayList();
}
public static final Parcelable.Creator<LargePreviewSet> CREATOR = new Parcelable.Creator<LargePreviewSet>() {
@Override
public LargePreviewSet createFromParcel(Parcel source) {
return new LargePreviewSet(source);
}
@Override
public LargePreviewSet[] newArray(int size) {
return new LargePreviewSet[size];
}
};
}
@@ -0,0 +1,609 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import com.hippo.ehviewer.client.EhConfig;
import com.hippo.ehviewer.client.EhUrl;
import com.hippo.ehviewer.client.EhUtils;
import com.hippo.ehviewer.dao.QuickSearch;
import com.hippo.ehviewer.widget.AdvanceSearchTable;
import com.hippo.network.UrlBuilder;
import com.hippo.yorozuya.NumberUtils;
import com.hippo.yorozuya.StringUtils;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.net.URLDecoder;
import java.net.URLEncoder;
public class ListUrlBuilder implements Cloneable, Parcelable {
@IntDef({MODE_NORMAL, MODE_UPLOADER, MODE_TAG, MODE_WHATS_HOT, MODE_IMAGE_SEARCH, MODE_SUBSCRIPTION})
@Retention(RetentionPolicy.SOURCE)
private @interface Mode {}
// Mode
public static final int MODE_NORMAL = 0x0;
public static final int MODE_UPLOADER = 0x1;
public static final int MODE_TAG = 0x2;
public static final int MODE_WHATS_HOT = 0x3;
public static final int MODE_IMAGE_SEARCH = 0x4;
public static final int MODE_SUBSCRIPTION = 0x5;
public static final int DEFAULT_ADVANCE = AdvanceSearchTable.SNAME | AdvanceSearchTable.STAGS;
public static final int DEFAULT_MIN_RATING = 2;
@Mode
private int mMode = MODE_NORMAL;
private int mPageIndex = 0;
private int mCategory = EhUtils.NONE;
private String mKeyword = null;
private int mAdvanceSearch = -1;
private int mMinRating = -1;
private int mPageFrom = -1;
private int mPageTo = -1;
private String mImagePath;
private boolean mUseSimilarityScan;
private boolean mOnlySearchCovers;
private boolean mShowExpunged;
/**
* Make this ListUrlBuilder point to homepage
*/
public void reset() {
mMode = MODE_NORMAL;
mPageIndex = 0;
mCategory = EhUtils.NONE;
mKeyword = null;
mAdvanceSearch = -1;
mMinRating = -1;
mPageFrom = -1;
mPageTo = -1;
mImagePath = null;
mUseSimilarityScan = false;
mOnlySearchCovers = false;
mShowExpunged = false;
}
@Override
public ListUrlBuilder clone() {
try {
return (ListUrlBuilder) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(e);
}
}
@Mode
public int getMode() {
return mMode;
}
public void setMode(@Mode int mode) {
mMode = mode;
}
public int getPageIndex() {
return mPageIndex;
}
public void setPageIndex(int pageIndex) {
mPageIndex = pageIndex;
}
public int getCategory() {
return mCategory;
}
public void setCategory(int category) {
mCategory = category;
}
public String getKeyword() {
return mKeyword;
}
public void setKeyword(String keyword) {
mKeyword = keyword;
}
public int getAdvanceSearch() {
return mAdvanceSearch;
}
public void setAdvanceSearch(int advanceSearch) {
mAdvanceSearch = advanceSearch;
}
public int getMinRating() {
return mMinRating;
}
public void setMinRating(int minRating) {
mMinRating = minRating;
}
public int getPageFrom() {
return mPageFrom;
}
public void setPageFrom(int pageFrom) {
mPageFrom = pageFrom;
}
public int getPageTo() {
return mPageTo;
}
public void setPageTo(int pageTo) {
mPageTo = pageTo;
}
@Nullable
public String getImagePath() {
return mImagePath;
}
public void setImagePath(String imagePath) {
mImagePath = imagePath;
}
public boolean isUseSimilarityScan() {
return mUseSimilarityScan;
}
public void setUseSimilarityScan(boolean useSimilarityScan) {
mUseSimilarityScan = useSimilarityScan;
}
public boolean isOnlySearchCovers() {
return mOnlySearchCovers;
}
public void setOnlySearchCovers(boolean onlySearchCovers) {
mOnlySearchCovers = onlySearchCovers;
}
public boolean isShowExpunged() {
return mShowExpunged;
}
public void setShowExpunged(boolean showExpunged) {
mShowExpunged = showExpunged;
}
/**
* Make them the same
* @param lub The template
*/
public void set(ListUrlBuilder lub) {
mMode = lub.mMode;
mPageIndex = lub.mPageIndex;
mCategory = lub.mCategory;
mKeyword = lub.mKeyword;
mAdvanceSearch = lub.mAdvanceSearch;
mMinRating = lub.mMinRating;
mPageFrom = lub.mPageFrom;
mPageTo = lub.mPageTo;
mImagePath = lub.mImagePath;
mUseSimilarityScan = lub.mUseSimilarityScan;
mOnlySearchCovers = lub.mOnlySearchCovers;
mShowExpunged = lub.mShowExpunged;
}
public void set(QuickSearch q) {
mMode = q.mode;
mCategory = q.category;
mKeyword = q.keyword;
mAdvanceSearch = q.advanceSearch;
mMinRating = q.minRating;
mPageFrom = q.pageFrom;
mPageTo = q.pageTo;
mImagePath = null;
mUseSimilarityScan = false;
mOnlySearchCovers = false;
mShowExpunged = false;
}
public QuickSearch toQuickSearch() {
QuickSearch q = new QuickSearch();
q.mode = mMode;
q.category = mCategory;
q.keyword = mKeyword;
q.advanceSearch = mAdvanceSearch;
q.minRating = mMinRating;
q.pageFrom = mPageFrom;
q.pageTo = mPageTo;
return q;
}
public boolean equalsQuickSearch(QuickSearch q) {
if (null == q) {
return false;
}
if (q.mode != mMode) {
return false;
}
if (q.category != mCategory) {
return false;
}
if (!StringUtils.equals(q.keyword, mKeyword)) {
return false;
}
if (q.advanceSearch != mAdvanceSearch) {
return false;
}
if (q.minRating != mMinRating) {
return false;
}
if (q.pageFrom != mPageFrom) {
return false;
}
if (q.pageTo != mPageTo) {
return false;
}
return true;
}
/**
* @param query xxx=yyy&mmm=nnn
*/
// TODO page
public void setQuery(String query) {
reset();
if (TextUtils.isEmpty(query)) {
return;
}
String[] querys = StringUtils.split(query, '&');
int category = 0;
String keyword = null;
boolean enableAdvanceSearch = false;
int advanceSearch = 0;
boolean enableMinRating = false;
int minRating = -1;
boolean enablePage = false;
int pageFrom = -1;
int pageTo = -1;
for (String str : querys) {
int index = str.indexOf('=');
if (index < 0) {
continue;
}
String key = str.substring(0, index);
String value = str.substring(index + 1);
switch (key) {
case "f_cats":
int cats = NumberUtils.parseIntSafely(value, EhConfig.ALL_CATEGORY);
category |= (~cats) & EhConfig.ALL_CATEGORY;
break;
case "f_doujinshi":
if ("1".equals(value)) {
category |= EhConfig.DOUJINSHI;
}
break;
case "f_manga":
if ("1".equals(value)) {
category |= EhConfig.MANGA;
}
break;
case "f_artistcg":
if ("1".equals(value)) {
category |= EhConfig.ARTIST_CG;
}
break;
case "f_gamecg":
if ("1".equals(value)) {
category |= EhConfig.GAME_CG;
}
break;
case "f_western":
if ("1".equals(value)) {
category |= EhConfig.WESTERN;
}
break;
case "f_non-h":
if ("1".equals(value)) {
category |= EhConfig.NON_H;
}
break;
case "f_imageset":
if ("1".equals(value)) {
category |= EhConfig.IMAGE_SET;
}
break;
case "f_cosplay":
if ("1".equals(value)) {
category |= EhConfig.COSPLAY;
}
break;
case "f_asianporn":
if ("1".equals(value)) {
category |= EhConfig.ASIAN_PORN;
}
break;
case "f_misc":
if ("1".equals(value)) {
category |= EhConfig.MISC;
}
break;
case "f_search":
try {
keyword = URLDecoder.decode(value, "utf-8");
} catch (UnsupportedEncodingException | IllegalArgumentException e) {
// Ignore
}
break;
case "advsearch":
if ("1".equals(value)) {
enableAdvanceSearch = true;
}
break;
case "f_sname":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SNAME;
}
break;
case "f_stags":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.STAGS;
}
break;
case "f_sdesc":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SDESC;
}
break;
case "f_storr":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.STORR;
}
break;
case "f_sto":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.STO;
}
break;
case "f_sdt1":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SDT1;
}
break;
case "f_sdt2":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SDT2;
}
break;
case "f_sh":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SH;
}
break;
case "f_sfl":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SFL;
}
break;
case "f_sfu":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SFU;
}
break;
case "f_sft":
if ("on".equals(value)) {
advanceSearch |= AdvanceSearchTable.SFT;
}
break;
case "f_sr":
if ("on".equals(value)) {
enableMinRating = true;
}
break;
case "f_srdd":
minRating = NumberUtils.parseIntSafely(value, -1);
break;
case "f_sp":
if ("on".equals(value)) {
enablePage = true;
}
break;
case "f_spf":
pageFrom = NumberUtils.parseIntSafely(value, -1);
break;
case "f_spt":
pageTo = NumberUtils.parseIntSafely(value, -1);
break;
}
}
mCategory = category;
mKeyword = keyword;
if (enableAdvanceSearch) {
mAdvanceSearch = advanceSearch;
if (enableMinRating) {
mMinRating = minRating;
} else {
mMinRating = -1;
}
if (enablePage) {
mPageFrom = pageFrom;
mPageTo = pageTo;
} else {
mPageFrom = -1;
mPageTo = -1;
}
} else {
mAdvanceSearch = -1;
}
}
public String build() {
switch (mMode) {
default:
case MODE_NORMAL:
case MODE_SUBSCRIPTION: {
String url;
if (mMode == MODE_NORMAL) {
url = EhUrl.getHost();
} else {
url = EhUrl.getWatchedUrl();
}
UrlBuilder ub = new UrlBuilder(url);
if (mCategory != EhUtils.NONE) {
ub.addQuery("f_cats", (~mCategory) & EhConfig.ALL_CATEGORY);
}
// Search key
if (mKeyword != null) {
String keyword = mKeyword.trim();
if (!keyword.isEmpty()) {
try {
ub.addQuery("f_search", URLEncoder.encode(mKeyword, "UTF-8"));
} catch (UnsupportedEncodingException e) {
// Empty
}
}
}
// Page index
if (mPageIndex != 0) {
ub.addQuery("page", mPageIndex);
}
// Advance search
if (mAdvanceSearch != -1) {
ub.addQuery("advsearch", "1");
if((mAdvanceSearch & AdvanceSearchTable.SNAME) != 0) ub.addQuery("f_sname", "on");
if((mAdvanceSearch & AdvanceSearchTable.STAGS) != 0) ub.addQuery("f_stags", "on");
if((mAdvanceSearch & AdvanceSearchTable.SDESC) != 0) ub.addQuery("f_sdesc", "on");
if((mAdvanceSearch & AdvanceSearchTable.STORR) != 0) ub.addQuery("f_storr", "on");
if((mAdvanceSearch & AdvanceSearchTable.STO) != 0) ub.addQuery("f_sto", "on");
if((mAdvanceSearch & AdvanceSearchTable.SDT1) != 0) ub.addQuery("f_sdt1", "on");
if((mAdvanceSearch & AdvanceSearchTable.SDT2) != 0) ub.addQuery("f_sdt2", "on");
if((mAdvanceSearch & AdvanceSearchTable.SH) != 0) ub.addQuery("f_sh", "on");
if((mAdvanceSearch & AdvanceSearchTable.SFL) != 0) ub.addQuery("f_sfl", "on");
if((mAdvanceSearch & AdvanceSearchTable.SFU) != 0) ub.addQuery("f_sfu", "on");
if((mAdvanceSearch & AdvanceSearchTable.SFT) != 0) ub.addQuery("f_sft", "on");
// Set min star
if (mMinRating != -1) {
ub.addQuery("f_sr", "on");
ub.addQuery("f_srdd", mMinRating);
}
// Pages
if (mPageFrom != -1 || mPageTo != -1) {
ub.addQuery("f_sp", "on");
ub.addQuery("f_spf", mPageFrom != -1 ? Integer.toString(mPageFrom) : "");
ub.addQuery("f_spt", mPageTo != -1 ? Integer.toString(mPageTo) : "");
}
}
return ub.build();
}
case MODE_UPLOADER: {
StringBuilder sb = new StringBuilder(EhUrl.getHost());
sb.append("uploader/");
try {
sb.append(URLEncoder.encode(mKeyword, "UTF-8"));
} catch (UnsupportedEncodingException e) {
// Empty
}
if (mPageIndex != 0) {
sb.append('/').append(mPageIndex);
}
return sb.toString();
}
case MODE_TAG: {
StringBuilder sb = new StringBuilder(EhUrl.getHost());
sb.append("tag/");
try {
sb.append(URLEncoder.encode(mKeyword, "UTF-8"));
} catch (UnsupportedEncodingException e) {
// Empty
}
if (mPageIndex != 0) {
sb.append('/').append(mPageIndex);
}
return sb.toString();
}
case MODE_WHATS_HOT:
return EhUrl.getPopularUrl();
case MODE_IMAGE_SEARCH:
return EhUrl.getImageSearchUrl();
}
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.mMode);
dest.writeInt(this.mPageIndex);
dest.writeInt(this.mCategory);
dest.writeString(this.mKeyword);
dest.writeInt(this.mAdvanceSearch);
dest.writeInt(this.mMinRating);
dest.writeInt(this.mPageFrom);
dest.writeInt(this.mPageTo);
dest.writeString(this.mImagePath);
dest.writeByte(mUseSimilarityScan ? (byte) 1 : (byte) 0);
dest.writeByte(mOnlySearchCovers ? (byte) 1 : (byte) 0);
dest.writeByte(mShowExpunged ? (byte) 1 : (byte) 0);
}
public ListUrlBuilder() {
}
@SuppressWarnings("WrongConstant")
protected ListUrlBuilder(Parcel in) {
this.mMode = in.readInt();
this.mPageIndex = in.readInt();
this.mCategory = in.readInt();
this.mKeyword = in.readString();
this.mAdvanceSearch = in.readInt();
this.mMinRating = in.readInt();
this.mPageFrom = in.readInt();
this.mPageTo = in.readInt();
this.mImagePath = in.readString();
this.mUseSimilarityScan = in.readByte() != 0;
this.mOnlySearchCovers = in.readByte() != 0;
this.mShowExpunged = in.readByte() != 0;
}
public static final Creator<ListUrlBuilder> CREATOR = new Creator<ListUrlBuilder>() {
@Override
public ListUrlBuilder createFromParcel(Parcel source) {
return new ListUrlBuilder(source);
}
@Override
public ListUrlBuilder[] newArray(int size) {
return new ListUrlBuilder[size];
}
};
}
@@ -0,0 +1,136 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcel;
import com.hippo.widget.LoadImageView;
import com.hippo.yorozuya.collect.IntList;
import java.util.ArrayList;
public class NormalPreviewSet extends PreviewSet {
private IntList mPositionList = new IntList();
private ArrayList<String> mImageKeyList = new ArrayList<>();
private ArrayList<String> mImageUrlList = new ArrayList<>();
private IntList mOffsetXList = new IntList();
private IntList mOffsetYList = new IntList();
private IntList mClipWidthList = new IntList();
private IntList mClipHeightList = new IntList();
private ArrayList<String> mPageUrlList = new ArrayList<>();
private String getImageKey(String imageUrl) {
int index = imageUrl.indexOf('/');
if (index >= 0) {
return imageUrl.substring(index + 1);
} else {
return imageUrl;
}
}
public void addItem(int position, String imageUrl, int xOffset, int yOffset, int width,
int height, String pageUrl) {
mPositionList.add(position);
mImageKeyList.add(getImageKey(imageUrl));
mImageUrlList.add(imageUrl);
mOffsetXList.add(xOffset);
mOffsetYList.add(yOffset);
mClipWidthList.add(width);
mClipHeightList.add(height);
mPageUrlList.add(pageUrl);
}
@Override
public int size() {
return mPositionList.size();
}
@Override
public int getPosition(int index) {
return mPositionList.get(index);
}
@Override
public String getPageUrlAt(int index) {
return mPageUrlList.get(index);
}
@Override
public GalleryPreview getGalleryPreview(long gid, int index) {
GalleryPreview galleryPreview = new GalleryPreview();
galleryPreview.position = mPositionList.get(index);
galleryPreview.imageKey = mImageKeyList.get(index);
galleryPreview.imageUrl = mImageUrlList.get(index);
galleryPreview.pageUrl = mPageUrlList.get(index);
galleryPreview.offsetX = mOffsetXList.get(index);
galleryPreview.offsetY = mOffsetYList.get(index);
galleryPreview.clipWidth = mClipWidthList.get(index);
galleryPreview.clipHeight = mClipHeightList.get(index);
return galleryPreview;
}
@Override
public void load(LoadImageView view, long gid, int index) {
view.setClip(mOffsetXList.get(index), mOffsetYList.get(index),
mClipWidthList.get(index), mClipHeightList.get(index));
view.load(mImageKeyList.get(index), mImageUrlList.get(index));
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeParcelable(this.mPositionList, flags);
dest.writeStringList(this.mImageKeyList);
dest.writeStringList(this.mImageUrlList);
dest.writeParcelable(this.mOffsetXList, flags);
dest.writeParcelable(this.mOffsetYList, flags);
dest.writeParcelable(this.mClipWidthList, flags);
dest.writeParcelable(this.mClipHeightList, flags);
dest.writeStringList(this.mPageUrlList);
}
public NormalPreviewSet() {
}
protected NormalPreviewSet(Parcel in) {
this.mPositionList = in.readParcelable(IntList.class.getClassLoader());
this.mImageKeyList = in.createStringArrayList();
this.mImageUrlList = in.createStringArrayList();
this.mOffsetXList = in.readParcelable(IntList.class.getClassLoader());
this.mOffsetYList = in.readParcelable(IntList.class.getClassLoader());
this.mClipWidthList = in.readParcelable(IntList.class.getClassLoader());
this.mClipHeightList = in.readParcelable(IntList.class.getClassLoader());
this.mPageUrlList = in.createStringArrayList();
}
public static final Creator<NormalPreviewSet> CREATOR = new Creator<NormalPreviewSet>() {
@Override
public NormalPreviewSet createFromParcel(Parcel source) {
return new NormalPreviewSet(source);
}
@Override
public NormalPreviewSet[] newArray(int size) {
return new NormalPreviewSet[size];
}
};
}
@@ -0,0 +1,34 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.data;
import android.os.Parcelable;
import com.hippo.widget.LoadImageView;
public abstract class PreviewSet implements Parcelable {
public abstract int size();
public abstract int getPosition(int index);
public abstract String getPageUrlAt(int index);
public abstract GalleryPreview getGalleryPreview(long gid, int index);
public abstract void load(LoadImageView view, long gid, int index);
}
@@ -0,0 +1,24 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class CancelledException extends Exception {
public CancelledException() {
super("CANCELED");
}
}
@@ -1,25 +1,28 @@
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.gallery.anim;
import com.hippo.ehviewer.gallery.glrenderer.GLCanvas;
public abstract class CanvasAnimation extends Animation {
public abstract int getCanvasSaveFlags();
public abstract void apply(GLCanvas canvas);
}
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class EhException extends Exception {
public EhException(String detailMessage) {
super(detailMessage);
}
public EhException(String detailMessage, Throwable cause) {
super(detailMessage, cause);
}
}
@@ -0,0 +1,24 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class Image509Exception extends EhException {
public Image509Exception() {
super("509");
}
}
@@ -0,0 +1,25 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class NoHAtHClientException extends EhException {
public NoHAtHClientException(String detailMessage) {
super(detailMessage);
}
}
@@ -1,22 +1,27 @@
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.gallery.ui;
public interface OrientationSource {
public int getDisplayRotation();
public int getCompensation();
}
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
/**
* It is an exception for get offensive tip for g.e-hentai.org
*/
public class OffensiveException extends EhException {
public OffensiveException() {
super("OFFENSIVE");
}
}
@@ -0,0 +1,36 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class ParseException extends EhException {
private String mBody;
public ParseException(String detailMessage, String body) {
super(detailMessage);
mBody = body;
}
public ParseException(String detailMessage, String body, Throwable cause) {
super(detailMessage, cause);
mBody = body;
}
public String getBody() {
return mBody;
}
}
Loaded 100 of 1092 files, more files were not shown because too many files have changed in this diff. Show more