Compare commits

..
155 Commits
Author SHA1 Message Date
tom5079 52a3339981 reload test 2022-01-21 16:12:51 +09:00
tom5079 226519ed38 Updated galleryblock.js 2022-01-21 15:58:36 +09:00
tom5079 208abfe127 0.0.6 publish hitomi.html 2022-01-20 15:58:59 +09:00
tom5079 42a06296b7 update misc.js 2022-01-20 15:41:11 +09:00
tom5079 2ac8bbf36d Code update 2022-01-20 15:35:49 +09:00
tom5079 47abbfe35b Code update 2022-01-20 15:33:16 +09:00
tom5079 620a3ee324 Updated gallery.js 2022-01-20 15:22:58 +09:00
tom5079 0453e7d2b6 Updated galleryblock.js 2022-01-20 15:16:31 +09:00
tom5079 c0682db621 Update gallery.js 2022-01-20 14:51:56 +09:00
tom5079 b85f4a6e53 Update gallery.js 2022-01-20 14:51:44 +09:00
tom5079 1656460b22 Updated gallery.js 2022-01-20 14:36:40 +09:00
tom5079 50686c8c3d Updated scripts 2022-01-20 14:27:53 +09:00
tom5079 b6c9e67fe4 Updated gallery.js 2022-01-20 14:05:37 +09:00
tom5079 cc4be07487 Created gallery.js 2022-01-20 14:01:11 +09:00
tom5079 af4bcb85fe Added flip_lazy_images 2022-01-20 13:08:48 +09:00
tom5079 d10c238578 Updated hitomi-dev.html.ver 2022-01-20 13:05:48 +09:00
tom5079 f1caf65d0c Created galleryblock.js 2022-01-20 13:04:45 +09:00
tom5079 ada8600722 Created galleryblock.js 2022-01-20 13:04:25 +09:00
tom5079 befb7a9366 file update 2022-01-06 04:28:10 +09:00
tom5079 d8731ac3ae file update 2022-01-06 04:28:10 +09:00
tom5079 945875e986 Update hitomi.html.ver 2022-01-06 04:22:59 +09:00
tom5079 8299cfdecc Update gg.js 2022-01-06 04:22:31 +09:00
tom5079 01d56a6660 Update hitomi.html.ver 2022-01-06 04:16:09 +09:00
tom5079 4eba5607b8 file update 2022-01-06 04:14:20 +09:00
tom5079 e22a04a21f Update gg-dev.js 2022-01-04 23:34:36 +09:00
tom5079 e9067761dc Update hitomi.html.ver 2022-01-04 23:31:50 +09:00
tom5079 918dff492f Update gg.js 2022-01-04 23:30:41 +09:00
tom5079 b9d3b8aa09 Update gg.js 2022-01-04 23:30:18 +09:00
tom5079 548f358813 Update hitomi.html.ver 2022-01-04 23:24:47 +09:00
tom5079 29ac81c6b1 Update gg.js 2022-01-04 23:21:46 +09:00
tom5079 053e8d8043 new scripts 2022-01-04 19:00:31 +09:00
tom5079 ae10743fbd test autoreload 2022-01-04 18:48:38 +09:00
tom5079 aa426e3331 test autoupdate 2022-01-04 18:40:39 +09:00
tom5079 7727589ee7 test autorefresh 2022-01-04 18:35:20 +09:00
tom5079 88102d56c9 Created hitomi-dev.html.ver 2022-01-04 18:26:06 +09:00
tom5079 fa2a105872 dev scripts 2022-01-04 18:18:02 +09:00
tom5079 dc501074de Removed viewport 2022-01-04 18:04:45 +09:00
tom5079 619fd15c8c Deleted https-server.py 2022-01-04 18:03:51 +09:00
tom5079 6947f61052 Created hitomi-dev.html 2022-01-04 18:03:51 +09:00
tom5079 263f438e4b Update common.js 2022-01-04 00:28:25 +09:00
tom5079 93bf6f4302 File update 2022-01-04 00:24:23 +09:00
tom5079 534533dc62 Update hitomi.html 2022-01-03 23:55:32 +09:00
tom5079 8bc2864eba Update hitomi.html 2022-01-03 23:54:54 +09:00
tom5079 b269b40a0a Update hitomi.html 2022-01-03 16:57:02 +09:00
tom5079 03f3963836 Update hitomi.html 2022-01-03 16:21:44 +09:00
tom5079 e6ab86d076 Update hitomi.html 2022-01-03 16:15:33 +09:00
tom5079 72bd25217c Create hitomi.html 2022-01-03 14:34:42 +09:00
tom5079 405d528db1 Post added 2020-10-01 23:01:38 +09:00
tom5079 e6d26f0116 Post added 2020-10-01 23:00:28 +09:00
tom5079 16adb6d032 Post added 2020-10-01 22:58:43 +09:00
tom5079 969e962881 Post added 2020-10-01 22:58:22 +09:00
tom5079 35e1f1509e updated screenshot 2020-09-27 19:30:30 +09:00
tom5079 5f547f7ba6 updated screenshot 2020-09-27 19:30:12 +09:00
tom5079 46bb61ac64 updated screenshot 2020-09-27 19:29:00 +09:00
tom5079 4e2e032819 update 2020-09-26 19:49:45 +09:00
Pupil 6a240b46ac . 2020-02-04 14:52:50 +09:00
Pupil 95922b1fce . 2020-02-04 14:47:54 +09:00
Pupil b7c6735975 Update _config.yml 2020-01-31 10:54:19 +09:00
Pupil b5d94ac8c0 Update _config.yml 2020-01-13 20:39:25 +09:00
tom5079 124ee249ed Version 4.2 2020-01-13 15:21:15 +09:00
tom5079 dc0d9365c4 Update _config.yml 2019-12-14 17:08:20 +09:00
tom5079 6c01418f01 Version v4.2-beta1 2019-12-13 20:20:39 +09:00
tom5079 3464957ce5 Update _config.yml 2019-11-02 21:47:47 +09:00
tom5079 c4db4c8f0f Update 2019-06-06-manual-kr.md 2019-11-02 21:16:21 +09:00
tom5079 66f16d78f0 . 2019-11-02 21:13:32 +09:00
tom5079 f64a688df9 typo 2019-11-02 20:54:35 +09:00
tom5079 55b7dc4c9f Version 4.0 2019-11-02 20:46:12 +09:00
tom5079 d53b7d2562 Added screenshots 2019-08-30 22:19:41 +09:00
tom5079 566fb7099b Version 3.3 2019-08-30 22:00:40 +09:00
tom5079 adaa15c080 Manual updated 2019-08-30 00:19:22 +09:00
tom5079 ce4ee6076c Version 3.2 2019-08-29 12:16:07 +09:00
tom5079 ed18adc962 Beta version! 2019-07-21 21:19:44 +09:00
tom5079 8e2f36b349 Version 3.1 2019-07-10 21:17:36 +09:00
tom5079 add8351e8c . 2019-07-08 23:18:51 +09:00
tom5079 3d51ebae45 asdf 2019-07-07 17:32:35 +09:00
tom5079 e32ac91070 srsly 2019-07-07 17:14:46 +09:00
tom5079 61a7bb6393 Redirect to github 2019-07-07 15:35:32 +09:00
tom5079 2a7e46c3cb Version 2.11.1 2019-06-23 23:29:04 +09:00
tom5079 ea1bc2e59a Version 2.11 2019-06-23 23:12:23 +09:00
tom5079 851234a5be Version 2.10.1 2019-06-23 17:30:49 +09:00
tom5079 30efdd605d Version 2.10 2019-06-23 16:25:43 +09:00
tom5079 805be867a5 Version 2.9.1 2019-06-23 16:14:31 +09:00
tom5079 404e44a4cf a 2019-06-23 16:12:59 +09:00
tom5079 cf83d53ec6 Version 2.10 2019-06-23 15:10:18 +09:00
tom5079 89031e589e Version 2.9.1 2019-06-14 20:12:15 +09:00
tom5079 c7fcf8929e Version 2.9 2019-06-13 21:51:42 +09:00
tom5079 3f62af5c87 Version 2.8 2019-06-12 21:59:55 +09:00
tom5079 1f6707e99c description 2019-06-12 21:44:07 +09:00
tom5079 b0e064bee7 description 2019-06-12 21:41:34 +09:00
tom5079 9622a40eb0 Beautify 2019-06-11 19:33:14 +09:00
tom5079 7dac537a38 Intragit add . 2019-06-11 19:29:29 +09:00
tom5079 1092999502 Added kakaotalk group chat link 2019-06-11 19:25:06 +09:00
tom5079 2a2cbf7354 Version 2.8 2019-06-09 15:34:40 +09:00
tom5079 64c568a99d manual update 2019-06-08 16:03:15 +09:00
tom5079 e8fb8e9fd3 Version 2.7 2019-06-08 15:37:28 +09:00
tom5079 cd2dd5cd93 Version 2.6 2019-06-07 21:52:59 +09:00
tom5079 fbf5309085 Version 2.5.3 2019-06-07 20:37:12 +09:00
tom5079 f51aa39ff8 Version 2.5.2 2019-06-07 20:31:04 +09:00
tom5079 b267d5b400 Version 2.5 2019-06-06 16:24:03 +09:00
tom5079 da8b3b9a7b Version 2.5 2019-06-06 16:17:09 +09:00
tom5079 1a8f1137b6 Version 2.5 2019-06-06 16:16:05 +09:00
tom5079 37e8598f0a Version 2.3 2019-06-06 16:10:13 +09:00
tom5079 534e25d049 Version 2.3 2019-06-06 16:00:42 +09:00
tom5079 8cdf6b08d0 version 2.3 2019-06-06 14:21:37 +09:00
tom5079 5097d92d27 Pupil v2.2 released 2019-06-02 01:21:23 +09:00
tom5079 a092c782b4 Deleted lang support 2019-05-30 20:24:45 +09:00
tom5079 e124d37ea6 https block bypass post 2019-05-30 20:10:11 +09:00
tom5079 e1b1867a39 post added 2019-05-19 11:52:52 +09:00
tom5079 981ee36cae Version 2.1 2019-05-19 11:40:30 +09:00
tom5079 e838f193ea Version 2.0 released 2019-05-18 23:34:46 +09:00
tom5079 5df9029686 language redirect fixed 2019-05-17 23:33:19 +09:00
tom5079 504b7bf090 add layout to index.html 2019-05-16 21:29:52 +09:00
tom5079 b266177ed1 Added comment! 2019-05-16 13:29:00 +09:00
tom5079 78050cfe9f Merge branch 'gh-pages' of https://github.com/tom5079/Pupil into gh-pages
version 1.4 launched
2019-05-16 13:24:14 +09:00
tom5079 2d101708ec Add blog posts 2019-05-16 13:24:11 +09:00
tom5079 194012d87f Merge branch 'gh-pages' of https://github.com/tom5079/Pupil into gh-pages 2019-05-16 13:12:10 +09:00
tom5079 19291e1f4f update 1.4 2019-05-16 13:10:59 +09:00
tom5079 4e76e7fa30 Fixed description 2019-05-16 09:34:31 +09:00
tom5079 d20a0c9963 Added blog post! 2019-05-16 09:27:43 +09:00
tom5079 f9a2f9bd11 multilanguage implemented 2019-05-15 19:32:38 +09:00
tom5079 4d67bbc76e Gemfile added 2019-05-15 16:07:45 +09:00
tom5079 e449dceda5 Pupil v1.3 released 2019-05-14 19:23:42 +09:00
tom5079 d78042824c rollback 2019-05-14 13:36:35 +09:00
tom5079 5a7982fc8f Revert "Update default.html"
This reverts commit c91bdd2ab5.
2019-05-14 04:06:02 +09:00
tom5079 ef4b6e319d Revert "Revert "Revert "Update default.html"""
This reverts commit 4edf99aca3.
2019-05-14 04:05:58 +09:00
tom5079 4edf99aca3 Revert "Revert "Update default.html""
This reverts commit e5edba7845.
2019-05-14 04:05:50 +09:00
tom5079 e5edba7845 Revert "Update default.html"
This reverts commit f070c110a8.
2019-05-14 04:05:43 +09:00
tom5079 f070c110a8 Update default.html 2019-05-13 22:33:45 +09:00
tom5079 c91bdd2ab5 Update default.html 2019-05-13 22:23:14 +09:00
tom5079 a0ddaf2f34 Added multianguage plugin 2019-05-13 22:19:45 +09:00
tom5079 c1c9a542be Update _config.yml 2019-05-13 22:05:02 +09:00
tom5079 025b6302f4 Merge branch 'gh-pages' of https://github.com/tom5079/Pupil into gh-pages 2019-05-12 21:32:11 +09:00
tom5079 857dd0ef26 Update default.html 2019-05-12 21:32:08 +09:00
tom5079 7baccc44de Delete CNAME 2019-05-12 20:40:06 +09:00
tom5079 a3a3212f85 Create CNAME 2019-05-12 20:39:30 +09:00
tom5079 4fc018aab9 Pupil 1.1 released 2019-05-12 20:10:31 +09:00
tom5079 a11013a09d Pupil v1.0.0 released 2019-05-12 19:19:45 +09:00
tom5079 2be5c025bf Update default.html 2019-05-12 01:36:45 +09:00
tom5079 be750019d9 Update default.html 2019-05-12 01:35:40 +09:00
tom5079 ecce969d1b Edited favicon 2019-05-12 01:34:12 +09:00
tom5079 0854226534 favicon added 2019-05-12 01:29:40 +09:00
tom5079 c775be1704 Update index.md 2019-05-12 01:23:15 +09:00
tom5079 bfb65e9a11 Update _config.yml 2019-05-12 01:20:37 +09:00
tom5079 4be49c6041 Update default.html 2019-05-12 01:18:17 +09:00
tom5079 3aca4eca97 Update _config.yml 2019-05-12 01:17:31 +09:00
tom5079 7bdcec1ea2 updated config 2019-05-12 01:17:03 +09:00
tom5079 52c0b9e2e5 Using github cayman theme 2019-05-12 01:06:20 +09:00
tom5079 c4c7be3dec Customized pages 2019-05-12 00:52:09 +09:00
tom5079 9b138cd0c4 Deployed cayman theme 2019-05-12 00:46:52 +09:00
tom5079 92045ec23f Update _config.yml 2019-05-12 00:44:53 +09:00
tom5079 8d368af8b0 Move default.html 2019-05-12 00:08:12 +09:00
tom5079 4af39469e5 Create .gitignore 2019-05-12 00:06:39 +09:00
tom5079 bc3b7e0d7a Create index.html 2019-05-12 00:00:40 +09:00
tom5079 39c2652fae Update _config.yml 2019-05-11 23:23:21 +09:00
tom5079 bfc8d76aed Initial commit 2019-05-11 23:13:41 +09:00
156 changed files with 9434 additions and 7638 deletions
+6 -33
View File
@@ -1,33 +1,6 @@
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof
_site
.bundle
.sass-cache
Gemfile.lock
.DS_Store
*.pem
+15
View File
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8000/hitomi-dev.html",
"webRoot": "${workspaceFolder}"
}
]
}
+3
View File
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
-4
View File
@@ -1,4 +0,0 @@
License is specified in following module separately
app/
libpupil/
+60 -17
View File
@@ -1,26 +1,69 @@
![Banner](https://github.com/tom5079/Pupil/blob/gh-pages/assets/images/pupil-banner.png?raw=true)
*Pupil, Hitomi.la viewer for Android*
# Jekyll Cayman theme
![](https://img.shields.io/github/downloads/tom5079/Pupil/total)
[![](https://img.shields.io/github/downloads/tom5079/Pupil/5.3.8-hotfix1/Pupil-v5.3.8-hotfix1.apk?color=%234fc3f7&label=DOWNLOAD%20APP&style=for-the-badge)](https://github.com/tom5079/Pupil/releases/download/5.3.8-hotfix1/Pupil-v5.3.8-hotfix1.apk)
[![](https://discordapp.com/api/guilds/610452916612104194/embed.png?style=banner2)](https://discord.gg/Stj4b5v)
This is a [Jekyll][1] theme for [@jasonlong][2]'s [Cayman theme][4] on [GitHub Pages][3].
# Features
![Main Screen](https://github.com/tom5079/Pupil/blob/gh-pages/assets/images/main-screenshot.jpg?raw=true)
Cayman is a clean, responsive theme for [GitHub Pages](https://pages.github.com). This theme is available as an option if you use the [Automatic Page Generator](https://help.github.com/articles/creating-pages-with-the-automatic-generator/) or you can copy the template and styles to use on your own.
# Installation
You can preview the theme at https://jasonlong.github.io/cayman-theme or with real content at https://jasonlong.github.io/geo_pattern.
Go [Releases page](https://github.com/tom5079/Pupil/releases) and get latest version or
Visit [github page](https://tom5079.github.io/Pupil/) (only available in Korean)
or Build app yourself
![](https://cl.ly/image/1T3r3d18311V/content)
# Manual
# How to use it?
[Manual](https://tom5079.github.io/Pupil/2019/06/06/manual-kr.html) is only available in Korean. Consider using translator.
Download the theme @ https://github.com/pietromenna/jekyll-cayman-theme/archive/master.zip
# Contribution
Unzip it and use it as a regular jekyll folder.
Any kind of contribution is appreciated. Feel free to leave PR!
```
$ unzip jekyll-cayman-theme-master.zip
```
## Tag Translation
Head over to [tags branch](https://github.com/tom5079/Pupil/tree/tags)
Get inside the newly extracted folder
```
$ cd jekyll-cayman-theme-master
```
Get the required gems
```
$ bundle install
```
Use it!
```
$ jekyll serve
```
For more details read about [Jekyll][1] on its web page.
# Setup
Some important configuration can be done in the file `_config.yml`. Please, check the Setup section in that file.
## baseurl
`baseurl` parameter is required in the case the site doesn't sit on the root of the domain. For example: https://pietromenna.github.io/jekyll-cayman-theme
In the case above the baseurl should be set to "/jekyll-cayman-theme".
In the case the site sits in the root, you can leave `baseurl` as empty "".
# Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/pietromenna/jekyll-cayman-theme.
# Development
To set up your environment to develop this theme, run `bundle install`.
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
# License
This work is licensed under a [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) license.
[1]: https://jekyllrb.com/
[2]: https://github.com/jasonlong
[3]: https://pages.github.com/
[4]: https://github.com/jasonlong/cayman-theme
+33
View File
@@ -0,0 +1,33 @@
theme: jekyll-theme-cayman
plugins:
- jekyll-sitemap
title: Pupil
description: Hitomi.la viewer for Android
baseurl: "/Pupil"
google_analytics: UA-119938781-2
disqus_url: "https://pupil.disqus.com"
discord_url: "https://discord.gg/Stj4b5v"
github_url: "https://github.com/tom5079/Pupil"
t:
en:
header:
description: "Hitomi.la viewer for Android"
download: "Download app"
issue: "Having a problem?"
or: "or…"
email: "Send an E-mail"
discord: "Join Discord server"
ko:
header:
description: "안드로이드 Hitomi.la 뷰어"
download: "앱 다운로드"
issue: "문제가 있으세요?"
or: "또는…"
email: "이메일 보내기"
discord: "디스코드"
+10
View File
@@ -0,0 +1,10 @@
---
layout: default
lang: ko
title: 히토미를 여행하는 신사들을 위한 안내서
---
![대충 히오스 로고]({{ "/assets/images/2019-05-16-hos.jpg" | absolute_url }})
*히옷!*
안녕하십니까, 전국 방방곡곡의 신사 여러분들~!
Binary file not shown.
+95
View File
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: " en-US " }}">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://kit.fontawesome.com/695c47bd28.js" crossorigin="anonymous"></script>
{% if site.google_analytics %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
<meta charset="UTF-8">
{% seo %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/styles.css' | absolute_url }}">
<link rel="shortcut icon" href="/Pupil/favicon.ico" type="image/x-icon" />
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
var disqus_config = function() {
this.page.url = '{{ site.url }}{{ page.url }}'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = '{{ page.id }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
this.page.language = '{{ page.lang }}';
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document,
s = d.createElement('script');
s.src = 'https://pupil.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<script type='text/javascript' src='/Pupil/assets/js/pupil.js'></script>
<script>
Promise.resolve()
.then(getLatestRelease)
.then(result => {
let url = result["assets"][0]["browser_download_url"];
$("#download-btn").attr("href", url)
})
.catch(err => {
console.log(err)
})
</script>
</head>
<body>
<header class="page-header" role="banner">
<a href="https://tom5079.github.io/Pupil" style="text-decoration:none; color:inherit;"><h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1></a>
<h2 class="project-tagline">{{ site.t[page.lang].header.description }}</h2>
<a id="download-btn" class="btn">{{ site.t[page.lang].header.download }}</a>
<p/>
<div class="wrap">
<a href="{{ site.github_url }}"><i class="fab fa-github"></i></a>
<a href="mailto:pupil.hentai@gmail.com"><i class="fas fa-envelope"></i></a>
<a href="{{ site.discord_url }}"><i class="fab fa-discord"></i></a>
</div>
</header>
<main id="content" class="main-content" role="main">
{{ content }}
<footer class="site-footer">
<div id="disqus_thread"></div>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% if site.github.is_project_page %}
<span class="site-footer-owner">{{ site.github.repository_name }} is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span> {% endif %}
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</main>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
---
layout: default
lang: ko
title: 접속 불가 현상 해결법
description: 히토미 뷰어 Pupil 접속 불가 현상 해결법
date: 2020-10-01
---
**현재 Intra/유니콘/Aspear 등으로 접속이 불가능합니다.**
**1줄요약: [PowerTunnel](https://github.com/krlvm/PowerTunnel-Android) / [1.1.1.1](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone)쓰세요**
![로고]({{ "assets/images/warning.or.kr.jpg" | absolute_url }})
*익숙한 `그` 화면*
현재 일부 통신사에서 https 차단이 시행되고 있는 관계로 우회접속을 해야합니다.
# 해결 방법
## 1. PowerTunnel(속도저하 없음, 무료)
테스트해본 앱 중 유일하게 작동하는 앱입니다.
SNI 파편화로 작동하며, 외부 서버를 경유하지 않아 속도가 가장 빠릅니다.
[Github](https://github.com/krlvm/PowerTunnel-Android)
## 2. 1.1.1.1(속도저하 거의 없음, 무료)
Cloudflare에서 제공하는 검열 우회 앱입니다.
가까운 Cloudflare 서버를 경유하여 일반 VPN보다는 빠른 속도가 특징입니다.
[플레이스토어 링크](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone)
## 3. VPN
확실한 해결 방법입니다.
추천 VPN으로는
* Tunnelbear(한 달 1.5GB 무료, 이후 유료)
* Betternet(무료)
* NordVPN(유료)
가 있습니다. 속도는 NordVPN>Tunnelbear>Betternet순입니다.
개인적으로 Tunnelbear을 추천드립니다.
+179
View File
@@ -0,0 +1,179 @@
---
layout: default
lang: ko
title: Pupil v4.0 사용 설명서
description: 히토미 뷰어 Pupil 사용 설명서
---
일단 읽어 보셔봐
**취소 버튼이 없는 알림창은 알림창 밖을 누르면 취소됩니다**
**만화 내보내기 기본 위치는 `내장메모리/Pupil`폴더 입니다.**
**결과 없음/연결 오류/썸네일 안 나오시는 분들은 [접속 불가 해결법](https://tom5079.github.io/Pupil/2019/05/30/https-block-kr.html)을 참조해 주세요!**
# 1. 메인 화면
![메인 화면]({{ "assets/images/manual/main.png" | absolute_url }})
1. <span style="color:rgb(34,177,76)">사이드 메뉴 열기</span>
2. <span style="color:rgb(255,127,39)">검색창</span>
3. <span style="color:rgb(0,162,232)">설정</span>
4. <span style="color:rgb(255,174,201)">기타</span>
- 정렬 설정 (시간순, 인기순)
5. <span style="color:rgb(185,122,87)">다운로드 상태</span>
- 녹색: 다운로드 완료
- 적색: 다운로드 중
- 없음: 다운로드 안 됨
6. <span style="color:rgb(237,28,36)">태그</span>
- 태그를 누르면 해당 태그로 검색됩니다
7. <span style="color:rgb(163,73,164)">갤러리 번호</span>
- 태그를 누르면 검색됩니다
8. <span style="color:rgb(255,242,0)">즐겨찾기</span>
9. <span style="color:rgb(181,230,29)">추가 기능</span>
- 페이지 이동: 원하는 페이지로 바로 이동
- 갤러리 번호로 열기: 갤러리 번호로 뷰어를 엽니다
## 1-1. 검색
검색창에 태그/검색어를 입력하면 검색이 됩니다
![추천 태그]({{ "assets/images/manual/search.png" | absolute_url }})
검색어를 덜 입력하면 추천 태그가 나옵니다.
물론 즐겨찾기 된 태그가 제일 앞에 표시됩니다.
우측 별 아이콘을 누르면 즐겨찾기 태그로 등록할 수 있습니다.
![즐겨찾기 태그]({{ "assets/images/manual/search-favorite.png" | absolute_url }})
즐겨찾기 태그는 검색어를 입력하지 않은 상태에서 나타납니다.
## 1-2. 페이지 이동
페이지 이동은 볼륨 버튼으로도 가능합니다
```
볼륨 상 -> 이전 페이지
볼륨 하 -> 다음 페이지
```
### 1-2.1. 다음 페이지
![다음]({{ "assets/images/manual/page-next.gif" | absolute_url }})
페이지 맨 아래에서 한 번 더 끌어주시면 됩니다
### 1-2.2. 이전 페이지
![이전]({{ "assets/images/manual/page-prev.gif" | absolute_url }})
페이지 맨 위에서 한 번 더 끌어주시면 됩니다
## 1-3. 갤러리 상세 보기
갤러리의 상세 정보를 볼 수 있습니다
해당하는 갤러리를 길게 눌러 주세요
![갤러리 상세정보]({{ "assets/images/manual/gallery-details.png" | absolute_url }})
* 갤러리 종류/작가/그룹/언어/태그를 볼 수 있습니다
- 클릭 시 해당 태그로 검색됩니다
* 썸네일 표시
* 연관 갤러리 표시
# 2. 뷰어
![뷰어]({{ "assets/images/manual/viewer.png" | absolute_url }})
1. <span style="color:rgb(0,0,0)">제목</span>
2. <span style="color:rgb(34,177,76)">즐겨찾기</span>
3. <span style="color:rgb(238,28,36)">hiyobi.me 사용 표시</span>
- hiyobi에서 이미지를 불러올 때 표시됩니다
4. <span style="color:rgb(163,73,164)">페이지 표시</span>
- 클릭 시 페이지 이동
5. <span style="color:rgb(255,127,39)">로딩 상태바</span>
- 다운로드 완료 시 사라짐
6. <span style="color:rgb(255,201,14)">백그라운드 다운로드 버튼</span>
7. <span style="color:rgb(0,162,232)">전체 화면 버튼</span>
## 2-1. 스크롤 모드
세로 스크롤 방식과 가로 스크롤 방식을 모두 지원합니다
![스크롤]({{ "assets/images/manual/viewer-showcase.gif" | absolute_url }})
* 세로 스크롤
* 기본 방식
* 세로 전체화면 스크롤
* 전체화면 버튼을 이용
* 가로 전체화면 스크롤
* 이미지를 한 번 클릭
* 뒤로가기 버튼으로 나갈 수 있음
# 3. 설정
## 3-1. 검색 설정
### 3-1.1. 한 번에 로드할 갤러리 수
한 페이지당 갤러리 수를 설정합니다.
기본 값은 `25`입니다.
### 3-1.2. 기본 검색어
![기본 검색어]({{ "assets/images/manual/default-query.png" | absolute_url }})
메인 화면에서 검색어를 지정하지 않아도 추가되는 검색어입니다.
한국어만 보고 싶을 때나 *특정 태그*에 관심이 있을 때 아주 유용합니다.
## 3-2. 캐시
### 3-1.1 캐시 삭제
캐시 된 갤러리를 삭제합니다.
### 3-1.2 다운로드 삭제
다운로드 된 갤러리를 삭제합니다.
다운로드 목록에서도 지워집니다.
### 3-1.3 기록 삭제
히스토리를 삭제합니다. 캐시된 이미지는 지워지지 않습니다.
## 3-3. 앱 잠금
시작 시 잠금을 지원합니다.
현재 패턴 잠금만 지원합니다.
패턴을 잊어버렸을 때는 앱을 재설치 해주시기 바랍니다.
## 3-4. 기타
### 3-4.1. hiyobi.me 사용
이미지 로딩 속도 향상을 위해 ***가급적이면*** 히요비에서 불러옵니다.
요즘 히요비가 계속 죽어서 효과가 없는 것 같기도 하고...
### 3-4.2. 보안 모드
최근 앱 목록 창에서 끄지 못한 히토미를 남이 보는 불상사를 아주 조금 방지합니다.
![보안 모드 ON]({{ "assets/images/manual/with-secure-mode.png" | absolute_url }})
*보안 모드 ON*
![보안 모드 OFF]({{ "assets/images/manual/without-secure-mode.png" | absolute_url }})
*보안 모드 OFF*
혹시 모르니까 켜 놓는게 좋습니다. **진짜루요**
### 3-4.3. 다크 모드
앱의 테마를 어두운 색깔로 바꿉니다.
밤에 볼때 좋겠지요^^*
![다크 모드 OFF]({{ "assets/images/manual/light-theme.png" | absolute_url }})
*다크 모드 OFF*
![다크 모드 ON]({{ "assets/images/manual/dark-theme.png" | absolute_url }})
*다크 모드 ON*
## 3-4.4. 이미지 숨기기
갤러리에서 다운로드한 이미지를 보이지 않게 합니다.
이런 곤란한 상황을 막아줍니다
![곤란...]({{ "assets/images/manual/oops.png" | absolute_url }})
*곤란...*
# 4. 갤러리 다운로드
갤러리를 다운로드 하시면 `내장메모리/Pupil/<갤러리ID>` 폴더에 저장됩니다.
이미지는 `images` 폴더에 이미지 번호 순서대로 저장되어 있습니다.
---
일단 여기까지입니다.
더 궁금하신 게 있으시면 이메일 주세요!
-1
View File
@@ -1 +0,0 @@
/build
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-1
View File
@@ -1 +0,0 @@
-95
View File
@@ -1,95 +0,0 @@
plugins {
alias(libs.plugins.org.jetbrains.kotlin.android)
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.googleServices)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.crashlytics)
}
android {
namespace = "xyz.quaver.pupil"
defaultConfig {
applicationId = "xyz.quaver.pupil"
minSdk = libs.versions.android.minSdk.get().toInt()
compileSdk = libs.versions.android.compileSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 69
versionName = "6.0.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("debug") {
isMinifyEnabled = false
isShrinkResources = false
isDebuggable = true
applicationIdSuffix = ".debug"
versionNameSuffix = "-DEBUG"
ext.set("enableCrashlytics", false)
ext.set("alwaysUpdateBuildId", false)
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
buildFeatures {
compose = true
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
dependencies {
coreLibraryDesugaring(libs.android.desugaring)
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.datetime)
implementation(libs.androidx.core)
implementation(libs.androidx.activity)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.windowSizeClass)
implementation(libs.androidx.compose.foundation)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.accompanist.adaptive)
implementation(libs.coil)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.perf)
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
implementation(libs.ktor.client)
implementation(libs.ktor.client.okhttp)
implementation(libs.documentFileX)
}
Binary file not shown.
Binary file not shown.
-35
View File
@@ -1,35 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-dontobfuscate
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt
-keep,includedescriptorclasses class xyz.quaver.**$$serializer { *; } # <-- change package name to your app's
-keepclassmembers class xyz.quaver.pupil.** { # <-- change package name to your app's
*** Companion;
}
-keepclasseswithmembers class xyz.quaver.pupil.** { # <-- change package name to your app's
kotlinx.serialization.KSerializer serializer(...);
}
-keep class xyz.quaver.pupil.** { *; }
-dontwarn org.slf4j.impl.StaticLoggerBinder
-20
View File
@@ -1,20 +0,0 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "xyz.quaver.pupil",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 69,
"versionName": "6.0.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
@@ -1,183 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2019 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@file:Suppress("UNUSED_VARIABLE")
package xyz.quaver.pupil
import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlinx.coroutines.runBlocking
import okhttp3.OkHttpClient
import okhttp3.Request
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import xyz.quaver.pupil.hitomi.*
import java.util.*
import java.util.concurrent.TimeUnit
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
// @Before
// fun init() {
// val appContext = InstrumentationRegistry.getInstrumentation().targetContext
// }
@Before
fun init() {
clientBuilder = OkHttpClient.Builder()
.readTimeout(0, TimeUnit.SECONDS)
.writeTimeout(0, TimeUnit.SECONDS)
.callTimeout(0, TimeUnit.SECONDS)
.connectTimeout(0, TimeUnit.SECONDS)
.addInterceptor { chain ->
val request = chain.request().newBuilder()
.header("Referer", "https://hitomi.la/")
.build()
chain.proceed(request)
}
}
@Test
fun test_empty() {
print(
"".trim()
.replace(Regex("""^\?"""), "")
.lowercase(Locale.getDefault())
.split(Regex("\\s+"))
.map {
it.replace('_', ' ')
})
}
@Test
fun test_nozomi() {
val nozomi = getGalleryIDsFromNozomi(null, "index", "all")
Log.d("PUPILD", nozomi.size.toString())
}
@Test
fun test_search() {
val ids = getGalleryIDsForQuery("language:korean").reversed()
print(ids.size)
}
@Test
fun test_suggestions() {
val suggestions = getSuggestionsForQuery("language:g")
print(suggestions)
}
@Test
fun test_doSearch() {
val r = runBlocking {
doSearch("language:korean")
}
Log.d("PUPILD", r.take(10).toString())
}
// @Test
// fun test_getBlock() {
// val galleryBlock = getGalleryBlock(2097576)
//
// print(galleryBlock)
// }
//
// @Test
// fun test_getGallery() {
// val gallery = getGallery(2097751)
//
// print(gallery)
// }
@Test
fun test_getGalleryInfo() {
val info = getGalleryInfo(1469394)
print(info)
}
@Test
fun test_getReader() {
val reader = getGalleryInfo(2128654)
Log.d("PUPILD", reader.toString())
}
@Test
fun test_getImages() { runBlocking {
val galleryID = 2128654
val images = getGalleryInfo(galleryID).files.map {
imageUrlFromImage(galleryID, it,false)
}
Log.d("PUPILD", images.toString())
// images.forEachIndexed { index, image ->
// println("Testing $index/${images.size}: $image")
// val response = client.newCall(
// Request.Builder()
// .url(image)
// .header("Referer", "https://hitomi.la/")
// .build()
// ).execute()
//
// assertEquals(200, response.code())
//
// println("$index/${images.size} Passed")
// }
} }
// @Test
// fun test_urlFromUrlFromHash() {
// val url = urlFromUrlFromHash(1531795, GalleryFiles(
// 212, "719d46a7556be0d0021c5105878507129b5b3308b02cf67f18901b69dbb3b5ef", 1, "00.jpg", 300
// ), "webp")
//
// print(url)
// }
// @Test
// suspend fun test_doSearch_extreme() {
// val query = "language:korean -tag:sample -female:humiliation -female:diaper -female:strap-on -female:squirting -female:lizard_girl -female:voyeurism -type:artistcg -female:blood -female:ryona -male:blood -male:ryona -female:crotch_tattoo -male:urethra_insertion -female:living_clothes -male:tentacles -female:slave -female:gag -male:gag -female:wooden_horse -male:exhibitionism -male:miniguy -female:mind_break -male:mind_break -male:unbirth -tag:scanmark -tag:no_penetration -tag:nudity_only -female:enema -female:brain_fuck -female:navel_fuck -tag:novel -tag:mosaic_censorship -tag:webtoon -male:rape -female:rape -female:yuri -male:anal -female:anal -female:futanari -female:huge_breasts -female:big_areolae -male:torture -male:stuck_in_wall -female:stuck_in_wall -female:torture -female:birth -female:pregnant -female:drugs -female:bdsm -female:body_writing -female:cbt -male:dark_skin -male:insect -female:insect -male:vore -female:vore -female:vomit -female:urination -female:urethra_insertion -tag:mmf_threesome -female:sex_toys -female:double_penetration -female:eggs -female:prolapse -male:smell -male:bestiality -female:bestiality -female:big_ass -female:milf -female:mother -male:dilf -male:netorare -female:netorare -female:cosplaying -female:filming -female:armpit_sex -female:armpit_licking -female:tickling -female:lactation -male:skinsuit -female:skinsuit -male:bbm -female:prostitution -female:double_penetration -female:females_only -male:males_only -female:tentacles -female:tentacles -female:stomach_deformation -female:hairy_armpits -female:large_insertions -female:mind_control -male:orc -female:dark_skin -male:yandere -female:yandere -female:scat -female:toddlercon -female:bbw -female:hairy -male:cuntboy -male:lactation -male:drugs -female:body_modification -female:monoeye -female:chikan -female:long_tongue -female:harness -female:fisting -female:glory_hole -female:latex -male:latex -female:unbirth -female:giantess -female:sole_dickgirl -female:robot -female:doll_joints -female:machine -tag:artbook -male:cbt -female:farting -male:farting -male:midget -female:midget -female:exhibitionism -male:monster -female:big_nipples -female:big_clit -female:gyaru -female:piercing -female:necrophilia -female:snuff -female:smell -male:cheating -female:cheating -male:snuff -female:harem -male:harem"
// print(doSearch(query).size)
// }
// @Test
// suspend fun test_parse() {
// print(doSearch("-male:yaoi -female:yaoi -female:loli").size)
// }
// @Test
// fun test_subdomainFromUrl() {
// val galleryInfo = getGalleryInfo(1929109).files[2]
// print(urlFromUrlFromHash(1929109, galleryInfo, "webp", null, "a"))
// }
}
-22
View File
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Pupil, Hitomi.la viewer for Android
~ Copyright (C) 2020 tom5079
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name" translatable="false" tools:override="true">Pupil-Debug</string>
</resources>
-65
View File
@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="23"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="23"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.RUN_USER_INITIATED_JOBS" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<application
android:name=".Pupil"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="UnusedAttribute" >
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face" />
<provider
android:authorities="${applicationId}.provider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<service android:name=".services.ImageCacheService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false" />
<activity
android:name=".ui.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Material.Light.NoActionBar"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

@@ -1,74 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2019 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package xyz.quaver.pupil
import android.app.Application
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import com.google.firebase.FirebaseApp
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.HiltAndroidApp
import xyz.quaver.io.FileX
import java.util.UUID
@HiltAndroidApp
class Pupil : Application() {
override fun onCreate() {
FirebaseApp.initializeApp(this)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
manager.createNotificationChannel(NotificationChannel("download", getString(R.string.channel_download), NotificationManager.IMPORTANCE_LOW).apply {
description = getString(R.string.channel_download_description)
enableLights(false)
enableVibration(false)
lockscreenVisibility = Notification.VISIBILITY_SECRET
})
manager.createNotificationChannel(NotificationChannel("downloader", getString(R.string.channel_downloader), NotificationManager.IMPORTANCE_LOW).apply {
description = getString(R.string.channel_downloader_description)
enableLights(false)
enableVibration(false)
lockscreenVisibility = Notification.VISIBILITY_SECRET
})
manager.createNotificationChannel(NotificationChannel("update", getString(R.string.channel_update), NotificationManager.IMPORTANCE_HIGH).apply {
description = getString(R.string.channel_update_description)
enableLights(true)
enableVibration(true)
lockscreenVisibility = Notification.VISIBILITY_SECRET
})
manager.createNotificationChannel(NotificationChannel("import", getString(R.string.channel_update), NotificationManager.IMPORTANCE_LOW).apply {
description = getString(R.string.channel_update_description)
enableLights(false)
enableVibration(false)
lockscreenVisibility = Notification.VISIBILITY_SECRET
})
}
super.onCreate()
}
}
@@ -1,24 +0,0 @@
package xyz.quaver.pupil.di
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import xyz.quaver.pupil.networking.FileImageCache
import xyz.quaver.pupil.networking.ImageCache
import java.io.File
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object SingletonModule {
@Singleton
@Provides
fun provideImageCache(
@ApplicationContext context: Context
): ImageCache {
return FileImageCache(File(context.cacheDir, "image_cache"))
}
}
@@ -1,110 +0,0 @@
package xyz.quaver.pupil.networking
import android.os.BaseBundle
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
interface TagLike {
fun toTag(): SearchQuery.Tag
}
@Serializable
data class Artist(val artist: String): TagLike {
override fun toTag() = SearchQuery.Tag("artist", artist)
}
@Serializable
data class Group(val group: String): TagLike {
override fun toTag() = SearchQuery.Tag("group", group)
}
@Serializable
data class Series(@SerialName("parody") val series: String): TagLike {
override fun toTag() = SearchQuery.Tag("series", series)
}
@Serializable
data class Character(val character: String): TagLike {
override fun toTag() = SearchQuery.Tag("character", character)
}
@Serializable
data class GalleryTag(
val tag: String,
val female: String? = null,
val male: String? = null
): TagLike {
override fun toTag() = SearchQuery.Tag(
if (female.isNullOrEmpty() && male.isNullOrEmpty()) {
"tag"
} else if (male.isNullOrEmpty()) {
"female"
} else {
"male"
},
tag
)
}
@Serializable
data class Language(
@SerialName("galleryid") val galleryID: String,
val name: String
)
@Serializable
data class GalleryFile(
@SerialName("haswebp") val hasWebP: Int = 0,
@SerialName("hasavif") val hasAVIF: Int = 0,
@SerialName("hasjxl") val hasJXL: Int = 0,
val height: Int,
val width: Int,
val hash: String,
val name: String,
) {
fun writeToBundle(bundle: BaseBundle) {
bundle.putInt("hasWebP", hasWebP)
bundle.putInt("hasAVIF", hasAVIF)
bundle.putInt("hasJXL", hasJXL)
bundle.putInt("height", height)
bundle.putInt("width", width)
bundle.putString("hash", hash)
bundle.putString("name", name)
}
companion object {
fun fromBundle(bundle: BaseBundle) = GalleryFile(
bundle.getInt("hasWebP"),
bundle.getInt("hasAVIF"),
bundle.getInt("hasJXL"),
bundle.getInt("height"),
bundle.getInt("width"),
bundle.getString("hash")!!,
bundle.getString("name")!!
)
}
}
@Serializable
data class GalleryInfo(
val id: String,
val title: String,
@SerialName("japanese_title") val japaneseTitle: String? = null,
val language: String? = null,
val type: String,
val date: String,
val artists: List<Artist>? = null,
val groups: List<Group>? = null,
@SerialName("parodys") val series: List<Series>? = null,
val tags: List<GalleryTag>? = null,
val related: List<Int> = emptyList(),
val languages: List<Language> = emptyList(),
val characters: List<Character>? = null,
@SerialName("scene_indexes") val sceneIndices: List<Int>? = emptyList(),
val files: List<GalleryFile> = emptyList()
)
@JvmName("joinToCapitalizedStringArtist")
fun List<Artist>.joinToCapitalizedString() = joinToString { it.artist.replaceFirstChar(Char::titlecase) }
@JvmName("joinToCapitalizedStringGroup")
fun List<Group>.joinToCapitalizedString() = joinToString { it.group.replaceFirstChar(Char::titlecase) }
@@ -1,36 +0,0 @@
package xyz.quaver.pupil.networking
import kotlinx.coroutines.Job
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
class GallerySearchSource(val query: SearchQuery?) {
private var searchResult: List<Int>? = null
private var job: Job? = null
suspend fun load(range: IntRange): Result<Pair<List<GalleryInfo>, Int>> = runCatching {
val searchResult = searchResult ?: (
HitomiHttpClient
.search(query)
.getOrThrow()
.toList()
.also { searchResult = it }
)
val galleryResults = coroutineScope {
searchResult.slice(range).map { galleryID ->
async {
HitomiHttpClient.getGalleryInfo(galleryID)
}
}
}
val galleries = galleryResults.map { result ->
result.await().getOrThrow()
}
Pair(galleries, searchResult.size)
}
fun cancel() = job?.cancel()
}
@@ -1,402 +0,0 @@
package xyz.quaver.pupil.networking
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.engine.okhttp.OkHttp
import io.ktor.client.plugins.onDownload
import io.ktor.client.request.get
import io.ktor.client.request.header
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.bodyAsText
import io.ktor.utils.io.ByteReadChannel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import kotlinx.datetime.Clock.System.now
import kotlinx.datetime.Instant
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonPrimitive
import java.nio.ByteBuffer
import java.nio.IntBuffer
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes
const val domain = "ltn.hitomi.la"
const val nozomiExtension = ".nozomi"
const val compressedNozomiPrefix = "n"
const val B = 16
const val indexDir = "tagindex"
const val maxNodeSize = 464
const val galleriesIndexDir = "galleriesindex"
const val tagIndexDomain = "tagindex.hitomi.la"
const val separator = "-"
const val extension = ".html"
data class Suggestion(
val tag: SearchQuery.Tag,
val count: Int,
)
fun IntBuffer.toSet(): Set<Int> {
val result = LinkedHashSet<Int>()
while (this.hasRemaining()) {
result.add(this.get())
}
return result
}
private val json = Json {
isLenient = true
ignoreUnknownKeys = true
}
class ImagePathResolver(ggjs: String) {
private val defaultPrefix: Int = Regex("var o = (\\d)").find(ggjs)!!.groupValues[1].toInt()
private val prefixMap: Map<Int, Int> = buildMap {
val o = Regex("o = (\\d); break;").find(ggjs)!!.groupValues[1].toInt()
Regex("case (\\d+):").findAll(ggjs).forEach {
val case = it.groupValues[1].toInt()
put(case, o)
}
}
private val imageBaseDir: String = Regex("b: '(.+)'").find(ggjs)!!.groupValues[1]
fun decodeSubdomain(hash: String, thumbnail: Boolean): String {
val key = (hash.last() + hash.dropLast(1).takeLast(2)).toInt(16)
val base = if (thumbnail) "tn" else "a"
return "${'a' + (prefixMap[key] ?: defaultPrefix)}$base"
}
fun decodeImagePath(hash: String, thumbnail: Boolean): String {
val key = hash.last() to hash.dropLast(1).takeLast(2)
return if (thumbnail) {
"${key.first}/${key.second}/$hash"
} else {
"$imageBaseDir/${(key.first + key.second).toInt(16)}/$hash"
}
}
}
class ExpirableEntry<T>(
private val expiryDuration: Duration,
private val action: suspend () -> T,
) {
private var value: T? = null
private var expiresAt: Instant = now()
private val mutex = Mutex()
suspend fun getValue(): T = mutex.withLock {
value?.let { if (expiresAt > now()) value else null } ?: action().also {
expiresAt = now() + expiryDuration
value = it
}
}
}
object HitomiHttpClient {
private val httpClient = HttpClient(OkHttp) {
engine {
config {
sslSocketFactory(SSLSettings.sslContext!!.socketFactory, SSLSettings.trustManager!!)
}
}
}
private var imagePathResolver = ExpirableEntry(1.minutes) {
ImagePathResolver(httpClient.get("https://ltn.hitomi.la/gg.js").bodyAsText())
}
private val tagIndexVersion = ExpirableEntry(1.minutes) { getIndexVersion("tagindex") }
private val galleriesIndexVersion =
ExpirableEntry(1.minutes) { getIndexVersion("galleriesindex") }
private suspend fun getIndexVersion(name: String): String = withContext(Dispatchers.IO) {
httpClient.get("https://$domain/$name/version?_=${System.currentTimeMillis()}").bodyAsText()
}
private suspend fun getURLAtRange(url: String, range: LongRange): ByteBuffer {
val response: HttpResponse = withContext(Dispatchers.IO) {
httpClient.get(url) {
header("Range", "bytes=${range.first}-${range.last}")
}
}
val result: ByteArray = response.body()
return ByteBuffer.wrap(result)
}
private suspend fun getNodeAtAddress(field: String, address: Long): Node {
val url = when (field) {
"galleries" -> "https://$domain/$galleriesIndexDir/galleries.${galleriesIndexVersion.getValue()}.index"
"languages" -> "https://$domain/$galleriesIndexDir/languages.${galleriesIndexVersion.getValue()}.index"
"nozomiurl" -> "https://$domain/$galleriesIndexDir/nozomiurl.${galleriesIndexVersion.getValue()}.index"
else -> "https://$domain/$indexDir/$field.${tagIndexVersion.getValue()}.index"
}
return Node.decodeNode(
getURLAtRange(url, address..<address + maxNodeSize)
)
}
private suspend fun bSearch(
field: String,
key: Node.Key,
node: Node,
): Node.Data? {
if (node.keys.isEmpty()) {
return null
}
val (matched, index) = node.locateKey(key)
if (matched) {
return node.datas[index]
} else if (node.isLeaf) {
return null
}
val nextNode = getNodeAtAddress(field, node.subNodeAddresses[index])
return bSearch(field, key, nextNode)
}
private suspend fun getGalleryIDsFromData(offset: Long, length: Int): IntBuffer {
val url =
"https://$domain/$galleriesIndexDir/galleries.${galleriesIndexVersion.getValue()}.data"
if (length > 100000000 || length <= 0) {
error("length $length is too long")
}
return getURLAtRange(url, offset until (offset + length)).asIntBuffer()
}
private fun encodeSearchQueryForUrl(s: Char) =
when (s) {
' ' -> "_"
'/' -> "slash"
'.' -> "dot"
else -> s.toString()
}
private fun sanitize(s: String) = s.replace(Regex("[/#]"), "")
private suspend fun getGalleryIDsFromNozomi(
area: String?,
tag: String,
language: String,
): IntBuffer {
val nozomiAddress = if (area == null) {
"https://$domain/$compressedNozomiPrefix/$tag-$language$nozomiExtension"
} else {
"https://$domain/$compressedNozomiPrefix/$area/$tag-$language$nozomiExtension"
}
val response: HttpResponse = withContext(Dispatchers.IO) {
httpClient.get(nozomiAddress)
}
val result: ByteArray = response.body()
return ByteBuffer.wrap(result).asIntBuffer()
}
private suspend fun getGalleryIDsForQuery(
query: SearchQuery.Tag,
language: String = "all",
): IntBuffer = when (query.namespace) {
"female", "male" -> getGalleryIDsFromNozomi("tag", query.toString(), language)
"language" -> getGalleryIDsFromNozomi(null, "index", query.tag)
null -> {
val key = Node.Key(query.tag)
val node = getNodeAtAddress("galleries", 0)
val data = bSearch("galleries", key, node)
if (data != null) getGalleryIDsFromData(
data.offset,
data.length
) else IntBuffer.allocate(0)
}
else -> getGalleryIDsFromNozomi(query.namespace, query.tag, language)
}
suspend fun getSuggestionsForQuery(query: SearchQuery.Tag): Result<List<Suggestion>> =
runCatching {
val field = query.namespace ?: "global"
val chars = query.tag.map(::encodeSearchQueryForUrl)
val suggestions = json.parseToJsonElement(
withContext(Dispatchers.IO) {
httpClient.get(
"https://$tagIndexDomain/$field${
if (chars.isNotEmpty()) "/${
chars.joinToString(
"/"
)
}" else ""
}.json"
).bodyAsText()
}
)
buildList {
suggestions.jsonArray.forEach { suggestionRaw ->
val suggestion = suggestionRaw.jsonArray
if (suggestion.size < 3) {
return@forEach
}
val namespace = suggestion[2].jsonPrimitive.contentOrNull ?: ""
val tag =
sanitize(suggestion[0].jsonPrimitive.contentOrNull ?: return@forEach)
add(
Suggestion(
SearchQuery.Tag(
namespace,
tag
),
suggestion[1].jsonPrimitive.contentOrNull?.toIntOrNull() ?: 0,
)
)
}
}
}
suspend fun getGalleryInfo(galleryID: Int) = runCatching {
withContext(Dispatchers.IO) {
json.decodeFromString<GalleryInfo>(
httpClient.get("https://$domain/galleries/$galleryID.js").bodyAsText()
.replace("var galleryinfo = ", "")
)
}
}
suspend fun search(query: SearchQuery?): Result<Set<Int>> = runCatching {
when (query) {
is SearchQuery.Tag -> getGalleryIDsForQuery(query).toSet()
is SearchQuery.Not -> coroutineScope {
val allGalleries = async {
getGalleryIDsFromNozomi(null, "index", "all")
}
val queriedGalleries = search(query.query).getOrThrow()
val result = LinkedHashSet<Int>()
with(allGalleries.await()) {
while (this.hasRemaining()) {
val gallery = this.get()
if (gallery in queriedGalleries) {
result.add(gallery)
}
}
}
result
}
is SearchQuery.And -> coroutineScope {
val queries = query.queries.map { query ->
async {
search(query).getOrThrow()
}
}
val result = queries.first().await().toMutableSet()
queries.drop(1).forEach {
val queryResult = it.await()
result.retainAll(queryResult)
}
result
}
is SearchQuery.Or -> coroutineScope {
val queries = query.queries.map { query ->
async {
search(query).getOrThrow()
}
}
val result = LinkedHashSet<Int>()
queries.forEach {
val queryResult = it.await()
result.addAll(queryResult)
}
result
}
null -> getGalleryIDsFromNozomi(null, "index", "all").toSet()
}
}
suspend fun getImageURL(galleryFile: GalleryFile, thumbnail: Boolean = false): List<String> =
buildList {
val imagePathResolver = imagePathResolver.getValue()
listOf("webp", "avif", "jxl").forEach { type ->
val available = when {
thumbnail && type != "jxl" -> true
type == "webp" -> galleryFile.hasWebP != 0
type == "avif" -> galleryFile.hasAVIF != 0
!thumbnail && type == "jxl" -> galleryFile.hasJXL != 0
else -> false
}
if (!available) return@forEach
val url = buildString {
append("https://")
append(imagePathResolver.decodeSubdomain(galleryFile.hash, thumbnail))
append(".hitomi.la/")
append(type)
if (thumbnail) append("bigtn")
append('/')
append(imagePathResolver.decodeImagePath(galleryFile.hash, thumbnail))
append('.')
append(type)
}
add(url)
}
}
suspend fun loadImage(
galleryFile: GalleryFile,
thumbnail: Boolean = false,
acceptImage: (String) -> Boolean = { true },
onDownload: (bytesSentTotal: Long, contentLength: Long?) -> Unit = { _, _ -> },
): Result<Pair<ByteReadChannel, String>> {
return runCatching {
withContext(Dispatchers.IO) {
val url = getImageURL(galleryFile, thumbnail).firstOrNull(acceptImage)
?: error("No available image")
val channel: ByteReadChannel = httpClient.get(url) { onDownload(onDownload) }.body()
Pair(channel, url)
}
}
}
}
@@ -1,135 +0,0 @@
package xyz.quaver.pupil.networking
import com.google.firebase.crashlytics.FirebaseCrashlytics
import io.ktor.util.cio.writeChannel
import io.ktor.utils.io.copyAndClose
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import java.io.File
sealed class ImageLoadProgress {
data object NotStarted : ImageLoadProgress()
data class Progress(val bytesSent: Long, val contentLength: Long?) : ImageLoadProgress()
data class Finished(val file: File) : ImageLoadProgress()
data class Error(val exception: Throwable) : ImageLoadProgress()
}
interface ImageCache {
suspend fun load(
galleryFile: GalleryFile,
forceDownload: Boolean = false,
): StateFlow<ImageLoadProgress>
suspend fun free(vararg files: GalleryFile)
suspend fun clear()
}
class FileImageCache(
private val cacheDir: File,
private val cacheLimit: Long = 128 * 1024 * 1024, // 128MB
) : ImageCache {
private val mutex = Mutex()
private val requests = mutableMapOf<String, Pair<Job, StateFlow<ImageLoadProgress>>>()
private val activeFiles = mutableMapOf<String, File>()
private suspend fun cleanup() = withContext(Dispatchers.IO) {
mutex.withLock {
val size = cacheDir.listFiles()?.sumOf { it.length() } ?: 0
if (size > cacheLimit) {
cacheDir.listFiles { file ->
file.nameWithoutExtension !in activeFiles
}?.forEach { file ->
file.delete()
}
}
}
}
override suspend fun free(vararg files: GalleryFile) = withContext(Dispatchers.IO) {
mutex.withLock {
files.forEach { file ->
val hash = file.hash
requests[hash]?.let { (job, _) ->
job.cancel()
}
requests.remove(hash)
activeFiles.remove(hash)
}
}
}
override suspend fun clear(): Unit = withContext(Dispatchers.IO) {
mutex.withLock {
requests.forEach { _, (job, _) -> job.cancel() }
activeFiles.clear()
cacheDir.deleteRecursively()
}
}
override suspend fun load(
galleryFile: GalleryFile,
forceDownload: Boolean,
): StateFlow<ImageLoadProgress> {
val hash = galleryFile.hash
mutex.withLock {
val file = activeFiles[hash]
if (!forceDownload && file != null) {
return MutableStateFlow(ImageLoadProgress.Finished(file))
}
}
cleanup()
mutex.withLock {
requests[hash]?.first?.cancelAndJoin()
activeFiles[hash]?.delete()
val flow = MutableStateFlow<ImageLoadProgress>(ImageLoadProgress.NotStarted)
val job = coroutineScope {
launch {
runCatching {
val (channel, url) = HitomiHttpClient.loadImage(galleryFile) { sent, total ->
flow.value = ImageLoadProgress.Progress(sent, total)
}.onFailure {
FirebaseCrashlytics.getInstance().recordException(it)
flow.value = ImageLoadProgress.Error(it)
}.getOrThrow()
val file = File(cacheDir, "$hash.${url.substringAfterLast('.')}")
mutex.withLock {
activeFiles.put(hash, file)
}
channel.copyAndClose(file.writeChannel())
file
}.onSuccess { file ->
flow.value = ImageLoadProgress.Finished(file)
}.onFailure {
activeFiles.remove(hash)
FirebaseCrashlytics.getInstance().recordException(it)
flow.value = ImageLoadProgress.Error(it)
}
}
}
requests[hash] = job to flow
return flow
}
}
}
@@ -1,107 +0,0 @@
@file:OptIn(ExperimentalUnsignedTypes::class)
package xyz.quaver.pupil.networking
import java.nio.ByteBuffer
import java.security.MessageDigest
import kotlin.math.min
private fun sha256(data: ByteArray): ByteArray =
MessageDigest.getInstance("SHA-256").digest(data)
private fun hashTerm(term: String): UByteArray =
sha256(term.toByteArray()).sliceArray(0..<4).toUByteArray()
data class Node(
val keys: List<Key>,
val datas: List<Data>,
val subNodeAddresses: List<Long>
) {
data class Key(
private val key: UByteArray
): Comparable<Key> {
constructor(term: String): this(hashTerm(term))
override fun compareTo(other: Key): Int {
val minSize = min(this.key.size, other.key.size)
for (i in 0..<minSize) {
if (this.key[i] < other.key[i]) {
return -1
} else if(this.key[i] > other.key[i]) {
return 1
}
}
return 0
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Key
return key.contentEquals(other.key)
}
override fun hashCode(): Int {
return key.contentHashCode()
}
}
data class Data(
val offset: Long,
val length: Int
)
companion object {
fun decodeNode(buffer: ByteBuffer): Node {
val numberOfKeys = buffer.int
val keys = mutableListOf<Node.Key>()
for (i in 0..<numberOfKeys) {
val keySize = buffer.int
val key = ByteArray(keySize)
buffer.get(key)
keys.add(Node.Key(key.toUByteArray()))
}
val numberOfDatas = buffer.int
val datas = mutableListOf<Data>()
for (i in 0..<numberOfDatas) {
val offset = buffer.long
val length = buffer.int
datas.add(Data(offset, length))
}
val numberOfSubNodeAddresses = B+1
val subNodeAddresses = mutableListOf<Long>()
for (i in 0..<numberOfSubNodeAddresses) {
val subNodeAddress = buffer.long
subNodeAddresses.add(subNodeAddress)
}
return Node(keys, datas, subNodeAddresses)
}
}
val isLeaf: Boolean = subNodeAddresses.all { it == 0L }
fun locateKey(target: Key): Pair<Boolean, Int> {
val index = keys.indexOfFirst { key -> target <= key }
if (index == -1) {
return Pair(false, keys.size)
}
return Pair(keys[index] == target, index)
}
}
@@ -1,80 +0,0 @@
package xyz.quaver.pupil.networking
import android.content.res.Resources
import java.io.ByteArrayInputStream
import java.security.KeyStore
import java.security.SecureRandom
import java.security.cert.CertificateFactory
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509TrustManager
const val ISRG_ROOT_X1 = """-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv
KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn
OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn
jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw
qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI
rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq
hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL
ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ
3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK
NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5
ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
-----END CERTIFICATE-----"""
object SSLSettings {
val keyStore: KeyStore by lazy {
KeyStore.getInstance(KeyStore.getDefaultType()).apply {
load(null, null)
val certificateFactory = CertificateFactory.getInstance("X.509")
val certificate = certificateFactory.generateCertificate(ISRG_ROOT_X1.byteInputStream())
setCertificateEntry("isrgrootx1", certificate)
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()).apply {
init(null as KeyStore?)
trustManagers.filterIsInstance<X509TrustManager>().forEach { trustManager ->
trustManager.acceptedIssuers.forEach { acceptedIssuer ->
setCertificateEntry(acceptedIssuer.subjectDN.name, acceptedIssuer)
}
}
}
}
}
val trustManagerFactory: TrustManagerFactory? by lazy {
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()).apply {
init(keyStore)
}
}
val sslContext: SSLContext? by lazy {
SSLContext.getInstance("TLS").apply {
init(null, trustManagerFactory?.trustManagers, null)
}
}
val trustManager: X509TrustManager? by lazy {
trustManagerFactory?.trustManagers?.filterIsInstance<X509TrustManager>()?.firstOrNull()
}
}
@@ -1,90 +0,0 @@
package xyz.quaver.pupil.networking
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
val validNamespace = listOf(
"female",
"male",
"artist",
"group",
"character",
"series",
"type",
"language",
"tag"
)
class SearchQueryPreviewParameterProvider: PreviewParameterProvider<SearchQuery> {
override val values = sequenceOf(
SearchQuery.And(listOf(
SearchQuery.Or(listOf(
SearchQuery.And(listOf(
SearchQuery.Tag("language", "thisisareallylongtagyoucantevenseetheendofthis"),
SearchQuery.Tag("language", "korean"),
SearchQuery.Tag("female", "unusual pupil"),
SearchQuery.Tag("female", "collar")
)),
SearchQuery.And(listOf(
SearchQuery.Tag("language", "japanese"),
SearchQuery.Tag("female", "unusual pupil"),
SearchQuery.Tag("female", "collar")
))
)),
SearchQuery.Not(
SearchQuery.And(listOf(
SearchQuery.Tag("male", "yaoi"),
SearchQuery.Tag("group", "zenmai kourogi")
))
)
))
)
}
sealed interface SearchQuery {
data class Tag(
val namespace: String? = null,
val tag: String
): SearchQuery, TagLike {
companion object {
fun parseTag(tag: String): Tag {
val splitTag = tag.split(':', limit = 1)
return if (splitTag.size == 1) {
Tag(null, tag)
} else {
Tag(splitTag[0], splitTag[1])
}
}
}
override fun toString() = if (namespace == null) tag else "$namespace:$tag"
override fun toTag() = this
}
data class And(
val queries: List<SearchQuery>
): SearchQuery {
init {
if (queries.isEmpty()) {
error("queries cannot be empty")
}
}
}
data class Or(
val queries: List<SearchQuery>
): SearchQuery {
init {
if (queries.isEmpty()) {
error("queries cannot be empty")
}
}
}
data class Not(
val query: SearchQuery
): SearchQuery
}
@@ -1,57 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2020 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package xyz.quaver.pupil.services
import android.annotation.SuppressLint
import android.app.job.JobParameters
import android.app.job.JobService
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.AndroidEntryPoint
import io.ktor.util.cio.writeChannel
import io.ktor.util.collections.ConcurrentMap
import io.ktor.util.collections.ConcurrentSet
import io.ktor.utils.io.copyAndClose
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import xyz.quaver.pupil.Pupil
import xyz.quaver.pupil.networking.GalleryFile
import xyz.quaver.pupil.networking.HitomiHttpClient
import java.io.File
@SuppressLint("SpecifyJobSchedulerIdRange")
@AndroidEntryPoint
class ImageCacheService : JobService() {
override fun onStartJob(params: JobParameters?): Boolean {
return false
}
override fun onStopJob(params: JobParameters?): Boolean {
return false
}
}
@@ -1,22 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2022 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package xyz.quaver.pupil.types
class SendLogException : Exception()
class JavascriptException(message: String?) : Exception(message)
@@ -1,111 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2019 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package xyz.quaver.pupil.types
import kotlinx.serialization.Serializable
@Serializable
data class Tag(val area: String?, val tag: String, val isNegative: Boolean = false) {
companion object {
fun parse(tag: String) : Tag {
if (tag.firstOrNull() == '-') {
tag.substring(1).split(Regex(":"), 2).let {
return when(it.size) {
2 -> Tag(it[0], it[1], true)
else -> Tag(null, tag, true)
}
}
}
tag.split(Regex(":"), 2).let {
return when(it.size) {
2 -> Tag(it[0], it[1])
else -> Tag(null, tag)
}
}
}
}
override fun toString(): String {
return (if (isNegative) "-" else "") + when(area) {
null -> tag
else -> "$area:$tag"
}
}
fun toQuery(): String {
return toString().replace(' ', '_')
}
override fun equals(other: Any?): Boolean {
if (other !is Tag)
return false
if (other.area == area && other.tag == tag)
return true
return false
}
override fun hashCode() = toString().hashCode()
}
class Tags(val tags: MutableSet<Tag> = mutableSetOf()) : MutableSet<Tag> by tags {
companion object {
fun parse(tags: String) : Tags {
return Tags(
tags.split(' ').map {
if (it.isNotEmpty())
Tag.parse(it)
else
null
}.filterNotNull().toMutableSet()
)
}
}
fun contains(element: String): Boolean {
tags.forEach {
if (it.toString() == element)
return true
}
return false
}
fun add(element: String): Boolean {
return tags.add(Tag.parse(element))
}
fun remove(element: String) {
tags.filter { it.toString() == element }.forEach {
tags.remove(it)
}
}
fun removeByArea(area: String, isNegative: Boolean? = null) {
tags.filter { it.area == area && (if(isNegative == null) true else (it.isNegative == isNegative)) }.forEach {
tags.remove(it)
}
}
override fun toString(): String {
return tags.joinToString(" ") { it.toString() }
}
}
@@ -1,69 +0,0 @@
/*
* Pupil, Hitomi.la viewer for Android
* Copyright (C) 2019 tom5079
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package xyz.quaver.pupil.ui
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.runtime.getValue
import androidx.core.view.WindowCompat
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.compose.rememberNavController
import com.google.accompanist.adaptive.calculateDisplayFeatures
import xyz.quaver.pupil.ui.composable.MainApp
import xyz.quaver.pupil.ui.theme.AppTheme
import xyz.quaver.pupil.ui.viewmodel.MainViewModel
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
val viewModel: MainViewModel by viewModels()
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
AppTheme {
val windowSize = calculateWindowSizeClass(this)
val displayFeatures = calculateDisplayFeatures(this)
val uiState by viewModel.searchState.collectAsStateWithLifecycle()
val navController = rememberNavController()
MainApp(
windowSize = windowSize,
displayFeatures = displayFeatures,
uiState = uiState,
navController = navController,
openGalleryDetails = viewModel::openGalleryDetails,
closeGalleryDetails = viewModel::closeGalleryDetails,
onQueryChange = viewModel::onQueryChange,
loadSearchResult = viewModel::loadSearchResult
)
}
}
}
}
@@ -1,5 +0,0 @@
package xyz.quaver.pupil.ui.composable
enum class ContentType {
SINGLE_PANE, DUAL_PANE
}
@@ -1,34 +0,0 @@
package xyz.quaver.pupil.ui.composable
import android.graphics.Rect
import androidx.window.layout.FoldingFeature
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
sealed interface DevicePosture {
data object NormalPosture: DevicePosture
data class BookPosture(
val hingePosition: Rect
): DevicePosture
data class Separating(
val hingePosition: Rect,
val orientation: FoldingFeature.Orientation
): DevicePosture
}
@OptIn(ExperimentalContracts::class)
fun isBookPosture(foldingFeature: FoldingFeature?): Boolean {
contract { returns(true) implies (foldingFeature != null) }
return foldingFeature?.state == FoldingFeature.State.HALF_OPENED &&
foldingFeature.orientation == FoldingFeature.Orientation.VERTICAL
}
@OptIn(ExperimentalContracts::class)
fun isSeparating(foldingFeature: FoldingFeature?): Boolean {
contract { returns(true) implies (foldingFeature != null) }
return foldingFeature?.state == FoldingFeature.State.FLAT && foldingFeature.isSeparating
}
@@ -1,504 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.foundation.text.appendInlineContent
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.BrokenImage
import androidx.compose.material.icons.filled.QuestionMark
import androidx.compose.material.icons.filled.StarOutline
import androidx.compose.material3.Card
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.Placeholder
import androidx.compose.ui.text.PlaceholderVerticalAlign
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.SubcomposeAsyncImage
import coil.request.ImageRequest
import xyz.quaver.pupil.R
import xyz.quaver.pupil.networking.Artist
import xyz.quaver.pupil.networking.Character
import xyz.quaver.pupil.networking.GalleryFile
import xyz.quaver.pupil.networking.GalleryInfo
import xyz.quaver.pupil.networking.GalleryTag
import xyz.quaver.pupil.networking.Group
import xyz.quaver.pupil.networking.HitomiHttpClient
import xyz.quaver.pupil.networking.Language
import xyz.quaver.pupil.networking.SearchQuery
import xyz.quaver.pupil.networking.Series
import xyz.quaver.pupil.networking.joinToCapitalizedString
import xyz.quaver.pupil.ui.theme.Blue500
import xyz.quaver.pupil.ui.theme.Green500
import xyz.quaver.pupil.ui.theme.Purple500
import xyz.quaver.pupil.ui.theme.Red500
import xyz.quaver.pupil.ui.theme.Yellow500
private val languageMap = mapOf(
"indonesian" to "Bahasa Indonesia",
"catalan" to "català",
"cebuano" to "Cebuano",
"czech" to "Čeština",
"danish" to "Dansk",
"german" to "Deutsch",
"estonian" to "eesti",
"english" to "English",
"spanish" to "Español",
"esperanto" to "Esperanto",
"french" to "Français",
"italian" to "Italiano",
"latin" to "Latina",
"hungarian" to "magyar",
"dutch" to "Nederlands",
"norwegian" to "norsk",
"polish" to "polski",
"portuguese" to "Português",
"romanian" to "română",
"albanian" to "shqip",
"slovak" to "Slovenčina",
"finnish" to "Suomi",
"swedish" to "Svenska",
"tagalog" to "Tagalog",
"vietnamese" to "tiếng việt",
"turkish" to "Türkçe",
"greek" to "Ελληνικά",
"mongolian" to "Монгол",
"russian" to "Русский",
"ukrainian" to "Українська",
"hebrew" to "עברית",
"arabic" to "العربية",
"persian" to "فارسی",
"thai" to "ไทย",
"korean" to "한국어",
"chinese" to "中文",
"japanese" to "日本語"
)
private val galleryTypeStringMap = mapOf(
"doujinshi" to R.string.doujinshi,
"manga" to R.string.manga,
"artistcg" to R.string.artist_cg,
"gamecg" to R.string.game_cg,
"imageset" to R.string.image_set
)
private val galleryTypeColorMap = mapOf(
"doujinshi" to Red500,
"manga" to Yellow500,
"artistcg" to Purple500,
"gamecg" to Green500,
"imageset" to Blue500
)
class GalleryInfoProvider: PreviewParameterProvider<GalleryInfo> {
override val values = sequenceOf(
GalleryInfo(
id = "2296437",
title = "Kakyuu Majutsushi, Inmon ni Somaru | 하급 마술사, 음문에 물들다",
language = "korean",
type = "doujinshi",
date = "2022-08-11 07:14:00-05",
artists = listOf(Artist("wagashi")),
groups = listOf(Group("dagashiya")),
series = listOf(Series("original")),
tags = listOf(
GalleryTag("ahegao", female="1"),
GalleryTag("big penis", male="1"),
GalleryTag("bike shorts", female="1"),
GalleryTag("blowjob", female="1"),
GalleryTag("blowjob face", female="1"),
GalleryTag("bukkake", female="1"),
GalleryTag("bunny girl", female="1"),
GalleryTag("clone", male="1"),
GalleryTag("corruption", female="1"),
GalleryTag("crotch tattoo", female="1"),
GalleryTag("gloves", female="1"),
GalleryTag("gokkun", female="1"),
GalleryTag("group"),
GalleryTag("kemonomimi", female="1"),
GalleryTag("leotard", female="1"),
GalleryTag("lingerie", female="1"),
GalleryTag("loli", female="1"),
GalleryTag("masked face", female="1"),
GalleryTag("masturbation", female="1"),
GalleryTag("mind control", female="1"),
GalleryTag("mmf threesome"),
GalleryTag("moral degeneration", female="1"),
GalleryTag("mouth mask", female="1"),
GalleryTag("nakadashi", female="1"),
GalleryTag("prostitution", female="1"),
GalleryTag("smell", male="1"),
GalleryTag("unusual pupils", female="1"),
),
related = listOf(2806924, 2806923, 2319091, 1647024, 2580808),
languages = listOf(
Language(galleryID="2806923", name="korean"),
Language(galleryID="2609305", name="english"),
Language(galleryID="2302333", name="spanish"),
Language(galleryID="2392785", name="portuguese"),
Language(galleryID="2303940", name="russian"),
Language(galleryID="2736129", name="chinese"),
Language(galleryID="2295647", name="japanese")
),
characters = listOf(Character("Kakyuu Majutsushi")),
files = listOf(
GalleryFile(name="01.jpg", hash="d441383396a6ba41a2db914328dc80d16b5191e53d23a5f0f9f8a0cd8f2e7cef", width=4185, height=6000, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="02.png", hash="a42517a19c7db6369749807bbc6676906e35709be07f780247f2e68d516ed1d5", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="03.png", hash="ee0841953755f34a0a146a7f757cf2993c678384f53e88715b1c97a00abe5c27", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="04.png", hash="66fafca77a7ed0287666e77fe268a02f75b4e27c2b9b77e6577bb3132396132b", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="05.png", hash="0ef8081ad9eef5093077c8551e87903e8b275e607634717857c2986e8d3c51a9", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="06.png", hash="2e59ffd59fa761355ea855a9e0f366cb39569207165a99659a9f0868cbba7e94", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="07.png", hash="5dc19fb97a2f1c64cae5634cd651f593d022b3114bbacaab15ba114be581cbea", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="08.png", hash="9121781d4f8fb1aaaee124f82c2ab98c97eb3e1f9508bab7c1d8771bb5eddfdb", width=4520, height=6295, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="09.png", hash="e5ceae4da5e497bd95a79a607f2c85bb3e8dc7386e041086cd5ccb9a9fb4dcb1", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="10.png", hash="be56219811a29f86dfcf5a7af0b25addc7436b134acd1a94d51c69c987da9d1b", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="11.png", hash="4e3b09ac015360ad4daffcea46265f3eb319bbe638ce90f26d4cbae37dc8c0f1", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="12.png", hash="5d57c0a0cd00604382eeaf0b32446b938dafc9d980eb086673e1fa0307166e39", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="13.png", hash="1ff2313fe979b52b826d482be90699a7c086afc251fa22306e92dfc582611f10", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="14.png", hash="7ad92a9408a059afafc68d3086c5f6a070c7e0d550bc2d328b5c9e16a62be01c", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="15.png", hash="4a6db95b7111b647e450c155af07c617d28313c02871ed94ad0c5986d3c5d1aa", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="16.png", hash="d4b53bf416c9bd2f72850e80ddaaf8467c663c72433c8ebebf3a70742fea7c32", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="17.png", hash="d189d5321f18414de816c049d3e2d72a7d31124d628037ca9f7da4572025cf01", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="18.png", hash="3ff372d7ba4e34cff9f7b46f5323e60b36f9b9df3dd5d02be4c71de4a7ee23c7", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="19.png", hash="2965852c2000fb17f756263b47ca196563995be2d03143f64c297f5930248d1e", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="20.png", hash="3713f95947cc6df0b67af5532a440f023c99ee37d483f3f9252400168e3a55ad", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="21.png", hash="c0b2b2d5ee79c3dc3b737c0eaff19ed1a731d81495adc2c94260de7ebbd85415", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="22.png", hash="8835fe309a26fce6882c0fcdf37cbd5f5bcc69dd2c32e436deb644891ca8499b", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="23.png", hash="5eb28619c1919ad29b86fb6cdaeccd50ad2ad857c81f56c060e8b66a2ed315d0", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="24.png", hash="7ea3ecf4c0b0e5e632163a5b0dc2475a071e1209a0fed8e8e49243093c35babb", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="25.png", hash="d01355724eb60c41e43159607652812d1fbbbac12962b2f9068a9e620ee0c246", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="26.png", hash="58a33c1d709b005a17600f7beb14a81711a106619bdb029d30646a9060c245c7", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="27.png", hash="0b18753f2fe7ea97c2e2c13a082a5a675f36085558bcd3fb7be916b6118c6000", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="28.png", hash="e8f0a2f9d35ec2c1974a4aea07eefd792462049e7b0972bf8cd5532dd82cee21", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="29.png", hash="90ec7a13aedf22c1f9317f75e843a4ace4e236d6100a8c8bb5aeb8160ff1cd00", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="30.png", hash="3229400975e6cef763c54a82a4ce0e6f51ec41c9b674072e74f66b41e325b655", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="31.png", hash="4e04efa56981804f7d13858a98935038fe421956367dcabba8e9118d273135d5", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="32.png", hash="e0d8641127aaaf587ec5e3040c49edee9cda866a5f1f377e567b908514b1eb68", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="33.png", hash="00125ab9090be7d3462fd6943c209bc68c236ef50ca0f1552530fd8253d87f7d", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="34.png", hash="1ea303198badaecfcf66a438baa6867690416d77a542f1ff0181b1895df95ccb", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="35.png", hash="40181ac057808a16716e640c462cc2b992822999ab8db43d454bb331d50bd39f", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="36.png", hash="92cbe1067c1c554c5a2e01b58b6fb86677a523cba586dfa209d61b4af70b2f54", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="37.png", hash="4fbbdc6d5450eb1f2f7e45a97ce8360d43e199454a8eb9e536740309c2067999", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="38.png", hash="0cb74b8af27e51604c728a26cf4788899fa04f854853badea9884b008c024e94", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="39.png", hash="254676c13ab418ce1110a9bad009554abc72af7e2ff9d719409881ea3c635d46", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="40.png", hash="33527e1171b9cf21ab164be2b76cb5b9daa91980a3330f2441dd9bf911e2e05b", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="41.png", hash="4dc331acb058665500aa308143c106efb6999855d1c3b0665c1dd331c8364430", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="42.png", hash="7674f03fa02cf96a20f1e192caf76d85e7e556add0cdb65aabdc86d417093d39", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="43.png", hash="27a4a280483142b213b26d53f06b991be35122cb263c69a87435e624b2a307fd", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="44.png", hash="3114ba3bff094abbae9160656894d462e0567cea23e6fa2693469c5e7defa6fe", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="45.png", hash="dc22ffed6a678a560e781f795b3ee0876ec8726ae2af942226710102758d44db", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="46.png", hash="4f7257ad75b990cc2b8dad0c5a09a831cb1670e7aaeadc71809f4bd7400f0071", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="47.png", hash="bf74fcd74ce77b5089bac98dc9f5737ba1fe87cdcfb01ad80e63024c93f82692", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="48.png", hash="d0baed210584183efa654ca7a483c558afe9eb18b71452ed2cfd4264b269ffca", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="49.png", hash="2b9c90a038e4e918655dffa84fbbb08cbedfce642277b1140d070aa9a711ebac", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="50.png", hash="cdfba6a9b8a570f2f317fb01e66ebc72ede5735a41256b326a38af2296799095", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="51.png", hash="84ad9d51aab2e8ae1cbb5a0918cc3f62473e98512db9f473ab1ffe3a4f7aa75a", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="52.png", hash="0d7a420aa23e23cee7f8e124b12080e309cffb3d7269389f23e1ac3d5b7363a5", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="53.png", hash="575cf99346f9786d6e30bc163dc6d5fa439bd157a9ffce90586bfc5657121981", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="54.png", hash="9004d3fd46dc278b79cf7a5bf72002dd4b0b03ad6bded30ceebcb633185b49ce", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="55.png", hash="8e53c301e2c2b539783c7b8c4f5028f221198d33e114dcc40e6a0025aee840ab", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="56.png", hash="576764073554fcf644c12d80f26b3bae42f39f3516ed7841c9e297248324b237", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="57.png", hash="110da01b9ae7ed4a145792f55498a5efa22cebec4da84f6220904840b508c75e", width=4535, height=6307, hasWebP=1, hasAVIF=1, hasJXL=0),
GalleryFile(name="58.jpg", hash="3ae38577135465b6224e0487c0cdcd37cf11764883f3b78a67545d48c6beade5", width=4260, height=6000, hasWebP=1, hasAVIF=1, hasJXL=0),
)
)
)
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun TagGroup(tags: List<SearchQuery.Tag>, folded: Boolean = false) {
var isFolded by remember { mutableStateOf(folded) }
FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
tags.sortedBy {
when(it.namespace) {
"female" -> 1
"male" -> 2
else -> 3
}
}.let {
if (isFolded) it.take(10) else it
}.forEach { tag ->
TagChip(tag = tag.toTag())
}
if (isFolded && tags.size > 10)
Surface(
modifier = Modifier.height(32.dp),
color = MaterialTheme.colorScheme.surface,
shape = RoundedCornerShape(16.dp),
onClick = { isFolded = false }
) {
Text(
"…",
modifier = Modifier.padding(16.dp, 8.dp),
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodyMedium
)
}
}
}
@Composable
fun GalleryTypeIndicator(galleryType: String) {
Surface(
modifier = Modifier.height(32.dp),
color = galleryTypeColorMap[galleryType] ?: MaterialTheme.colorScheme.surface,
shape = RoundedCornerShape(16.dp)
) {
Box(Modifier.fillMaxHeight()) {
Text(
galleryTypeStringMap[galleryType]?.let { stringResource(it) } ?: galleryType,
modifier = Modifier
.padding(horizontal = 16.dp)
.align(Alignment.Center),
style = MaterialTheme.typography.bodyMedium,
color = Color.White
)
}
}
}
@Composable
fun LanguageTitle(title: String, language: String?) {
val icon = languageIconMap[language]
if (icon != null) {
Text(
buildAnnotatedString {
appendInlineContent("language", "<language>")
append(' ')
append(title)
},
style = MaterialTheme.typography.headlineSmall,
inlineContent = mapOf(
"language" to InlineTextContent(
Placeholder(
width = 20.sp,
height = 20.sp,
placeholderVerticalAlign = PlaceholderVerticalAlign.Center
)
) {
Icon(
painterResource(icon),
contentDescription = null,
tint = Color.Unspecified
)
}
)
)
} else {
Text(title, style = MaterialTheme.typography.headlineSmall)
}
}
@Composable
fun DetailedGalleryInfoHeader(galleryInfo: GalleryInfo, thumbnailUrl: String?) {
val thumbnailFile = galleryInfo.files.first()
val aspectRatio = thumbnailFile.let { it.width / it.height.toFloat() }
if (thumbnailFile.let { it.width > it.height }) {
Column {
if (thumbnailUrl != null) {
SubcomposeAsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(thumbnailUrl)
.setHeader("Referer", "https://hitomi.la/")
.build(),
modifier = Modifier
.fillMaxWidth()
.aspectRatio(aspectRatio)
.clip(RoundedCornerShape(8.dp)),
loading = { CircularProgressIndicator(Modifier.align(Alignment.Center)) },
error = {
Icon(
Icons.Default.BrokenImage,
contentDescription = null,
)
},
contentDescription = "Thumbnail"
)
} else {
Box(
Modifier
.fillMaxWidth()
.aspectRatio(aspectRatio)) {
CircularProgressIndicator(Modifier.align(Alignment.Center))
}
}
Spacer(Modifier.height(8.dp))
LanguageTitle(galleryInfo.title, galleryInfo.language)
val artistsAndGroups = buildString {
if (!galleryInfo.artists.isNullOrEmpty())
append(galleryInfo.artists.joinToCapitalizedString())
if (!galleryInfo.groups.isNullOrEmpty()) {
if (this.isNotEmpty()) append(' ')
append('(')
append(galleryInfo.groups.joinToCapitalizedString())
append(')')
}
}
if (artistsAndGroups.isNotEmpty()) {
Text(
artistsAndGroups,
style = MaterialTheme.typography.labelLarge,
)
}
}
} else {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically
) {
if (thumbnailUrl != null) {
SubcomposeAsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(thumbnailUrl)
.setHeader("Referer", "https://hitomi.la/")
.build(),
modifier = Modifier
.height(200.dp)
.aspectRatio(aspectRatio)
.clip(RoundedCornerShape(8.dp)),
loading = { CircularProgressIndicator(Modifier.align(Alignment.Center)) },
error = {
Icon(
Icons.Default.BrokenImage,
contentDescription = null,
)
},
contentDescription = "Thumbnail"
)
} else {
Box(
Modifier
.height(200.dp)
.aspectRatio(aspectRatio)) {
CircularProgressIndicator(Modifier.align(Alignment.Center))
}
}
Column(Modifier.heightIn(min = 200.dp)) {
LanguageTitle(galleryInfo.title, galleryInfo.language)
val artistsAndGroups = buildString {
if (!galleryInfo.artists.isNullOrEmpty())
append(galleryInfo.artists.joinToCapitalizedString())
if (!galleryInfo.groups.isNullOrEmpty()) {
if (this.isNotEmpty()) append(' ')
append('(')
append(galleryInfo.groups.joinToCapitalizedString())
append(')')
}
}
if (artistsAndGroups.isNotEmpty()) {
Text(
artistsAndGroups,
style = MaterialTheme.typography.labelLarge
)
}
}
}
}
}
@Preview
@Composable
fun DetailedGalleryInfo(
@PreviewParameter(GalleryInfoProvider::class) galleryInfo: GalleryInfo,
modifier: Modifier = Modifier,
) {
var thumbnailUrl by remember { mutableStateOf<String?>(null) }
LaunchedEffect(galleryInfo) {
thumbnailUrl = galleryInfo.files.firstOrNull()?.let {
HitomiHttpClient.getImageURL(it, true).firstOrNull()
} ?: ""
}
Card(modifier) {
Column(Modifier.padding(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
DetailedGalleryInfoHeader(galleryInfo, thumbnailUrl)
GalleryTypeIndicator(galleryInfo.type)
if (galleryInfo.tags?.isNotEmpty() == true) {
TagGroup(galleryInfo.tags.map { it.toTag() }, folded = true)
}
HorizontalDivider()
Box(
Modifier
.fillMaxWidth()
.padding(4.dp)) {
Text(
modifier = Modifier.align(Alignment.CenterStart),
text = galleryInfo.id,
style = MaterialTheme.typography.bodyMedium
)
Text(
modifier = Modifier.align(Alignment.Center),
text = "${galleryInfo.files.size}P",
style = MaterialTheme.typography.bodyMedium
)
Icon(
modifier = Modifier
.align(Alignment.CenterEnd)
.size(32.dp),
imageVector = Icons.Default.StarOutline,
contentDescription = null,
tint = Yellow500
)
}
}
}
}
@@ -1,306 +0,0 @@
package xyz.quaver.pupil.ui.composable
import android.util.Log
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.ime
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.material3.DrawerValue
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalNavigationDrawer
import androidx.compose.material3.PermanentNavigationDrawer
import androidx.compose.material3.Text
import androidx.compose.material3.rememberDrawerState
import androidx.compose.material3.windowsizeclass.WindowHeightSizeClass
import androidx.compose.material3.windowsizeclass.WindowSizeClass
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import androidx.navigation.activity
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.window.layout.DisplayFeature
import androidx.window.layout.FoldingFeature
import kotlinx.coroutines.launch
import xyz.quaver.pupil.R
import xyz.quaver.pupil.networking.GalleryInfo
import xyz.quaver.pupil.networking.SearchQuery
import xyz.quaver.pupil.ui.viewmodel.SearchState
@Composable
fun MainApp(
windowSize: WindowSizeClass,
displayFeatures: List<DisplayFeature>,
uiState: SearchState,
navController: NavHostController,
openGalleryDetails: (GalleryInfo) -> Unit,
closeGalleryDetails: () -> Unit,
onQueryChange: (SearchQuery?) -> Unit,
loadSearchResult: (IntRange) -> Unit,
) {
val navigationType: NavigationType
val contentType: ContentType
val foldingFeature: FoldingFeature? = displayFeatures.filterIsInstance<FoldingFeature>().firstOrNull()
val foldingDevicePosture = when {
isBookPosture(foldingFeature) -> DevicePosture.BookPosture(foldingFeature.bounds)
isSeparating(foldingFeature) -> DevicePosture.Separating(foldingFeature.bounds, foldingFeature.orientation)
else -> DevicePosture.NormalPosture
}
when (windowSize.widthSizeClass) {
WindowWidthSizeClass.Compact -> {
navigationType = NavigationType.BOTTOM_NAVIGATION
contentType = ContentType.SINGLE_PANE
}
WindowWidthSizeClass.Medium -> {
navigationType = NavigationType.NAVIGATION_RAIL
contentType = if (foldingDevicePosture != DevicePosture.NormalPosture) {
ContentType.DUAL_PANE
} else {
ContentType.SINGLE_PANE
}
}
WindowWidthSizeClass.Expanded -> {
navigationType = if (foldingDevicePosture is DevicePosture.BookPosture) {
NavigationType.NAVIGATION_RAIL
} else {
NavigationType.PERMANENT_NAVIGATION_DRAWER
}
contentType = ContentType.DUAL_PANE
}
else -> {
navigationType = NavigationType.BOTTOM_NAVIGATION
contentType = ContentType.SINGLE_PANE
}
}
val navigationContentPosition = when (windowSize.heightSizeClass) {
WindowHeightSizeClass.Compact -> NavigationContentPosition.TOP
WindowHeightSizeClass.Medium,
WindowHeightSizeClass.Expanded -> NavigationContentPosition.CENTER
else -> NavigationContentPosition.TOP
}
MainNavigationWrapper(
navigationType,
contentType,
displayFeatures,
navigationContentPosition,
uiState,
navController,
openGalleryDetails = openGalleryDetails,
closeGalleryDetails = closeGalleryDetails,
onQueryChange = onQueryChange,
loadSearchResult = loadSearchResult
)
}
@Composable
private fun MainNavigationWrapper(
navigationType: NavigationType,
contentType: ContentType,
displayFeatures: List<DisplayFeature>,
navigationContentPosition: NavigationContentPosition,
uiState: SearchState,
navController: NavHostController,
openGalleryDetails: (GalleryInfo) -> Unit,
closeGalleryDetails: () -> Unit,
onQueryChange: (SearchQuery?) -> Unit,
loadSearchResult: (IntRange) -> Unit
) {
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
val coroutineScope = rememberCoroutineScope()
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
val openDrawer: () -> Unit = {
coroutineScope.launch {
drawerState.open()
}
}
if (navigationType == NavigationType.PERMANENT_NAVIGATION_DRAWER) {
PermanentNavigationDrawer(
drawerContent = {
PermanentNavigationDrawerContent(
selectedDestination = currentRoute,
navigateToDestination = { navController.navigate(it.route) {
popUpTo(MainDestination.Search.route)
launchSingleTop = true
} },
navigationContentPosition = navigationContentPosition,
)
}
) {
MainContent(
navigationType = navigationType,
contentType = contentType,
displayFeatures = displayFeatures,
uiState = uiState,
navController = navController,
onDrawerClicked = openDrawer,
openGalleryDetails = openGalleryDetails,
closeGalleryDetails = closeGalleryDetails,
onQueryChange = onQueryChange,
loadSearchResult = loadSearchResult,
)
}
} else {
ModalNavigationDrawer(
drawerContent = {
ModalNavigationDrawerContent(
selectedDestination = currentRoute,
navigateToDestination = { navController.navigate(it.route) {
popUpTo(MainDestination.Search.route)
launchSingleTop = true
} },
navigationContentPosition = navigationContentPosition,
onDrawerClicked = {
coroutineScope.launch {
drawerState.close()
}
}
)
},
drawerState = drawerState
) {
MainContent(
navigationType = navigationType,
contentType = contentType,
displayFeatures = displayFeatures,
uiState = uiState,
navController = navController,
onDrawerClicked = openDrawer,
openGalleryDetails = openGalleryDetails,
closeGalleryDetails = closeGalleryDetails,
onQueryChange = onQueryChange,
loadSearchResult = loadSearchResult,
)
}
}
}
@Composable
fun NotImplemented() {
Box(Modifier.fillMaxSize()) {
Column(
Modifier.align(Alignment.Center),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Text("(⁄ ⁄•⁄ω⁄•⁄ ⁄)", style = MaterialTheme.typography.headlineMedium, color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f))
Text(stringResource(R.string.not_implemented), textAlign = TextAlign.Center)
}
}
}
@Composable
fun MainContent(
navigationType: NavigationType,
contentType: ContentType,
displayFeatures: List<DisplayFeature>,
uiState: SearchState,
navController: NavHostController,
onDrawerClicked: () -> Unit,
openGalleryDetails: (GalleryInfo) -> Unit,
closeGalleryDetails: () -> Unit,
onQueryChange: (SearchQuery?) -> Unit,
loadSearchResult: (IntRange) -> Unit,
) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
Row(modifier = Modifier.fillMaxSize()) {
AnimatedVisibility(visible = navigationType == NavigationType.NAVIGATION_RAIL) {
MainNavigationRail(
selectedDestination = currentRoute,
navigateToDestination = { navController.navigate(it.route) {
popUpTo(MainDestination.Search.route)
launchSingleTop = true
} },
onDrawerClicked = onDrawerClicked
)
}
Column(
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.inverseOnSurface)
) {
Box(
modifier = Modifier
.weight(1f)
.run {
if (navigationType == NavigationType.BOTTOM_NAVIGATION) {
this
.consumeWindowInsets(WindowInsets.ime)
.consumeWindowInsets(WindowInsets.navigationBars)
} else this
}
) {
NavHost(
modifier = Modifier.fillMaxSize(),
navController = navController,
startDestination = MainDestination.Search.route
) {
composable(MainDestination.Search.route) {
SearchScreen(
contentType = contentType,
displayFeatures = displayFeatures,
uiState = uiState,
openGalleryDetails = openGalleryDetails,
closeGalleryDetails = closeGalleryDetails,
onQueryChange = onQueryChange,
loadSearchResult = loadSearchResult,
openGallery = {
navController.navigate(MainDestination.ImageViewer(it.id).route) {
launchSingleTop = true
}
}
)
}
composable(MainDestination.History.route) {
NotImplemented()
}
composable(MainDestination.Downloads.route) {
NotImplemented()
}
composable(MainDestination.Favorites.route) {
NotImplemented()
}
composable(MainDestination.Settings.route) {
NotImplemented()
}
composable(MainDestination.ImageViewer.commonRoute) {
NotImplemented()
}
}
}
AnimatedVisibility(visible = navigationType == NavigationType.BOTTOM_NAVIGATION) {
BottomNavigationBar(
selectedDestination = currentRoute,
navigateToDestination = { navController.navigate(it.route) {
popUpTo(MainDestination.Search.route)
launchSingleTop = true
} }
)
}
}
}
}
@@ -1,67 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.MenuBook
import androidx.compose.material.icons.filled.Download
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.History
import androidx.compose.material.icons.filled.MenuBook
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Star
import androidx.compose.ui.graphics.vector.ImageVector
import xyz.quaver.pupil.R
sealed interface MainDestination {
val route: String
val icon: ImageVector
val textId: Int
data object Search: MainDestination {
override val route = "search"
override val icon = Icons.Default.Search
override val textId = R.string.main_destination_search
}
data object History: MainDestination {
override val route = "history"
override val icon = Icons.Default.History
override val textId = R.string.main_destination_history
}
data object Downloads: MainDestination {
override val route = "downloads"
override val icon = Icons.Default.Download
override val textId = R.string.main_destination_downloads
}
data object Favorites: MainDestination {
override val route = "favorites"
override val icon = Icons.Default.Favorite
override val textId = R.string.main_destination_favorites
}
data object Settings: MainDestination {
override val route = "settings"
override val icon = Icons.Default.Settings
override val textId = R.string.main_destination_settings
}
class ImageViewer(galleryID: String): MainDestination {
override val route = "image_viewer/$galleryID"
override val icon = Icons.AutoMirrored.Filled.MenuBook
override val textId = R.string.main_destination_image_viewer
companion object {
val commonRoute = "image_viewer/{galleryID}"
}
}
}
val mainDestinations = listOf(
MainDestination.Search,
MainDestination.History,
MainDestination.Downloads,
MainDestination.Favorites,
MainDestination.Settings
)
@@ -1,5 +0,0 @@
package xyz.quaver.pupil.ui.composable
enum class NavigationContentPosition {
TOP, CENTER
}
@@ -1,294 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.ime
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.layout.union
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.MenuOpen
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalDrawerSheet
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.NavigationDrawerItem
import androidx.compose.material3.NavigationDrawerItemDefaults
import androidx.compose.material3.NavigationRail
import androidx.compose.material3.NavigationRailItem
import androidx.compose.material3.PermanentDrawerSheet
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.Measurable
import androidx.compose.ui.layout.MeasurePolicy
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.offset
import androidx.navigation.NavDestination
import xyz.quaver.pupil.R
@Composable
fun PermanentNavigationDrawerContent(
selectedDestination: String?,
navigateToDestination: (MainDestination) -> Unit,
navigationContentPosition: NavigationContentPosition,
) {
PermanentDrawerSheet(
modifier = Modifier.sizeIn(minWidth = 200.dp, maxWidth = 300.dp),
drawerContainerColor = MaterialTheme.colorScheme.inverseOnSurface
) {
Layout(
modifier = Modifier
.background(MaterialTheme.colorScheme.inverseOnSurface)
.padding(16.dp),
content = {
Row(
modifier = Modifier.layoutId(LayoutType.HEADER),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
modifier = Modifier.size(32.dp),
painter = painterResource(R.drawable.app_icon),
tint = Color.Unspecified,
contentDescription = "app icon"
)
Text(
modifier = Modifier.padding(16.dp),
text = "Pupil",
style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
color = MaterialTheme.colorScheme.primary
)
}
Column(
modifier = Modifier
.layoutId(LayoutType.CONTENT)
.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally
) {
mainDestinations.forEach { destination ->
NavigationDrawerItem(
label = {
Text(
text = stringResource(destination.textId),
modifier = Modifier.padding(16.dp)
)
},
icon = {
Icon(
imageVector = destination.icon,
contentDescription = stringResource(destination.textId)
)
},
selected = selectedDestination == destination.route,
colors = NavigationDrawerItemDefaults.colors(
unselectedContainerColor = Color.Transparent
),
onClick = { navigateToDestination(destination) }
)
}
}
},
measurePolicy = navigationMeasurePolicy(navigationContentPosition)
)
}
}
@Composable
fun ModalNavigationDrawerContent(
selectedDestination: String?,
navigationContentPosition: NavigationContentPosition,
navigateToDestination: (MainDestination) -> Unit,
onDrawerClicked: () -> Unit
) {
ModalDrawerSheet {
Layout(
modifier = Modifier
.background(MaterialTheme.colorScheme.inverseOnSurface)
.padding(16.dp),
content = {
Row(
modifier = Modifier
.layoutId(LayoutType.HEADER)
.fillMaxWidth()
.padding(16.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
Icon(
modifier = Modifier.size(32.dp),
painter = painterResource(R.drawable.app_icon),
tint = Color.Unspecified,
contentDescription = "app icon"
)
Text(
modifier = Modifier.padding(16.dp),
text = "Pupil",
style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
color = MaterialTheme.colorScheme.primary
)
}
IconButton(onClick = onDrawerClicked) {
Icon(
imageVector = Icons.AutoMirrored.Default.MenuOpen,
contentDescription = stringResource(R.string.main_open_navigation_drawer)
)
}
}
Column (
modifier = Modifier
.layoutId(LayoutType.CONTENT)
.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally
) {
mainDestinations.forEach { destination ->
NavigationDrawerItem(
label = {
Text(
text = stringResource(destination.textId),
modifier = Modifier.padding(16.dp)
)
},
icon = {
Icon(
imageVector = destination.icon,
contentDescription = stringResource(destination.textId)
)
},
selected = selectedDestination == destination.route,
colors = NavigationDrawerItemDefaults.colors(
unselectedContainerColor = Color.Transparent
),
onClick = { navigateToDestination(destination) }
)
}
}
},
measurePolicy = navigationMeasurePolicy(navigationContentPosition)
)
}
}
@Composable
fun MainNavigationRail(
selectedDestination: String?,
navigateToDestination: (MainDestination) -> Unit,
onDrawerClicked: () -> Unit
) {
NavigationRail (
modifier = Modifier.fillMaxHeight(),
containerColor = MaterialTheme.colorScheme.inverseOnSurface
) {
NavigationRailItem(
selected = false,
onClick = onDrawerClicked,
icon = {
Icon(
imageVector = Icons.Default.Menu,
contentDescription = stringResource(R.string.main_open_navigation_drawer)
)
}
)
Column(
modifier = Modifier.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
mainDestinations.forEach { destination ->
NavigationRailItem(
selected = selectedDestination == destination.route,
onClick = { navigateToDestination(destination) },
icon = {
Icon(
imageVector = destination.icon,
contentDescription = stringResource(destination.textId)
)
}
)
}
}
}
}
@Composable
fun BottomNavigationBar(
selectedDestination: String?,
navigateToDestination: (MainDestination) -> Unit
) {
NavigationBar(modifier = Modifier.fillMaxWidth(), windowInsets = WindowInsets.ime.union(WindowInsets.navigationBars)) {
mainDestinations.forEach { destination ->
NavigationBarItem(
selected = selectedDestination == destination.route,
onClick = { navigateToDestination(destination) },
icon = {
Icon(
imageVector = destination.icon,
contentDescription = stringResource(destination.textId)
)
}
)
}
}
}
fun navigationMeasurePolicy(
navigationContentPosition: NavigationContentPosition,
): MeasurePolicy {
return MeasurePolicy { measurables, constraints ->
lateinit var headerMeasurable: Measurable
lateinit var contentMeasurable: Measurable
measurables.forEach {
when (it.layoutId) {
LayoutType.HEADER -> headerMeasurable = it
LayoutType.CONTENT -> contentMeasurable = it
else -> error("Unknown layoutId encountered!")
}
}
val headerPlaceable = headerMeasurable.measure(constraints)
val contentPlaceable = contentMeasurable.measure(
constraints.offset(vertical = -headerPlaceable.height)
)
layout(constraints.maxWidth, constraints.maxHeight) {
headerPlaceable.placeRelative(0, 0)
val nonContentVerticalSpace = constraints.maxHeight - contentPlaceable.height
val contentPlaceableY = when (navigationContentPosition) {
NavigationContentPosition.TOP -> 0
NavigationContentPosition.CENTER -> nonContentVerticalSpace / 2
}.coerceAtLeast(headerPlaceable.height)
contentPlaceable.placeRelative(0, contentPlaceableY)
}
}
}
enum class LayoutType {
HEADER, CONTENT
}
@@ -1,5 +0,0 @@
package xyz.quaver.pupil.ui.composable
enum class NavigationType {
NAVIGATION_RAIL, PERMANENT_NAVIGATION_DRAWER, BOTTOM_NAVIGATION
}
@@ -1,217 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.gestures.awaitEachGesture
import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.NavigateBefore
import androidx.compose.material.icons.automirrored.filled.NavigateNext
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.input.pointer.changedToUpIgnoreConsumed
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.input.pointer.positionChange
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.toSize
import androidx.compose.ui.util.fastFirstOrNull
import xyz.quaver.pupil.R
import xyz.quaver.pupil.ui.theme.Blue300
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
@Composable
fun OverscrollPager(
prevPage: Int?,
nextPage: Int?,
onPageTurn: (Int) -> Unit,
prevPageTurnIndicatorOffset: Dp = 0.dp,
nextPageTurnIndicatorOffset: Dp = 0.dp,
content: @Composable () -> Unit
) {
val haptic = LocalHapticFeedback.current
val pageTurnIndicatorHeight = LocalDensity.current.run { 64.dp.toPx() }
var overscroll: Float? by remember { mutableStateOf(null) }
var size: Size? by remember { mutableStateOf(null) }
val circleRadius = (size?.width ?: 0f) / 2
val topCircleRadius by animateFloatAsState(if (overscroll?.let { it >= pageTurnIndicatorHeight } == true) circleRadius else 0f, label = "topCircleRadius")
val bottomCircleRadius by animateFloatAsState(if (overscroll?.let { it <= -pageTurnIndicatorHeight } == true) circleRadius else 0f, label = "bottomCircleRadius")
val prevPageTurnIndicatorOffsetPx = LocalDensity.current.run { prevPageTurnIndicatorOffset.toPx() }
val nextPageTurnIndicatorOffsetPx = LocalDensity.current.run { nextPageTurnIndicatorOffset.toPx() }
if (topCircleRadius != 0f || bottomCircleRadius != 0f)
Canvas(modifier = Modifier.fillMaxSize()) {
drawCircle(
Blue300,
center = Offset(this.center.x, prevPageTurnIndicatorOffsetPx),
radius = topCircleRadius
)
drawCircle(
Blue300,
center = Offset(this.center.x, this.size.height-nextPageTurnIndicatorOffsetPx),
radius = bottomCircleRadius
)
}
val isOverscrollOverHeight = overscroll?.let { abs(it) >= pageTurnIndicatorHeight } == true
LaunchedEffect(isOverscrollOverHeight) {
if (isOverscrollOverHeight) haptic.performHapticFeedback(HapticFeedbackType.LongPress)
}
Box(
Modifier
.fillMaxHeight()
.onGloballyPositioned {
size = it.size.toSize()
}
) {
overscroll?.let { overscroll ->
if (overscroll > 0f && prevPage != null) {
Row(
modifier = Modifier
.align(Alignment.TopCenter)
.offset(0.dp, prevPageTurnIndicatorOffset),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
Icons.AutoMirrored.Filled.NavigateBefore,
contentDescription = null,
tint = MaterialTheme.colorScheme.secondary,
modifier = Modifier.size(48.dp)
)
Text(stringResource(R.string.move_to_page, prevPage))
}
}
if (overscroll < 0f && nextPage != null) {
Row(
modifier = Modifier
.align(Alignment.BottomCenter)
.offset(0.dp, -nextPageTurnIndicatorOffset),
verticalAlignment = Alignment.CenterVertically
) {
Text(stringResource(R.string.move_to_page, nextPage))
Icon(
Icons.AutoMirrored.Filled.NavigateNext,
contentDescription = null,
tint = MaterialTheme.colorScheme.secondary,
modifier = Modifier.size(48.dp)
)
}
}
}
Box(
modifier = Modifier
.offset(
0.dp,
overscroll
?.coerceIn(-pageTurnIndicatorHeight, pageTurnIndicatorHeight)
?.let { overscroll -> LocalDensity.current.run { overscroll.toDp() } }
?: 0.dp)
.nestedScroll(object : NestedScrollConnection {
override fun onPreScroll(
available: Offset,
source: NestedScrollSource
): Offset {
val overscrollSnapshot = overscroll
return if (overscrollSnapshot == null || overscrollSnapshot == 0f) {
Offset.Zero
} else {
val newOverscroll =
if (overscrollSnapshot > 0f && available.y < 0f)
max(overscrollSnapshot + available.y, 0f)
else if (overscrollSnapshot < 0f && available.y > 0f)
min(overscrollSnapshot + available.y, 0f)
else
overscrollSnapshot
Offset(0f, newOverscroll - overscrollSnapshot).also {
overscroll = newOverscroll
}
}
}
override fun onPostScroll(
consumed: Offset,
available: Offset,
source: NestedScrollSource
): Offset {
if (
available.y == 0f ||
prevPage == null && available.y > 0f ||
nextPage == null && available.y < 0f
) return Offset.Zero
return overscroll?.let {
overscroll = it + available.y
Offset(0f, available.y)
} ?: Offset.Zero
}
})
.pointerInput(prevPage, nextPage) {
awaitEachGesture {
val down = awaitFirstDown(requireUnconsumed = false)
var pointer = down.id
overscroll = 0f
while (true) {
val event = awaitPointerEvent()
val dragEvent =
event.changes.fastFirstOrNull { it.id == pointer }!!
if (dragEvent.changedToUpIgnoreConsumed()) {
val otherDown = event.changes.fastFirstOrNull { it.pressed }
if (otherDown == null) {
if (dragEvent.positionChange() != Offset.Zero) dragEvent.consume()
overscroll?.let {
if (abs(it) > pageTurnIndicatorHeight) {
if (it > 0 && prevPage != null) onPageTurn(prevPage)
if (it < 0 && nextPage != null) onPageTurn(nextPage)
}
}
overscroll = null
break
} else
pointer = otherDown.id
}
}
}
}
) {
content()
}
}
}
@@ -1,793 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.AddCircleOutline
import androidx.compose.material.icons.filled.RemoveCircleOutline
import androidx.compose.material3.Card
import androidx.compose.material3.CardColors
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import xyz.quaver.pupil.R
import xyz.quaver.pupil.networking.HitomiHttpClient
import xyz.quaver.pupil.networking.SearchQuery
import xyz.quaver.pupil.networking.Suggestion
import xyz.quaver.pupil.networking.validNamespace
import xyz.quaver.pupil.ui.theme.Blue300
import xyz.quaver.pupil.ui.theme.Blue600
import xyz.quaver.pupil.ui.theme.Gray300
import xyz.quaver.pupil.ui.theme.Pink600
import xyz.quaver.pupil.ui.theme.Red300
import xyz.quaver.pupil.ui.theme.Yellow400
private fun SearchQuery.toEditableStateInternal(): EditableSearchQueryState = when (this) {
is SearchQuery.Tag -> EditableSearchQueryState.Tag(namespace, tag)
is SearchQuery.And -> EditableSearchQueryState.And(queries.map { it.toEditableStateInternal() })
is SearchQuery.Or -> EditableSearchQueryState.Or(queries.map { it.toEditableStateInternal() })
is SearchQuery.Not -> EditableSearchQueryState.Not(query.toEditableStateInternal())
}
fun SearchQuery?.toEditableState(): EditableSearchQueryState.Root =
EditableSearchQueryState.Root(this?.toEditableStateInternal())
private fun EditableSearchQueryState.Tag.toSearchQueryInternal(): SearchQuery.Tag? =
if (namespace.value != null || tag.value.isNotBlank()) SearchQuery.Tag(
namespace.value,
tag.value.lowercase().trim()
) else null
private fun EditableSearchQueryState.And.toSearchQueryInternal(): SearchQuery.And? =
queries.mapNotNull { it.toSearchQueryInternal() }
.let { if (it.isNotEmpty()) SearchQuery.And(it) else null }
private fun EditableSearchQueryState.Or.toSearchQueryInternal(): SearchQuery.Or? =
queries.mapNotNull { it.toSearchQueryInternal() }
.let { if (it.isNotEmpty()) SearchQuery.Or(it) else null }
private fun EditableSearchQueryState.Not.toSearchQueryInternal(): SearchQuery.Not? =
query.value?.toSearchQueryInternal()?.let { SearchQuery.Not(it) }
private fun EditableSearchQueryState.toSearchQueryInternal(): SearchQuery? = when (this) {
is EditableSearchQueryState.Tag -> this.toSearchQueryInternal()
is EditableSearchQueryState.And -> this.toSearchQueryInternal()
is EditableSearchQueryState.Or -> this.toSearchQueryInternal()
is EditableSearchQueryState.Not -> this.toSearchQueryInternal()
}
fun EditableSearchQueryState.Root.toSearchQuery(): SearchQuery? =
query.value?.toSearchQueryInternal()
fun coalesceTags(
oldTag: EditableSearchQueryState.Tag?,
newTag: EditableSearchQueryState?,
): EditableSearchQueryState? = if (oldTag != null) {
when (newTag) {
is EditableSearchQueryState.Tag,
is EditableSearchQueryState.Not,
-> EditableSearchQueryState.And(listOf(oldTag, newTag))
is EditableSearchQueryState.And -> newTag.apply { queries.add(oldTag) }
is EditableSearchQueryState.Or -> newTag.apply { queries.add(oldTag) }
null -> oldTag
}
} else newTag
sealed interface EditableSearchQueryState {
class Tag(
namespace: String? = null,
tag: String = "",
expanded: Boolean = false,
) : EditableSearchQueryState {
val namespace = mutableStateOf(namespace)
val tag = mutableStateOf(tag)
val expanded = mutableStateOf(expanded)
}
class And(
queries: List<EditableSearchQueryState> = emptyList(),
) : EditableSearchQueryState {
val queries = queries.toMutableStateList()
}
class Or(
queries: List<EditableSearchQueryState> = emptyList(),
) : EditableSearchQueryState {
val queries = queries.toMutableStateList()
}
class Not(
query: EditableSearchQueryState? = null,
) : EditableSearchQueryState {
val query = mutableStateOf(query)
}
class Root(
query: EditableSearchQueryState? = null,
) {
val query = mutableStateOf(query)
}
}
@Composable
fun TagSuggestionList(
state: EditableSearchQueryState.Tag,
) {
var suggestionList: List<Suggestion>? by remember { mutableStateOf(null) }
var namespace by state.namespace
var tag by state.tag
var expanded by state.expanded
LaunchedEffect(namespace, tag) {
suggestionList = null
val searchQuery = state.toSearchQueryInternal()
suggestionList = if (searchQuery != null) {
HitomiHttpClient.getSuggestionsForQuery(searchQuery)
.getOrDefault(emptyList())
.filterNot { it.tag == SearchQuery.Tag(namespace, tag) }
} else {
emptyList()
}
}
val suggestionListSnapshot = suggestionList
if (suggestionListSnapshot == null) {
Row(
Modifier.padding(16.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically
) {
CircularProgressIndicator(Modifier.size(24.dp))
Text("Loading")
}
} else if (suggestionListSnapshot.isNotEmpty()) {
Column(
modifier = Modifier.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
suggestionListSnapshot.forEach { suggestion ->
TagChip(
tag = suggestion.tag,
onClick = {
namespace = it.namespace
tag = it.tag
expanded = false
}
)
}
}
}
}
@Composable
fun EditableTagChip(
state: EditableSearchQueryState.Tag,
isFavorite: Boolean = false,
autoFocus: Boolean = true,
requestScrollTo: (Float) -> Unit,
leftIcon: @Composable RowScope.(SearchQuery.Tag) -> Unit = { tag -> TagChipIcon(tag) },
rightIcon: @Composable RowScope.(SearchQuery.Tag) -> Unit = { _ -> Spacer(Modifier.width(16.dp)) },
content: @Composable RowScope.(SearchQuery.Tag) -> Unit = { tag ->
Text(
modifier = Modifier
.weight(1f, fill = false)
.horizontalScroll(rememberScrollState()),
text = tag.tag.ifBlank { stringResource(R.string.search_bar_edit_tag) }
)
},
) {
val coroutineScope = rememberCoroutineScope()
var namespace by state.namespace
var tag by state.tag
var expanded by state.expanded
var wasFocused by remember { mutableStateOf(false) }
var positionY by remember { mutableFloatStateOf(0f) }
LaunchedEffect(expanded) {
if (!expanded) {
wasFocused = false
}
}
val surfaceColor by animateColorAsState(
when {
expanded -> MaterialTheme.colorScheme.surface
isFavorite -> Yellow400
namespace == "male" -> Blue600
namespace == "female" -> Pink600
else -> MaterialTheme.colorScheme.surface
}, label = "tag surface color"
)
val contentColor by animateColorAsState(
when {
expanded -> Color.White
isFavorite -> Color.White
namespace == "male" -> Color.White
namespace == "female" -> Color.White
else -> MaterialTheme.colorScheme.onSurface
}, label = "tag content color"
)
Surface(
modifier = Modifier.onGloballyPositioned {
positionY = it.positionInRoot().y
},
shape = RoundedCornerShape(16.dp),
color = surfaceColor,
shadowElevation = 4.dp
) {
AnimatedContent(targetState = expanded, label = "open tag editor") { targetExpanded ->
if (!targetExpanded) {
CompositionLocalProvider(
LocalContentColor provides contentColor,
LocalTextStyle provides MaterialTheme.typography.bodyMedium
) {
val queryTag = SearchQuery.Tag(namespace, tag)
Row(
modifier = Modifier
.height(32.dp)
.clickable { expanded = true },
verticalAlignment = Alignment.CenterVertically
) {
leftIcon(queryTag)
content(queryTag)
rightIcon(queryTag)
}
}
} else {
Column(
Modifier
.fillMaxWidth()
.padding(top = 8.dp, bottom = 8.dp, end = 8.dp)
) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
IconButton(
onClick = {
expanded = false
}
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "close tag editor"
)
}
var selection by remember(tag) { mutableStateOf(TextRange(tag.length)) }
var composition by remember { mutableStateOf<TextRange?>(null) }
val focusRequester = remember { FocusRequester() }
val textFieldValue = remember(tag, selection, composition) {
TextFieldValue(tag, selection, composition)
}
LaunchedEffect(expanded) {
if (autoFocus && expanded) {
focusRequester.requestFocus()
}
}
OutlinedTextField(
value = textFieldValue,
singleLine = true,
keyboardOptions = KeyboardOptions(
capitalization = KeyboardCapitalization.None,
autoCorrectEnabled = false,
imeAction = ImeAction.Done
),
leadingIcon = {
TagChipIcon(SearchQuery.Tag(namespace, tag))
},
modifier = Modifier
.fillMaxWidth()
.onKeyEvent { event ->
if (event.key == Key.Backspace && tag.isEmpty()) {
val newTag = namespace?.dropLast(1) ?: ""
namespace = null
tag = newTag
selection = TextRange(newTag.length)
composition = null
true
} else false
}
.focusRequester(focusRequester)
.onFocusChanged { event ->
if (event.isFocused) {
wasFocused = true
coroutineScope.launch {
delay(300)
requestScrollTo(positionY)
}
} else if (wasFocused) {
expanded = false
}
},
keyboardActions = KeyboardActions(
onDone = {
expanded = false
}
),
onValueChange = { newTextValue ->
val newTag = newTextValue.text
val possibleNamespace = newTag.dropLast(1).lowercase().trim()
tag =
if (namespace == null && newTag.endsWith(':') && possibleNamespace in validNamespace) {
namespace = possibleNamespace
""
} else newTag
selection = newTextValue.selection
composition = newTextValue.composition
}
)
}
TagSuggestionList(state)
}
}
}
}
}
@Composable
fun NewQueryChip(
currentQuery: EditableSearchQueryState?,
onNewQuery: (EditableSearchQueryState) -> Unit,
) {
var opened by remember { mutableStateOf(false) }
@Composable
fun NewQueryRow(
modifier: Modifier = Modifier,
icon: ImageVector = Icons.Default.AddCircleOutline,
text: String,
onClick: () -> Unit,
) {
Row(
modifier = modifier
.height(32.dp)
.clickable(onClick = onClick),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
modifier = Modifier
.padding(8.dp)
.size(16.dp),
imageVector = icon,
contentDescription = text
)
Text(
modifier = Modifier.padding(end = 16.dp),
text = text,
style = MaterialTheme.typography.bodyMedium
)
}
}
Surface(shape = RoundedCornerShape(16.dp), shadowElevation = 4.dp) {
AnimatedContent(targetState = opened, label = "add new query") { targetOpened ->
if (targetOpened) {
Column {
NewQueryRow(
modifier = Modifier.fillMaxWidth(),
icon = Icons.Default.RemoveCircleOutline,
text = stringResource(android.R.string.cancel)
) {
opened = false
}
HorizontalDivider()
if (currentQuery != null && currentQuery !is EditableSearchQueryState.Tag && currentQuery !is EditableSearchQueryState.And) {
NewQueryRow(
modifier = Modifier.fillMaxWidth(),
text = stringResource(R.string.search_add_query_item_tag)
) {
opened = false
onNewQuery(EditableSearchQueryState.Tag(expanded = true))
}
}
if (currentQuery !is EditableSearchQueryState.And) {
HorizontalDivider()
NewQueryRow(modifier = Modifier.fillMaxWidth(), text = "AND") {
opened = false
onNewQuery(EditableSearchQueryState.And())
}
}
if (currentQuery !is EditableSearchQueryState.Or) {
HorizontalDivider()
NewQueryRow(modifier = Modifier.fillMaxWidth(), text = "OR") {
opened = false
onNewQuery(EditableSearchQueryState.Or())
}
}
if (currentQuery !is EditableSearchQueryState.Not || currentQuery.query.value != null) {
HorizontalDivider()
NewQueryRow(modifier = Modifier.fillMaxWidth(), text = "NOT") {
opened = false
onNewQuery(EditableSearchQueryState.Not())
}
}
}
} else {
NewQueryRow(text = stringResource(R.string.search_add_query_item)) {
opened = true
}
}
}
}
}
@Composable
fun QueryEditorQueryView(
state: EditableSearchQueryState,
onQueryRemove: (EditableSearchQueryState) -> Unit,
requestScrollTo: (Float) -> Unit,
requestScrollBy: (Float) -> Unit,
) {
when (state) {
is EditableSearchQueryState.Tag -> {
EditableTagChip(
state,
requestScrollTo = requestScrollTo,
rightIcon = {
Icon(
modifier = Modifier
.padding(8.dp)
.size(16.dp)
.clickable {
onQueryRemove(state)
},
imageVector = Icons.Default.RemoveCircleOutline,
contentDescription = stringResource(R.string.search_remove_query_item_description)
)
}
)
}
is EditableSearchQueryState.Or -> {
Card(
colors = CardColors(
containerColor = Blue300,
contentColor = Color.Black,
disabledContainerColor = Blue300,
disabledContentColor = Color.Black
)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.Start,
) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
"OR",
modifier = Modifier.padding(horizontal = 8.dp),
style = MaterialTheme.typography.labelMedium
)
Icon(
modifier = Modifier
.size(16.dp)
.clickable { onQueryRemove(state) },
imageVector = Icons.Default.RemoveCircleOutline,
contentDescription = stringResource(R.string.search_remove_query_item_description)
)
}
state.queries.forEachIndexed { index, subQueryState ->
if (index != 0) {
Text("+", modifier = Modifier.padding(horizontal = 8.dp))
}
QueryEditorQueryView(
subQueryState,
onQueryRemove = { state.queries.remove(it) },
requestScrollTo = requestScrollTo,
requestScrollBy = requestScrollBy
)
}
NewQueryChip(state) { newQueryState ->
state.queries.add(newQueryState)
}
}
}
}
is EditableSearchQueryState.And -> {
Card(
colors = CardColors(
containerColor = Gray300,
contentColor = Color.Black,
disabledContainerColor = Gray300,
disabledContentColor = Color.Black
)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.Start,
) {
val newSearchQuery = remember { EditableSearchQueryState.Tag() }
var newQueryNamespace by newSearchQuery.namespace
var newQueryTag by newSearchQuery.tag
var newQueryExpanded by newSearchQuery.expanded
val offset = with(LocalDensity.current) { 40.dp.toPx() }
LaunchedEffect(newQueryExpanded) {
if (!newQueryExpanded && (newQueryNamespace != null || newQueryTag.isNotBlank())) {
state.queries.add(
EditableSearchQueryState.Tag(
newQueryNamespace,
newQueryTag
)
)
newQueryNamespace = null
newQueryTag = ""
newQueryExpanded = true
requestScrollBy(offset)
}
}
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
"AND",
modifier = Modifier.padding(horizontal = 8.dp),
style = MaterialTheme.typography.labelMedium
)
Icon(
modifier = Modifier
.size(16.dp)
.clickable { onQueryRemove(state) },
imageVector = Icons.Default.RemoveCircleOutline,
contentDescription = stringResource(R.string.search_remove_query_item_description)
)
}
state.queries.forEach { subQuery ->
QueryEditorQueryView(
subQuery,
onQueryRemove = { state.queries.remove(it) },
requestScrollTo = requestScrollTo,
requestScrollBy = requestScrollBy
)
}
EditableTagChip(
newSearchQuery,
requestScrollTo = requestScrollTo,
)
NewQueryChip(state) { newQueryState ->
state.queries.add(newQueryState)
}
}
}
}
is EditableSearchQueryState.Not -> {
var subQueryState by state.query
Card(
colors = CardColors(
containerColor = Red300,
contentColor = Color.Black,
disabledContainerColor = Red300,
disabledContentColor = Color.Black
)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.Start,
) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
"-",
modifier = Modifier.padding(horizontal = 8.dp),
style = MaterialTheme.typography.labelMedium
)
Icon(
modifier = Modifier
.size(16.dp)
.clickable { onQueryRemove(state) },
imageVector = Icons.Default.RemoveCircleOutline,
contentDescription = stringResource(R.string.search_remove_query_item_description)
)
}
val subQueryStateSnapshot = subQueryState
if (subQueryStateSnapshot != null) {
QueryEditorQueryView(
subQueryStateSnapshot,
onQueryRemove = { subQueryState = null },
requestScrollTo = requestScrollTo,
requestScrollBy = requestScrollBy,
)
}
if (subQueryStateSnapshot == null) {
NewQueryChip(state) { newQueryState ->
subQueryState = newQueryState
}
}
if (subQueryStateSnapshot is EditableSearchQueryState.Tag) {
NewQueryChip(state) { newQueryState ->
subQueryState = coalesceTags(subQueryStateSnapshot, newQueryState)
}
}
}
}
}
}
}
@Composable
fun QueryEditor(
state: EditableSearchQueryState.Root,
) {
var rootQuery by state.query
val scrollState = rememberScrollState()
var topY by remember { mutableFloatStateOf(0f) }
val scrollOffset = with(LocalDensity.current) { 16.dp.toPx() }
val coroutineScope = rememberCoroutineScope()
Column(
modifier = Modifier
.onGloballyPositioned {
topY = it.positionInRoot().y
}
.verticalScroll(scrollState)
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp)
) {
val rootQuerySnapshot = rootQuery
val requestScrollTo: (Float) -> Unit = { target ->
val topYSnapshot = topY
coroutineScope.launch {
scrollState.animateScrollBy(
target - topYSnapshot - scrollOffset,
spring(stiffness = Spring.StiffnessLow)
)
}
}
val requestScrollBy: (Float) -> Unit = { value ->
coroutineScope.launch {
scrollState.animateScrollBy(value)
}
}
if (rootQuerySnapshot != null) {
QueryEditorQueryView(
state = rootQuerySnapshot,
onQueryRemove = { rootQuery = null },
requestScrollTo = requestScrollTo,
requestScrollBy = requestScrollBy
)
}
if (rootQuerySnapshot is EditableSearchQueryState.Tag?) {
val newSearchQuery = remember { EditableSearchQueryState.Tag(expanded = true) }
var newQueryNamespace by newSearchQuery.namespace
var newQueryTag by newSearchQuery.tag
var newQueryExpanded by newSearchQuery.expanded
val offset = with(LocalDensity.current) { 40.dp.toPx() }
LaunchedEffect(newQueryExpanded) {
if (!newQueryExpanded && (newQueryNamespace != null || newQueryTag.isNotBlank())) {
rootQuery = if (rootQuerySnapshot == null) {
EditableSearchQueryState.Tag(newQueryNamespace, newQueryTag)
} else {
EditableSearchQueryState.And(
listOf(
rootQuerySnapshot,
EditableSearchQueryState.Tag(newQueryNamespace, newQueryTag)
)
)
}
newQueryNamespace = null
newQueryTag = ""
newQueryExpanded = true
requestScrollBy(offset)
}
}
EditableTagChip(
newSearchQuery,
requestScrollTo = requestScrollTo
)
NewQueryChip(rootQuerySnapshot) { newState ->
rootQuery = coalesceTags(rootQuerySnapshot, newState)
}
}
}
}
@@ -1,703 +0,0 @@
package xyz.quaver.pupil.ui.composable
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.AnimationState
import androidx.compose.animation.core.VectorConverter
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.animateTo
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.absoluteOffset
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.Label
import androidx.compose.material.icons.filled.Book
import androidx.compose.material.icons.filled.Brush
import androidx.compose.material.icons.filled.Face
import androidx.compose.material.icons.filled.Female
import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.filled.Group
import androidx.compose.material.icons.filled.Male
import androidx.compose.material.icons.filled.Translate
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
import androidx.window.layout.DisplayFeature
import com.google.accompanist.adaptive.HorizontalTwoPaneStrategy
import com.google.accompanist.adaptive.TwoPane
import xyz.quaver.pupil.R
import xyz.quaver.pupil.networking.GalleryInfo
import xyz.quaver.pupil.networking.HitomiHttpClient
import xyz.quaver.pupil.networking.SearchQuery
import xyz.quaver.pupil.ui.theme.Blue600
import xyz.quaver.pupil.ui.theme.Pink600
import xyz.quaver.pupil.ui.theme.Yellow400
import xyz.quaver.pupil.ui.viewmodel.SearchState
import kotlin.math.roundToInt
private val iconMap = mapOf(
"female" to Icons.Default.Female,
"male" to Icons.Default.Male,
"artist" to Icons.Default.Brush,
"group" to Icons.Default.Group,
"character" to Icons.Default.Face,
"series" to Icons.Default.Book,
"type" to Icons.Default.Folder,
"language" to Icons.Default.Translate,
"tag" to Icons.AutoMirrored.Filled.Label,
)
val languageIconMap = mapOf(
"indonesian" to R.drawable.language_indonesian,
"javanese" to R.drawable.language_javanese,
"catalan" to R.drawable.language_catalan,
"cebuano" to R.drawable.language_philippines,
"czech" to R.drawable.language_czech,
"danish" to R.drawable.language_danish,
"german" to R.drawable.language_german,
"estonian" to R.drawable.language_estonian,
"english" to R.drawable.language_english,
"spanish" to R.drawable.language_spanish,
"french" to R.drawable.language_french,
"italian" to R.drawable.language_italian,
"latin" to R.drawable.language_latin,
"hungarian" to R.drawable.language_hungarian,
"dutch" to R.drawable.language_dutch,
"norwegian" to R.drawable.language_norwegian,
"polish" to R.drawable.language_polish,
"portuguese" to R.drawable.language_portuguese,
"romanian" to R.drawable.language_romanian,
"albanian" to R.drawable.language_albanian,
"slovak" to R.drawable.language_slovak,
"finnish" to R.drawable.language_finnish,
"swedish" to R.drawable.language_swedish,
"tagalog" to R.drawable.language_philippines,
"vietnamese" to R.drawable.language_vietnamese,
"turkish" to R.drawable.language_turkish,
"greek" to R.drawable.language_greek,
"mongolian" to R.drawable.language_mongolian,
"russian" to R.drawable.language_russian,
"ukrainian" to R.drawable.language_ukrainian,
"hebrew" to R.drawable.language_hebrew,
"persian" to R.drawable.language_persian,
"thai" to R.drawable.language_thai,
"korean" to R.drawable.language_korean,
"chinese" to R.drawable.language_chinese,
"japanese" to R.drawable.language_japanese,
)
@Composable
fun TagChipIcon(tag: SearchQuery.Tag) {
val icon = iconMap[tag.namespace]
if (icon != null) {
if (tag.namespace == "language" && languageIconMap.contains(tag.tag)) {
Icon(
painter = painterResource(languageIconMap[tag.tag]!!),
contentDescription = "icon",
modifier = Modifier
.padding(4.dp)
.size(24.dp),
tint = Color.Unspecified
)
} else {
Icon(
icon,
contentDescription = "icon",
modifier = Modifier
.padding(4.dp)
.size(24.dp)
)
}
} else {
Spacer(Modifier.width(16.dp))
}
}
@Composable
fun TagChip(
tag: SearchQuery.Tag,
isFavorite: Boolean = false,
enabled: Boolean = true,
onClick: (SearchQuery.Tag) -> Unit = { },
leftIcon: @Composable (SearchQuery.Tag) -> Unit = { TagChipIcon(it) },
rightIcon: @Composable (SearchQuery.Tag) -> Unit = { Spacer(Modifier.width(16.dp)) },
content: @Composable RowScope.(SearchQuery.Tag) -> Unit = {
Text(
it.tag,
modifier = Modifier
.weight(1f, fill = false)
.horizontalScroll(rememberScrollState())
)
},
) {
val surfaceColor = if (isFavorite) Yellow400 else when (tag.namespace) {
"male" -> Blue600
"female" -> Pink600
else -> MaterialTheme.colorScheme.surface
}
val contentColor =
if (surfaceColor == MaterialTheme.colorScheme.surface)
MaterialTheme.colorScheme.onSurface
else
Color.White
val inner = @Composable {
CompositionLocalProvider(
LocalContentColor provides contentColor,
LocalTextStyle provides MaterialTheme.typography.bodyMedium
) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
leftIcon(tag)
content(tag)
rightIcon(tag)
}
}
}
val modifier = Modifier.height(32.dp)
val shape = RoundedCornerShape(16.dp)
if (enabled)
Surface(
modifier = modifier,
shape = shape,
color = surfaceColor,
onClick = { onClick(tag) },
content = inner,
shadowElevation = 4.dp
)
else
Surface(
modifier,
shape = shape,
color = surfaceColor,
content = inner,
shadowElevation = 4.dp
)
}
@Composable
fun QueryView(
query: SearchQuery?,
topLevel: Boolean = true,
) {
val modifier = if (topLevel) {
Modifier
} else {
Modifier.border(
width = 0.5.dp,
color = LocalContentColor.current,
shape = CardDefaults.shape
)
}
when (query) {
null -> {
Text(
modifier = Modifier
.height(60.dp)
.wrapContentHeight()
.padding(horizontal = 16.dp),
text = stringResource(id = R.string.search_hint),
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f)
)
}
is SearchQuery.Tag -> {
TagChip(
query,
enabled = false
)
}
is SearchQuery.Or -> {
Row(
modifier = modifier.padding(vertical = 2.dp, horizontal = 4.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
) {
query.queries.forEachIndexed { index, subQuery ->
if (index != 0) {
Text("+")
}
QueryView(subQuery, topLevel = false)
}
}
}
is SearchQuery.And -> {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalAlignment = Alignment.CenterVertically
) {
query.queries.forEach { subQuery ->
QueryView(subQuery, topLevel = false)
}
}
}
is SearchQuery.Not -> {
Row(
modifier = modifier.padding(vertical = 2.dp, horizontal = 4.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text("-")
QueryView(query.query, topLevel = false)
}
}
}
}
@Composable
fun SearchBar(
contentType: ContentType,
query: SearchQuery?,
onQueryChange: (SearchQuery?) -> Unit,
onSearchBarPositioned: (Int) -> Unit,
topOffset: Int,
onTopOffsetChange: (Int) -> Unit,
content: @Composable () -> Unit,
) {
var focused by remember { mutableStateOf(false) }
val scrimAlpha: Float by animateFloatAsState(
if (focused && contentType == ContentType.SINGLE_PANE) 0.3f else 0f,
label = "scrim alpha"
)
val interactionSource = remember { MutableInteractionSource() }
val state = remember(query) { query.toEditableState() }
LaunchedEffect(focused) {
if (!focused) {
onQueryChange(state.toSearchQuery())
} else {
AnimationState(Int.VectorConverter, topOffset).animateTo(0) { onTopOffsetChange(value) }
}
}
if (focused) {
BackHandler {
focused = false
}
}
BoxWithConstraints(
modifier = Modifier
.fillMaxSize()
.clickable(
interactionSource = interactionSource,
indication = null
) {
focused = false
}
) {
val height: Dp by animateDpAsState(
if (focused) maxHeight else 60.dp,
label = "searchbar height"
)
val cardShape = RoundedCornerShape(30.dp)
content()
Box(
Modifier
.fillMaxSize()
.background(Color.Black.copy(alpha = scrimAlpha))
)
Card(
modifier = Modifier
.safeDrawingPadding()
.padding(16.dp)
.fillMaxWidth()
.height(height)
.clickable(
interactionSource = interactionSource,
indication = null
) {
focused = true
}
.onGloballyPositioned {
onSearchBarPositioned(it.positionInRoot().y.roundToInt() + it.size.height)
}
.absoluteOffset { IntOffset(0, topOffset) },
shape = cardShape,
elevation = CardDefaults.cardElevation(6.dp)
) {
Box {
androidx.compose.animation.AnimatedVisibility(
!focused,
enter = fadeIn(),
exit = fadeOut()
) {
Row(
modifier = Modifier
.heightIn(min = 60.dp)
.horizontalScroll(rememberScrollState()),
verticalAlignment = Alignment.CenterVertically
) {
Box(Modifier.size(8.dp))
QueryView(query)
Box(Modifier.size(8.dp))
}
}
androidx.compose.animation.AnimatedVisibility(
focused,
enter = fadeIn(),
exit = fadeOut()
) {
Column(
Modifier
.fillMaxSize()
.padding(top = 8.dp, start = 8.dp, end = 8.dp)
) {
IconButton(
onClick = {
focused = false
}
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "close search bar"
)
}
QueryEditor(state = state)
}
}
}
}
}
}
@Composable
fun GalleryList(
contentType: ContentType,
galleries: List<GalleryInfo>,
query: SearchQuery?,
currentPage: Int,
maxPage: Int,
loading: Boolean = false,
error: Boolean = false,
onPageChange: (Int) -> Unit,
onQueryChange: (SearchQuery?) -> Unit = {},
openGalleryDetails: (GalleryInfo) -> Unit,
) {
val listState = rememberLazyListState()
var topOffset by remember { mutableIntStateOf(0) }
var searchBarPosition by remember { mutableIntStateOf(0) }
val listModifier = Modifier.nestedScroll(object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
topOffset = (topOffset + available.y.roundToInt()).coerceIn(-searchBarPosition, 0)
return Offset.Zero
}
})
LaunchedEffect(galleries) {
listState.animateScrollToItem(0)
topOffset = 0
}
SearchBar(
contentType = contentType,
query = query,
onQueryChange = onQueryChange,
onSearchBarPositioned = { searchBarPosition = it },
topOffset = topOffset,
onTopOffsetChange = { topOffset = it },
) {
AnimatedVisibility(loading, enter = fadeIn(), exit = fadeOut()) {
Box(Modifier.fillMaxSize()) {
CircularProgressIndicator(Modifier.align(Alignment.Center))
}
}
AnimatedVisibility(error, enter = fadeIn(), exit = fadeOut()) {
Box(Modifier.fillMaxSize()) {
Column(
Modifier.align(Alignment.Center),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Text(
"(´∇`)",
style = MaterialTheme.typography.headlineMedium,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f)
)
Text("No sources found!\nLet's go download one.", textAlign = TextAlign.Center)
}
}
}
AnimatedVisibility(!loading && !error, enter = fadeIn(), exit = fadeOut()) {
OverscrollPager(
prevPage = if (currentPage != 0) currentPage else null,
nextPage = if (currentPage < maxPage) currentPage + 2 else null,
onPageTurn = { onPageChange(it - 1) }
) {
LazyColumn(
modifier = listModifier,
contentPadding = WindowInsets.systemBars.asPaddingValues()
.let { systemBarPaddingValues ->
val layoutDirection = LocalLayoutDirection.current
PaddingValues(
top = systemBarPaddingValues.calculateTopPadding() + 96.dp,
bottom = systemBarPaddingValues.calculateBottomPadding(),
start = systemBarPaddingValues.calculateStartPadding(layoutDirection),
end = systemBarPaddingValues.calculateEndPadding(layoutDirection),
)
},
verticalArrangement = Arrangement.spacedBy(8.dp),
state = listState
) {
items(galleries, key = { it.id }) { galleryInfo ->
DetailedGalleryInfo(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 4.dp)
.clickable { openGalleryDetails(galleryInfo) },
galleryInfo = galleryInfo
)
}
}
}
}
}
}
@Composable
fun DetailScreen(
galleryInfo: GalleryInfo,
closeGalleryDetails: () -> Unit = { },
openGallery: (GalleryInfo) -> Unit = { },
) {
var thumbnailUrl by remember { mutableStateOf<String?>(null) }
LaunchedEffect(galleryInfo) {
thumbnailUrl = galleryInfo.files.firstOrNull()?.let {
HitomiHttpClient.getImageURL(it, true).firstOrNull()
} ?: ""
}
Column(
Modifier
.padding(horizontal = 8.dp)
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Spacer(Modifier.windowInsetsTopHeight(WindowInsets.systemBars))
IconButton(onClick = closeGalleryDetails) {
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Close Detail")
}
DetailedGalleryInfoHeader(galleryInfo, thumbnailUrl)
Row(Modifier.fillMaxWidth()) {
FilledTonalButton(
modifier = Modifier
.weight(1f)
.padding(horizontal = 4.dp),
onClick = { /*TODO*/ }
) {
Text(stringResource(R.string.download))
}
Button(
modifier = Modifier
.weight(1f)
.padding(horizontal = 4.dp),
onClick = { openGallery(galleryInfo) }
) {
Text("Open")
}
}
GalleryTypeIndicator(galleryInfo.type)
if (galleryInfo.series?.isNotEmpty() == true) {
TagGroup(galleryInfo.series.map { it.toTag() })
}
if (galleryInfo.characters?.isNotEmpty() == true) {
TagGroup(galleryInfo.characters.map { it.toTag() })
}
if (galleryInfo.tags?.isNotEmpty() == true) {
TagGroup(galleryInfo.tags.map { it.toTag() })
}
}
}
@Composable
fun SearchScreen(
contentType: ContentType,
displayFeatures: List<DisplayFeature>,
uiState: SearchState,
openGalleryDetails: (GalleryInfo) -> Unit,
closeGalleryDetails: () -> Unit,
onQueryChange: (SearchQuery?) -> Unit,
loadSearchResult: (IntRange) -> Unit,
openGallery: (GalleryInfo) -> Unit,
) {
val itemsPerPage by remember { mutableIntStateOf(20) }
val pageToRange: (Int) -> IntRange = remember(itemsPerPage) {
{ page ->
page * itemsPerPage..<(page + 1) * itemsPerPage
}
}
val currentPage = remember(uiState) {
if (uiState.currentRange != IntRange.EMPTY) {
uiState.currentRange.first / itemsPerPage
} else 0
}
val maxPage = remember(itemsPerPage, uiState) {
if (uiState.galleryCount != null) {
uiState.galleryCount / itemsPerPage + if (uiState.galleryCount % itemsPerPage != 0) 1 else 0
} else 0
}
val loadResult: (Int) -> Unit = remember(loadSearchResult) {
{ page ->
loadSearchResult(pageToRange(page))
}
}
LaunchedEffect(uiState.query) { loadSearchResult(pageToRange(currentPage)) }
LaunchedEffect(contentType) {
if (contentType == ContentType.SINGLE_PANE && !uiState.isDetailOnlyOpen) {
closeGalleryDetails()
}
}
if (contentType == ContentType.SINGLE_PANE && uiState.isDetailOnlyOpen) {
BackHandler {
closeGalleryDetails()
}
}
if (contentType == ContentType.DUAL_PANE) {
TwoPane(
first = {
GalleryList(
contentType = contentType,
galleries = uiState.galleries,
query = uiState.query,
currentPage = currentPage,
maxPage = maxPage,
loading = uiState.loading,
error = uiState.error,
onQueryChange = onQueryChange,
onPageChange = loadResult,
openGalleryDetails = openGalleryDetails
)
},
second = {
},
strategy = HorizontalTwoPaneStrategy(splitFraction = 0.5f, gapWidth = 16.dp),
displayFeatures = displayFeatures
)
} else {
val detailGallery = uiState.openedGallery
AnimatedVisibility(!uiState.isDetailOnlyOpen || detailGallery == null) {
GalleryList(
contentType = contentType,
galleries = uiState.galleries,
query = uiState.query,
currentPage = currentPage,
maxPage = maxPage,
loading = uiState.loading,
error = uiState.error,
onQueryChange = onQueryChange,
onPageChange = loadResult,
openGalleryDetails = openGalleryDetails
)
}
AnimatedVisibility(uiState.isDetailOnlyOpen && detailGallery != null) {
if (detailGallery != null) {
DetailScreen(
galleryInfo = detailGallery,
closeGalleryDetails = closeGalleryDetails,
openGallery = openGallery
)
}
}
}
}
@@ -1,148 +0,0 @@
package xyz.quaver.pupil.ui.theme
import androidx.compose.ui.graphics.Color
val md_theme_light_primary = Color(0xFF006688)
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFFC2E8FF)
val md_theme_light_onPrimaryContainer = Color(0xFF001E2B)
val md_theme_light_secondary = Color(0xFF4E616D)
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFD1E5F3)
val md_theme_light_onSecondaryContainer = Color(0xFF091E28)
val md_theme_light_tertiary = Color(0xFF5F5A7D)
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
val md_theme_light_tertiaryContainer = Color(0xFFE5DEFF)
val md_theme_light_onTertiaryContainer = Color(0xFF1C1736)
val md_theme_light_error = Color(0xFFBA1A1A)
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
val md_theme_light_onError = Color(0xFFFFFFFF)
val md_theme_light_onErrorContainer = Color(0xFF410002)
val md_theme_light_background = Color(0xFFFBFCFE)
val md_theme_light_onBackground = Color(0xFF191C1E)
val md_theme_light_surface = Color(0xFFFBFCFE)
val md_theme_light_onSurface = Color(0xFF191C1E)
val md_theme_light_surfaceVariant = Color(0xFFDCE3E9)
val md_theme_light_onSurfaceVariant = Color(0xFF40484D)
val md_theme_light_outline = Color(0xFF71787D)
val md_theme_light_inverseOnSurface = Color(0xFFF0F1F3)
val md_theme_light_inverseSurface = Color(0xFF2E3133)
val md_theme_light_inversePrimary = Color(0xFF75D1FF)
val md_theme_light_shadow = Color(0xFF000000)
val md_theme_light_surfaceTint = Color(0xFF006688)
val md_theme_light_outlineVariant = Color(0xFFC0C7CD)
val md_theme_light_scrim = Color(0xFF000000)
val md_theme_dark_primary = Color(0xFF75D1FF)
val md_theme_dark_onPrimary = Color(0xFF003548)
val md_theme_dark_primaryContainer = Color(0xFF004D67)
val md_theme_dark_onPrimaryContainer = Color(0xFFC2E8FF)
val md_theme_dark_secondary = Color(0xFFB5C9D7)
val md_theme_dark_onSecondary = Color(0xFF20333D)
val md_theme_dark_secondaryContainer = Color(0xFF364954)
val md_theme_dark_onSecondaryContainer = Color(0xFFD1E5F3)
val md_theme_dark_tertiary = Color(0xFFC9C2EA)
val md_theme_dark_onTertiary = Color(0xFF312C4C)
val md_theme_dark_tertiaryContainer = Color(0xFF474364)
val md_theme_dark_onTertiaryContainer = Color(0xFFE5DEFF)
val md_theme_dark_error = Color(0xFFFFB4AB)
val md_theme_dark_errorContainer = Color(0xFF93000A)
val md_theme_dark_onError = Color(0xFF690005)
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
val md_theme_dark_background = Color(0xFF191C1E)
val md_theme_dark_onBackground = Color(0xFFE1E2E5)
val md_theme_dark_surface = Color(0xFF191C1E)
val md_theme_dark_onSurface = Color(0xFFE1E2E5)
val md_theme_dark_surfaceVariant = Color(0xFF40484D)
val md_theme_dark_onSurfaceVariant = Color(0xFFC0C7CD)
val md_theme_dark_outline = Color(0xFF8A9297)
val md_theme_dark_inverseOnSurface = Color(0xFF191C1E)
val md_theme_dark_inverseSurface = Color(0xFFE1E2E5)
val md_theme_dark_inversePrimary = Color(0xFF006688)
val md_theme_dark_shadow = Color(0xFF000000)
val md_theme_dark_surfaceTint = Color(0xFF75D1FF)
val md_theme_dark_outlineVariant = Color(0xFF40484D)
val md_theme_dark_scrim = Color(0xFF000000)
val seed = Color(0xFF4FC3F7)
val Gray50 = Color(0xFFF9FAFB)
val Gray100 = Color(0xFFF3F4F6)
val Gray200 = Color(0xFFE5E7EB)
val Gray300 = Color(0xFFD1D5DB)
val Gray400 = Color(0xFF9CA3AF)
val Gray500 = Color(0xFF6B7280)
val Gray600 = Color(0xFF4B5563)
val Gray700 = Color(0xFF374151)
val Gray800 = Color(0xFF1F2937)
val Gray900 = Color(0xFF111827)
val Red50 = Color(0xFFFEF2F2)
val Red100 = Color(0xFFFEE2E2)
val Red200 = Color(0xFFFECACA)
val Red300 = Color(0xFFFCA5A5)
val Red400 = Color(0xFFF87171)
val Red500 = Color(0xFFEF4444)
val Red600 = Color(0xFFDC2626)
val Red700 = Color(0xFFB91C1C)
val Red800 = Color(0xFF991B1B)
val Red900 = Color(0xFF7F1D1D)
val Yellow50 = Color(0xFFFFFBEB)
val Yellow100 = Color(0xFFFEF3C7)
val Yellow200 = Color(0xFFFDE68A)
val Yellow300 = Color(0xFFFCD34D)
val Yellow400 = Color(0xFFFBBF24)
val Yellow500 = Color(0xFFF59E0B)
val Yellow600 = Color(0xFFD97706)
val Yellow700 = Color(0xFFB45309)
val Yellow800 = Color(0xFF92400E)
val Yellow900 = Color(0xFF78350F)
val Green50 = Color(0xFFECFDF5)
val Green100 = Color(0xFFD1FAE5)
val Green200 = Color(0xFFA7F3D0)
val Green300 = Color(0xFF6EE7B7)
val Green400 = Color(0xFF34D399)
val Green500 = Color(0xFF10B981)
val Green600 = Color(0xFF059669)
val Green700 = Color(0xFF047857)
val Green800 = Color(0xFF065F46)
val Green900 = Color(0xFF064E3B)
val Blue50 = Color(0xFFEFF6FF)
val Blue100 = Color(0xFFDBEAFE)
val Blue200 = Color(0xFFBFDBFE)
val Blue300 = Color(0xFF93C5FD)
val Blue400 = Color(0xFF60A5FA)
val Blue500 = Color(0xFF3B82F6)
val Blue600 = Color(0xFF2563EB)
val Blue700 = Color(0xFF1D4ED8)
val Blue800 = Color(0xFF1E40AF)
val Blue900 = Color(0xFF1E3A8A)
val Indigo50 = Color(0xFFEEF2FF)
val Indigo100 = Color(0xFFE0E7FF)
val Indigo200 = Color(0xFFC7D2FE)
val Indigo300 = Color(0xFFA5B4FC)
val Indigo400 = Color(0xFF818CF8)
val Indigo500 = Color(0xFF6366F1)
val Indigo600 = Color(0xFF4F46E5)
val Indigo700 = Color(0xFF4338CA)
val Indigo800 = Color(0xFF3730A3)
val Indigo900 = Color(0xFF312E81)
val Purple50 = Color(0xFFF5F3FF)
val Purple100 = Color(0xFFEDE9FE)
val Purple200 = Color(0xFFDDD6FE)
val Purple300 = Color(0xFFC4B5FD)
val Purple400 = Color(0xFFA78BFA)
val Purple500 = Color(0xFF8B5CF6)
val Purple600 = Color(0xFF7C3AED)
val Purple700 = Color(0xFF6D28D9)
val Purple800 = Color(0xFF5B21B6)
val Purple900 = Color(0xFF4C1D95)
val Pink50 = Color(0xFFFDF2F8)
val Pink100 = Color(0xFFFCE7F3)
val Pink200 = Color(0xFFFBCFE8)
val Pink300 = Color(0xFFF9A8D4)
val Pink400 = Color(0xFFF472B6)
val Pink500 = Color(0xFFEC4899)
val Pink600 = Color(0xFFDB2777)
val Pink700 = Color(0xFFBE185D)
val Pink800 = Color(0xFF9D174D)
val Pink900 = Color(0xFF831843)
@@ -1,90 +0,0 @@
package xyz.quaver.pupil.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
private val LightColors = lightColorScheme(
primary = md_theme_light_primary,
onPrimary = md_theme_light_onPrimary,
primaryContainer = md_theme_light_primaryContainer,
onPrimaryContainer = md_theme_light_onPrimaryContainer,
secondary = md_theme_light_secondary,
onSecondary = md_theme_light_onSecondary,
secondaryContainer = md_theme_light_secondaryContainer,
onSecondaryContainer = md_theme_light_onSecondaryContainer,
tertiary = md_theme_light_tertiary,
onTertiary = md_theme_light_onTertiary,
tertiaryContainer = md_theme_light_tertiaryContainer,
onTertiaryContainer = md_theme_light_onTertiaryContainer,
error = md_theme_light_error,
errorContainer = md_theme_light_errorContainer,
onError = md_theme_light_onError,
onErrorContainer = md_theme_light_onErrorContainer,
background = md_theme_light_background,
onBackground = md_theme_light_onBackground,
surface = md_theme_light_surface,
onSurface = md_theme_light_onSurface,
surfaceVariant = md_theme_light_surfaceVariant,
onSurfaceVariant = md_theme_light_onSurfaceVariant,
outline = md_theme_light_outline,
inverseOnSurface = md_theme_light_inverseOnSurface,
inverseSurface = md_theme_light_inverseSurface,
inversePrimary = md_theme_light_inversePrimary,
surfaceTint = md_theme_light_surfaceTint,
outlineVariant = md_theme_light_outlineVariant,
scrim = md_theme_light_scrim,
)
private val DarkColors = darkColorScheme(
primary = md_theme_dark_primary,
onPrimary = md_theme_dark_onPrimary,
primaryContainer = md_theme_dark_primaryContainer,
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
secondary = md_theme_dark_secondary,
onSecondary = md_theme_dark_onSecondary,
secondaryContainer = md_theme_dark_secondaryContainer,
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
tertiary = md_theme_dark_tertiary,
onTertiary = md_theme_dark_onTertiary,
tertiaryContainer = md_theme_dark_tertiaryContainer,
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
error = md_theme_dark_error,
errorContainer = md_theme_dark_errorContainer,
onError = md_theme_dark_onError,
onErrorContainer = md_theme_dark_onErrorContainer,
background = md_theme_dark_background,
onBackground = md_theme_dark_onBackground,
surface = md_theme_dark_surface,
onSurface = md_theme_dark_onSurface,
surfaceVariant = md_theme_dark_surfaceVariant,
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
outline = md_theme_dark_outline,
inverseOnSurface = md_theme_dark_inverseOnSurface,
inverseSurface = md_theme_dark_inverseSurface,
inversePrimary = md_theme_dark_inversePrimary,
surfaceTint = md_theme_dark_surfaceTint,
outlineVariant = md_theme_dark_outlineVariant,
scrim = md_theme_dark_scrim,
)
@Composable
fun AppTheme(
useDarkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable() () -> Unit
) {
val colors = if (!useDarkTheme) {
LightColors
} else {
DarkColors
}
MaterialTheme(
colorScheme = colors,
content = content
)
}
@@ -1,86 +0,0 @@
package xyz.quaver.pupil.ui.viewmodel
import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import xyz.quaver.pupil.networking.GalleryInfo
import xyz.quaver.pupil.networking.GallerySearchSource
import xyz.quaver.pupil.networking.SearchQuery
import kotlin.math.max
import kotlin.math.min
class MainViewModel : ViewModel() {
private val _uiState = MutableStateFlow(SearchState())
val searchState: StateFlow<SearchState> = _uiState
private var searchSource: GallerySearchSource = GallerySearchSource(null)
private var job: Job? = null
fun openGalleryDetails(galleryInfo: GalleryInfo) {
_uiState.value = _uiState.value.copy(
openedGallery = galleryInfo,
isDetailOnlyOpen = true
)
}
fun closeGalleryDetails() {
_uiState.value = _uiState.value.copy(
isDetailOnlyOpen = false
)
}
fun onQueryChange(query: SearchQuery?) {
_uiState.value = _uiState.value.copy(
query = query,
galleryCount = null,
currentRange = IntRange.EMPTY
)
searchSource = GallerySearchSource(query)
}
fun loadSearchResult(range: IntRange) {
Thread.dumpStack()
job?.cancel()
job = viewModelScope.launch {
val sanitizedRange = max(range.first, 0) .. min(range.last, searchState.value.galleryCount ?: Int.MAX_VALUE)
_uiState.value = _uiState.value.copy(
loading = true,
error = false,
currentRange = sanitizedRange
)
var error = false
val (galleries, galleryCount) = searchSource.load(range).getOrElse {
error = true
it.printStackTrace()
emptyList<GalleryInfo>() to 0
}
_uiState.value = _uiState.value.copy(
galleries = galleries,
galleryCount = galleryCount,
error = error,
loading = false
)
}
}
fun navigateToDetail() {
}
}
data class SearchState(
val query: SearchQuery? = null,
val galleries: List<GalleryInfo> = emptyList(),
val loading: Boolean = false,
val error: Boolean = false,
val galleryCount: Int? = null,
val currentRange: IntRange = IntRange.EMPTY,
val openedGallery: GalleryInfo? = null,
val isDetailOnlyOpen: Boolean = false
)
-12
View File
@@ -1,12 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="900dp"
android:height="900dp"
android:viewportWidth="900"
android:viewportHeight="900">
<path
android:pathData="M450,450m-450,0a450,450 0,1 1,900 0a450,450 0,1 1,-900 0"
android:fillColor="#4EC1F5"/>
<path
android:pathData="M450,450m-175,0a175,175 0,1 1,350 0a175,175 0,1 1,-350 0"
android:fillColor="#1D1D1D"/>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M400.7,190H308a33.3,33.3 0,0 0,-24.2 -56.4,33.3 33.3,0 0,0 -27.8,14.9 33.4,33.4 0,1 0,-52 41.5h-92.7a45.8,45.8 0,0 0,46 44.5h-1.5c0,24.6 20,44.6 44.5,44.6 0,8 2.1,15.4 5.8,21.8l-37,37 28.4,28.3 40.2,-40.2a30.5,30.5 0,0 0,4.9 1.4l-24.3,54.8L256,423l37.7,-40.8 -24.3,-54.8a30.4,30.4 0,0 0,4.9 -1.4l40.2,40.2 28.3,-28.3 -37,-37a44.2,44.2 0,0 0,5.9 -21.8c24.5,0 44.5,-20 44.5,-44.6h-1.5c24.6,0 46,-19.9 46,-44.5z"
android:fillColor="#333"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0v57l32,29 -32,28v57l32,29 -32,28v57l32,28 -32,28v57l32,29 -32,28v57h512v-57l-32,-28 32,-29v-57l-32,-28 32,-28v-57l-32,-28 32,-29v-57l-32,-28 32,-29V0H0z"
android:fillColor="#ffda44"/>
<path
android:pathData="M0,57h512v57L0,114ZM0,171h512v57L0,228ZM0,285h512v56L0,341ZM0,398h512v57L0,455Z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0z"
android:fillColor="#d80027"/>
<path
android:pathData="m140.1,155.8 l22.1,68h71.5l-57.8,42.1 22.1,68 -57.9,-42 -57.9,42 22.2,-68 -57.9,-42.1L118,223.8zM303.5,396.5 L286.6,375.7 261.6,385.4 276.1,362.9 259.2,342 285.1,348.9 299.7,326.4 301.1,353.2 327.1,360.1 302,369.7zM337.1,335.5 L345.1,309.9 323.2,294.4 350,294 357.9,268.4 366.6,293.8 393.4,293.5 371.9,309.5 380.5,334.9 358.6,319.4zM382.4,187.9L370.6,212l19.2,18.7 -26.5,-3.8 -11.8,24 -4.6,-26.4 -26.6,-3.8 23.8,-12.5 -4.6,-26.5 19.2,18.7zM304.2,114.9 L302.2,141.6 327.1,151.7 301,158.1 299.1,184.9 285,162.1 258.9,168.5 276.2,148 262,125.3 286.9,135.4z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v256l-265,45.2z"
android:fillColor="#eee"/>
<path
android:pathData="M210,256h302v256H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,0v512l256,-256L0,0z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h133.6l32.7,20.3 34,-20.3H512v222.6L491.4,256l20.6,33.4V512H200.3l-31.7,-20.4 -35,20.4H0V289.4l29.4,-33L0,222.7z"
android:fillColor="#d80027"/>
<path
android:pathData="M133.6,0v222.6H0v66.8h133.6V512h66.7V289.4H512v-66.8H200.3V0h-66.7z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,167 l253.8,-19.3L512,167v178l-254.9,32.3L0,345z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0h512v167H0z"
android:fillColor="#a2001d"/>
<path
android:pathData="M0,345h512v167H0z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,22 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M256,0 L0,256v64l32,32 -32,32v128l22,-8 23,8h23l54,-32 54,32h32l48,-32 48,32h32l54,-32 54,32h68l-8,-22 8,-23v-23l-32,-54 32,-54v-32l-32,-48 32,-48v-32l-32,-54 32,-54V0H256z"
android:fillColor="#eee"/>
<path
android:pathData="M224,64v64h160l64,-64zM224,192 L256,256 208,304v208h96L304,304h208v-96L304,208l16,-16zM0,320v64h128l-64,64L0,448v64h45l131,-131v-45l16,-16zM336,336 L512,512v-45L381,336Z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,0v256h256L256,0L0,0zM512,68L404,176h108L512,68zM404,336l108,108L512,336L404,336zM176,404L68,512h108L176,404zM336,404v108h108L336,404z"
android:fillColor="#0052b4"/>
<path
android:pathData="m187,243 l57,-41h-70l57,41 -22,-67zM106,243 L163,202L93,202l57,41 -22,-67zM25,243 L82,202L12,202l57,41 -22,-67zM187,162 L244,121h-70l57,41 -22,-67zM106,162 L163,121L93,121l57,41 -22,-67zM25,162 L82,121L12,121l57,41 -22,-67ZM187,80 L244,39h-70l57,41 -22,-67zM106,80 L163,39L93,39l57,41 -22,-67ZM25,80 L82,39L12,39l57,41 -22,-67Z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,167 l254.6,-36.6L512,166.9v178l-254.6,36.4L0,344.9z"
android:fillColor="#333"/>
<path
android:pathData="M0,0h512v166.9H0z"
android:fillColor="#0052b4"/>
<path
android:pathData="M0,344.9h512V512H0z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h133.6l35.3,16.7L200.3,0H512v222.6l-22.6,31.7 22.6,35.1V512H200.3l-32,-19.8 -34.7,19.8H0V289.4l22.1,-33.3L0,222.6z"
android:fillColor="#eee"/>
<path
android:pathData="M133.6,0v222.6H0v66.8h133.6V512h66.7V289.4H512v-66.8H200.3V0h-66.7z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M167,0h178l25.9,252.3L345,512H167l-29.8,-253.4z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0h167v512H0z"
android:fillColor="#0052b4"/>
<path
android:pathData="M345,0h167v512H345z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,345 l256.7,-25.5L512,345v167H0z"
android:fillColor="#ffda44"/>
<path
android:pathData="m0,167 l255,-23 257,23v178H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,0h512v167H0z"
android:fillColor="#333"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h99l29,32 28,-32h356v57l-32,28 32,29v57l-32,28 32,29v57l-32,28 32,28v57l-32,29 32,28v57H0v-57l32,-28 -32,-29v-56l32,-29 -32,-28V171l32,-29 -32,-28Z"
android:fillColor="#0052b4"/>
<path
android:pathData="M99,0v114L0,114v57h99v114L0,285v57h512v-57L156,285L156,171h100v-57L156,114L156,0ZM256,57v57h256L512,57ZM256,171v57h256v-57ZM0,398v57h512v-57z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v55.7l-25,32.7 25,34v267.2l-26,36 26,30.7V512H0v-55.7l24.8,-34.1L0,389.6V122.4l27.2,-33.2L0,55.7z"
android:fillColor="#eee"/>
<path
android:pathData="M0,55.7v66.7h512L512,55.7zM0,389.6v66.7h512v-66.7zM352.4,200.3L288,200.3l-32,-55.6 -32.1,55.6h-64.3l32.1,55.7 -32,55.7h64.2l32.1,55.6 32.1,-55.6h64.3L320.3,256l32,-55.7zM295.4,256 L275.7,290.2h-39.4L216.5,256l19.8,-34.2h39.4l19.8,34.2zM256,187.6l7.3,12.7h-14.6zM196.8,221.8h14.7l-7.4,12.7zM196.8,290.2 L204.1,277.5 211.5,290.2zM256,324.4 L248.7,311.7h14.6zM315.2,290.2h-14.7l7.4,-12.7zM300.5,221.8h14.7l-7.3,12.7z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,167 l253.8,-19.3L512,167v178l-254.9,32.3L0,345z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0h512v167H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,345h512v167H0z"
android:fillColor="#6da544"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,256 l249.6,-41.3L512,256v256H0z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0h512v256H0z"
android:fillColor="#a2001d"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M167,0h178l25.9,252.3L345,512H167l-29.8,-253.4z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0h167v512H0z"
android:fillColor="#6da544"/>
<path
android:pathData="M345,0h167v512H345z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0z"
android:fillColor="#eee"/>
<path
android:pathData="M256,256m-111.3,0a111.3,111.3 0,1 1,222.6 0a111.3,111.3 0,1 1,-222.6 0"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,43 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0Z"
android:fillColor="#ffda44"/>
<path
android:pathData="m256,114 l-6,2 -95,78c-4,3 -4,9 -1,13l102,-33 102,33c3,-4 3,-10 -1,-13l-95,-78 -6,-2z"
android:fillColor="#d80027"/>
<path
android:pathData="M278,231h-1zM235,231z"
android:fillColor="#eee"/>
<path
android:pathData="m256,134 l-99,72 6,22 51,-32 42,25 42,-25 51,32 6,-22z"
android:fillColor="#6da544"/>
<path
android:pathData="m256,191 l-28,60 -9,-21 -10,21 -7,-16 -10,21 -7,-16 -13,27 14,23h140l14,-23 -12,-27 -8,16 -10,-21 -7,16 -10,-21 -9,21zM194,325zM318,325z"
android:fillColor="#333"/>
<path
android:pathData="m183,290 l11,32h124l11,-32h-73z"
android:fillColor="#338af3"/>
<path
android:pathData="M256,129a4,4 0,0 0,-2 1l-100,73a4,4 0,0 0,-2 4l38,117a4,4 0,0 0,4 3h124a4,4 0,0 0,4 -3l38,-117a4,4 0,0 0,-2 -4l-100,-73a4,4 0,0 0,-2 -1zM256,138 L351,208 315,319L197,319l-36,-111 95,-70z"
android:fillColor="#eee"/>
<path
android:pathData="M256.5,170L256.5,170A4.5,4.5 0,0 1,261 174.5L261,307.5A4.5,4.5 0,0 1,256.5 312L256.5,312A4.5,4.5 0,0 1,252 307.5L252,174.5A4.5,4.5 0,0 1,256.5 170z"
android:fillColor="#ff9811"/>
<path
android:pathData="M204,338L308,338A12,12 0,0 1,320 350L320,350A12,12 0,0 1,308 362L204,362A12,12 0,0 1,192 350L192,350A12,12 0,0 1,204 338z"
android:fillColor="#d80027"/>
<path
android:pathData="M188,350L324,350A12,12 0,0 1,336 362L336,362A12,12 0,0 1,324 374L188,374A12,12 0,0 1,176 362L176,362A12,12 0,0 1,188 350z"
android:fillColor="#eee"/>
<path
android:pathData="m242,191 l14,-42 14,42 -36,-26h44z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,28 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0Z"
android:fillColor="#eee"/>
<path
android:pathData="m350,335 l24,-24 16,16 -24,23zM311,374 L335,350 350,366 327,390zM398,382 L421,358 437,374 413,398zM358,421 L382,398 398,413 374,437ZM374,358 L398,335 413,350 390,374zM335,398 L358,374 374,390 350,413zM398,177 L335,114 350,99 414,162zM335,162 L311,138 327,122 350,146zM374,201 L350,177 366,162 390,185zM382,114 L358,91 374,75 398,99ZM421,154 L398,130 413,114 437,138ZM91,358l63,63 -16,16 -63,-63zM154,374 L177,398 162,413 138,390zM114,335 L138,358 122,374 99,350zM138,311 L201,374 185,390 122,327zM154,91 L91,154 75,138 138,75zM177,114 L114,177 99,161 162,98zM201,138 L138,201 122,185 185,122z"
android:fillColor="#333"/>
<path
android:pathData="M319,319 L193,193a89,89 0,1 1,126 126z"
android:fillColor="#d80027"/>
<path
android:pathData="M319,319a89,89 0,1 1,-126 -126z"
android:fillColor="#0052b4"/>
<path
android:pathData="M224.5,224.5m-44.5,0a44.5,44.5 0,1 1,89 0a44.5,44.5 0,1 1,-89 0"
android:fillColor="#d80027"/>
<path
android:pathData="M287.5,287.5m-44.5,0a44.5,44.5 0,1 1,89 0a44.5,44.5 0,1 1,-89 0"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0Z"
android:fillColor="#d80027"/>
<path
android:pathData="M192,112a16,16 0,0 0,-8 2c-17,9 -33,20 -45,34 -8,-22 -24,-26 -24,-26s-14,13 -7,35c2,9 6,15 10,19 -8,14 -14,29 -18,45 -17,-15 -33,-10 -33,-10s-6,17 11,34c6,6 13,9 18,11 0,17 3,33 7,48 -22,-5 -33,7 -33,7s4,18 26,24c9,3 16,2 21,1 9,14 19,27 31,38 -22,6 -26,23 -26,23s13,14 35,7c9,-2 15,-6 19,-10a159,159 0,0 0,160 0c4,4 10,8 19,10 22,7 35,-7 35,-7s-4,-17 -26,-23c12,-11 22,-24 31,-38 5,1 12,2 21,-1 22,-6 26,-24 26,-24s-11,-12 -33,-7c4,-15 7,-31 7,-48 5,-2 12,-5 18,-11 17,-17 11,-34 11,-34s-16,-5 -33,10c-4,-16 -10,-31 -18,-45 4,-4 8,-10 10,-19 7,-22 -7,-35 -7,-35s-16,4 -24,26c-12,-14 -28,-25 -45,-34a16,16 0,0 0,-8 -2,16 16,0 0,0 -13,9 16,16 0,0 0,7 21c13,7 24,16 34,26 -23,1 -31,16 -31,16s8,16 32,16c8,0 15,-2 19,-5 6,10 10,20 12,31 -20,-11 -35,-2 -35,-2s-1,18 19,30c8,4 14,6 20,6 0,11 -2,23 -5,33l-1,-1c-11,-20 -30,-19 -30,-19s-9,15 3,36c4,7 9,12 14,14 -6,9 -12,18 -20,25 -1,-23 -17,-31 -17,-31s-16,8 -16,32c0,8 3,15 5,19a126,126 0,0 1,-122 0c3,-4 5,-11 5,-19 0,-24 -16,-32 -16,-32s-16,8 -17,31c-7,-7 -14,-16 -20,-25 5,-2 10,-7 14,-14 12,-21 3,-36 3,-36s-19,-1 -30,19v1c-4,-10 -6,-22 -6,-33 6,0 12,-2 20,-6 20,-12 19,-30 19,-30s-15,-9 -35,2c2,-11 6,-21 12,-31 4,3 11,5 19,5 24,0 32,-16 32,-16s-8,-15 -31,-16c10,-10 21,-19 34,-26a16,16 0,0 0,7 -21,16 16,0 0,0 -13,-9z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,28 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h167l84.9,45L345,0h167v512H345l-87.7,-48.1L167,512H0z"
android:fillColor="#a2001d"/>
<path
android:pathData="M167,0h178v512H167z"
android:fillColor="#0052b4"/>
<path
android:pathData="M122.4,256h22.3v89h-22.3zM33.4,256h22.3v89L33.4,345z"
android:fillColor="#ffda44"/>
<path
android:pathData="M89,289.4m-22.3,0a22.3,22.3 0,1 1,44.6 0a22.3,22.3 0,1 1,-44.6 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M89,211.5m-11.1,0a11.1,11.1 0,1 1,22.2 0a11.1,11.1 0,1 1,-22.2 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M66.8,322.8h44.5L111.3,345L66.8,345zM66.8,233.8h44.5L111.3,256L66.8,256zM89,133.5l8,24.2h25.4l-20.6,15 7.9,24.3L89,182l-20.6,15 7.9,-24.3 -20.6,-15h25.5z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h100.2l66.1,53.5L233.7,0H512v189.3L466.3,257l45.7,65.8V512H233.7l-68,-50.7 -65.5,50.7H0V322.8l51.4,-68.5 -51.4,-65z"
android:fillColor="#d80027"/>
<path
android:pathData="M100.2,0v189.3H0v33.4l24.6,33L0,289.5v33.4h100.2V512h33.4l30.6,-26.3 36.1,26.3h33.4V322.8H512v-33.4l-24.6,-33.7 24.6,-33v-33.4H233.7V0h-33.4l-33.8,25.3L133.6,0z"
android:fillColor="#eee"/>
<path
android:pathData="M133.6,0v222.7H0v66.7h133.6V512h66.7V289.4H512v-66.7H200.3V0z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,144.7 L258.8,39.6 512,144.7v222.6L257,493 0,367.3z"
android:fillColor="#eee"/>
<path
android:pathData="M0,0v144.7h105.6v-22.2h33.6v22.2h33.3v-22.2h33.6v22.2h33.3v-22.2H273v22.2h33v-22.2h33.6v22.2h33.2v-22.2h33.6v22.2H512V0z"
android:fillColor="#6da544"/>
<path
android:pathData="M0,367.3L0,512h512L512,367.3L406.4,367.3v22.4h-33.6v-22.4h-33.2v22.4L306,389.7v-22.4h-33v22.4h-33.6v-22.4h-33.3v22.4h-33.6v-22.4h-33.3v22.4h-33.6v-22.4zM339.1,189.3h-33.4c0.2,3.7 0.4,7.4 0.4,11.1 0,24.8 -6.2,48.8 -17,66 -3.3,5.2 -9,12.6 -16.4,17.6v-94.7h-33.4v94.8c-7.5,-5 -13,-12.4 -16.4,-17.7 -10.8,-17 -17,-41 -17,-65.9 0,-3.7 0.2,-7.4 0.4,-11L173,189.5a190,190 0,0 0,-0.4 11c0,68.7 36.7,122.5 83.5,122.5s83.5,-53.8 83.5,-122.5c0,-3.7 -0.1,-7.4 -0.4,-11z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,22 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v256l-265,45.2z"
android:fillColor="#0052b4"/>
<path
android:pathData="M210,256h302v256H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,0v512l256,-256z"
android:fillColor="#eee"/>
<path
android:pathData="M175.3,256 L144,241.3l16.7,-30.3 -34,6.5 -4.3,-34.3 -23.6,25.2L75,183.2l-4.3,34.3 -34,-6.5 16.7,30.3L22.3,256l31.2,14.7L37,301l34,-6.5 4.2,34.3 23.7,-25.2 23.6,25.2 4.3,-34.3 34,6.5 -16.7,-30.3zM68.3,100.2 L78.7,114.7 95.7,109.3 85.1,123.7 95.5,138.2 78.5,132.6L68,147l0.2,-17.9 -17,-5.6 17,-5.4zM68.3,365 L78.7,379.6 95.7,374.2 85.1,388.5 95.5,403.1 78.5,397.4L68,411.8l0.2,-17.9 -17,-5.6 17,-5.4zM216.7,232.6L206.3,247l-17,-5.4 10.5,14.4 -10.4,14.6 17,-5.7 10.6,14.4 -0.1,-17.9 17,-5.6 -17.1,-5.4z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,256 l256.4,-44.3L512,256v256H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,0h512v256H0z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,25 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,512h167l37.9,-260.3L167,0H0z"
android:fillColor="#6da544"/>
<path
android:pathData="M512,0H167v512h345z"
android:fillColor="#d80027"/>
<path
android:pathData="M167,256m-89,0a89,89 0,1 1,178 0a89,89 0,1 1,-178 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M116.9,211.5V267a50,50 0,1 0,100.1 0v-55.6H117z"
android:fillColor="#d80027"/>
<path
android:pathData="M167,283.8c-9.2,0 -16.7,-7.5 -16.7,-16.7V245h33.4v22c0,9.2 -7.5,16.7 -16.7,16.7z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M167,0h178l25.9,252.3L345,512H167l-29.8,-253.4z"
android:fillColor="#ffda44"/>
<path
android:pathData="M0,0h167v512H0z"
android:fillColor="#0052b4"/>
<path
android:pathData="M345,0h167v512H345z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M512,170v172l-256,32L0,342V170l256,-32z"
android:fillColor="#0052b4"/>
<path
android:pathData="M512,0v170H0V0Z"
android:fillColor="#eee"/>
<path
android:pathData="M512,342v170H0V342Z"
android:fillColor="#d80027"/>
</group>
</vector>
@@ -1,31 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,160 l256,-32 256,32v192l-256,32L0,352z"
android:fillColor="#0052b4"/>
<path
android:pathData="M0,0h512v160H0z"
android:fillColor="#eee"/>
<path
android:pathData="M0,352h512v160H0z"
android:fillColor="#d80027"/>
<path
android:pathData="M64,63v217c0,104 144,137 144,137s144,-33 144,-137V63z"
android:fillColor="#eee"/>
<path
android:pathData="M96,95v185a83,78 0,0 0,9 34h206a83,77 0,0 0,9 -34V95z"
android:fillColor="#d80027"/>
<path
android:pathData="M288,224h-64v-32h32v-32h-32v-32h-32v32h-32v32h32v32h-64v32h64v32h32v-32h64z"
android:fillColor="#eee"/>
<path
android:pathData="M152,359a247,231 0,0 0,56 24c12,-3 34,-11 56,-24a123,115 0,0 0,47 -45,60 56,0 0,0 -34,-10l-14,2a60,56 0,0 0,-110 0,60 56,0 0,0 -14,-2c-12,0 -24,4 -34,10a123,115 0,0 0,47 45z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,91 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,128 l256,-32 256,32v256l-256,32L0,384Z"
android:fillColor="#ffda44"/>
<path
android:pathData="M0,0h512v128L0,128zM0,384h512v128L0,512z"
android:fillColor="#d80027"/>
<path
android:pathData="M144,304h-16v-80h16zM272,304h16v-80h-16z"
android:fillColor="#eee"/>
<path
android:pathData="M160,296a48,32 0,1 0,96 0a48,32 0,1 0,-96 0z"
android:fillColor="#eee"/>
<path
android:pathData="M136,192L136,192A8,8 0,0 1,144 200L144,208A8,8 0,0 1,136 216L136,216A8,8 0,0 1,128 208L128,200A8,8 0,0 1,136 192z"
android:fillColor="#d80027"/>
<path
android:pathData="M280,192L280,192A8,8 0,0 1,288 200L288,208A8,8 0,0 1,280 216L280,216A8,8 0,0 1,272 208L272,200A8,8 0,0 1,280 192z"
android:fillColor="#d80027"/>
<path
android:pathData="M208,272v24a24,24 0,0 0,24 24,24 24,0 0,0 24,-24v-24h-24z"
android:fillColor="#d80027"/>
<path
android:pathData="M128,208L144,208A8,8 0,0 1,152 216L152,216A8,8 0,0 1,144 224L128,224A8,8 0,0 1,120 216L120,216A8,8 0,0 1,128 208z"
android:fillColor="#ff9811"/>
<path
android:pathData="M272,208L288,208A8,8 0,0 1,296 216L296,216A8,8 0,0 1,288 224L272,224A8,8 0,0 1,264 216L264,216A8,8 0,0 1,272 208z"
android:fillColor="#ff9811"/>
<path
android:pathData="M128,304L144,304A8,8 0,0 1,152 312L152,312A8,8 0,0 1,144 320L128,320A8,8 0,0 1,120 312L120,312A8,8 0,0 1,128 304z"
android:fillColor="#ff9811"/>
<path
android:pathData="M272,304L288,304A8,8 0,0 1,296 312L296,312A8,8 0,0 1,288 320L272,320A8,8 0,0 1,264 312L264,312A8,8 0,0 1,272 304z"
android:fillColor="#ff9811"/>
<path
android:pathData="M160,272v24c0,8 4,14 9,19l5,-6 5,10a21,21 0,0 0,10 0l5,-10 5,6c6,-5 9,-11 9,-19v-24h-9l-5,8 -5,-8h-10l-5,8 -5,-8z"
android:fillColor="#ff9811"/>
<path
android:fillColor="#FF000000"
android:pathData="M122,252h172m-172,24h28m116,0h28"/>
<path
android:pathData="M122,248a4,4 0,0 0,-4 4,4 4,0 0,0 4,4h172a4,4 0,0 0,4 -4,4 4,0 0,0 -4,-4zM122,272a4,4 0,0 0,-4 4,4 4,0 0,0 4,4h28a4,4 0,0 0,4 -4,4 4,0 0,0 -4,-4zM266,272a4,4 0,0 0,-4 4,4 4,0 0,0 4,4h28a4,4 0,0 0,4 -4,4 4,0 0,0 -4,-4z"
android:fillColor="#d80027"/>
<path
android:pathData="M196,168c-7,0 -13,5 -15,11l-5,-1c-9,0 -16,7 -16,16s7,16 16,16c7,0 13,-4 15,-11a16,16 0,0 0,17 -4,16 16,0 0,0 17,4 16,16 0,1 0,10 -20,16 16,0 0,0 -27,-5c-3,-4 -7,-6 -12,-6zM196,176c5,0 8,4 8,8 0,5 -3,8 -8,8 -4,0 -8,-3 -8,-8 0,-4 4,-8 8,-8zM220,176c5,0 8,4 8,8 0,5 -3,8 -8,8 -4,0 -8,-3 -8,-8 0,-4 4,-8 8,-8zM176,186 L180,187 184,195c0,4 -4,7 -8,7s-8,-3 -8,-8c0,-4 4,-8 8,-8zM240,186c5,0 8,4 8,8 0,5 -3,8 -8,8 -4,0 -8,-3 -8,-7l4,-8z"
android:fillColor="#eee"/>
<path
android:pathData="M200,160h16v32h-16z"
android:fillColor="#ff9811"/>
<path
android:pathData="M208,224h48v48h-48z"
android:fillColor="#eee"/>
<path
android:pathData="m248,208 l-8,8h-64l-8,-8c0,-13 18,-24 40,-24s40,11 40,24zM160,224h48v48h-48z"
android:fillColor="#d80027"/>
<path
android:pathData="M232,232L232,232A10,10 0,0 1,242 242L242,254A10,10 0,0 1,232 264L232,264A10,10 0,0 1,222 254L222,242A10,10 0,0 1,232 232z"
android:fillColor="#d80027"/>
<path
android:pathData="M168,232v8h8v16h-8v8h32v-8h-8v-16h8v-8zM176,216h64v8h-64z"
android:fillColor="#ff9811"/>
<path
android:pathData="M186,202m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M208,202m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M230,202m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
android:fillColor="#ffda44"/>
<path
android:pathData="M169,272v43a24,24 0,0 0,10 4v-47h-10zM189,272v47a24,24 0,0 0,10 -4v-43h-10z"
android:fillColor="#d80027"/>
<path
android:pathData="M208,272m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0"
android:fillColor="#338af3"/>
<path
android:pathData="M272,320L288,320A8,8 0,0 1,296 328L296,328A8,8 0,0 1,288 336L272,336A8,8 0,0 1,264 328L264,328A8,8 0,0 1,272 320z"
android:fillColor="#338af3"/>
<path
android:pathData="M128,320L144,320A8,8 0,0 1,152 328L152,328A8,8 0,0 1,144 336L128,336A8,8 0,0 1,120 328L120,328A8,8 0,0 1,128 320z"
android:fillColor="#338af3"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h133.6l35.3,16.7L200.3,0H512v222.6l-22.6,31.7 22.6,35.1V512H200.3l-32,-19.8 -34.7,19.8H0V289.4l22.1,-33.3L0,222.6z"
android:fillColor="#0052b4"/>
<path
android:pathData="M133.6,0v222.6H0v66.8h133.6V512h66.7V289.4H512v-66.8H200.3V0z"
android:fillColor="#ffda44"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v89l-79.2,163.7L512,423v89H0v-89l82.7,-169.6L0,89z"
android:fillColor="#d80027"/>
<path
android:pathData="M0,89h512v78l-42.6,91.2L512,345v78H0v-78l40,-92.5L0,167z"
android:fillColor="#eee"/>
<path
android:pathData="M0,167h512v178H0z"
android:fillColor="#0052b4"/>
</group>
</vector>
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0z"
android:fillColor="#d80027"/>
<path
android:pathData="m245.5,209.2 l21,29 34,-11.1 -21,29 21,28.9 -34,-11.1 -21,29V267l-34,-11.1 34,-11z"
android:fillColor="#eee"/>
<path
android:pathData="M188.2,328.3a72.3,72.3 0,1 1,34.4 -136,89 89,0 1,0 0,127.3 72,72 0,0 1,-34.4 8.7z"
android:fillColor="#eee"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="m0,256 l258,-39.4L512,256v256H0z"
android:fillColor="#ffda44"/>
<path
android:pathData="M0,0h512v256H0z"
android:fillColor="#338af3"/>
</group>
</vector>
@@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<group>
<clip-path
android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0"/>
<path
android:pathData="M0,0h512v512H0z"
android:fillColor="#d80027"/>
<path
android:pathData="m256,133.6 l27.6,85H373L300.7,271l27.6,85 -72.3,-52.5 -72.3,52.6 27.6,-85 -72.3,-52.6h89.4z"
android:fillColor="#ffda44"/>
</group>
</vector>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

-177
View File
@@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="galleryblock_language">言語: %1$s</string>
<string name="galleryblock_series">シリーズ: %1$s</string>
<string name="galleryblock_type">タイプ: %1$s</string>
<string name="main_no_result">結果なし</string>
<string name="search_hint">ギャラリー検索</string>
<string name="settings_clear_cache">キャッシュクリア</string>
<string name="settings_clear_cache_alert_message">キャッシュをクリアするとイメージのロード速度に影響を与えます。実行しますか?</string>
<string name="settings_storage_usage">%s使用中</string>
<string name="settings_storage_usage_loading">ストレージ使用量読み込み中…</string>
<string name="settings_default_query">デフォルトキーワード</string>
<string name="settings_galleries_per_page">一回にロードするギャラリー数</string>
<string name="settings_search_title">検索設定</string>
<string name="settings_title">設定</string>
<string name="update_notification_description">アップデートダウンロード中</string>
<string name="doujinshi">同人誌</string>
<string name="manga">漫画</string>
<string name="artist_cg">アーティストCG</string>
<string name="game_cg">ゲームCG</string>
<string name="image_set">イメージまとめ</string>
<string name="update_title">新しいアップデートがあります</string>
<string name="warning">注意</string>
<string name="settings_miscellaneous_title">その他</string>
<string name="settings_mirror_title">ミラーサーバー</string>
<string name="settings_clear_history">履歴を削除</string>
<string name="settings_clear_history_alert_message">履歴を削除しますか?</string>
<string name="settings_clear_history_summary">履歴数: %1$d</string>
<string name="main_destination_history">履歴</string>
<string name="notification_denied">通知を無効にするとバックグラウンドダウンロード及びアプリのアップデート機能が使用不可になります。</string>
<string name="main_destination_search">トップ</string>
<string name="update_release_note"># リリースノート(v%1$s)\n%2$s</string>
<string name="settings_security_mode_title">セキュリティーモード</string>
<string name="settings_security_mode_summary">アプリ履歴でアプリの画面を表示しない</string>
<string name="reader_go_to_page">移動</string>
<string name="default_query_dialog_language_selector_none">非選択</string>
<string name="default_query_dialog_filter_BL">BLフィルター</string>
<string name="default_query_dialog_filter_guro">グロフィルター</string>
<string name="default_query_dialog_language">"言語: "</string>
<string name="default_query_dialog_title">デフォルトキーワード設定</string>
<string name="main_destination_settings">設定</string>
<string name="main_open_navigation_drawer">メニューを開く</string>
<string name="main_drawer_group_contact_title">お問い合わせ先</string>
<string name="main_drawer_group_contact_homepage">ホームページ</string>
<string name="main_drawer_group_contact_help">ヘルプ</string>
<string name="main_drawer_group_contact_github">Github</string>
<string name="main_drawer_group_contact_email">メールを送る</string>
<string name="reader_fab_fullscreen">フルスクリーン</string>
<string name="channel_download">ダウンロード</string>
<string name="channel_download_description">ダウンロードの進行を通知</string>
<string name="reader_fab_download">バックグラウンドダウンロード</string>
<string name="reader_notification_text">ダウンロード中…</string>
<string name="reader_notification_complete">ダウンロード完了</string>
<string name="reader_fab_download_cancel">バックグラウンドダウンロード中止</string>
<string name="main_destination_downloads">ダウンロード</string>
<string name="main_jump_title">ページ移動</string>
<string name="main_jump_message">現ページ番号: %1$d\nページ数: %2$d</string>
<string name="unable_to_connect">hitomi.laに接続できません</string>
<string name="main_move_to_page">%1$dページへ移動</string>
<string name="settings_clear_downloads">ダウンロード削除</string>
<string name="settings_clear_downloads_alert_message">ダウンロードしたギャラリーを全て削除します。\n実行しますか?</string>
<string name="settings_mirror_summary">ミラーサーバからイメージをロード</string>
<string name="main_destination_favorites">ブックマーク</string>
<string name="main_open_gallery_by_id">ギャラリー番号で見る</string>
<string name="reader_failed_to_find_gallery">エラーが発生しました</string>
<string name="settings_storage">ストレージ</string>
<string name="main_drawer_grouop_contact_discord">ディスコード</string>
<string name="settings_app_lock">アプリロック</string>
<string name="settings_app_lock_type">アップロックの種類</string>
<string name="settings_app_version_title">バージョン(アップデート確認)</string>
<string name="settings_lock_biometrics">生体認識</string>
<string name="settings_lock_confirm">ロック確認のためもう一回入力してください。</string>
<string name="settings_lock_enabled">有効</string>
<string name="settings_lock_fingerprint">指紋</string>
<string name="settings_lock_password">パスワード</string>
<string name="settings_lock_pattern">パターン</string>
<string name="settings_lock_wrong_confirm">ロックが一致しません。やり直してください。</string>
<string name="settings_lock_none">なし</string>
<string name="settings_lock_remove_message">ロックを無効にしますか?</string>
<string name="reader_loading">ロード中</string>
<string name="main_menu_sort">ソート</string>
<string name="main_menu_sort_newest">投稿日時順</string>
<string name="main_menu_sort_popular">人気順</string>
<string name="ignore">無視</string>
<string name="lock_corrupted">ロックファイルが破損されています。Pupilを再再インストールしてください。</string>
<string name="settings_dark_mode_title">ダークモード</string>
<string name="settings_dark_mode_summary">夜にシコりたい方々へ</string>
<string name="search_add_query_item">追加</string>
<string name="gallery_details">ギャラリー情報</string>
<string name="gallery_artists">アーティスト</string>
<string name="gallery_characters">キャラクター</string>
<string name="gallery_groups">グループ</string>
<string name="gallery_language">言語</string>
<string name="gallery_series">シリーズ</string>
<string name="gallery_tags">タグ</string>
<string name="gallery_thumbnails">サムネイル</string>
<string name="gallery_related">おすすめ</string>
<string name="settings_nomedia_title">イメージを隠す</string>
<string name="main_delete">削除</string>
<string name="download">ダウンロード</string>
<string name="settings_backup_title">ブックマークバックアップ</string>
<string name="settings_restore_title">ブックマーク復元</string>
<string name="settings_backup_file_created">バックアップファイルを作成しました</string>
<string name="settings_restore_failed">復元に失敗しました</string>
<string name="settings_restore_success">%1$d項目を復元しました</string>
<string name="settings_download_folder">ダウンロード場所</string>
<string name="settings_download_folder_internal">内部ストレージ</string>
<string name="settings_download_folder_removable">外部SDカード</string>
<string name="settings_download_folder_available">%s 使用可能</string>
<string name="update_download_completed">ダウンロードが完了しました</string>
<string name="update_download_completed_description">ここをクリックしてアップデートを行えます</string>
<string name="settings_beta">ベータチャンネルでアップデートを受信</string>
<string name="settings_app_version_description">v%s</string>
<string name="settings_low_quality">低解像度イメージ</string>
<string name="settings_low_quality_summary">ロード速度とデータ使用料を改善するため低解像度イメージをロード</string>
<string name="settings_download_folder_custom">手動で設定</string>
<string name="settings_download_folder_not_writable">このフォルダにアクセスできません。他のフォルダを選択してください。</string>
<string name="settings_proxy_title">プロクシ</string>
<string name="proxy_dialog_username_hint">ID</string>
<string name="proxy_dialog_type">プロクシタイプ</string>
<string name="proxy_dialog_port_hint">ポート</string>
<string name="proxy_dialog_password_hint">パスワード</string>
<string name="proxy_dialog_error">エラー</string>
<string name="proxy_dialog_addr_hint">サーバーアドレス</string>
<string name="proxy_dialog_server">サーバー</string>
<string name="main_menu_thin">簡単モード</string>
<string name="main_fab_cancel">すべてのダウンロードキャンセル</string>
<string name="channel_update">アップデート</string>
<string name="channel_update_description">アップデートの進行状態を表示</string>
<string name="settings_import_old_galleries">旧ギャラリーインポート</string>
<string name="import_old_galleries_folder_not_readable">フォルダを読めません</string>
<string name="import_old_galleries_notification">旧ギャラリーインポート中…</string>
<string name="import_old_galleries_notification_done">インポート完了</string>
<string name="main_fab_random">ランダムギャラリーを開く</string>
<string name="settings_lock_fingerprint_without_lock">予備のロックが設定されていないと指紋ロックは使用できません</string>
<string name="settings_lock_fingerprint_prompt">Pupil指紋ロック™</string>
<string name="settings_lock_fingerprint_prompt_subtitle">こうかはばつぐんだ!</string>
<string name="default_query_dialog_filter_loli">登場人物を全て18歳以上にする</string>
<string name="settings_user_id">ユーザーID</string>
<string name="copied_to_clipboard">クリップボードにコピーしました</string>
<string name="reader_fab_retry">リトライ</string>
<string name="reader_fab_auto">まばたき検知スクロール</string>
<string name="search_all">全てのギャラリーを対象に検索</string>
<string name="settings_rtl">綴じ方向を左にする</string>
<string name="settings_manage_favorites">ブックマーク管理</string>
<string name="settings_backup_failed">エラーが発生しました</string>
<string name="settings_backup_share">バックアップ共有</string>
<string name="channel_downloader">ダウンローダ</string>
<string name="channel_downloader_description">ダウンローダの状態を表示</string>
<string name="downloader_running">ダウンローダー起動中</string>
<string name="settings_download_folder_name">フォルダ名パターン</string>
<string name="settings_invalid_download_folder_name">フォルダ名に使用できない文字が含まれています</string>
<string name="settings_download_folder_name_message">%sに含まれている文字列を対応する変数に置換します\n\n%s</string>
<string name="settings_manage_storage">ストレージ管理</string>
<string name="settings_oss">オープンソースライセンス</string>
<string name="search_show_tags">お気に入りのタグを見る</string>
<string name="search_show_histories">履歴を見る</string>
<string name="reader_fab_auto_cancel">まばたき検知を中止</string>
<string name="camera_denied">カメラ権限が拒否されているため、まばたき検知使用できません</string>
<string name="no_camera">この機器には前面カメラが装着されていません</string>
<string name="error">エラー</string>
<string name="settings_cache_limit">キャッシュサイズ制限</string>
<string name="unlimited">制限なし</string>
<string name="settings_tag_translation">タグ言語</string>
<string name="settings_tag_translation_message">Githubにて翻訳に参加できます</string>
<string name="settings_max_concurrent_download">並列ダウンロード</string>
<string name="unaccessible_download_folder">アンドロイド11以上では外部からのアプリ内部空間接近が不可能です。ダウンロードフォルダを変更しますか?</string>
<string name="settings_networking">ネットワーク</string>
<string name="settings_recover_downloads">ダウンロードデータベースを再構築</string>
<string name="main_close_navigation_drawer">メニューを閉じる</string>
<string name="search_remove_query_item_description">検索構文を除去</string>
<string name="search_add_query_item_tag">タグ</string>
<string name="move_to_page">%1$d ページへ移動</string>
<string name="search_bar_edit_tag">タッチして編集</string>
<string name="main_destination_image_viewer">イメージビューア</string>
<string name="not_implemented">この機能はまだ実装されていません</string>
</resources>
-177
View File
@@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="galleryblock_language">언어: %1$s</string>
<string name="galleryblock_series">시리즈: %1$s</string>
<string name="galleryblock_type">종류: %1$s</string>
<string name="search_hint">갤러리 검색</string>
<string name="settings_default_query">기본 검색어</string>
<string name="settings_clear_cache">캐시 정리하기</string>
<string name="settings_clear_cache_alert_message">캐시를 정리하면 이미지 로딩속도가 느려질 수 있습니다. 계속하시겠습니까?</string>
<string name="settings_storage_usage">%s 사용중</string>
<string name="settings_storage_usage_loading">저장공간 사용량 계산 중…</string>
<string name="settings_galleries_per_page">한 번에 로드할 갤러리 수</string>
<string name="settings_search_title">검색 설정</string>
<string name="settings_title">설정</string>
<string name="update_notification_description">업데이트 다운로드중&#8230;</string>
<string name="doujinshi">동인지</string>
<string name="manga">만화</string>
<string name="artist_cg">아티스트 CG</string>
<string name="game_cg">게임 CG</string>
<string name="image_set">이미지 모음</string>
<string name="update_title">업데이트가 있습니다!</string>
<string name="warning">경고</string>
<string name="main_no_result">결과 없음\n해결법</string>
<string name="settings_miscellaneous_title">기타</string>
<string name="settings_clear_history">기록 삭제</string>
<string name="settings_clear_history_alert_message">기록을 삭제하시겠습니까?</string>
<string name="settings_clear_history_summary">기록 %1$d개 저장됨</string>
<string name="main_destination_history">기록</string>
<string name="notification_denied">백그라운드 다운로드를 위해서는 알림을 활성화할 필요가 있습니다. 알림을 비활성화하면 백그라운드 다운로드와 앱 업데이트 기능을 사용할 수 없습니다.</string>
<string name="main_destination_search">홈</string>
<string name="update_release_note"># 릴리즈 노트(v%1$s)\n%2$s</string>
<string name="settings_security_mode_summary">최근 앱 목록 창에서 앱 화면을 보이지 않게 합니다</string>
<string name="settings_security_mode_title">보안 모드 활성화</string>
<string name="reader_go_to_page">이동</string>
<string name="default_query_dialog_language_selector_none">미선택</string>
<string name="default_query_dialog_filter_BL">BL물 필터</string>
<string name="default_query_dialog_filter_guro">고어물 필터</string>
<string name="default_query_dialog_language">"언어: "</string>
<string name="default_query_dialog_title">기본 검색어 설정</string>
<string name="main_drawer_group_contact_email">메일 보내기!</string>
<string name="main_drawer_group_contact_github">Github</string>
<string name="main_drawer_group_contact_help">도움말</string>
<string name="main_drawer_group_contact_homepage">홈페이지</string>
<string name="main_destination_settings">설정</string>
<string name="main_destination_image_viewer">뷰어</string>
<string name="main_open_navigation_drawer">메뉴 열기</string>
<string name="main_drawer_group_contact_title">문의</string>
<string name="reader_fab_fullscreen">전체 화면</string>
<string name="channel_download">다운로드</string>
<string name="channel_download_description">다운로드 상태 알림</string>
<string name="reader_fab_download">백그라운드 다운로드</string>
<string name="reader_notification_text">다운로드 중…</string>
<string name="reader_notification_complete">다운로드 완료</string>
<string name="reader_fab_download_cancel">백그라운드 다운로드 취소</string>
<string name="main_destination_downloads">다운로드</string>
<string name="main_jump_title">페이지 이동</string>
<string name="main_jump_message">현재 페이지: %1$d\n페이지 수: %2$d</string>
<string name="unable_to_connect">hitomi.la에 연결할 수 없습니다</string>
<string name="main_move_to_page">%1$d 페이지로 이동</string>
<string name="settings_clear_downloads">다운로드 삭제</string>
<string name="settings_clear_downloads_alert_message">다운로드 된 만화를 모두 삭제합니다.\n계속하시겠습니까?</string>
<string name="main_destination_favorites">즐겨찾기</string>
<string name="main_open_gallery_by_id">갤러리 번호로 열기</string>
<string name="reader_failed_to_find_gallery">갤러리를 찾지 못했습니다</string>
<string name="settings_storage">저장 공간</string>
<string name="main_drawer_grouop_contact_discord">디스코드</string>
<string name="settings_app_lock">앱 잠금</string>
<string name="settings_app_lock_type">앱 잠금 종류</string>
<string name="settings_app_version_title">앱 버전(업데이트 확인)</string>
<string name="settings_lock_biometrics">생체 인식</string>
<string name="settings_lock_confirm">잠금 확인을 위해 한번 더 입력해주세요</string>
<string name="settings_lock_enabled">사용 중</string>
<string name="settings_lock_fingerprint">지문</string>
<string name="settings_lock_password">비밀번호</string>
<string name="settings_lock_pattern">패턴</string>
<string name="settings_lock_wrong_confirm">잠금이 일치하지 않습니다. 다시 시도하세요.</string>
<string name="settings_lock_none">없음</string>
<string name="settings_lock_remove_message">잠금을 해제할까요?</string>
<string name="reader_loading">로딩중</string>
<string name="main_menu_sort">정렬</string>
<string name="main_menu_sort_popular">인기순</string>
<string name="main_menu_sort_newest">시간순</string>
<string name="ignore">무시</string>
<string name="lock_corrupted">잠금 파일이 손상되었습니다! 앱을 재설치 해 주시기 바랍니다.</string>
<string name="settings_dark_mode_title">다크 모드</string>
<string name="settings_dark_mode_summary">딥 다크한 모오드</string>
<string name="search_add_query_item">추가</string>
<string name="gallery_details">갤러리 정보</string>
<string name="gallery_artists">작가</string>
<string name="gallery_characters">캐릭터</string>
<string name="gallery_groups">그룹</string>
<string name="gallery_language">언어</string>
<string name="gallery_series">시리즈</string>
<string name="gallery_tags">태그</string>
<string name="gallery_related">관련 갤러리</string>
<string name="gallery_thumbnails">미리보기</string>
<string name="settings_nomedia_title">이미지 숨기기</string>
<string name="main_delete">삭제</string>
<string name="download">다운로드</string>
<string name="settings_backup_title">즐겨찾기 백업</string>
<string name="settings_restore_title">즐겨찾기 복원</string>
<string name="settings_backup_file_created">백업 파일을 생성하였습니다</string>
<string name="settings_restore_failed">복원에 실패했습니다</string>
<string name="settings_restore_success">%1$d개 항목을 복원했습니다</string>
<string name="settings_download_folder">다운로드 위치</string>
<string name="settings_download_folder_internal">내부 저장공간</string>
<string name="settings_download_folder_removable">외부 SD카드</string>
<string name="settings_download_folder_available">%s 사용 가능</string>
<string name="update_download_completed">다운로드가 완료되었습니다</string>
<string name="update_download_completed_description">여기를 클릭해서 업데이트를 진행할 수 있습니다</string>
<string name="settings_beta">베타 채널에서 업데이트</string>
<string name="settings_app_version_description">v%s</string>
<string name="settings_low_quality">저해상도 이미지</string>
<string name="settings_low_quality_summary">로드 속도와 데이터 사용량을 줄이기 위해 저해상도 이미지를 로드</string>
<string name="settings_mirror_summary">미러 서버에서 이미지 로드</string>
<string name="settings_mirror_title">미러 설정</string>
<string name="settings_download_folder_custom">직접 설정</string>
<string name="settings_download_folder_not_writable">이 폴더에 접근할 수 없습니다. 다른 폴더를 선택해주세요.</string>
<string name="settings_proxy_title">프록시</string>
<string name="proxy_dialog_username_hint">ID</string>
<string name="proxy_dialog_type">프록시 타입</string>
<string name="proxy_dialog_port_hint">포트</string>
<string name="proxy_dialog_password_hint">비밀번호</string>
<string name="proxy_dialog_error">잘못된 값</string>
<string name="proxy_dialog_addr_hint">서버 주소</string>
<string name="proxy_dialog_server">서버</string>
<string name="main_menu_thin">간단히 보기</string>
<string name="main_fab_cancel">다운로드 모두 취소</string>
<string name="channel_update">업데이트</string>
<string name="channel_update_description">업데이트 진행상황 표시</string>
<string name="settings_import_old_galleries">이전 버전 갤러리 가져오기</string>
<string name="import_old_galleries_folder_not_readable">폴더를 읽을 수 없습니다</string>
<string name="import_old_galleries_notification">이전 버전 갤러리 가져오는 중…</string>
<string name="import_old_galleries_notification_done">가져오기 완료</string>
<string name="main_fab_random">무작위 갤러리 열기</string>
<string name="settings_lock_fingerprint_without_lock">지문 잠금은 다른 잠금 방식이 활성화 되어 있을 때만 사용 가능합니다</string>
<string name="settings_lock_fingerprint_prompt">Pupil 지문 인식™</string>
<string name="settings_lock_fingerprint_prompt_subtitle">힘세고 강한 지문 인식</string>
<string name="default_query_dialog_filter_loli">판사님 저는 페도가 아닙니다</string>
<string name="settings_user_id">유저 ID</string>
<string name="copied_to_clipboard">클립보드에 복사됨</string>
<string name="reader_fab_retry">재시도</string>
<string name="reader_fab_auto">눈 깜빡임 감지 스크롤</string>
<string name="search_all">모든 갤러리 검색</string>
<string name="settings_rtl">좌측으로 페이지 넘기기</string>
<string name="settings_manage_favorites">즐겨찾기 관리</string>
<string name="settings_backup_failed">업로드 실패</string>
<string name="settings_backup_share">백업 공유</string>
<string name="channel_downloader">다운로더</string>
<string name="channel_downloader_description">다운로더 작동 여부 표시</string>
<string name="downloader_running">다운로더 작동중…</string>
<string name="settings_download_folder_name">폴더명 패턴</string>
<string name="settings_invalid_download_folder_name">폴더 패턴에 사용할 수 없는 문자가 포함되어 있습니다</string>
<string name="settings_download_folder_name_message">지원되는 변수는 %s 입니다\n\n%s</string>
<string name="settings_manage_storage">저장소 관리</string>
<string name="settings_oss">오픈 소스 라이선스</string>
<string name="search_show_histories">검색 기록 보기</string>
<string name="search_show_tags">즐겨찾기 태그 보기</string>
<string name="reader_fab_auto_cancel">눈 깜빡임 감지 중지</string>
<string name="camera_denied">카메라 권한이 거부되었기 때문에 눈 깜빡임 감지가 불가능합니다</string>
<string name="no_camera">이 장치에는 전면 카메라가 없습니다</string>
<string name="error">오류</string>
<string name="settings_cache_limit">캐시 크기 제한</string>
<string name="unlimited">무제한</string>
<string name="settings_tag_translation">태그 언어</string>
<string name="settings_tag_translation_message">Github에서 번역에 참여하세요</string>
<string name="settings_max_concurrent_download">병렬 다운로드</string>
<string name="unaccessible_download_folder">안드로이드 11 이상에서는 외부에서 현재 다운로드 폴더에 접근할 수 없습니다. 변경하시겠습니까?</string>
<string name="settings_networking">네트워크</string>
<string name="settings_recover_downloads">다운로드 데이터베이스 복구</string>
<string name="main_close_navigation_drawer">메뉴 닫기</string>
<string name="search_remove_query_item_description">검색 구문 제거</string>
<string name="search_add_query_item_tag">태그</string>
<string name="move_to_page">%1$d 페이지로 이동</string>
<string name="search_bar_edit_tag">터치하여 수정</string>
<string name="not_implemented">이 기능은 아직 개발 중입니다</string>
</resources>
-275
View File
@@ -1,275 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name" translatable="false" tools:override="true">Pupil</string>
<string name="release_url" translatable="false">https://api.github.com/repos/tom5079/Pupil/releases</string>
<string name="home_page" translatable="false">http://bit.ly/2EZDClw</string>
<string name="help" translatable="false">http://bit.ly/2Z7lNZE</string>
<string name="github" translatable="false">https://github.com/tom5079/Pupil/</string>
<string name="email" translatable="false">mailto:pupil.hentai@gmail.com</string>
<string name="discord" translatable="false">https://discord.gg/Stj4b5v</string>
<!-- Korean only -->
<string name="https_text" translatable="false">해결법</string>
<string name="https" translatable="false">https://bit.ly/34dUBwy</string>
<string name="backup_url" translatable="false">http://ix.io/</string>
<string name="main_settings" translatable="false">Settings</string>
<string name="galleryblock_thumbnail_description" translatable="false">Thumbnail</string>
<string name="reader_imageview_description" translatable="false">Content ImageView</string>
<string name="page_indicator_placeholder" translatable="false">-/-</string>
<string name="galleryblock_artist_with_group" translatable="false">%s (%s)</string>
<!-- Translate needed down here -->
<string name="warning">Warning</string>
<string name="error">Error</string>
<string name="ignore">Ignore</string>
<string name="unlimited">Unlimited</string>
<string name="not_implemented">This feature is not implemented yet</string>
<string name="copied_to_clipboard">Copied to clipboard</string>
<string name="channel_download">Download</string>
<string name="channel_download_description">Shows download status</string>
<string name="channel_downloader">Downloader</string>
<string name="channel_downloader_description">Shows downloader status</string>
<string name="channel_update">Update</string>
<string name="channel_update_description">Shows update progress</string>
<string name="unable_to_connect">Unable to connect to hitomi.la</string>
<string name="lock_corrupted">Lock file corrupted! Please re-install Pupil</string>
<string name="main_no_result">No result</string>
<string name="unaccessible_download_folder">From Android 11 and above, current Download folder cannot be accessed by outside apps. Would you like to change the download folder?</string>
<string name="notification_denied">Notification permission is required for background downloads. If you deny notifications from this app, in-app update and background download will be disabled.</string>
<string name="main_destination_search">Home</string>
<string name="main_destination_history">History</string>
<string name="main_destination_downloads">Downloads</string>
<string name="main_destination_favorites">Favorites</string>
<string name="main_destination_settings">Settings</string>
<string name="main_destination_image_viewer">Reader</string>
<string name="main_open_navigation_drawer">Open Navigation Drawer</string>
<string name="main_close_navigation_drawer">Close Navigation Drawer</string>
<string name="main_drawer_group_contact_title">Contact</string>
<string name="main_drawer_group_contact_help">Help</string>
<string name="main_drawer_group_contact_homepage">Visit homepage</string>
<string name="main_drawer_group_contact_github">Visit github</string>
<string name="main_drawer_group_contact_email">Email me!</string>
<string name="main_drawer_grouop_contact_discord">Discord</string>
<string name="main_menu_sort">Sort</string>
<string name="main_menu_sort_newest">Newest</string>
<string name="main_menu_sort_popular">Popular</string>
<string name="main_jump_title">Jump to page</string>
<string name="main_jump_message">Current page: %1$d\nMaximum page: %2$d</string>
<string name="main_open_gallery_by_id">Open Gallery by ID</string>
<string name="reader_failed_to_find_gallery">Failed to open gallery</string>
<string name="main_fab_random">Open a random gallery</string>
<string name="main_fab_cancel">Cancel all downloads</string>
<string name="main_move_to_page">Move to page %1$d</string>
<string name="download">Download</string>
<string name="main_delete">DELETE</string>
<string name="doujinshi">Doujinshi</string>
<string name="manga">Manga</string>
<string name="artist_cg">Artist CG</string>
<string name="game_cg">Game CG</string>
<string name="image_set">Image Set</string>
<string name="update_title">Update available</string>
<string name="update_download_completed">Download Completed</string>
<string name="update_download_completed_description">Click here to update</string>
<string name="update_notification_description">Downloading update&#8230;</string>
<string name="update_release_note"># Release Note(v%1$s)\n%2$s</string>
<string name="search_hint">Search galleries</string>
<string name="search_all">Search all galleries</string>
<string name="search_show_histories">Show histories</string>
<string name="search_show_tags">Show favorite tags</string>
<string name="search_add_query_item">Add</string>
<string name="search_add_query_item_tag">Tag</string>
<string name="search_remove_query_item_description">Remove query item</string>
<string name="gallery_details">Details</string>
<string name="gallery_thumbnails">Thumbnails</string>
<string name="gallery_related">Related Galleries</string>
<string name="gallery_artists">Artists</string>
<string name="gallery_groups">Groups</string>
<string name="gallery_language">Language</string>
<string name="gallery_series">Series</string>
<string name="gallery_characters">Characters</string>
<string name="gallery_tags">Tags</string>
<string name="galleryblock_series">Series: %1$s</string>
<string name="galleryblock_type">Type: %1$s</string>
<string name="galleryblock_language">Language: %1$s</string>
<string name="galleryblock_pagecount" translatable="false">%dP</string>
<string name="move_to_page">Move to page %1$d</string>
<!-- SEARCH BAR -->
<string name="search_bar_edit_tag">Touch to edit</string>
<!-- READER -->
<string name="reader_loading">Loading</string>
<string name="reader_go_to_page">Go to page</string>
<string name="reader_fab_fullscreen">Fullscreen</string>>
<string name="reader_fab_retry">Retry</string>
<string name="reader_fab_auto">Scroll with eye blink</string>
<string name="reader_fab_auto_cancel">Stop scroll with eye blink</string>
<string name="reader_fab_download">Background download</string>
<string name="reader_fab_download_cancel">Cancel background download</string>
<string name="reader_notification_text">Downloading&#8230;</string>
<string name="reader_notification_complete">Download complete</string>
<string name="camera_denied">Eye blink detection cannot be used without a permission</string>
<string name="no_camera">There is no front facing camera in this device</string>
<!-- DOWNLOADER -->
<string name="downloader_running">Downloader running…</string>
<!-- SETTINGS -->
<string name="settings_title">Settings</string>
<string name="settings_app_version_title">App version(Click to check update)</string>
<string name="settings_app_version_description">v%s</string>
<string name="settings_beta">Update from beta channel</string>
<!-- SEARCH -->
<string name="settings_search_title">Search Settings</string>
<string name="settings_galleries_per_page">Galleries per page</string>
<string name="settings_default_query">Default query</string>
<!-- SETTINGS/STORAGE -->
<string name="settings_storage">Storage</string>
<!-- SETTINGS/STORAGE / MANAGE STORAGE -->
<string name="settings_manage_storage">Manage Storage</string>
<string name="settings_storage_usage">Currently using %s</string>
<string name="settings_storage_usage_loading">Calculating storage usage…</string>
<string name="settings_clear_cache">Clear cache</string>
<string name="settings_clear_cache_alert_message">Deleting cache can affect image loading speed. Do you want to continue?</string>
<string name="settings_recover_downloads">Reconstruct download database</string>
<string name="settings_clear_downloads">Clear downloads</string>
<string name="settings_clear_downloads_alert_message">Delete all downloaded galleries.\nDo you want to continue?</string>
<string name="settings_clear_history">Clear history</string>
<string name="settings_clear_history_alert_message">Do you want to clear histories?</string>
<string name="settings_clear_history_summary">%1$d histories saved</string>
<!-- SETTINGS/STORAGE / MISCELLANEOUS -->
<string name="settings_download_folder_name">Folder naming pattern</string>
<string name="settings_invalid_download_folder_name">Folder naming pattern is containing invalid characters</string>
<string name="settings_download_folder_name_message">%s will be replaced to its corresponding value\n\n%s</string>
<string name="settings_download_folder">Download folder</string>
<string name="settings_download_folder_removable">Removable Storage</string>
<string name="settings_download_folder_internal">Internal Storage</string>
<string name="settings_download_folder_available">%s available</string>
<string name="settings_download_folder_custom">Custom Location</string>
<string name="settings_download_folder_not_writable">This folder is not writable. Please select another folder.</string>
<string name="settings_cache_limit">Cache Limit</string>
<string name="settings_nomedia_title">Hide image from gallery</string>
<string name="settings_low_quality">Low quality images</string>
<string name="settings_low_quality_summary">Load low quality images to improve load speed and data usage</string>
<!-- SETTINGS/APP LOCK -->
<string name="settings_app_lock">App lock</string>
<string name="settings_app_lock_type">App lock type</string>
<!-- SETTINGS/NETWORKING -->
<string name="settings_networking">Networking</string>
<string name="settings_mirror_summary">Load images from mirrors</string>
<string name="settings_proxy_title">Proxy</string>
<string name="settings_max_concurrent_download">Concurrent Download</string>
<!-- SETTINGS/MISCELLANEOUS -->
<string name="settings_miscellaneous_title">Miscellaneous</string>
<string name="settings_tag_translation">Tag Language</string>
<string name="settings_tag_translation_message">Participate in translation on Github</string>
<string name="settings_rtl">Turn pages Right-to-Left</string>
<string name="settings_security_mode_title">Enable security mode</string>
<string name="settings_security_mode_summary">Enable security mode to make the screen invisible on recent app window</string>
<string name="settings_dark_mode_title">Dark mode</string>
<string name="settings_dark_mode_summary">Protect yourself against light attacks!</string>
<string name="settings_import_old_galleries">Import old galleries</string>
<string name="settings_user_id">User ID</string>
<string name="settings_oss">Open Source Notice</string>
<!-- MANAGE FAVORITES -->
<string name="settings_manage_favorites">Manage favorites</string>
<string name="settings_backup_title">Backup favorites</string>
<string name="settings_backup_failed">Upload Failed</string>
<string name="settings_backup_share">Share Backup</string>
<string name="settings_backup_file_created">Backup file created</string>
<string name="settings_restore_title">Restore favorites</string>
<string name="settings_restore_failed">Restore failed</string>
<string name="settings_restore_success">%1$d entries restored</string>
<!-- SETTINGS/APP LOCK ACTIVITY -->
<string name="settings_lock_none">None</string>
<string name="settings_lock_pattern">Pattern</string>
<string name="settings_lock_pin" translatable="false">PIN</string>
<string name="settings_lock_password">Password</string>
<string name="settings_lock_biometrics">Biometrics</string>
<string name="settings_lock_fingerprint">Fingerprint</string>
<string name="settings_lock_fingerprint_without_lock">Fingerprint can be only enabled if one of the other locks are enabled</string>
<string name="settings_lock_fingerprint_prompt">Pupil Fingerprint Lock™</string>
<string name="settings_lock_enabled">Enabled</string>
<string name="settings_lock_confirm">Input same lock once more to confirm Lock</string>
<string name="settings_lock_remove_message">Do you want to remove lock?</string>
<string name="settings_lock_wrong_confirm">Lock is different from last one. Please try again.</string>
<!-- SETTINGS/DEFAULT QUERY DIALOG -->
<string name="default_query_dialog_title">Set default query</string>
<string name="default_query_dialog_language">Language: </string>
<string name="default_query_dialog_filter_BL">Filter BL</string>
<string name="default_query_dialog_filter_guro">Filter Guro</string>
<string name="default_query_dialog_filter_loli">I\'m not a pedophile</string>
<string name="default_query_dialog_language_selector_none">Any</string>
<string name="settings_mirror_title">Mirrors</string>
<!-- PROXY DIALOG -->
<string name="proxy_dialog_type">type</string>
<string name="proxy_dialog_addr_hint">address</string>
<string name="proxy_dialog_port_hint">port</string>
<string name="proxy_dialog_username_hint">username</string>
<string name="proxy_dialog_password_hint">password</string>
<string name="proxy_dialog_error">Wrong value</string>
<string name="proxy_dialog_server">server</string>
<!-- IMPORT OLD GALLERIES -->
<string name="import_old_galleries_folder_not_readable">This folder is not readable</string>
<string name="import_old_galleries_notification">Importing old galleries…</string>
<string name="import_old_galleries_notification_text" translatable="false">%1$d/%2$d</string>
<string name="import_old_galleries_notification_done">Importing completed</string>
<string name="settings_lock_fingerprint_prompt_subtitle">Ah Shit, Here we go again</string>
<string name="main_menu_thin">Thin Mode</string>
</resources>
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Pupil, Hitomi.la viewer for Android
~ Copyright (C) 2019 tom5079
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<paths>
<external-path name="external" path="."/>
<external-files-path name="files" path="."/>
<files-path name="files" path="." />
</paths>

Some files were not shown because too many files have changed in this diff Show More