Compare commits

..
1174 Commits
Author SHA1 Message Date
Vologhat ff404b21b5 override obtainAttributes 2022-11-29 11:07:07 +03:00
Vologhat aeed9efaeb remove redundant code 2022-11-29 11:04:03 +03:00
Vologhat 29b9251763 refactor 2022-11-22 16:53:34 +03:00
Vologhat 91e6c3185f refactored color attributes storing and color value replacement 2022-11-22 16:52:00 +03:00
Vologhat 7169e3ab8b refactored color attributes storing and color value replacement 2022-11-22 16:48:59 +03:00
Vologhat 97a0ae4b95 refactored color attributes storing and color value replacement 2022-11-22 11:49:00 +03:00
Vologhat 5d5ad70e7e converted color strings to integers and added copies with prefix "ff" 2022-11-22 11:47:20 +03:00
Vologhat 752c59e2a2 removed old ui hooks for recoloring and added some new 2022-11-22 11:45:52 +03:00
Vologhat e3b33a88c7 added try-catch block for ignoring unknown resource ids 2022-11-22 11:43:37 +03:00
aliveoutside b35d5c428f get rid of static imports in themes 2022-11-21 23:03:00 +03:00
aliveoutside c796006b94 fix access flag in VKLayoutInflater 2022-11-12 16:18:39 +03:00
Vologhat 70d3b8f8c0 convert VKLayoutInflater and VKUILayoutFactory to java 2022-10-30 18:35:12 +03:00
Vologhat 15f678e20d added recolor to accent methods 2022-10-22 19:35:25 +03:00
Vologhat 011698a722 fix 3 2022-10-13 22:45:19 +03:00
Vologhat d127fbbd22 fix 2 2022-10-07 12:48:43 +03:00
Vologhat eb167be1c0 renamed package name, temporarily disabled theme creating, test fixes 2022-10-04 16:54:21 +03:00
aliveoutside 19fa48a1f6 add AccentAttrs 2022-08-28 20:08:33 +03:00
aliveoutside e96ba600cb uncomments 2022-08-28 20:08:02 +03:00
aliveoutside 70c75edacc hz 2022-08-28 20:07:44 +03:00
aliveoutside 5a048eff92 add attr replacer 2022-08-28 20:07:26 +03:00
aliveoutside 9abed48ec0 get color from theme by attr 2022-08-28 20:07:04 +03:00
aliveoutside 6758c8735c get color from theme by attr 2022-08-28 20:06:57 +03:00
aliveoutside b20fdee8da and some more junk code removed 2022-08-28 18:30:49 +03:00
aliveoutside dffa4ff7c4 remove junk code 2022-08-28 18:29:49 +03:00
Vologhat 6dd715af0b added palettes 2022-08-25 22:06:58 +03:00
Vologhat 10de24f119 added resources hooks, palettes manager and new color pickers 2022-08-25 21:47:34 +03:00
Vologhat 2cd856e574 made hook and added images for theme toggle animation 2022-08-25 19:03:29 +03:00
aliveoutside 9e9617fd16 Merge pull request #555 from iNotFlying/vtl-remaster && update from vtl-remaster branch
Remove dead VK code, update colors.xml
2022-08-01 19:09:53 +03:00
iNotFlying 3ae2637da0 Update colors.xml 2022-08-01 16:45:30 +04:00
iNotFlying 94438662cb Update colors.xml 2022-08-01 16:31:46 +04:00
iNotFlying aa3d4df40a Merge branch 'vtosters:vtl-remaster' into vtl-remaster 2022-08-01 16:29:57 +04:00
Vologhat e499d98050 added "likes on right" displaying mode for posts and viewers 2022-08-01 13:33:58 +03:00
gdlbo 7299c9e33a some vkui improvements 2022-08-01 01:53:50 +03:00
gdlbo 4d0573ffe5 some fixes 2022-08-01 00:48:58 +03:00
gdlbo 83d13dce1e read to feature 2022-08-01 00:39:02 +03:00
k1zn 55dbb029c0 Add translate function to catch 2022-07-31 23:01:30 +03:00
k1zn 3df51d0685 Remove %
The percentage in the text breaks the translation process, so I remove it.
2022-07-31 23:01:30 +03:00
Erik Kiznov 9bc87a1d79 Another refactoring... 2022-07-31 23:01:30 +03:00
Erik Kiznov 94667ac741 Add @ support 2022-07-31 23:01:30 +03:00
Erik Kiznov 3a354b359a Fix bug 2022-07-31 23:01:30 +03:00
Erik Kiznov 09443d6ec1 Refactoring 2022-07-31 23:01:30 +03:00
Erik Kiznov ca27776aaf Don't translate mentions
Don't translate mentions in MessagesHook
2022-07-31 23:01:30 +03:00
gdlbo 3b6cdacf96 req dumper 2022-07-31 22:26:36 +03:00
iNotFlying 1e5fdde641 Remove dead VK code 2022-07-31 22:44:07 +04:00
Vologhat b37b41ddd3 added ui 2022-07-31 21:05:39 +03:00
Vologhat 25d6231ae3 Merge branch 'theming' of https://github.com/vtosters/lite into theming 2022-07-31 20:22:19 +03:00
Vologhat db83fbff52 added themes manager ui (beta) 2022-07-31 20:22:06 +03:00
gdlbo c7621c44d5 video history delete 2022-07-31 18:33:37 +03:00
aliveoutside 89997317bf fix #450 / #547 and speed up logout 2022-07-31 18:10:30 +03:00
gdlbo c87be6c9b8 about debug activation 2022-07-31 16:58:39 +03:00
aliveoutside 48e6b4f54d [accents] add exceptions to attr hooker 2022-07-31 16:58:18 +03:00
gdlbo 4ae5ea8e57 settings moment 2022-07-31 14:04:23 +03:00
gdlbo b967e72a04 cache moment 2022-07-31 13:42:50 +03:00
gdlbo cc66af3e3a deepl ded 2022-07-31 13:34:24 +03:00
Erik Kiznov f82ef2f64e Fix strings about bombs 2022-07-31 13:34:24 +03:00
Vologhat 646329f93b added translation language as argument 2022-07-31 13:34:24 +03:00
gdlbo 3f7b9eb796 some imp 2022-07-31 13:34:24 +03:00
gdlbo a3d8a9ba70 fixed gtranslate + added reply’s translate 2022-07-31 13:34:24 +03:00
gdlbo 8d05973848 some imp 2022-07-31 13:34:24 +03:00
gdlbo 2b553d263c compiling fix 2022-07-31 13:34:23 +03:00
gdlbo 265d3afbff compiling fix 2022-07-31 13:34:23 +03:00
Vologhat 858fced1aa added new translators and choicing of that 2022-07-31 13:34:23 +03:00
gdlbo a01d12b012 Update MessagesSendApiCmd.smali 2022-07-31 13:34:23 +03:00
gdlbo 8bde61b059 some fixes 2022-07-31 13:34:23 +03:00
gdlbo 05eec57058 fixed dialog 2022-07-31 13:34:23 +03:00
gdlbo c2a1a4bb5f dialog fixes 2022-07-31 13:34:23 +03:00
gdlbo 5e01ebcff6 added bombs 2022-07-31 13:34:23 +03:00
gdlbo ffe0955ef1 updated icons 2022-07-31 13:34:23 +03:00
gdlbo f4ca7c9e66 Create ic_deepl_logo_icon.xml 2022-07-31 13:34:22 +03:00
gdlbo 57b19369a0 some icons 2022-07-31 13:34:22 +03:00
gdlbo 4019219293 migrated to vkalertdialog 2022-07-31 13:34:22 +03:00
gdlbo 5d6c001dfb Update DNRInjector.java 2022-07-31 13:34:22 +03:00
gdlbo 1f2b1b1180 china number one 2022-07-31 13:34:22 +03:00
gdlbo cb7862a0e2 updated translate dialog 2022-07-31 13:34:22 +03:00
gdlbo 1cd23341e2 Update Translate.java 2022-07-31 13:34:08 +03:00
gdlbo f85dac2ff8 fixed onclick 2022-07-31 13:34:08 +03:00
gdlbo 992b29894e message hook 2022-07-31 13:34:08 +03:00
gdlbo 9e67ded6bd code imp 2022-07-31 13:34:07 +03:00
Vologhat 24607e1ea5 added messages hook and base class for translators 2022-07-31 13:34:07 +03:00
Vologhat 8e260a9de4 fixed errors 2022-07-31 13:34:07 +03:00
gdlbo de045f749a dialog 2022-07-31 13:33:42 +03:00
gdlbo fde1628fac rebase 2022-07-31 13:33:31 +03:00
Vologhat fdeaa05360 removed deepl and added yandex 2022-07-31 13:32:49 +03:00
Vologhat d0197142cd replace net to okhttp 2022-07-31 13:32:48 +03:00
gdlbo 8257393909 DeepLApi test 2022-07-31 13:32:48 +03:00
k1zn 9542317b23 Update README.md 2022-07-30 18:32:54 +03:00
gdlbo de595c93f4 fixed msg 2022-07-30 17:54:26 +03:00
gdlbo 7596b4117a deviceinfo and geodata hide feature 2022-07-30 17:37:28 +03:00
iNotFlying 8b6ef6d3af Update README.md 2022-07-30 15:48:05 +03:00
gdlbo 1d71def416 fixed adding music catalog bug 2022-07-30 13:59:54 +03:00
iNotFlying 18799ce11c Refactoring 2022-07-30 02:33:23 +03:00
gdlbo b4e34e34b1 dialog pin/unpin system (api) 2022-07-30 01:13:52 +03:00
gdlbo cd6f975e56 updated stock icon 2022-07-29 23:54:37 +03:00
aliveoutside de73c6216b Merge pull request #539 from ricoshett/vtl-remaster
добавлена быстрая навигация
размер изображений в блоке Линукса и Винды теперь одинаков
2022-07-29 18:30:14 +03:00
aliveoutside 937c7efb03 [accents] use sparseintarray instead of hashmap for hooked attributes 2022-07-29 17:46:33 +03:00
aliveoutside 86c513ed58 [accents] fix header background in newsfeed 2022-07-29 17:44:53 +03:00
aliveoutside e701d03233 [accents] fix tinttextview 2022-07-29 17:44:09 +03:00
gdlbo 129ae95121 code beautifying 2022-07-29 16:28:49 +03:00
ricoshett 78cd5cac9a update README.md 2022-07-29 16:23:44 +03:00
aliveoutside f7fab596ba update ffmpeg-kit 2022-07-29 18:39:39 +03:00
gdlbo 85afaa5057 some java moments 2022-07-29 16:14:24 +03:00
k1zn f1ed0fc221 Fix README.md 2022-07-29 15:20:07 +03:00
aliveoutside b64b17038d Merge pull request #536 from k1zn/vtl-remaster
<!> Ignore *.md files in Github Actions
2022-07-29 14:49:54 +03:00
aliveoutside e5b5bf9d48 Update README.md (Update README.md)
Update README.md (Update README.md) (Update README.md)
2022-07-29 14:49:44 +03:00
k1zn c58e511040 Update build.yml 2022-07-29 16:41:30 +05:00
iNotFlying a067a35040 Update README.md 2022-07-29 12:52:35 +04:00
iNotFlying dbee2a5a42 Update README.md 2022-07-29 12:50:27 +04:00
iNotFlying 104ca05772 Update README.md 2022-07-29 12:30:41 +04:00
iNotFlying ad5eca635a Update README.md 2022-07-29 12:29:31 +04:00
iNotFlying 6c86b49e97 Update README.md 2022-07-29 12:17:27 +04:00
iNotFlying ad8f2b5b5a Update README.md 2022-07-29 12:15:21 +04:00
iNotFlying 3058c220a8 Update README.md 2022-07-29 12:13:31 +04:00
aliveoutside 6531a21fb4 Merge pull request #532 from k1zn/vtl-remaster
fixes a bug where pinned dialogs don't show up in the message section
2022-07-29 01:32:05 +03:00
k1zn 3366d28e7e Fix locals + fix fields 2022-07-29 03:13:58 +05:00
k1zn 39b08702d5 Set MessagesGetConversationsApiCmd fields to public 2022-07-29 02:29:00 +05:00
k1zn b90b27e8ce Add support for major_sort_id in messages
This commit fixes a bug where pinned dialogs don't show up in the message section.
2022-07-29 02:15:53 +05:00
iNotFlying 9b03299c7b Update README.md 2022-07-28 23:15:47 +03:00
iNotFlying a9343c6777 Update README.md 2022-07-28 23:15:47 +03:00
k1zn a03505f27f Update README.md 2022-07-28 23:15:47 +03:00
k1zn b9126aa184 Update README.md 2022-07-28 23:15:47 +03:00
k1zn 613a101c82 Update README.md 2022-07-28 23:15:47 +03:00
k1zn 43fe0577cd Update README.md 2022-07-28 23:15:47 +03:00
gdlbo 6208c966d0 added music grabber 2022-07-28 20:16:01 +03:00
aliveoutside 097faf6b38 [accents] hook linkedtextview 2022-07-28 20:15:57 +03:00
aliveoutside 4f4b167d99 [accents] return hex2 back
(Влад спасибо)
2022-07-28 18:57:35 +03:00
aliveoutside d886e43f3d Merge branch 'vtl-remaster' into theming 2022-07-28 18:50:35 +03:00
aliveoutside fcf1ee608d [accents] remove a12 detection from themes 2022-07-28 18:47:05 +03:00
aliveoutside cd15541583 [accents] fix attr injector 2022-07-28 18:25:20 +03:00
gdlbo 636341b4f2 icon changed 2022-07-28 18:02:20 +03:00
gdlbo 576ce7d6b0 Revert "Temporary fix for pinned dialogs"
This reverts commit e74001e17e.
2022-07-28 17:48:31 +03:00
k1zn e74001e17e Temporary fix for pinned dialogs
A temporary fix for pinned dialogs, so that they at least appear in the section
2022-07-28 17:45:45 +03:00
aliveoutside 7bdaa736ef [accents] force red accent until color picker will be implemented 2022-07-28 17:44:37 +03:00
aliveoutside 74f10e6ab2 [accents] resolve merge issues 2022-07-28 17:40:54 +03:00
aliveoutside 678a398612 [accents] return themeCSL method back to ThemesUtils 2022-07-28 17:40:26 +03:00
aliveoutside 7e1c3d62cf Merge branch 'vtl-remaster' into theming
# Conflicts:
#	app/src/main/java/ru/vtosters/lite/utils/Globals.java
#	app/src/main/java/ru/vtosters/lite/utils/ThemesUtils.java
2022-07-28 17:09:52 +03:00
aliveoutside c0ce22565e [accents] add tablayouthook to ViewInjector 2022-07-28 17:09:02 +03:00
aliveoutside 217a376f5b [accents] fix dropdown color in newsfeed 2022-07-28 17:08:43 +03:00
aliveoutside 35f486dc86 [accents] add some dirty hacks 2022-07-28 17:08:07 +03:00
aliveoutside 252d761b9e [accents] hook VKTabLayout instead of TabLayout 2022-07-28 17:07:06 +03:00
aliveoutside 237be0cc88 [accents] fix crash on theme switching 2022-07-28 17:06:36 +03:00
aliveoutside 2717fd5736 [accents] remove ToolbarHook for now 2022-07-28 17:05:20 +03:00
gdlbo 48f6b35abe cache sett refactoring 2022-07-28 15:49:24 +03:00
gdlbo 5beea5d273 screenshot detect 2022-07-28 13:21:37 +03:00
gdlbo 842130628e some code improvements 2022-07-28 11:46:08 +03:00
gdlbo ab26bab35d some settings logic reworked 2022-07-28 02:24:38 +03:00
gdlbo 6ffcbe8329 some improvements of scrobbler 2022-07-28 01:41:21 +03:00
gdlbo ca3d1e9585 fixed hint text 2022-07-28 01:40:51 +03:00
gdlbo 05a9e9a12c Update Scrobbler.java 2022-07-28 00:49:39 +03:00
gdlbo 9e2f3bb048 Update Scrobbler.java 2022-07-28 00:46:52 +03:00
gdlbo 91aef33725 lastfm test 2022-07-28 00:15:41 +03:00
gdlbo 32c5aa9ac2 fixed crashreporter 2022-07-28 00:15:41 +03:00
Vologhat e32c3ec74b The great refactoring 2022-07-27 21:05:15 +03:00
gdlbo 3fea0e9c40 podcasts are dead + returned old vk pay 2022-07-27 18:03:45 +03:00
gdlbo c9c5c96d63 some pic fixes 2022-07-27 16:42:50 +03:00
gdlbo 2a91238b4f upped conv api ver 2022-07-27 15:51:30 +03:00
gdlbo e4d740061d upped vk hardcoded build number 2022-07-27 13:52:12 +03:00
gdlbo f96f2cb7d7 some music fixes 2022-07-27 13:33:47 +03:00
aliveoutside 81cf7ad694 Merge branch 'vtl-remaster' into theming 2022-07-26 19:46:54 +03:00
aliveoutside 34007658d5 implement attributes resolver 2022-07-26 19:46:28 +03:00
gdlbo 0482f75172 some default prefs fix 2022-07-26 19:21:08 +03:00
gdlbo eaed8fc752 default prefs + fix default fragment 2022-07-26 19:09:38 +03:00
gdlbo f871e63002 temp fix for a10+ 2022-07-26 18:50:45 +03:00
gdlbo 189d699d48 some deobf FileUtils (why?) 2022-07-26 18:42:13 +03:00
k1zn f3b6b3c1b0 Fix access_token regex (again) 2022-07-26 18:14:32 +03:00
k1zn 519722d613 Fix access_token regex 2022-07-26 18:14:32 +03:00
gdlbo 3aaca80da1 fix comments 2022-07-26 18:13:40 +03:00
gdlbo b889015368 fixed video catalog + deleted useless feature 2022-07-25 21:59:55 +03:00
Erik Kiznov 1d3463df0c Add VK Video new icon 2022-07-25 21:49:54 +03:00
Erik Kiznov 60ac497e6d Updated VK Music icon for all DPI 2022-07-25 21:49:54 +03:00
Erik Kiznov f8192c7169 VK Rebranding (Part 2.1)
Founded and updated some VK logos (in notification, in app-icon)
2022-07-25 21:49:54 +03:00
Erik Kiznov 3f2e0c9b98 New "Music" logo in dockbar 2022-07-25 21:49:54 +03:00
Erik Kiznov 2a9ea90df5 VK Rebranding (Part 2)
* Updated VK Logo
* Updated VK Music logo
* Updated VK Pay logo
2022-07-25 21:49:54 +03:00
gdlbo aa40bbb390 dockbar improved 2022-07-25 21:19:18 +03:00
gdlbo 4782401f0a speedup settings 2022-07-25 21:19:18 +03:00
gdlbo 0255cfb1b9 fixed open music catalog 2022-07-25 21:19:18 +03:00
gdlbo 764b68d47f fixed tgs dialog 2022-07-25 21:19:18 +03:00
gdlbo 126154fc9b deleted getAdvertisingId check + deleted vigo tracker 2022-07-25 21:19:18 +03:00
gdlbo ec2df87e42 deleted my target lib (fully) 2022-07-25 21:19:18 +03:00
gdlbo e963080385 del ad audio lib 2022-07-25 21:19:18 +03:00
Erik Kiznov 23286a21f0 VK Rebranding
This commit updates VK logo in all (maybe) pictures
2022-07-25 18:50:25 +03:00
aliveoutside 3d1ca8d36a Merge branch 'vtl-remaster' into theming 2022-07-25 03:55:55 +03:00
aliveoutside 99f8e4f896 init theming stuff 2022-07-25 03:55:33 +03:00
gdlbo 4e48faec16 dockbar fixes 2022-07-25 01:53:12 +03:00
gdlbo 666c562092 some migration to VkAlertDialog 2022-07-25 01:45:32 +03:00
gdlbo 4f5cbe426a dockbar fixes 2022-07-24 22:32:35 +03:00
gdlbo 5635cd4139 size text labels 2022-07-24 20:35:56 +03:00
gdlbo 4bb31d492a bold text labels 2022-07-24 20:11:11 +03:00
gdlbo f85fe81881 dockbar colors fix 2022-07-24 19:43:26 +03:00
gdlbo 5295e465e9 some profile inj fixes 2022-07-24 16:16:17 +03:00
gdlbo 7f30e66c0c new profile buttons injector 2022-07-24 15:24:21 +03:00
Vologhat d55361fd72 added new way of music downloading 2022-07-24 02:17:20 +03:00
gdlbo 63d1c1a3b0 unlocked dockbar_tab_titles 2022-07-24 00:31:21 +03:00
gdlbo 4cc6bfabd0 fixes
foaf time is now with local timezone
fixed music starting
2022-07-24 00:02:46 +03:00
gdlbo 802f639633 foaf online 2022-07-23 21:36:37 +03:00
Vologhat 8a90602328 Update JsonInjectors.java 2022-07-22 15:52:04 +03:00
gdlbo 6f607e9ae8 Update StandartFilter.txt 2022-07-22 15:06:28 +03:00
gdlbo dd0f238701 fixed parseRepostItem fetch bug 2022-07-22 15:01:09 +03:00
gdlbo 600a9da953 speedup adblock 2022-07-22 14:42:25 +03:00
gdlbo d14dec88bc speedup adblock + logs 2022-07-22 13:55:43 +03:00
Vologhat 6e216830d1 optimized new newsfeed adblocker 2022-07-22 02:31:20 +03:00
Vologhat 2b6012b1e7 optimized new newsfeed adblocker 2022-07-22 01:42:32 +03:00
gdlbo ded283df35 speedup stories adblock 2022-07-22 00:34:47 +03:00
gdlbo 86a5c60f7f some fixes 2022-07-22 00:29:56 +03:00
gdlbo 1d964762ca new adblock (alpha) 2022-07-21 23:35:03 +03:00
gdlbo 4a2d2b23f2 unlocked custom newsfeed 2022-07-21 22:08:26 +03:00
gdlbo a06d129c8d fuck vk 2022-07-21 21:45:23 +03:00
gdlbo a0b1adbfe9 some ad fixes 2022-07-21 19:38:20 +03:00
Vologhat 0093463fae fixes in stories adblocker 2022-07-21 16:56:05 +03:00
gdlbo 9e572d7844 some ad fixes 2022-07-21 16:34:55 +03:00
gdlbo 900dbcfe0a some ad fixes 2022-07-21 15:35:13 +03:00
gdlbo e3e06d1638 new stories adblock 2022-07-21 15:30:21 +03:00
gdlbo 69a4cfa715 def catalog music 2022-07-21 14:16:22 +03:00
gdlbo 21d9c13fdf convBarRecomm 2022-07-21 12:50:46 +03:00
gdlbo 09bf8e26ce whatsnew block hide 2022-07-21 12:24:09 +03:00
Vologhat 21c0ccd9fc added feature of item state changing by swipe to dockbar and superapp editors 2022-07-21 12:00:46 +03:00
gdlbo aa95b368f8 fix superapp 2022-07-20 23:12:28 +03:00
Vologhat 4be234632c fixed chat preview 2022-07-20 22:30:23 +03:00
gdlbo 00d37e3721 some settings sorting 2022-07-20 18:40:19 +03:00
gdlbo 4c4a3ae11c vkme warn 2022-07-20 18:21:35 +03:00
gdlbo 7e09e6d4e6 google moment fix 2022-07-20 18:08:07 +03:00
Vologhat b92fa69628 added state changing by swipe for unmoved items to adapter 2022-07-20 17:55:54 +03:00
gdlbo d127a84b07 dockbar_accent is true 2022-07-20 16:50:00 +03:00
gdlbo 95916b4289 some dockbar fixes + accent 2022-07-20 16:42:28 +03:00
gdlbo 5cb5d06993 hide beta feature (need to rework tbh) 2022-07-20 15:54:32 +03:00
gdlbo f0da269968 some dockbar and superapp editor fixes 2022-07-20 15:50:37 +03:00
Vologhat 2fb021ad05 added superapp editor, added titles in dockbar and some changes
-Added new SuperApp editor
-Added titles in dockbar and option for it in settings
-Refactored DockBarAdapter
2022-07-20 15:05:17 +03:00
gdlbo 1981bc9d14 vkpay/games/miniapps hide feature 2022-07-20 12:24:58 +03:00
gdlbo c60cce5467 fixed vkx cringe logging 2022-07-19 21:46:38 +03:00
gdlbo 2035d513f1 updated some wrappers 2022-07-19 21:39:27 +03:00
gdlbo 3849569794 updated some wrappers 2022-07-19 21:38:17 +03:00
gdlbo 9f2f6d6f60 added playlists 2022-07-19 20:58:30 +03:00
gdlbo 586a82a15f disabled stats 2022-07-19 19:02:55 +03:00
gdlbo eba922871f music tricks kekw 2022-07-19 19:02:30 +03:00
gdlbo 337aa7493e music tricks 2022-07-19 16:52:59 +03:00
gdlbo 1ed9f871c3 Update LogWriterService.java 2022-07-19 16:52:59 +03:00
aliveoutside 083d96707c fix #453 2022-07-19 17:21:35 +03:00
aliveoutside 10e0bd50da update .gitignore 2022-07-19 15:58:57 +03:00
gdlbo 2864056186 IconsFragment fixes 2022-07-18 22:42:52 +03:00
gdlbo 8876a66449 icooooooooons! 2022-07-18 22:27:28 +03:00
gdlbo 41a1d29c4b some fixes 2022-07-18 21:44:03 +03:00
gdlbo 1bb10807c4 fix superappitems counter 2022-07-18 21:25:44 +03:00
gdlbo 7f8100660a icons 2022-07-18 15:31:25 +03:00
Vologhat 274a1b9fa8 temporary hooks disabling 2022-07-18 14:26:27 +03:00
gdlbo 03c5f83a42 fix proxy? 2022-07-18 12:50:41 +03:00
gdlbo f394bdfec5 fixed vk me mode 2022-07-18 10:38:05 +03:00
gdlbo 19c9dd102f added some new counters 2022-07-18 03:21:48 +03:00
gdlbo d38038f848 fixed friends hide with birthday 2022-07-18 01:53:56 +03:00
Vologhat 8ab5cdd860 fixed dockbar counters #449 2022-07-18 01:35:26 +03:00
Vologhat 2f30d070ec fixed scroll to top feature 2022-07-18 01:13:14 +03:00
gdlbo 401fc44e91 fixed ExternalLinkHandler 2022-07-17 23:31:43 +03:00
Vologhat 028b3aad59 fix external player crash in vkplayer 2022-07-17 22:31:29 +03:00
gdlbo 8a7c21c549 updated some strings 2022-07-17 21:18:27 +03:00
Vologhat 918967f502 added some features to photo viewer #411
-Added image searching in the internet with feature of selecting search engine
-Added copying image file url to the clipboard
-Added opening image file url in the browsers
2022-07-17 21:15:23 +03:00
gdlbo 95636ad4f4 some settings summ fixes 2022-07-17 16:59:36 +03:00
gdlbo 561afe8765 counters 2022-07-17 15:21:19 +03:00
gdlbo 929e481b3d fixed stickers dialog 2022-07-17 15:21:06 +03:00
gdlbo 69266ed31f fixed live tab + imports 2022-07-17 13:54:23 +03:00
gdlbo 742e0c46b3 some dockbar fixes 2022-07-17 13:21:46 +03:00
gdlbo 319f3c421a updated StandartFilter.txt 2022-07-17 11:37:18 +03:00
gdlbo 3b5eb3cd10 some dockbar fixes 2022-07-17 11:14:45 +03:00
gdlbo 55f71bfd8b added tgsbotkey check if not valid 2022-07-17 11:08:32 +03:00
gdlbo 1ac755a98b some dockbar fixes 2022-07-17 11:03:45 +03:00
gdlbo 00d0b9d237 fixed saving settings 2022-07-17 10:56:04 +03:00
Vologhat edd04586ea make shorter external player string in action menu 2022-07-17 08:42:17 +03:00
gdlbo 98b1cf8db3 some settings fixes 2022-07-17 00:18:22 +03:00
gdlbo d20296d4b8 some settings fixes 2022-07-16 23:42:10 +03:00
gdlbo 7c8627f9f6 dockbar fixes 2022-07-16 23:26:19 +03:00
gdlbo 2e2be2fe4a added disabler of OnlineFormatter 2022-07-16 23:02:38 +03:00
Vologhat 673d5fe16c fix #443 2022-07-16 18:07:54 +03:00
aliveoutside 4a949e7d45 [musicdownloader] increase the audio quality 2022-07-16 20:01:25 +03:00
aliveoutside 39391a4ace [musicdownloader] fix previous commit 2022-07-16 19:43:16 +03:00
aliveoutside 9a9552c369 [musicdownloader] show the download progress in notifications 2022-07-16 19:39:10 +03:00
Vologhat 6b9f80284c dockbar editor fixes 2022-07-15 17:39:25 +03:00
gdlbo 15dd2b2fde some hooks refactoring 2022-07-15 11:09:15 +03:00
aliveoutside 4b2a537e3b fix vkx integration 2022-07-15 02:39:17 +03:00
gdlbo a94ca687eb Update CopyrightAds.txt 2022-07-14 23:00:00 +03:00
gdlbo 06f0864cc3 fix getVoiceListened 2022-07-14 22:33:13 +03:00
gdlbo 1ddc2f6b14 fixed dialog style in tgs and PreferencesUtil 2022-07-14 22:12:23 +03:00
Vologhat ad6c350e69 changed dockbar editor logic
- Changed data storage method
- Added json config check
- Some optimizations
2022-07-14 22:10:37 +03:00
gdlbo dadbc37189 Update MsgMarkAsListenedJob.smali 2022-07-14 21:50:40 +03:00
gdlbo d646a0cd19 getVoiceListened inj 2022-07-14 21:48:58 +03:00
gdlbo ae145691c5 Fixed vkx inj + some fixes 2022-07-14 21:15:29 +03:00
Vologhat a6cbf35350 fix #416 2022-07-14 20:09:46 +03:00
Vologhat aba12ad48a added base fragment with toolbar implementation 2022-07-14 20:09:20 +03:00
Vologhat 32ebf0e4f4 added layout helper 2022-07-14 20:08:52 +03:00
gdlbo 099de74ac1 miniapps hide feature 2022-07-14 19:27:53 +03:00
gdlbo dd490abf69 hide friends recomm in friends 2022-07-14 18:27:10 +03:00
gdlbo 3468b9352e android:debuggable="false" 2022-07-14 12:15:00 +03:00
gdlbo af0efb7184 Update build.gradle 2022-07-14 02:44:53 +03:00
gdlbo 592d25bf6d Update build.gradle 2022-07-14 02:36:36 +03:00
gdlbo a53f1d7299 disabled force miui dark theme 2022-07-14 01:43:15 +03:00
gdlbo ea3707cebd added check for android sdk 26 to get adaptive icon 2022-07-14 01:37:27 +03:00
gdlbo b2ba9774bc some codebase to future update with support no adaptive icons 2022-07-14 01:34:11 +03:00
gdlbo 7205c78839 Update DockBarEditorFragment.java 2022-07-14 01:12:55 +03:00
gdlbo 26672cfbc2 Update build.gradle 2022-07-14 01:12:52 +03:00
gdlbo 941335ec02 added splashscreen for < Android 12
pls check
2022-07-14 00:35:14 +03:00
gdlbo 8bbf0ebb1f added cleaning web cache for theme changing 2022-07-14 00:13:56 +03:00
gdlbo 9d16d4e57e deleted some useless and dead vk features 2022-07-13 23:45:57 +03:00
gdlbo cece5a2a55 disabled feature 2022-07-13 19:07:42 +03:00
gdlbo fb907d68a4 dnt inj 2022-07-13 19:03:44 +03:00
gdlbo dac2e10a52 recomm disabler 2022-07-13 18:49:45 +03:00
gdlbo 0e472e985b fixed crash + added notifs about verif 2022-07-13 18:41:41 +03:00
gdlbo e349193afb Update IconsFragment.java 2022-07-13 18:06:31 +03:00
Vologhat 066beb14f1 Update IconsFragment.java 2022-07-13 17:57:48 +03:00
gdlbo 15f8af1e3e icon manager test dead 2022-07-13 17:41:44 +03:00
gdlbo 599ee3dfab VideoDownloader fix 2022-07-13 17:26:29 +03:00
gdlbo 9d005cd2e0 Update TokenConfirmationHandlerChainCall.smali 2022-07-13 15:29:07 +03:00
gdlbo c8747ea957 fix 2022-07-13 15:18:31 +03:00
gdlbo 6bc33dbb31 some connection fixes 2022-07-13 15:05:13 +03:00
Vologhat 303fe83ff9 added vk video opening externally 2022-07-13 13:21:40 +03:00
Vologhat cb122bb6c8 added external player redirection 2022-07-13 05:34:22 +03:00
Vologhat bb73aaa580 fixed toolbar visibility 2022-07-13 04:20:02 +03:00
gdlbo 7e7730e825 codebase for future multiple list pref with appnames and icons 2022-07-13 01:28:15 +03:00
aliveoutside 8f291b058f [musicdownloader] hook track bottomsheet 2022-07-13 04:23:58 +03:00
gdlbo 0f9ab88e68 Update OtherFragment.java 2022-07-13 01:10:50 +03:00
gdlbo 36c244be15 some backup fixes 2022-07-13 01:03:04 +03:00
gdlbo 71d4cd09fc added some icons 2022-07-13 00:50:17 +03:00
Vologhat 037f1809e8 added restore prefs from file 2022-07-13 00:30:37 +03:00
Vologhat 3513844ca5 optimizations 2022-07-12 23:58:00 +03:00
Vologhat 2e180d2c9c added vkme mode checker 2022-07-12 23:49:53 +03:00
Vologhat fd3eae0283 fixed dockbar counter 2022-07-12 23:14:51 +03:00
gdlbo 048a835b2b icons fix 2022-07-12 23:11:45 +03:00
Vologhat e144390d4f refactored icon switcher 2022-07-12 23:08:41 +03:00
gdlbo 320892cdf5 added all to manifest 2022-07-12 23:04:29 +03:00
gdlbo 1716aa51dd some fixes 2022-07-12 22:45:14 +03:00
gdlbo 7157a0c664 icon changer test
appname cursed
2022-07-12 21:55:20 +03:00
gdlbo 34787ffb5b added resources 2022-07-12 19:32:50 +03:00
gdlbo d44b363d1d null check 2022-07-12 18:29:59 +03:00
gdlbo 3972ceba5b network check 2022-07-12 18:27:35 +03:00
gdlbo 505a2d4553 some fragments in dockbar fixes 2022-07-12 17:42:46 +03:00
gdlbo 84da0b422a superapp disabler fix 2022-07-12 17:34:04 +03:00
gdlbo ab19f6b71a new vkpay lol 2022-07-12 17:25:02 +03:00
gdlbo 9c8f962e5f some sticker fixes 2022-07-12 16:28:00 +03:00
gdlbo ad706355cd some filter fixes 2022-07-12 16:15:11 +03:00
gdlbo efac38a871 added some effects) 2022-07-12 15:49:02 +03:00
gdlbo 049940f3bb some filters fix + added more filters codebase 2022-07-12 15:21:05 +03:00
aliveoutside 5f68809d9c use track id as a temp folder name 2022-07-12 17:37:08 +03:00
gdlbo 930792f983 monochrome wp 2022-07-12 14:14:10 +03:00
gdlbo 5e7eb51127 mosaic effect 2022-07-12 13:46:04 +03:00
gdlbo 99a387f9a0 fixed crash 2022-07-12 12:42:09 +03:00
gdlbo 679960045a some fragments fixes 2022-07-12 12:12:48 +03:00
gdlbo 1dc1436082 restart app when dark theme changed to amoled 2022-07-12 11:11:47 +03:00
gdlbo 2ba602ae9f restart app when milkshake val changed 2022-07-12 11:00:18 +03:00
gdlbo 98aa6ef0f8 disabled force dark theme for miui 2022-07-12 10:58:17 +03:00
gdlbo b8f5b0179a fixed milkshake changer 2022-07-12 00:00:54 +03:00
gdlbo 877670bb84 Update DockBarManager.java 2022-07-11 23:21:48 +03:00
Vologhat 5859b93612 Update DockBarManager.java 2022-07-11 21:59:05 +03:00
gdlbo 0f33dfc395 codesyle cringe 2022-07-11 21:14:02 +03:00
gdlbo 0330b8ad8e lmao 2022-07-11 21:11:17 +03:00
gdlbo 7d85d61eb5 fix dockbar 2022-07-11 20:58:45 +03:00
aliveoutside 28ee64fc30 create notifications for music downloading 2022-07-11 23:02:10 +03:00
gdlbo 19bc27059d Update BottomNavigationMenu.smali 2022-07-11 20:00:53 +03:00
gdlbo 457822de7d Update CopyrightAds.txt 2022-07-11 19:57:37 +03:00
Vologhat 4c5d83fccc refactored dockbar editor 2022-07-11 19:57:03 +03:00
gdlbo 92c9ea2222 Update WallpaperMenuFragment.java 2022-07-11 19:35:07 +03:00
gdlbo e6b7ea8c2c Update WallpaperMenuFragment.java 2022-07-11 19:34:28 +03:00
gdlbo 81bc85a0aa added stickers background if wallpaper is not null 2022-07-11 19:28:48 +03:00
gdlbo f9b02b1cce fix dark toast lmao 2022-07-11 19:17:23 +03:00
gdlbo 2cb6321776 fixed dialog style 2022-07-11 19:11:51 +03:00
gdlbo bbf0ada834 fixed auth proxy dialog 2022-07-11 17:56:03 +03:00
aliveoutside 8c63ff69c7 check if ffmpeg converted successfully 2022-07-11 20:14:34 +03:00
aliveoutside 94c72eb490 finish music downloader 2022-07-11 19:55:04 +03:00
aliveoutside d1f2a78a48 fix ts to mp3 converter 2022-07-11 19:26:05 +03:00
aliveoutside 2983afcda5 update ffmpeg libs for mp3 support 2022-07-11 19:25:41 +03:00
aliveoutside fe87a5dd64 fix ffmpeg loading 2022-07-11 18:07:22 +03:00
gdlbo 9daa346e31 dialog design fixes 2022-07-11 14:36:22 +03:00
gdlbo 816683ac8a disabled dockbar hook 2022-07-11 13:30:02 +03:00
gdlbo b90fd41bf2 added dev ver mark 2022-07-11 13:18:32 +03:00
gdlbo 991f1f9eb8 Update Globals.java 2022-07-11 13:13:17 +03:00
gdlbo 2ae9df03e1 fixed player on gappless phones 2022-07-11 13:08:37 +03:00
gdlbo 665e2dda05 added proxy button at start 2022-07-11 13:02:31 +03:00
gdlbo a5134f1cd5 writebar coloring 2022-07-11 11:26:05 +03:00
gdlbo 3680ff44a2 Some animation fixes 2022-07-11 02:58:43 +03:00
gdlbo 34ae44016d some wp fixes 2022-07-11 02:20:19 +03:00
gdlbo a0ebc913d1 fixed some cringe blur 2022-07-11 01:38:22 +03:00
gdlbo 1afa317e7b Wallpaper in msg
Upgraded dialogs opening
2022-07-11 01:29:55 +03:00
aliveoutside 84c194d318 try to do ffmpeg convert 2022-07-11 01:34:28 +03:00
aliveoutside 56cd2b2d39 add some missing classes 2022-07-11 01:34:28 +03:00
aliveoutside b001517a63 add some missing classes 2022-07-11 01:34:27 +03:00
aliveoutside cd389af2bd update build.gradle 2022-07-11 01:34:27 +03:00
aliveoutside 69a2f03656 add ffmpeg wrapper 2022-07-11 01:34:27 +03:00
aliveoutside 047b547449 add ffmpeg lib 2022-07-11 01:34:27 +03:00
aliveoutside 0912f57184 add libs to assets 2022-07-11 01:34:27 +03:00
gdlbo 568f69db60 Update GroupApiParser.smali 2022-07-10 19:16:43 +03:00
aliveoutside 511c16771d fix permissions in AudioDownloader 2022-07-10 22:08:58 +03:00
gdlbo 321273c54a Renames for profiles and groups 2022-07-10 19:01:25 +03:00
gdlbo f6e0a7edb4 Fix 2022-07-10 17:49:59 +03:00
gdlbo dd9b2a8a58 menu inj test 2022-07-10 17:48:39 +03:00
Vologhat 77f80883ae add method check 2022-07-10 17:31:09 +03:00
Vologhat ec5b8b3455 added asyns downloading 2022-07-10 16:37:31 +03:00
gdlbo cd611afbd3 Update vt_ui_oled.css 2022-07-10 16:03:42 +03:00
gdlbo 943c612581 amoled theme wtf 2022-07-10 16:01:04 +03:00
aliveoutside 2ed8082df2 test m3u8 downloader 2022-07-10 18:32:02 +03:00
gdlbo 4806d97e29 fixed crash at start 2022-07-10 15:25:19 +03:00
gdlbo c603c9844a updated jars + added amoled theme values to code 2022-07-10 14:52:23 +03:00
aliveoutside a3b1220f18 move some stuff to music package 2022-07-10 17:35:10 +03:00
gdlbo 18582c535a reformated code 2022-07-10 14:32:27 +03:00
Vologhat d002d05b2a M3U8 Dumper 2022-07-10 14:11:27 +03:00
gdlbo c198a14e0c Some online fixes 2022-07-10 10:54:25 +03:00
gdlbo deda04cbf8 Update OnlineFormatter.java 2022-07-10 04:05:03 +03:00
gdlbo 021e85d5b8 Update OnlineFormatter.java 2022-07-10 03:21:35 +03:00
gdlbo 0921485959 added appid saving + some fixes 2022-07-10 01:38:14 +03:00
aliveoutside 82aacf32b7 - Дашь списать домашку?
- Да, только не списывай точь-в-точь
-
2022-07-10 04:14:55 +03:00
gdlbo e7b0ae0225 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-07-10 01:08:41 +03:00
aliveoutside 2fb7778717 m3u8 shit 2022-07-10 04:07:02 +03:00
gdlbo a993993773 imports 2022-07-10 01:08:19 +03:00
gdlbo 6f49e35b22 Added local caching appid names 2022-07-10 01:07:55 +03:00
gdlbo ea277c303f VideoDownloader inj 2022-07-09 22:40:56 +03:00
gdlbo a7652e4e71 Fixed bug with reload mgs on old design on sdk 28+ 2022-07-09 22:18:28 +03:00
gdlbo 5cb7306613 Update StoryDownloader.java 2022-07-09 22:03:20 +03:00
gdlbo 1ddecb47af Stories video downloader 2022-07-09 21:59:42 +03:00
gdlbo ac2c972b9b some stories download fixes 2022-07-09 21:24:35 +03:00
gdlbo 86798ffb59 disabled fixGapps 2022-07-09 20:47:18 +03:00
gdlbo a85a7d84b2 isMusicRestricted must be true by default 2022-07-09 20:26:49 +03:00
gdlbo 1ed90da1b8 Update VideoDownloader.java 2022-07-09 20:22:38 +03:00
gdlbo a2b231f365 Update VideoDownloader.java 2022-07-09 20:19:05 +03:00
gdlbo a618b2cc5b check if link is not valid 2022-07-09 20:18:31 +03:00
gdlbo 4e4c287111 Video downloader in settings 2022-07-09 20:09:02 +03:00
gdlbo 060f24b6c6 updated jars 2022-07-09 19:48:22 +03:00
gdlbo d3840bf9fd renamed music to media settings + some settings refactoring 2022-07-09 19:48:06 +03:00
gdlbo ba216cb06b Update Newsfeed.java 2022-07-09 19:31:11 +03:00
gdlbo 917f5b565f Some settings logic fixes 2022-07-09 18:47:32 +03:00
gdlbo 938c6ff633 fixed poll if 2022-07-09 16:03:28 +03:00
gdlbo 56bf382618 show poll results 2022-07-09 15:58:38 +03:00
gdlbo eb3cc75a98 updated jars 2022-07-09 15:58:18 +03:00
gdlbo f3e3cdf79a fix msg db 2022-07-09 15:26:37 +03:00
gdlbo ad808263d1 Story downloader test
video download dead xd
2022-07-09 15:13:13 +03:00
gdlbo 53616c8bc6 updated jars 2022-07-09 15:12:45 +03:00
gdlbo 466105d69c Update NavigationDelegateBottom.smali 2022-07-08 14:29:07 +03:00
gdlbo 64c9cff0bb VK Me mode inject 2022-07-08 14:10:27 +03:00
gdlbo 8fbbf8b6be kostil for dockbak lol 2022-07-08 13:58:26 +03:00
gdlbo 6c0d5619e4 inj dockbar 2022-07-08 13:36:25 +03:00
gdlbo c3c41f9d2e Fixed feed cache toggle 2022-07-08 11:03:15 +03:00
gdlbo a154138fb5 Video redesign optional 2022-07-08 11:00:03 +03:00
gdlbo 0bf6821a4b Update Toggles.java 2022-07-08 10:55:08 +03:00
gdlbo 470ac9dd4d VTSettings fixes
fixed design
fixed proxy type null
2022-07-08 10:49:12 +03:00
gdlbo b68b10f776 Update DockBarManager.java 2022-07-08 10:35:26 +03:00
gdlbo c06f2588a8 Update DockBarManager.java 2022-07-08 10:31:35 +03:00
gdlbo f6ade7a059 Update DockBarManager.java 2022-07-07 21:38:42 +03:00
gdlbo 08d7851de3 Fixed dockbar color?, fixed double vt icons 2022-07-07 20:37:49 +03:00
gdlbo 78902110eb fixed R.java.......... 2022-07-07 20:14:37 +03:00
gdlbo b7b9de4ba4 Revert "Update public.xml"
This reverts commit 487cb6c076.
2022-07-07 19:48:48 +03:00
gdlbo 83014931dc IconManager manifest inject 2022-07-07 19:18:02 +03:00
gdlbo 46edd53cb6 Fixed AndroidManifest 2022-07-07 19:12:31 +03:00
Vologhat 87b1251f5a Update R.java 2022-07-07 19:02:00 +03:00
gdlbo 4ce73d9e55 Update IconManager.java
fixed logic
2022-07-07 16:41:58 +03:00
gdlbo 4541ef61c1 Update IconManager.java 2022-07-07 16:40:40 +03:00
gdlbo 4f3f26e3f5 Update IconManager.java 2022-07-07 16:33:14 +03:00
gdlbo 1f235bfc4a Update IconManager.java 2022-07-07 16:30:24 +03:00
gdlbo 548a029db2 IconManager codebase 2022-07-07 16:26:19 +03:00
aliveoutside 6d1b964239 hook dockbar 2022-07-07 16:37:26 +03:00
gdlbo 487cb6c076 Update public.xml 2022-07-07 13:16:36 +03:00
gdlbo 5a372f6c60 Update R.java 2022-07-07 11:51:39 +03:00
gdlbo 81f954d25a fix download icon for tgs 2022-07-07 11:39:29 +03:00
aliveoutside ec3248f5c3 telegram stickers doesn't look like shit now 2022-07-07 04:58:27 +03:00
gdlbo c959d5e5d6 tgs inj 2022-07-06 18:07:49 +03:00
Vologhat 49798694b2 fixed crashes in StickersFragment 2022-07-06 17:39:39 +03:00
gdlbo 3879555297 some music fixes 2022-07-06 11:40:02 +03:00
gdlbo fc11e2d055 Update VTSettings.java 2022-07-06 10:04:57 +03:00
gdlbo 4905e8fed0 updated superapp in settings 2022-07-06 09:58:04 +03:00
Vologhat 9a02f2a7c3 fixed superapp injector 2022-07-05 20:51:02 +03:00
Vologhat 03014f245c fixed profile hiding 2022-07-05 20:43:20 +03:00
Vologhat 13f247467c optimizations 2022-07-05 20:11:06 +03:00
gdlbo 5116f507c5 Update ProfileHide.java 2022-07-05 16:28:17 +03:00
gdlbo 228e6ea282 profile hide inj test
profiles dead lmao
2022-07-05 16:25:01 +03:00
gdlbo 7663d4cee2 Update JsonInjectors.java 2022-07-05 15:11:24 +03:00
gdlbo 4e003d355e Update JsonInjectors.java 2022-07-05 15:00:31 +03:00
gdlbo 75982656b1 upgraded convBar ext + added debug link 2022-07-05 14:51:44 +03:00
gdlbo 2f12cb188f Update Proxy.java 2022-07-05 13:11:24 +03:00
gdlbo 46cd9c0582 Update Proxy.java 2022-07-05 13:07:32 +03:00
gdlbo 8be76aa871 proxy fixes 2022-07-05 13:02:24 +03:00
gdlbo 9d9c02bec5 Some settings + proxy fixes 2022-07-03 14:11:33 +03:00
gdlbo 30faa329e9 Fix proxy summ for vt settings 2022-07-03 13:39:22 +03:00
gdlbo 0a9322741c Fix crash for android 5, 5.1, 6 + added cute icon for superapp editor 2022-07-03 13:33:27 +03:00
gdlbo f68cc4a6bd fixed scaling pic 2022-07-02 14:00:54 +03:00
gdlbo 0717fd960e Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-07-02 12:55:27 +03:00
gdlbo 0dcb2b8fd7 fixed rounding pic 2022-07-02 12:55:17 +03:00
gdlbo 2581b5a1a2 Merge pull request #410 from k1zn/vtl-remaster 2022-07-02 08:19:27 +03:00
k1zn 36cd21f7f6 Fix Russian music subscription string 2022-07-02 02:00:06 +05:00
k1zn e09a6291fe Fix Ukrainian music subscription string 2022-07-02 01:59:30 +05:00
gdlbo f800dffb5f music subs warning 2022-07-01 15:41:35 +03:00
gdlbo 86ba91a77e deleted useless feature 2022-07-01 15:37:59 +03:00
gdlbo 6aade65b4b fixed loopedanimstickers pref 2022-07-01 14:55:31 +03:00
gdlbo ba1aeeb4b1 Loop anim stickers test 2022-07-01 14:45:05 +03:00
gdlbo 4467abc181 added more font sizes 2022-07-01 14:29:52 +03:00
gdlbo 75960a7631 Fixes
Deleted unused code
Fixed some settings
Sorted toggles features
2022-07-01 14:24:16 +03:00
Vologhat 8209aa6fdf added backup settings in test mode 2022-06-30 19:47:11 +03:00
gdlbo 38bcd40ad6 fixed some toggles 2022-06-30 17:55:09 +03:00
gdlbo dbc358d0a0 superapp editor test 2022-06-30 17:40:20 +03:00
gdlbo dcb2244498 Update JsonInjectors.java 2022-06-30 14:33:05 +03:00
Vologhat e3b6bd8219 fixed fox1d code 2022-06-30 14:20:31 +03:00
aliveoutside 07f1f62fb7 fix ne4italki popup menu 2022-06-30 01:59:33 +03:00
aliveoutside 89f94df42b yes milkshake 2022-06-30 01:44:28 +03:00
gdlbo b3197aa921 startfragment inj 2022-06-29 20:31:31 +03:00
gdlbo cfc2c67efc Update SuperAppPresenter.smali 2022-06-29 20:29:27 +03:00
gdlbo d3b1e6e075 superapp inj
without superapp editor
2022-06-29 20:20:49 +03:00
gdlbo b221a8d55d no shopping v2 2022-06-29 18:49:15 +03:00
gdlbo 9cc6d4f8e0 no shopping anymore in stock menu 2022-06-29 18:03:02 +03:00
gdlbo 1a0a24df45 Fixed crash in interface sett 2022-06-29 17:56:32 +03:00
gdlbo f74b2b1acf fixed translation 2022-06-29 17:46:33 +03:00
gdlbo c7b5b7d6ca More animations :) 2022-06-29 17:42:51 +03:00
gdlbo 215d747dad Test fix anim crash in My Stickers 2022-06-29 17:41:29 +03:00
gdlbo c10b3e5619 anim inj 2022-06-29 17:08:51 +03:00
gdlbo f03d4892a2 fixed imports 2022-06-29 16:49:15 +03:00
gdlbo 6c84540a5d fix 2022-06-29 16:40:44 +03:00
gdlbo 664e1fe428 deleted some unused code 2022-06-29 16:08:29 +03:00
gdlbo 328b2caecb do not seen stories inj 2022-06-29 16:03:17 +03:00
gdlbo 0799757097 showmenu inj 2022-06-29 15:46:25 +03:00
gdlbo 8c9fee306f disable videofeed inj 2022-06-29 15:39:50 +03:00
gdlbo c23624ab11 milkshake disabled by default + disabled welcome banner on milkshake 2022-06-29 15:29:13 +03:00
gdlbo ea4315274b fixed msgs 2022-06-29 13:49:43 +03:00
gdlbo 947183ff02 Maybe fix msg 2022-06-29 13:28:22 +03:00
gdlbo dbe80696d6 Update StandartFilter.txt 2022-06-29 12:02:39 +03:00
gdlbo 1296ab56a7 Refactored reposts adblock + updated filter 2022-06-29 11:53:24 +03:00
gdlbo bda751e692 updated filters 2022-06-29 11:47:44 +03:00
gdlbo 5135cfa347 some important fixes 2022-06-29 01:21:05 +03:00
aliveoutside c450ef7f87 update apktool 2022-06-28 19:57:25 +03:00
aliveoutside bd470aba41 inject ne4italki into dialog menu 2022-06-28 19:57:25 +03:00
gdlbo 3435531cb2 Updated Toggles 2022-06-28 01:27:44 +03:00
gdlbo e784f8a27b Update Toggles.java 2022-06-28 01:05:45 +03:00
gdlbo 96e9579bbf fixed crash in music + added disabler milkshake 2022-06-27 23:55:57 +03:00
aliveoutside 36432e0c80 ne4italki 2022-06-27 20:54:04 +03:00
gdlbo b58a918f27 toggles redirect 2022-06-27 19:45:51 +03:00
gdlbo e8753831b6 ServerDialog disabler 2022-06-27 18:40:11 +03:00
gdlbo 7068600d3d covbar inj test 2 2022-06-27 17:58:30 +03:00
gdlbo b9443f0d78 covbar inj test 2022-06-27 16:47:41 +03:00
gdlbo 3ca54043d8 fixed adfilter 2022-06-27 15:26:37 +03:00
gdlbo e672a6dcf4 upgraded newsfeed ad posts detection
added support for reposts
refactored copyright posts detection
updated adblock filters
2022-06-27 15:15:42 +03:00
gdlbo 453d90827b Update build.yml 2022-06-26 20:55:30 +03:00
gdlbo 13f68a3b12 Messages -> Chats 2022-06-26 20:50:36 +03:00
gdlbo 07a26092ae Merge pull request #392 from iNotFlying/vtl-remaster 2022-06-26 17:49:40 +03:00
iNotFlying 57b6ba04b3 Telegram icon fix 2022-06-26 18:47:55 +04:00
gdlbo cf744757b6 Update FriendsGetRecommendationsWithMutual.smali 2022-06-26 17:04:33 +03:00
gdlbo 59afe0a412 Merge pull request #391 from iNotFlying/vtl-remaster 2022-06-26 16:40:12 +03:00
iNotFlying 488eb7c0ea New icons 2022-06-26 16:35:03 +04:00
gdlbo 2a7af94f10 Update OnlineFormatter.java 2022-06-25 20:29:41 +03:00
gdlbo 1922863723 Update OnlineFormatter.java 2022-06-25 20:27:02 +03:00
gdlbo 1259231653 Update OnlineFormatter.java 2022-06-25 20:15:28 +03:00
gdlbo ba8d3c42a1 updated Online Formatter 2022-06-25 20:13:58 +03:00
gdlbo ab851d3600 Custom online detection
need to do make requests to get appid name from vk
2022-06-25 19:39:34 +03:00
gdlbo b80213a017 ServerDialog upgraded 2022-06-25 15:36:44 +03:00
gdlbo 8cb4bb0a55 ServerDialog upgraded 2022-06-25 15:36:10 +03:00
gdlbo 58cddd18e2 ServerDialog null check 2022-06-25 14:50:12 +03:00
gdlbo 67c0a3eed4 ServerDialog impl 2022-06-25 14:41:42 +03:00
gdlbo e7c7dae411 fixed verifications 2022-06-25 12:39:17 +03:00
gdlbo f66d2af98a fixed number rounding in groups 2022-06-25 12:28:12 +03:00
gdlbo dc3e6293ee fixed number rounding in groups 2022-06-25 12:24:31 +03:00
gdlbo 05397f69d0 fixed crash 2022-06-25 12:13:18 +03:00
gdlbo 9f341eb485 fixes of music and debug 2022-06-25 12:05:22 +03:00
gdlbo e944f5bdf5 fixes of music and debug 2022-06-25 12:05:15 +03:00
gdlbo a0a34d138f fixed crashreport icon 2022-06-25 12:01:26 +03:00
gdlbo 4b55279c84 added install permission 2022-06-25 11:57:57 +03:00
gdlbo b5a7852f2e fixed ota requests 2022-06-25 11:55:56 +03:00
gdlbo b675834a6f deleted benchmark tracker + fixes 2022-06-25 11:46:05 +03:00
gdlbo 09e509e48f deleted music tracker 2022-06-25 11:33:37 +03:00
gdlbo e2b6a3a75e fixed profile open 2022-06-25 11:11:34 +03:00
gdlbo dc4c31d66a fixed libvoip lib 2022-06-25 11:00:11 +03:00
gdlbo abeb31f4f0 fixes of LinkProcessorKt 2022-06-25 10:52:05 +03:00
gdlbo c7b91b62e6 added some redirects to settings 2022-06-25 10:30:56 +03:00
gdlbo 648369b7cd added support to open links from m.vk.com 2022-06-25 09:23:01 +03:00
gdlbo 3f834cc83b Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-25 09:19:06 +03:00
gdlbo 4dd5f13b3a gmap fix + added needed activities and services 2022-06-25 09:18:56 +03:00
gdlbo faea96a786 gmap fix 2022-06-25 09:11:33 +03:00
aliveoutside 7882968a05 vkx integration 2022-06-25 04:05:11 +03:00
gdlbo d6595f54f1 newsfeed filter inj to NewsfeedCustomGet 2022-06-25 01:06:00 +03:00
gdlbo 6f1ba0ca9f stories ads inj 2022-06-25 00:30:01 +03:00
gdlbo daee7c8665 awayphp inj 2022-06-25 00:28:08 +03:00
gdlbo dd591ee78b added donate button 2022-06-25 00:22:15 +03:00
gdlbo f72ff25ebe inj refresh newsfeed 2022-06-24 23:44:39 +03:00
gdlbo 04cf3b1b8a swipe stories inj 2022-06-24 23:41:28 +03:00
gdlbo 0cd82deaa6 dockcounter inj 2022-06-24 23:41:13 +03:00
gdlbo 826b566540 alteremoji inj 2022-06-24 23:33:31 +03:00
gdlbo a2018f85b4 system emoji inj 2022-06-24 23:26:06 +03:00
aliveoutside f48e05badb fix init 2022-06-24 23:21:45 +03:00
gdlbo 21ad47b45b fixed some settings logic for stupid users 2022-06-24 23:20:43 +03:00
gdlbo ea54706e8b added date formatter + deleted some unused code 2022-06-24 23:14:51 +03:00
gdlbo db6c23d511 chat count load inj + fixes 2022-06-24 22:54:56 +03:00
gdlbo d06396a51d date formatter in chats 2022-06-24 22:53:28 +03:00
gdlbo bc5cc9b6f6 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-24 22:37:47 +03:00
gdlbo b05d6fb22b value rounding 2022-06-24 22:37:40 +03:00
aliveoutside 3144dd07e8 hooked stories disabler 2022-06-24 22:13:48 +03:00
gdlbo 247627fe08 shortpost 2022-06-24 22:07:18 +03:00
gdlbo 32668111e1 fixed dialogs load 2022-06-24 20:27:43 +03:00
gdlbo c3848fdbba upped vk ver 2022-06-24 20:02:23 +03:00
gdlbo 834367ea65 getDrawableFromUrl fix 2022-06-24 19:41:08 +03:00
gdlbo 7f9e5aa11e fix summ in feed 2022-06-24 13:31:16 +03:00
gdlbo 5554b5197a added filter for copyright links 2022-06-24 13:27:59 +03:00
aliveoutside a0e504a834 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-24 13:03:11 +03:00
gdlbo f5d4892ba6 added filter for copyright links 2022-06-24 11:54:35 +03:00
gdlbo 32e807e130 fixed ads in discover 2022-06-24 11:43:38 +03:00
gdlbo d7ff759cde added app version to about 2022-06-24 10:49:25 +03:00
gdlbo fc4f8056c5 renamed some strings 2022-06-24 10:39:31 +03:00
gdlbo 7b073523fa added proxied static and oauth + refactored by copilot 2022-06-24 10:37:49 +03:00
gdlbo 7205be3749 vk api proxy inj 2022-06-24 09:38:57 +03:00
gdlbo e1915e19a3 voice inject 2022-06-24 09:31:29 +03:00
gdlbo 4da341ccf8 pic compress inject 2022-06-24 09:27:27 +03:00
gdlbo 6ef958a606 pic compress inject 2022-06-24 09:27:18 +03:00
aliveoutside a5811047d9 implement messages undeleter (via reflection for now) 2022-06-24 03:56:12 +03:00
gdlbo 75e562e92f changed codestyle 2022-06-23 17:31:32 +03:00
gdlbo 75d537f36a added reload msg feature 2022-06-23 00:56:32 +03:00
gdlbo b68812109c added multiacc + updated jars 2022-06-23 00:19:57 +03:00
gdlbo 44d0f31f93 fixed ru locale 2022-06-22 23:27:42 +03:00
gdlbo b5d5b87779 fixed ssl by default 2022-06-22 23:22:14 +03:00
gdlbo cf180f5146 fixed some settings 2022-06-22 23:21:02 +03:00
gdlbo 430c1686c0 ru locale 2022-06-22 23:20:32 +03:00
gdlbo d1d4bb1f5b fixed auto detect theme + fixes of debug 2022-06-22 23:09:05 +03:00
gdlbo 03561407a3 fixed workflow compiling 2022-06-22 23:00:55 +03:00
gdlbo a9c2c6945b fixed windows compiling 2022-06-22 23:00:26 +03:00
gdlbo 6ae59e0557 fixed proxy tab 2022-06-22 22:59:33 +03:00
gdlbo b1c2c785f3 fixed auth + added old prefs to debug 2022-06-22 22:52:28 +03:00
gdlbo aa0c2a7093 updated jars 2022-06-22 20:44:08 +03:00
gdlbo 987379b7a2 updated themes and disabled auto theme (dead) 2022-06-22 20:43:57 +03:00
gdlbo 7ee38e27d3 fixes themes 2022-06-22 19:34:20 +03:00
gdlbo 60be976861 fixed cringe logs 2022-06-22 19:16:13 +03:00
gdlbo 14e1c736b3 added vkui inj + upgraded vkui coloring and theme changing 2022-06-22 18:55:45 +03:00
gdlbo fc6945a72d fixed opening vk id and bugtracker 2022-06-22 18:33:00 +03:00
aliveoutside b73e8b5c99 fix crashing tgstickers fragment 2022-06-22 18:12:17 +03:00
gdlbo 7fad5f2db8 fixed icons 2022-06-22 18:04:46 +03:00
gdlbo 6119610d7f added new params 2022-06-22 17:58:57 +03:00
gdlbo 401685c1b6 added old icons 2022-06-22 17:56:34 +03:00
aliveoutside bf0f78b391 update icons in settings 2022-06-22 17:29:51 +03:00
gdlbo 0f40e271db fixed FriendsGetRecommendationsWithMutual.smali 2022-06-22 16:49:13 +03:00
gdlbo 990a392b83 newsfeed inj 2022-06-22 16:43:18 +03:00
gdlbo 9e1d0077f6 added offline and news injector 2022-06-22 16:41:41 +03:00
gdlbo 68c3619f7f fixed auto cleaning cache 2022-06-22 14:51:22 +03:00
gdlbo 0419316f32 fixed settings opening 2022-06-22 14:47:26 +03:00
gdlbo fb8252eebe verifications 2022-06-22 14:21:52 +03:00
gdlbo 8a7763c356 navbar coloring (s0v@ killer tbh) 2022-06-22 12:37:44 +03:00
gdlbo 6187eecac5 deleted video/msg reporter 2022-06-22 12:14:22 +03:00
gdlbo 4d3f262d59 fix network 2022-06-22 12:08:56 +03:00
gdlbo 95feb481a9 deleted vk ui analytics and anr 2022-06-22 11:52:38 +03:00
gdlbo 1a42c24dab deleted app start duration checker 2022-06-22 11:41:29 +03:00
gdlbo 833e02bfb2 deleted vk analytics reporter 2022-06-22 11:35:00 +03:00
gdlbo 705d6bf639 deleted my tracker 2022-06-22 11:29:40 +03:00
gdlbo 1186cd4a8d Deleted crashlytics 2022-06-22 11:17:00 +03:00
gdlbo 4b19b59b3a fixed strings compiling 2022-06-22 10:25:27 +03:00
gdlbo 066a1ed161 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-22 10:21:33 +03:00
gdlbo cc9a826f1d inited new version + app name 2022-06-22 10:21:17 +03:00
aliveoutside 8dd7b2d368 add settings 2022-06-22 04:58:42 +03:00
gdlbo d82609304a added Toggles.java with hook 2022-06-22 01:23:00 +03:00
aliveoutside 831ba0a774 fix not loading messages 2022-06-22 04:06:51 +03:00
aliveoutside 15fe52d83f update jars 2022-06-22 03:55:21 +03:00
aliveoutside bce20b9ad6 hide DeletedMessagesHandler for now 2022-06-22 03:54:57 +03:00
aliveoutside 291273aef5 update buildscripts 2022-06-22 03:54:34 +03:00
aliveoutside 8248418fe2 fix ModalBottomSheetWrapper 2022-06-22 03:44:08 +03:00
gdlbo 99629f0a3e added Toggles.java with hook 2022-06-22 00:42:42 +03:00
gdlbo 9405ee352d fix Toggles.java 2022-06-22 00:17:14 +03:00
gdlbo 4dd055b9b1 added Toggles.java 2022-06-22 00:13:13 +03:00
aliveoutside 7769a76bea fix galo4ki 2022-06-22 02:07:39 +03:00
aliveoutside 27b8b57625 fix OTAHelper 2022-06-22 02:07:39 +03:00
gdlbo 682ed1c8c5 fixed imports and Themes.java 2022-06-21 23:05:33 +03:00
Vologhat f6c30a4953 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:55:08 +03:00
aliveoutside 4c352713ca fix DeletedMessagesHandler 2022-06-22 01:52:15 +03:00
Vologhat 20efb909ae extended ReflectionUtils 2022-06-21 22:54:44 +03:00
gdlbo fc6f528541 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:38:15 +03:00
aliveoutside 1d97000bef fix DockBarFragment 2022-06-22 01:31:01 +03:00
aliveoutside ade116fa03 fix otadownloader 2022-06-22 01:24:48 +03:00
aliveoutside ec40c99c95 fix net/request 2022-06-22 01:18:00 +03:00
aliveoutside ab66804d87 fix ExternalLinkHandler 2022-06-22 01:13:58 +03:00
gdlbo 126d8c7926 debuggable true 2022-06-21 22:36:49 +03:00
gdlbo b936327eec fixed setup with official vk 2022-06-21 22:36:18 +03:00
gdlbo 7499aadec6 Merge branch 'vtl-remaster' of https://github.com/vtosters/lite into vtl-remaster 2022-06-21 20:40:46 +03:00
aliveoutside ed5f82cbd2 fix dnr and dnt 2022-06-21 23:39:00 +03:00
aliveoutside 596b71ce56 remove okhttp request 2022-06-21 23:39:00 +03:00
aliveoutside af6aaf341e fix foaf 2022-06-21 23:39:00 +03:00
gdlbo 4f51cdec0a fixes refl theme 2022-06-21 20:40:29 +03:00
gdlbo e4f68f4024 fixes refl theme 2022-06-21 20:38:10 +03:00
aliveoutside b2f78987f7 fix materialfragment is settings 2022-06-21 23:14:56 +03:00
aliveoutside a567d044c6 add activity to manifest 2022-06-21 23:14:56 +03:00
aliveoutside 5e6fff7b8d fix materialfragment 2022-06-21 23:14:56 +03:00
gdlbo f4766d0a11 Update R.java 2022-06-21 20:14:42 +03:00
aliveoutside 5b95b17703 update jars 2022-06-21 23:00:13 +03:00
aliveoutside 534e33ee46 Revert "fixes private/public"
This reverts commit 94a6b5aa96.
2022-06-21 22:51:21 +03:00
aliveoutside 3d0b8cf0a2 dev mode 2022-06-21 22:37:24 +03:00
aliveoutside 764f026ab9 ssl 2022-06-21 22:28:30 +03:00
gdlbo 056fdc3b2c Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 19:16:12 +03:00
aliveoutside d4641d88c0 enable music 2022-06-21 22:13:58 +03:00
aliveoutside 6a82aee5cc disable calls 2022-06-21 22:13:57 +03:00
gdlbo ffa64a0125 fixes analytics 2022-06-21 19:16:07 +03:00
gdlbo 856eafe8de fixes private/public 2022-06-21 19:11:41 +03:00
gdlbo 94a6b5aa96 fixes private/public 2022-06-21 19:08:51 +03:00
aliveoutside 42b02add89 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:01:12 +03:00
aliveoutside 034bf2dd2c спустя два дня пофиксили 2022-06-21 21:58:55 +03:00
aliveoutside 0eccfbf5ea Revert "deobf"
This reverts commit 755268de
2022-06-20 00:31:48 +03:00
aliveoutside 23c3bd8852 partially ifx 2022-06-20 00:19:11 +03:00
gdlbo 037444d813 fixes 2022-06-19 23:37:59 +03:00
gdlbo 44de228f9f fixes 2022-06-19 20:44:33 +03:00
gdlbo 7b25221fee fixes 2022-06-19 20:13:27 +03:00
gdlbo 363afa251a added new fonts 2022-06-19 20:13:18 +03:00
gdlbo 052e3114bf fix 2022-06-19 19:28:04 +03:00
gdlbo d73c5133d3 fix 2022-06-19 19:17:30 +03:00
gdlbo 8d0b63ad72 fixes 2022-06-19 15:32:24 +03:00
aliveoutside 5766d03767 update r.java 2022-06-19 18:21:48 +03:00
gdlbo 7ee2f8ab46 fixes 2022-06-19 14:52:27 +03:00
gdlbo 1840c76a26 fixes 2022-06-19 14:38:22 +03:00
aliveoutside 51e8219306 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 17:17:50 +03:00
aliveoutside 82d16c6a0c Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 17:01:32 +03:00
aliveoutside da087054cc fix preferences 2022-06-19 16:57:53 +03:00
aliveoutside 5781df15d3 fix preferences 2022-06-19 16:54:07 +03:00
gdlbo 4c1cb174b8 fixes 2022-06-19 14:17:37 +03:00
gdlbo fa1ef6dfa5 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 14:01:28 +03:00
gdlbo 1389a39bea fixes 2022-06-19 14:01:24 +03:00
gdlbo 0491afacec fixed all res 2022-06-19 13:11:07 +03:00
gdlbo de62447522 added resources + fixed animfrag 2022-06-19 12:47:35 +03:00
aliveoutside 3ba9b8c4e4 add assests 2022-06-19 07:05:35 +03:00
aliveoutside c1760a48ca update jars 2022-06-19 07:03:08 +03:00
aliveoutside 32b854baf8 remove multiacc (it's already in the client) 2022-06-19 07:02:55 +03:00
aliveoutside 5b91699c69 fix StickersPreferencesFragment 2022-06-19 06:59:52 +03:00
aliveoutside 1f42bb9ec6 fix DeletedMessagesHandler 2022-06-19 06:52:32 +03:00
aliveoutside 8330f7fe89 add update jars script 2022-06-19 06:49:32 +03:00
aliveoutside 74bbb9eed9 fix verifications 2022-06-19 05:57:58 +03:00
aliveoutside 78960e7827 fix vkx 2022-06-19 05:53:17 +03:00
aliveoutside 3dfe10fc87 fix settings 2022-06-19 05:49:10 +03:00
aliveoutside 807c3b95c4 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 05:44:34 +03:00
aliveoutside 4f408e4cfa Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 05:30:56 +03:00
aliveoutside 0d0caa9d83 fix messages settings 2022-06-19 05:03:00 +03:00
aliveoutside d33e382b49 fix 2022-06-19 04:54:56 +03:00
aliveoutside 20b7e77be2 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 04:48:03 +03:00
aliveoutside 3652e8c593 fix video downloader 2022-06-19 04:42:43 +03:00
aliveoutside 755268de6b deobf 2022-06-19 04:32:02 +03:00
gdlbo 4473e68f7e fixes 2022-06-19 02:44:29 +03:00
gdlbo 65aac426b2 fixes 2022-06-19 02:13:23 +03:00
gdlbo a186fd35be Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 02:06:52 +03:00
gdlbo c651074d91 fixes 2022-06-19 02:06:47 +03:00
gdlbo 34335d723a fixes 2022-06-19 01:47:55 +03:00
gdlbo 6cd0cd4730 fixes 2022-06-19 00:27:34 +03:00
gdlbo 3125ba2f8a dev mode 2022-06-18 23:52:54 +03:00
gdlbo 638ddd0518 music + ssl v2 2022-06-18 23:29:48 +03:00
gdlbo 429f8214b0 ssl + debug check 2022-06-18 23:29:05 +03:00
aliveoutside bdd5c80504 rename 2022-06-18 23:01:03 +03:00
aliveoutside c11d763760 disable calls 2022-06-18 20:04:41 +03:00
aliveoutside d2df533c1d fix music 2022-06-18 20:01:17 +03:00
aliveoutside db3944b8d6 fix buildscripts 2022-06-18 20:01:07 +03:00
aliveoutside 0d0e5fdd37 add new files 2022-06-18 19:27:15 +03:00
aliveoutside 2273d2f346 init new ver 2022-06-18 19:12:50 +03:00
gdlbo 7df03fd5e6 fixed deleting acc 2022-06-17 22:52:50 +03:00
gdlbo 7dd30d5169 shakal mode 2022-06-17 19:49:41 +03:00
gdlbo c7820e2571 fixed multi account 2022-06-17 19:27:35 +03:00
gdlbo cf058d65fd updated gh actions script 2022-06-17 19:13:27 +03:00
gdlbo 3eabe1f659 added compress disabler 2022-06-17 19:10:57 +03:00
gdlbo f442f089bf added compress disabler 2022-06-17 19:08:37 +03:00
gdlbo 82abf48b18 Merge remote-tracking branch 'origin/master' 2022-06-17 18:35:06 +03:00
gdlbo 7729614f8b added auto cleaning cache 2022-06-17 18:35:01 +03:00
gdlbo 9b86678daf Merge pull request #342 from k1zn/master
Fix avatar position on tablet
2022-06-17 18:27:20 +03:00
gdlbo 9d356e7d9d added auto cleaning cache 2022-06-17 18:21:10 +03:00
Erik Kiznov 6ac6819d5d Fix README.md 2022-06-17 20:09:03 +05:00
Erik Kiznov e859baf6e5 Fix avatar position on tablet 2022-06-17 19:36:42 +05:00
Vologhat ac137e1fb6 changed buttons style 2022-06-17 17:12:26 +03:00
gdlbo 997d861f83 fix foxbin.f0x1d.com/enotik 2022-06-17 15:12:59 +03:00
gdlbo 91cde36777 fix 2022-06-17 14:54:47 +03:00
gdlbo ebf7a4070c fix 99% problems on android 11 and lower 2022-06-17 14:19:27 +03:00
gdlbo c63a31ddd8 fixed colors 2022-06-17 13:58:41 +03:00
gdlbo 8a0000b678 fix vk icon in menu 2022-06-17 13:53:17 +03:00
gdlbo 2fc79dbdb8 fixed crash android 5.1 2022-06-17 13:34:40 +03:00
gdlbo 037ea45448 fix crash MusicFragment 2022-06-16 23:30:08 +03:00
gdlbo e389f7d353 gcmfix v2 is here 2022-06-16 22:46:07 +03:00
gdlbo 6cdba67118 gcmfix v2 is here 2022-06-16 22:32:00 +03:00
gdlbo 3bb32dfd44 gcmfix v2 is here 2022-06-16 22:30:00 +03:00
gdlbo d7d3ef7549 counters is back 2022-06-16 21:58:13 +03:00
gdlbo 95a029ab6f fix rounded msg + improved vkme msg mode 2022-06-16 21:25:41 +03:00
gdlbo f284a96587 fixed bg stickers issue 2022-06-16 21:14:13 +03:00
gdlbo ca91b16647 VKID Protection alert in music settings 2022-06-16 20:25:02 +03:00
gdlbo 35e5a97266 VKID Protection alert 2022-06-16 19:38:18 +03:00
gdlbo 6678a361ba VKID Protection alert 2022-06-16 19:35:45 +03:00
gdlbo 1e8bd2afc7 fix sharing action buttons 2022-06-16 17:05:42 +03:00
gdlbo ad5f658423 small fixes 2022-06-16 16:51:27 +03:00
gdlbo 24e81159f3 small fixes 2022-06-16 16:37:35 +03:00
gdlbo b6e60e3461 verif icon coloring in dialogs 2022-06-16 16:24:23 +03:00
gdlbo 203b4b166b toolbar fixes 2022-06-16 16:02:19 +03:00
gdlbo d586eea977 writebar fix 2022-06-16 14:16:46 +03:00
gdlbo d33e25f95d fix msg loading 2022-06-16 14:03:39 +03:00
gdlbo b9508d9be4 online fixes 2022-06-16 13:18:09 +03:00
gdlbo 5b39f797b1 fix 2022-06-16 09:12:39 +03:00
gdlbo 6ceb91e8b6 added signature check to detect github actions builds and etc 2022-06-16 01:26:07 +03:00
gdlbo 94259ce68c fixes 2022-06-16 01:06:11 +03:00
gdlbo 0f035ebc13 fixes 2022-06-16 00:33:40 +03:00
gdlbo dc605a7292 fixed toast 2022-06-16 00:15:31 +03:00
Vologhat 15ef4b5419 Merge branch 'ota' 2022-06-16 00:09:40 +03:00
Vologhat fc6cf416dc Final fixes 2022-06-16 00:04:34 +03:00
gdlbo 0a28430c5a impossible color fix 2022-06-15 23:08:58 +03:00
gdlbo 3207290d77 kill androidx 2022-06-15 21:47:21 +03:00
Vologhat b0fa321606 final changes
added apk downloading and installing features, bottomshit wrapper with mirroring
2022-06-15 21:29:09 +03:00
gdlbo 2bffa59a10 color fixes 2022-06-15 21:11:30 +03:00
gdlbo 7f080970e4 wtf debuggable must be false 2022-06-15 17:20:01 +03:00
gdlbo f1c2527ca3 fixes 2022-06-15 17:13:18 +03:00
Vologhat 33d210af7f added ota 2022-06-15 16:41:21 +03:00
gdlbo d7378e4674 fixed auto theme 2022-06-15 07:59:10 +03:00
gdlbo 8e40b622f7 fixes 2022-06-15 02:36:25 +03:00
gdlbo 92e4c55cb5 upgraded new settings
refactored multi account counter
2022-06-15 02:13:33 +03:00
gdlbo f498e7af73 fixes 2022-06-14 23:48:07 +03:00
gdlbo bacf196a31 isdarktheme now should work depending on the dark theme of the app v2 2022-06-14 13:26:47 +03:00
gdlbo 2f4603af26 Merge pull request #313 from iNotFlying/master
New VK logo
2022-06-14 13:10:11 +03:00
gdlbo 203a7d00f2 isdarktheme now should work depending on the dark theme of the app 2022-06-14 13:08:20 +03:00
iNotFlying f8c351cd0b Some fixes 2022-06-14 10:48:25 +03:00
iNotFlying 93ab8d368b Merge branch 'vtosters:master' into master 2022-06-14 11:41:47 +04:00
gdlbo e38d93fa2b injected new setting to default theme 2022-06-14 01:19:20 +03:00
gdlbo 59518fa4ce fixed dark theme in new settings 2022-06-14 01:07:17 +03:00
gdlbo c7b7ccfb8b fixed amoled css 2022-06-14 00:15:25 +03:00
gdlbo e0f9ac1ea3 amoled theme now is fully amoled theme 2022-06-14 00:11:33 +03:00
gdlbo 2fa9f76d16 fixes 2022-06-13 23:57:53 +03:00
gdlbo 7eceb08e8c fixes 2022-06-13 22:49:22 +03:00
gdlbo 41f558c34c fixes 2022-06-13 22:40:10 +03:00
gdlbo dd5963b172 vkme mode updated 2022-06-13 22:34:35 +03:00
iNotFlying c1e3a03412 New VK logo 2022-06-13 21:45:29 +03:00
gdlbo ffd60ded27 vkme mode updated 2022-06-13 21:07:16 +03:00
gdlbo b5e02b04b7 vkme mode updated 2022-06-13 21:06:36 +03:00
gdlbo 4077621891 vkme mode updated 2022-06-13 21:04:16 +03:00
gdlbo 2d2a835bbe vkme mode updated 2022-06-13 18:18:38 +03:00
gdlbo 526c2a3b8a vkme mode updated 2022-06-13 12:38:50 +03:00
gdlbo 0bee2560d5 vkme mode updated 2022-06-13 12:20:21 +03:00
gdlbo c4796fb9c7 vkme mode updated 2022-06-13 12:01:04 +03:00
gdlbo 504aa22064 vkme mode test 2022-06-13 01:03:10 +03:00
gdlbo 7882532361 test coloring bottomsheet 2022-06-12 20:02:15 +03:00
gdlbo f4786f0479 mini refactoring 2022-06-12 16:19:45 +03:00
gdlbo 2dc814eacb fix https://github.com/vtosters/lite/issues/156 2022-06-12 15:44:05 +03:00
gdlbo 289d82e5bc fix 2022-06-12 01:49:10 +03:00
gdlbo 1157d96589 fix hardcoded text 2022-06-12 01:29:19 +03:00
gdlbo e1044a288d fix 2022-06-12 01:12:01 +03:00
gdlbo 2cba8fd9ef dropdown menu text color fix 2022-06-12 00:36:18 +03:00
gdlbo 1d9285d371 dropdown menu coloring!!!!!!! 2022-06-11 23:51:48 +03:00
gdlbo f8d342ba93 fixes 2022-06-11 23:08:16 +03:00
gdlbo eae02f4f4a fixes 2022-06-11 22:57:52 +03:00
gdlbo f8c397e57f fixes 2022-06-11 22:45:55 +03:00
gdlbo 87c53c8a42 fixes 2022-06-11 20:16:10 +03:00
gdlbo 8615d33da9 Animation fragment injector (beta) 2022-06-11 19:46:22 +03:00
gdlbo 59702a47f0 fixed games button 2022-06-11 17:29:05 +03:00
gdlbo cd69714985 upgraded ColorStateList recoloring 2022-06-11 16:42:39 +03:00
gdlbo f4e51b79fd some fixes of color inj 2022-06-11 15:24:04 +03:00
gdlbo b6fde08278 Merge remote-tracking branch 'origin/master' 2022-06-11 14:26:43 +03:00
gdlbo 4773f7faef fixed search color 2022-06-11 14:26:39 +03:00
gdlbo 33e4637b60 Fix string 2022-06-10 22:22:46 +03:00
gdlbo e676c5c4f1 fixed crash docs 2022-06-10 21:49:12 +03:00
gdlbo 58741f88f6 fixed crash docs 2022-06-10 21:37:52 +03:00
gdlbo 12077ba07a some improves 2022-06-10 21:00:37 +03:00
gdlbo 748cb47b4b fixed issue with undelete by default (oops) 2022-06-10 19:42:20 +03:00
gdlbo c0470012eb fixed issue with dateformat value 2022-06-10 19:00:26 +03:00
gdlbo cf3eacc14f Added an expanded view of the date format type selection
Full date in private messages
Minor improvements
Fixed a bug with anti-deletion of messages
2022-06-10 18:58:19 +03:00
gdlbo 083dc40ad9 improved disabling number shortening 2022-06-10 17:26:40 +03:00
gdlbo 72001373b9 fixed pic rounding 2022-06-10 16:40:50 +03:00
gdlbo 1eb33b6cc5 fixed serach text coloring 2022-06-10 16:19:00 +03:00
gdlbo 908047fbe2 fixed casino moment 2022-06-10 16:17:32 +03:00
gdlbo 2ac791344a fixed casino moment 2022-06-10 15:29:46 +03:00
gdlbo 0b28a4d20b fixed rounded msgs colors monet 2022-06-10 15:26:40 +03:00
gdlbo 62fbdab39a added pref disableanimstickers to debug 2022-06-09 00:04:14 +03:00
gdlbo 282c82282e fixed some accents 2022-06-08 23:44:58 +03:00
gdlbo 4b7eeed21c fixed accent vkim link 2022-06-08 23:26:30 +03:00
gdlbo d6d50bdc41 fixed load friends page 2022-06-08 22:58:52 +03:00
gdlbo 3be46106a1 added shadow in dialogs vkme 2022-06-08 21:18:05 +03:00
gdlbo ea2cda888d disabled divider in dialogs 2022-06-08 21:09:12 +03:00
gdlbo 1d59d4c5ed fixed shadow 2022-06-08 20:55:19 +03:00
gdlbo be47db75aa fixed shadow on 31 sdk+ 2022-06-08 20:47:52 +03:00
gdlbo 41b81641ce sdk 31 rounded msgs 2022-06-08 20:29:30 +03:00
gdlbo 1faebbb490 amoled theme for rounded msgs 2022-06-08 19:55:11 +03:00
gdlbo 7036c3e613 some fixes 2022-06-08 19:32:29 +03:00
gdlbo aa1fece7b5 init rounded msg for light theme 2022-06-08 19:26:01 +03:00
gdlbo 896b420c28 added applying theme after restart 2022-06-08 19:25:01 +03:00
gdlbo ac4fe43aef init rounded msg for dark theme 2022-06-08 18:50:28 +03:00
gdlbo 98e5bfb2bb init rounded theme 2022-06-08 18:41:03 +03:00
gdlbo ae722e689e fixed stickers time color 2022-06-08 18:28:56 +03:00
gdlbo 3abff8cad1 fixes some themes logic 2022-06-08 17:22:11 +03:00
gdlbo 155fa80c95 fixes + more translations 2022-06-08 15:14:34 +03:00
gdlbo a5a2179399 fixes + more translations 2022-06-08 14:02:45 +03:00
gdlbo 8aee5a78a4 fixes 2022-06-07 17:50:02 +03:00
gdlbo 06ce8a7e6f New feature open news settings via settings lmao 2022-06-07 11:56:23 +03:00
gdlbo 1cc4d7624a fixed news logic 2022-06-07 11:26:29 +03:00
gdlbo dd817960e1 Fixed some translations + fixed settings logic 2022-06-07 11:24:44 +03:00
gdlbo 92e0f3b55b Fixed links 2022-06-07 10:51:24 +03:00
gdlbo 03bdf92ae2 Casino update from 7 to 5 2022-06-04 22:14:36 +03:00
gdlbo 5492d69445 Added randomize to disable donate alert 2022-06-04 21:18:50 +03:00
gdlbo 83779a1698 fixed links + disable recomms 2022-06-04 20:36:00 +03:00
gdlbo 49c70e8162 Added donate banners lmao 2022-06-04 20:04:28 +03:00
gdlbo 654ba13dea Fixed market colors 2022-06-04 11:25:38 +03:00
gdlbo e4c0b7be6c Fix dark accent color on monet 2022-06-04 10:25:41 +03:00
gdlbo 0ee809a721 Merge pull request #283 from bxkr/master 2022-06-04 09:32:58 +03:00
Andrew 683e17bee4 Update R.java 2022-06-04 06:10:16 +03:00
gdlbo b9d35c2343 Fix pull requests building 2022-06-04 04:54:54 +03:00
Andrew 6b6c69fb19 Preferences localization
- Added en,ru translations for hardcoded strings in preferences
- Updated public.xml
- Fixed some ru strings
2022-06-03 23:38:52 +03:00
gdlbo 960980022f Fix actions compiling 2022-06-03 20:36:56 +03:00
gdlbo f72da4bec1 Fix actions compiling 2022-06-03 20:33:29 +03:00
gdlbo 08e35a811f fix some strings 2022-06-03 19:43:23 +03:00
gdlbo a34c41870c color fixes 2022-06-03 17:47:29 +03:00
gdlbo 25428464b7 Update build.gradle 2022-06-03 16:00:11 +03:00
gdlbo 97c65f9585 Color article fixes 2022-06-02 19:45:49 +03:00
gdlbo 302fa7e6af Color fixes 2022-06-02 19:28:16 +03:00
gdlbo ab067f242b Disabled discover ads 2022-06-02 19:04:24 +03:00
gdlbo 30e5ff6f64 Fix https://github.com/vtosters/lite/issues/266 2022-06-02 17:38:28 +03:00
gdlbo 2838dc5e7e Fixes 2022-06-02 16:42:45 +03:00
gdlbo 6f4f073ed3 Fixed comments load 2022-06-02 14:25:32 +03:00
gdlbo 564eb85575 Updated gitignore 2022-06-02 14:02:37 +03:00
gdlbo a6de8e0be4 Fixed icon changing 2022-06-02 13:25:19 +03:00
gdlbo abc87c0254 Fixed crash + fixed msg cache 2022-06-02 13:06:55 +03:00
gdlbo aec302d7f2 Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 12:33:52 +03:00
gdlbo d27d9227bc Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 11:20:11 +03:00
gdlbo a1c23aeaaa Refactoring 2022-05-31 16:55:19 +03:00
gdlbo 6b05544716 added more documentations 2022-05-31 16:43:58 +03:00
gdlbo 161ea1d318 Added our git links 2022-05-26 20:25:51 +03:00
gdlbo f500f34e78 Fixed statusbar and navbar light coloring 2022-05-17 23:08:12 +03:00
gdlbo e3716b759a Poll fix 2022-05-17 20:05:16 +03:00
gdlbo abc37de666 Fixes 2022-05-17 18:40:56 +03:00
gdlbo e09994cd30 reworked statusbar coloring 2022-05-17 00:35:39 +03:00
gdlbo e1dfd9bd99 fix music tabs 2022-05-16 22:38:57 +03:00
gdlbo b4ac86ef35 reworked do not read 2022-05-16 21:50:32 +03:00
gdlbo 3e40286e5d fixes 2022-05-16 21:27:59 +03:00
gdlbo 4a2d307410 copyright posts detect 2022-05-16 21:21:39 +03:00
gdlbo 878d68a655 Fixes + some imp of custom msg loader 2022-05-16 00:11:00 +03:00
gdlbo a56c92f87f Fixes 2022-05-15 21:23:48 +03:00
gdlbo 9095629f96 Reworked some cringe code 2022-05-15 21:11:25 +03:00
gdlbo 8755c2df34 fixed white screamers (maybe) 2022-05-13 20:28:20 +03:00
gdlbo 888a1af9b4 fixes 2022-05-13 19:59:36 +03:00
gdlbo e0450d3835 Fix summ 2022-05-13 15:36:42 +03:00
gdlbo 4e56fdf5aa Color fixes 2022-05-13 15:12:02 +03:00
gdlbo c332d5c97f Some corrections 2022-05-13 14:13:36 +03:00
gdlbo 2977a19532 color fix header 2022-05-13 14:10:18 +03:00
gdlbo a9365a8ba8 Fixes 2022-05-13 14:05:00 +03:00
gdlbo a6ddcdb759 Fix open notifs 2022-05-13 12:40:42 +03:00
gdlbo d9dccd53f0 Fixes 2022-05-13 11:59:15 +03:00
gdlbo 3b2f964961 Fix article custom verifs 2022-05-12 18:47:42 +03:00
gdlbo 2d8bd820a5 Monet dockbar icons coloring 2022-05-12 18:04:12 +03:00
gdlbo 56a979970c Added more summaries 2022-05-12 16:50:30 +03:00
gdlbo 836676eb18 System theme at start 2022-05-11 20:59:37 +03:00
gdlbo 86a013b619 Some color fixes + upped default app version 2022-05-10 22:34:56 +03:00
gdlbo e57a76790f Added another cringe feature 2022-05-10 22:12:40 +03:00
gdlbo b4cec48bbb Fixed doc upload 2022-05-10 21:27:25 +03:00
gdlbo 96676721c9 Fixed stats crash 2022-05-10 21:07:29 +03:00
gdlbo eeb8785d42 Custom opus lib bridges 2022-05-10 20:22:39 +03:00
gdlbo 993a1a7f86 Custom opus lib bridges 2022-05-10 20:18:59 +03:00
gdlbo 0b6f29dc70 Crashreporter fix 2022-05-10 14:35:33 +03:00
gdlbo 26007f97f3 Amoled monet accent + color fixes 2022-05-10 14:11:14 +03:00
gdlbo 5a55cca59d Disabled stats.track*** 2022-05-10 13:53:14 +03:00
gdlbo cb425fd18e Fixed vk cringe refl 2022-05-10 13:26:00 +03:00
gdlbo 5889dc675e Beautify code 2022-05-07 18:31:07 +03:00
gdlbo df8e7e4b54 Deleted unused code 2022-05-07 11:16:22 +03:00
gdlbo e07d253a5e Decrypt 2022-05-06 14:50:02 +03:00
gdlbo 81f4e6503a Fixes 2022-05-06 14:05:23 +03:00
gdlbo d7ff250faf Undelete feature + fixes 2022-05-06 13:43:42 +03:00
gdlbo 1d12a5f171 Merge branch 'master' of https://github.com/vtosters/lite 2022-05-06 01:58:35 +03:00
gdlbo 485d3d884a Encryption + Undelete code base 2022-05-06 01:57:33 +03:00
gdlbo e78754e39e color fixes 2022-05-04 16:41:59 +03:00
gdlbo 0b6c11f0d0 Fixed crash 2022-05-04 14:23:25 +03:00
gdlbo d25604ed66 Added proxy user/pass auth 2022-05-04 13:12:39 +03:00
gdlbo 4f3167064c Update README.md 2022-05-03 23:45:37 +03:00
gdlbo f0d4bec116 Updated build gradle 2022-05-03 22:19:23 +03:00
gdlbo 76a1872f74 Merge remote-tracking branch 'origin/master' 2022-05-03 22:11:35 +03:00
gdlbo 1158cb4aeb Fix 2022-05-03 22:11:19 +03:00
Vologhat 41ab384e1f fix #204 (null pointer while account deleting) 2022-05-02 18:07:04 +03:00
gdlbo 3839e721db Fix dockbar issue 2022-05-02 13:30:51 +03:00
gdlbo d1b84461e6 Fixed store stickers colors 2022-05-02 12:54:58 +03:00
gdlbo 3c79cb3ef5 Reworked some about menu 2022-05-02 12:40:57 +03:00
gdlbo ea7641278a Disabled anim stickers 2022-05-02 12:31:30 +03:00
gdlbo 23032e8409 Fixed bug with new feed design 2022-05-02 11:03:39 +03:00
gdlbo 1d687a01c1 Fixes + new update feed logic 2022-05-02 10:44:57 +03:00
gdlbo 0b751964fa Oh sh*t I am sorry (for refactoring) 2022-05-02 09:44:30 +03:00
gdlbo 59eb43c33f Color fixes 2022-04-30 14:25:40 +03:00
gdlbo dfdb056e07 Refactoring + renaming 2022-04-30 13:48:04 +03:00
gdlbo cd38eba184 Refactoring + renaming 2022-04-30 13:17:32 +03:00
gdlbo a4063b978f Updated README.md + version null fix 2022-04-29 22:22:07 +03:00
gdlbo af51775844 Github Actions test 2022-04-29 21:51:56 +03:00
gdlbo f4039abae3 Github Actions test 2022-04-29 21:48:08 +03:00
gdlbo 1b64f46588 gh actions test 3 2022-04-29 21:42:51 +03:00
gdlbo ad40368639 gh actions test 2 2022-04-29 21:38:24 +03:00
gdlbo d15159d9b0 fix 2022-04-29 21:29:20 +03:00
gdlbo c837f6eacc gh actions test 2022-04-29 21:27:25 +03:00
gdlbo 14b884daf7 Updated README.md 2022-04-29 20:56:14 +03:00
gdlbo 63ca14bbe6 color fixes 2022-04-29 16:49:30 +03:00
gdlbo 2605566f90 color fixes 2022-04-28 22:02:35 +03:00
gdlbo 0bcd59d5ba color fixes 2022-04-28 21:56:54 +03:00
gdlbo a9744bb577 Some fixes 2022-04-28 21:21:20 +03:00
gdlbo 9b4dae4af5 Clean up code 2022-04-28 21:11:04 +03:00
gdlbo 319d657ab4 Fixes 2022-04-28 20:57:57 +03:00
gdlbo d9896257c5 Backup system fixes 2022-04-28 19:07:11 +03:00
gdlbo b5d5e85ee2 Reset/Save prefs system init 2022-04-28 18:29:31 +03:00
gdlbo 9dcaddd7fd Reset/Save prefs system init 2022-04-28 18:29:21 +03:00
gdlbo d1bec2e815 fixes 2022-04-27 23:06:43 +03:00
gdlbo 96d7f28db9 fixes for music popup 2022-04-27 21:34:14 +03:00
gdlbo 90c4ca88e0 https://github.com/vtosters/lite/issues/181 + color fixes for tabs 2022-04-27 21:09:29 +03:00
gdlbo 942fe202d7 Fixed crash
https://github.com/vtosters/lite/issues/192
2022-04-27 20:29:18 +03:00
gdlbo e17f888598 Deleted exit button :) 2022-04-27 20:25:29 +03:00
gdlbo b089c7d7f9 Added debug feature for clear all sticks cache 2022-04-27 20:15:47 +03:00
gdlbo afc2a5b258 Fixed pic theme 2022-04-27 20:08:23 +03:00
gdlbo 1f0adb7510 Fixed header coloring 2022-04-27 19:37:48 +03:00
gdlbo aba62966b0 Max tabs updated 2022-04-26 14:28:37 +03:00
gdlbo aaff05685c Updated icons 2022-04-25 19:37:14 +03:00
gdlbo 9c1bbab253 Fixed msg strange bug + fixes 2022-04-25 17:24:13 +03:00
gdlbo def1c699e0 Improved Dark theme 2022-04-25 16:47:43 +03:00
gdlbo e6639a63b7 Improved player progress color 2022-04-25 16:31:02 +03:00
gdlbo 1b14761e9e Refactored vkui injector + added headers coloring 2022-04-25 15:51:07 +03:00
gdlbo 07a070a4fe Monet fixes 2022-04-25 14:23:18 +03:00
gdlbo 8b13fcfd68 Update preferences_themes.xml 2022-04-24 22:44:06 +03:00
gdlbo 4088ea68fa Update DockBarManager.java 2022-04-24 22:32:39 +03:00
gdlbo 2e95ed13ce Improved dark theme 2022-04-24 19:22:35 +03:00
gdlbo f79091bc9c added more info + reformated xml 2022-04-24 18:42:17 +03:00
gdlbo ebfc19c1f7 Update ThemesFragment.java 2022-04-24 18:28:12 +03:00
gdlbo bdb8f3cf6f Improved Theme changing 2022-04-24 18:16:24 +03:00
gdlbo 4b998f2b97 fixed comments 2022-04-24 17:57:26 +03:00
gdlbo aa1d254a49 Fixes + Added comments sorting 2022-04-24 17:43:02 +03:00
gdlbo 897b3300e6 fixes 2022-04-24 16:58:17 +03:00
gdlbo 9c6c9489ff Oh, fixes?
-Added styles list for dark and light themes
-Updated libs
-Auto refactored resources for easy editing
-Improved amoled theme
2022-04-23 21:36:08 +03:00
gdlbo 6d147b081e Improved Amoled Theme 2022-04-23 00:03:37 +03:00
gdlbo 78432057ca Revert "Improved navbar coloring"
This reverts commit 21b0ed8925.
2022-04-22 23:01:45 +03:00
gdlbo 21b0ed8925 Improved navbar coloring 2022-04-22 19:29:18 +03:00
gdlbo 1040e50b32 Update preferences_themes.xml 2022-04-22 18:59:48 +03:00
gdlbo 3806a05f4a Amoled Theme feature 2022-04-22 18:51:42 +03:00
gdlbo 82d45915c6 Improved Amoled Theme + Added support for SSFS 2022-04-22 18:04:56 +03:00
gdlbo 80e5145742 Amoled Theme Styles for VKIM + fixed vk refl 2022-04-22 17:39:37 +03:00
gdlbo f1b7a52f0c Test Amoled Theme Styles + Updated R.java 2022-04-22 17:03:41 +03:00
gdlbo 924952128f Updated Libs 2022-04-22 16:08:23 +03:00
gdlbo 2fcd04a55f Updated gradle + amoled inject 2022-04-22 14:07:56 +03:00
gdlbo deb6e86854 Improved dark theme 2022-04-16 18:41:11 +03:00
gdlbo 086fa37e86 Fixed bot keyboard 2022-04-16 17:58:12 +03:00
gdlbo e87ecf2f4f Custom load of msg 2022-04-16 01:56:12 +03:00
gdlbo 3dc01dd945 Fixed all issues with msgs 2022-04-16 00:23:32 +03:00
gdlbo da21999192 Fixed video downloading 2022-04-16 00:01:21 +03:00
gdlbo 161efaeb52 Downgraded msg api 2022-04-15 23:41:18 +03:00
gdlbo 1759fbe8d5 Zaborona fix 2022-04-15 23:40:06 +03:00
gdlbo b1525266a8 Improved dark theme 2022-04-12 17:34:09 +03:00
gdlbo 28ede39c26 Fixed vk refl 2022-04-12 16:37:52 +03:00
gdlbo 6b25eb37ba Fixed msg loading null 2022-04-12 15:07:35 +03:00
gdlbo e12dcdf86a Fixed strange twitter crash 2022-04-12 13:49:11 +03:00
gdlbo 4bab1490ae Fixed strange statusbar coloring 2022-04-12 13:29:32 +03:00
gdlbo 2374785ae7 Improved white theme 2022-04-12 13:17:45 +03:00
gdlbo b338da4359 Fixed crash 2022-04-11 22:56:11 +03:00
gdlbo d808f453d9 haha bruh dev->beta
1989 китай ничего не было
2022-04-11 22:38:51 +03:00
gdlbo b869f713eb Fixed bugs 2022-04-11 22:22:13 +03:00
gdlbo 2f9cf4751d Improved dark theme 2022-04-11 21:46:32 +03:00
gdlbo 6c7e796e17 deleted confidential logging 2022-04-11 21:12:00 +03:00
gdlbo ff40c7e576 Update MultiAccountAdapter.java 2022-04-11 21:10:16 +03:00
gdlbo 0ccc8b2607 fixes + disabled debuggable mode 2022-04-11 21:07:08 +03:00
Vologhat 8febcfdfb7 update multi account 2022-04-11 20:57:52 +03:00
gdlbo 9d05d077b5 Improved dark theme 2022-04-11 16:27:10 +03:00
gdlbo 63ad926078 Improved coloring 2022-04-11 14:24:50 +03:00
gdlbo e241848426 Msg fixes 2022-04-11 01:23:12 +03:00
gdlbo a82b652bc1 Fixes 2022-04-11 01:01:08 +03:00
gdlbo e59aecdc75 FIxed authactiviry cringe accent color on sdk31+ 2022-04-11 00:54:21 +03:00
gdlbo e56ba6b41a Improved dark theme 2022-04-11 00:29:28 +03:00
gdlbo cfd12483ae Improved dark theme 2022-04-11 00:13:21 +03:00
gdlbo fd18837f1b Deleted new video feature 2022-04-10 23:54:53 +03:00
gdlbo 4f3e37349d Improved dark theme 2022-04-10 23:47:51 +03:00
gdlbo 20653847f4 Improved dark theme 2022-04-10 23:10:12 +03:00
gdlbo 3e294a3ba4 Improved dark theme 2022-04-10 22:52:05 +03:00
gdlbo 20ca6f96f9 multiaccount fixes 2022-04-10 22:00:21 +03:00
Vologhat 70a30a5f33 multi account refactoring 2022-04-10 20:17:47 +03:00
gdlbo b9f170e668 Improved dark theme 2022-04-10 19:53:51 +03:00
gdlbo 809dfbe338 Update Prefs.java 2022-04-10 19:02:23 +03:00
Vologhat af25a82eca fix notifications updater 2022-04-10 16:08:08 +03:00
gdlbo 50b1fcadb4 Update InterfaceFragment.java 2022-04-09 20:40:06 +03:00
gdlbo aefe1b2f07 Improved dark theme 2022-04-09 19:28:53 +03:00
gdlbo 28bc30bd83 Improved dark theme 2022-04-09 18:26:11 +03:00
gdlbo 0aeffcd79d Improved dark theme 2022-04-09 17:57:00 +03:00
gdlbo f3863811bd Improved dark theme 2022-04-09 16:50:33 +03:00
gdlbo e4aab2fd15 Improved dark theme 2022-04-08 21:58:08 +03:00
gdlbo 5f72a6b855 Improved dark theme 2022-04-08 21:29:00 +03:00
gdlbo 31a0444409 Improved dark theme 2022-04-08 20:45:47 +03:00
gdlbo 4522935545 Improved dark theme 2022-04-08 15:03:42 +03:00
gdlbo 67c13bd416 Improved dark theme 2022-04-08 13:46:35 +03:00
gdlbo 28d5af5fa0 Improved dark theme 2022-04-08 13:31:09 +03:00
gdlbo 15d7e71e7f Improved dark theme 2022-04-08 13:14:44 +03:00
gdlbo 49bac975d2 Fixed crash crop 2022-04-08 11:57:33 +03:00
gdlbo 3878c9a1e2 Fixed installing app 2022-04-07 20:43:15 +03:00
gdlbo a5053c4418 Fixed win script 2022-04-07 20:30:26 +03:00
gdlbo 4cb844dea8 Fixed win script 2022-04-07 20:28:38 +03:00
gdlbo 04afad2fd3 Updated keystore 2022-04-07 19:47:02 +03:00
gdlbo 149efe3199 Fixed versioning null 2022-04-07 19:44:20 +03:00
gdlbo 6f05867563 Updated scripts 2022-04-07 19:15:46 +03:00
gdlbo 4442fd3265 Updated README.md 2022-04-07 19:10:11 +03:00
gdlbo 6e49856474 Fixed podcasts colors 2022-04-07 18:55:01 +03:00
gdlbo cc379b71de Added old icons feature 2022-04-07 18:40:04 +03:00
gdlbo c2a1bb4a5a Improved external video link parser 2022-04-07 18:23:57 +03:00
gdlbo cc58c33e37 Disabled monet coloring for dockbar 2022-04-07 17:38:52 +03:00
gdlbo 012f03f7e7 Fixed some color issues 2022-04-07 17:32:52 +03:00
gdlbo 28a7a3c389 Fixed some color issues 2022-04-07 16:44:55 +03:00
gdlbo 6417279d65 Fixed miniplayer text color issues 2022-04-07 15:30:39 +03:00
gdlbo 07db680ad3 Fixed settings stickers color issues 2022-04-07 15:26:02 +03:00
gdlbo d7c97b6589 Fixed docs text color issue 2022-04-07 15:01:51 +03:00
gdlbo af12289d7e Fixed a11+ issue 2022-04-07 14:55:34 +03:00
gdlbo afeafba67d Fixed crash 2022-04-07 13:54:15 +03:00
gdlbo f56e49da5c Fixed crash on sdk31+ 2022-04-07 13:17:17 +03:00
gdlbo d233897c73 Deleted libverify button 2022-04-04 20:45:48 +03:00
gdlbo 273f1c3d07 Fixed crash 2022-04-04 20:34:38 +03:00
gdlbo d34812b77b Update LinkProcessor1.smali 2022-04-03 18:30:23 +03:00
Vologhat 375a60bafc fix recycler view wrong resizing 2022-04-03 17:09:59 +03:00
gdlbo 156bd57461 Update DockBarManager.java 2022-04-03 14:15:12 +03:00
gdlbo dacc1b8eeb Update DockBarManager.java 2022-04-03 14:05:08 +03:00
gdlbo b3bb023852 Update StandartFilter.txt 2022-04-03 13:44:58 +03:00
gdlbo 8ca8272bc4 Fixed crash
https://github.com/vtosters/lite/issues/103
2022-04-03 13:17:55 +03:00
Vologhat fc36f7ad77 add saving and resetting 2022-04-03 12:26:17 +03:00
Vologhat 496bdf5b54 fix dockbar tabs limit 2022-04-03 12:23:42 +03:00
gdlbo 877d625945 Fixes fixes fixes 2022-04-02 23:53:54 +03:00
gdlbo 458710e9f0 Fixes dockbar 2022-04-02 23:41:20 +03:00
gdlbo fa6e7e44a0 Fixes 2022-04-02 22:30:51 +03:00
gdlbo bc12220d7a Merge branch 'master' of https://github.com/vtosters/lite 2022-04-02 22:05:09 +03:00
gdlbo 9d7b879e1f Some improvements 2022-04-02 22:04:16 +03:00
Vologhat e4ff8a169b add outline icons 2022-04-02 22:00:04 +03:00
Vologhat 5a62aea978 add inability to unselect menu tab 2022-04-02 22:00:04 +03:00
Vologhat b4d9de74c3 add possibility to choice alternative fragments for "news" and "discover" 2022-04-02 22:00:04 +03:00
Vologhat aa37d8b4b3 level down min tabs count 2022-04-02 22:00:04 +03:00
Vologhat e334bc6440 fix color palette and tab items 2022-04-02 22:00:04 +03:00
Vologhat 9f6b9923b0 fix dockbar 2022-04-02 22:00:04 +03:00
Vologhat 85415ae7fc add dockbar injector 2022-04-02 22:00:03 +03:00
Vologhat f5382e9649 migration to android support due to androidx instability 2022-04-02 22:00:03 +03:00
Vologhat 3ca786b820 докбар 2022-04-02 22:00:03 +03:00
gdlbo c13908f096 Updated README.md 2022-04-02 22:00:02 +03:00
gdlbo d11de94e0b Updated README.md https://github.com/vtosters/lite/pull/89 2022-04-02 22:00:02 +03:00
Daniil Isakov e2c10f7e87 Grammar check, a bit of rephrasing 2022-04-02 22:00:02 +03:00
gdlbo b05c717981 updated multiacc 2022-04-02 22:00:02 +03:00
gdlbo 38db5dfee4 updated adblock filter 2022-04-02 22:00:02 +03:00
gdlbo 151eeb5ec1 updated resources + R.java again 2022-04-02 22:00:02 +03:00
gdlbo 0d150765b8 translation fixes 2022-04-02 22:00:02 +03:00
gdlbo cd6ee3048c Updated R.java + some fixes 2022-04-02 22:00:02 +03:00
gdlbo 0ed9e62283 Added multi account feature 2022-04-02 22:00:02 +03:00
gdlbo fdb89fbf64 Improved adblock 2022-04-02 22:00:02 +03:00
gdlbo 3fd11831f6 Improvements of multiacc + added migrating from old type of accounts to new type 2022-04-02 22:00:01 +03:00
gdlbo cd81fc8b38 Improvements of multiacc + deleted old accs xD 2022-04-02 22:00:01 +03:00
gdlbo b512b7d5f7 Improvements of multiacc 2022-04-02 22:00:01 +03:00
gdlbo 883cb34bdb Multiaccount impl test 2022-04-02 22:00:01 +03:00
gdlbo c683947d20 fixed picker crash 2022-04-02 22:00:01 +03:00
gdlbo 483204a811 Updated README.md 2022-04-01 19:05:57 +03:00
gdlbo 0b5b7bcae2 Updated README.md https://github.com/vtosters/lite/pull/89 2022-04-01 18:56:52 +03:00
gdlbo e1d517f9c2 Merge pull request #84 from oplexz/patch-1 2022-04-01 09:53:41 +03:00
Daniil Isakov b80b869823 Grammar check, a bit of rephrasing 2022-04-01 09:40:25 +03:00
gdlbo 386a6cbb6c updated multiacc 2022-04-01 08:43:52 +03:00
gdlbo 9ce4c0ee90 updated adblock filter 2022-04-01 08:39:04 +03:00
gdlbo 1351b5ff90 updated resources + R.java again 2022-03-31 21:09:42 +03:00
gdlbo 84960a6107 translation fixes 2022-03-31 20:41:10 +03:00
gdlbo 5d3fdc0abd Updated R.java + some fixes 2022-03-31 20:19:28 +03:00
gdlbo 0d491f0d41 Added multi account feature 2022-03-31 19:22:37 +03:00
gdlbo 955ae91110 Improved adblock 2022-03-30 18:03:52 +03:00
gdlbo 85fa63d2a1 Improvements of multiacc + added migrating from old type of accounts to new type 2022-03-30 17:16:23 +03:00
gdlbo 6d8f02435e Improvements of multiacc + deleted old accs xD 2022-03-30 17:01:50 +03:00
gdlbo fc0600dfd8 Improvements of multiacc 2022-03-30 14:51:50 +03:00
gdlbo 1494579353 Multiaccount impl test 2022-03-30 00:22:49 +03:00
gdlbo 834d7e1da1 fixed picker crash 2022-03-28 10:13:12 +03:00
gdlbo 08b64834cf Update SettingsListFragment$b.smali 2022-03-27 21:12:45 +03:00
Vologhat 8265c5adec fix script for windows 2022-03-27 20:31:31 +03:00
gdlbo be4f2398a9 fixed compilation on windows 2022-03-27 18:04:47 +03:00
gdlbo b8f2d36f5e fixed compilation on windows 2022-03-27 18:01:02 +03:00
aliveoutside 49a2526528 fix icons in dropdown menu in newsfeed 2022-03-27 12:19:11 +03:00
aliveoutside a755d3d55e fix text color in dropdown menu in newsfeed 2022-03-27 12:19:11 +03:00
gdlbo 41a6ddb62a fixed proxy issue 2022-03-27 11:50:14 +03:00
gdlbo e32acd17ba fixed video catalog issue 2022-03-27 11:40:32 +03:00
gdlbo 0de0add858 fixed pic edit crash 2022-03-27 11:35:30 +03:00
gdlbo 9a90ca4c53 Fix doc upload crash 2022-03-26 23:38:53 +03:00
gdlbo 86b1fa6276 Fix graffiti crash 2022-03-26 23:15:47 +03:00
gdlbo 08d5fb50a7 Updated shit Filter 2022-03-26 22:57:17 +03:00
gdlbo 6fca7c7940 Updated ADBlock Filter + new test filter 2022-03-26 22:41:07 +03:00
gdlbo fad14b26b6 Updated ADBlock Filter 2022-03-26 21:37:17 +03:00
gdlbo d33fe6e185 Now some new features are enabled by default 2022-03-26 21:32:24 +03:00
gdlbo a1db85e50f updated README.md 2022-03-26 21:25:43 +03:00
gdlbo e67f1a649c fixed some color issues 2022-03-26 21:16:15 +03:00
gdlbo e88fe21802 fixed some crashes and other problems 2022-03-26 21:07:27 +03:00
gdlbo 21875b8dd5 fixed some issues 2022-03-26 20:38:38 +03:00
aliveoutside 8f4c6a5b32 fix animated stickers 2022-03-26 19:59:29 +03:00
gdlbo ba696abe0c fixed some issues 2022-03-26 17:43:49 +03:00
gdlbo 7f32d8d136 updated prefs 2022-03-26 17:03:58 +03:00
gdlbo e0af365ef3 updated README.md 2022-03-26 16:52:38 +03:00
gdlbo caa85cef49 updated debug 2022-03-26 16:44:55 +03:00
gdlbo 0cb6902519 updated README.md 2022-03-26 16:28:15 +03:00
gdlbo 7226473dcb Improvements + updated R.java and README.md 2022-03-26 16:27:02 +03:00
aliveoutside 222fdf51b5 fix pinned dialogs loading 2022-03-26 16:17:37 +03:00
aliveoutside 381ba0f69a fix "popular" videos 2022-03-26 15:44:24 +03:00
gdlbo e4170b5f16 libverify preference 2022-03-25 19:43:52 +03:00
gdlbo 81294ac9be fix fix 2fa auth........ 2022-03-25 19:15:28 +03:00
gdlbo 5ae0110153 fixed versioning on macos/linux 2022-03-25 18:45:11 +03:00
gdlbo 930c2ef9bb fixed versioning on macos/linux 2022-03-25 18:30:26 +03:00
gdlbo f109fb33d0 updated README.md 2022-03-25 17:51:00 +03:00
gdlbo eae4f99b34 added bug report button 2022-03-25 17:28:14 +03:00
gdlbo 241f0bec43 fixed ssfs domain 2022-03-25 16:52:36 +03:00
gdlbo 01ea68560f fix Jetifier 2022-03-25 16:45:49 +03:00
gdlbo 03ae42c98a fixed 2fa, fixed some issues with proxy, deleted xtrafrancyz proxy, fixed compiling, some other fixes 2022-03-25 16:42:25 +03:00
aliveoutside ab060b0981 update framework and add apksigner.jar 2022-03-25 16:16:13 +03:00
aliveoutside 89ef96f2b4 fix crash when music download button clicked 2022-03-24 22:31:43 +03:00
aliveoutside b7a1af9f64 fix serverside features 2022-03-24 22:30:52 +03:00
aliveoutside 102db1f46d Update README.md 2022-03-24 19:59:23 +03:00
aliveoutside cc35404c7f Update README.md 2022-03-24 19:41:44 +03:00
aliveoutside c07fccf607 init 2022-03-24 19:37:43 +03:00
1460 changed files with 28937 additions and 10483 deletions
-27
View File
@@ -1,27 +0,0 @@
---
name: Bug Report
about: Заготовка для репорта багов
title: Ошибка обновлении ленты новостей
labels: bug
assignees: ''
---
**Опишите сам баг**
При обновлении новостей вылезает ошибка
**Опишите действия для воспроизведения ошибки**
1. Обновил ленту интересных новостей
2. Пролистал до конца страницы
**Опишите ожидаемый результат**
Интересная лента должна прогружать результаты
**Скриншот ошибки**
**Информация об устройстве:**
- Устройство: Samsung Galaxy J1 Mini
- OS: Android 9 | OneUi 3.0
- Коммит: fa12e8f (В О Приложении написана версия коммита)
**Дополнительная информация о баге или мыслях почему оно может происходить (если есть)**
-15
View File
@@ -1,15 +0,0 @@
---
name: Feature request
about: Предложение функции
title: Улучшение голосовых сообщений
labels: enhancement
assignees: ''
---
**Опишите вашу идею максимально подробно и понятно**
Необходима функция улучшения голосовых сообщений. Она значительно улучшит запись голосовых сообщений и собеседнику будет лучше слышно меня
**Опишите возможное решение/реализацию функции (если понимаете как это можно реализовать на Java/C++)**
**Остальные мысли о предложенной функции**
+1 -5
View File
@@ -66,7 +66,6 @@
* Округление чисел * Округление чисел
* Сокращение постов **(Показать полностью)** * Сокращение постов **(Показать полностью)**
* Результаты опросов без участия * Результаты опросов без участия
* Возможность указывать папку для загрузки фото/видео/музыки/всего
* Интеграция с <a href="https://www.last.fm/">LAST.FM</a> (а также возможность скробблинга) * Интеграция с <a href="https://www.last.fm/">LAST.FM</a> (а также возможность скробблинга)
* Новый раздел музыки * Новый раздел музыки
* Возможность скачивать видео * Возможность скачивать видео
@@ -91,7 +90,6 @@
* Возможность видеть онлайн пользователей, если у вас скрыт онлайн через VK Messenger * Возможность видеть онлайн пользователей, если у вас скрыт онлайн через VK Messenger
* Отключить уведомление о том, что вы сделали скриншот в беседе * Отключить уведомление о том, что вы сделали скриншот в беседе
* Отключение редиректа через away.php * Отключение редиректа через away.php
* Отключение отправки метрики
* Внешний вид * Внешний вид
* **Milkshake** тема (дизайн новых версий ВК) * **Milkshake** тема (дизайн новых версий ВК)
* Название заголовков в докбаре * Название заголовков в докбаре
@@ -105,10 +103,8 @@
* Возможность отключить блок историй наверху ленты * Возможность отключить блок историй наверху ленты
* Возможность отключить боковую камеру в разделе «Новости» * Возможность отключить боковую камеру в разделе «Новости»
* Возможность отключить блок «Что у вас нового?» в разделе «Новости» * Возможность отключить блок «Что у вас нового?» в разделе «Новости»
* Возможность показывать лайки у постов справа * Возможность менять раздел, который запускается при запуске
* Возможность менять стартовый раздел при запуске приложения
* Анимации фрагментов * Анимации фрагментов
* Возможность изменять размер закругления картинок (аватарок и прочего)
* Возможность отключить редизайн видеопостов * Возможность отключить редизайн видеопостов
* Возможность отключить блок миниаппов/VK Pay/Superapp * Возможность отключить блок миниаппов/VK Pay/Superapp
* Возможность отключить сокращение названий разделов в меню * Возможность отключить сокращение названий разделов в меню
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
5df53281cbfd1b6caf676bd10d2a403361a2904b
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,6 @@ import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import ru.vtosters.lite.utils.AndroidUtils;
/** /**
* Created by Aefyr on 20.05.2018. * Created by Aefyr on 20.05.2018.
@@ -40,7 +39,7 @@ public class NotificationsHelper {
downloadingPacksNotificationsIds = new HashMap<>(); downloadingPacksNotificationsIds = new HashMap<>();
if (oreo()) { if (oreo()) {
NotificationChannel notificationChan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, AndroidUtils.getString("telegram_stickers_service"), NotificationManager.IMPORTANCE_HIGH); NotificationChannel notificationChan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "Сервис стикеров Telegram в VTosters", NotificationManager.IMPORTANCE_HIGH);
((NotificationManager) c.getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChan); ((NotificationManager) c.getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChan);
} }
} }
@@ -50,8 +49,8 @@ public class NotificationsHelper {
downloadingPacksNotificationsIds.put(pack, notificationId); downloadingPacksNotificationsIds.put(pack, notificationId);
Notification.Builder builder = commonBuilder(); Notification.Builder builder = commonBuilder();
builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + AndroidUtils.getString("telegram_stickers_downloading") : pack.title + AndroidUtils.getString("telegram_stickers_updating")); builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + ": загрузка" : pack.title + ": обновление");
builder.setContentText(AndroidUtils.getString("telegram_stickers_gettinginfo")); builder.setContentText("Получение информации");
builder.setOngoing(true); builder.setOngoing(true);
manager.notify(notificationId, builder.build()); manager.notify(notificationId, builder.build());
@@ -64,7 +63,7 @@ public class NotificationsHelper {
lastNotificationTime.set(System.currentTimeMillis()); lastNotificationTime.set(System.currentTimeMillis());
Notification.Builder builder = commonBuilder(); Notification.Builder builder = commonBuilder();
builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + AndroidUtils.getString("telegram_stickers_downloading") : pack.title + AndroidUtils.getString("telegram_stickers_updating")); builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + ": загрузка" : pack.title + ": обновление");
builder.setContentText(downloadProgress + "/" + pack.stickersCount); builder.setContentText(downloadProgress + "/" + pack.stickersCount);
builder.setProgress(pack.stickersCount, downloadProgress, false); builder.setProgress(pack.stickersCount, downloadProgress, false);
builder.setOngoing(true); builder.setOngoing(true);
@@ -78,13 +77,13 @@ public class NotificationsHelper {
Notification.Builder builder = commonBuilder(); Notification.Builder builder = commonBuilder();
builder.setProgress(0, 0, false); builder.setProgress(0, 0, false);
builder.setOngoing(false); builder.setOngoing(false);
builder.setContentTitle(AndroidUtils.getString("telegram_stickers_service")); builder.setContentTitle("Сервис стикеров Telegram в VTosters");
String text; String text;
if (success) if (success)
text = wasUpdate ? pack.title + AndroidUtils.getString("telegram_stickers_updated") : pack.title + AndroidUtils.getString("telegram_stickers_downloaded"); text = wasUpdate ? pack.title + " успешно обновлен" : pack.title + " успешно загружен";
else else
text = wasUpdate ? pack.title + AndroidUtils.getString("telegram_stickers_error_update") : pack.title + AndroidUtils.getString("telegram_stickers_error_download"); text = wasUpdate ? pack.title + ": ошибка при обновлении" : pack.title + ": ошибка при загрузке";
if (e instanceof TelegramStickersGrabber.TSGException) { if (e instanceof TelegramStickersGrabber.TSGException) {
text = pack.title + ": " + e.getMessage(); text = pack.title + ": " + e.getMessage();
@@ -0,0 +1,51 @@
package com.vk.core.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
public class VKLayoutInflater extends LayoutInflater {
private final static String[] DEFAULT_PACKAGES = {
"android.widget.", "android.webkit.", "android.app."
};
public VKLayoutInflater(LayoutInflater original, Context context) {
super(original, context);
}
@Override
public LayoutInflater cloneInContext(Context newContext) {
return new VKLayoutInflater(this, newContext);
}
public final View createView(View parent, String name, Context context, AttributeSet attrs) {
if (!name.startsWith("android.")) {
try {
return onCreateView(parent, name, attrs);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
try {
return createView(name, null, attrs);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return null;
}
@Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
for (var defPackage : DEFAULT_PACKAGES) {
try {
View view = createView(name, defPackage, attrs);
if (view != null) return view;
} catch (ClassCastException | ClassNotFoundException ignored) {
}
}
return super.onCreateView(name, attrs);
}
}
@@ -0,0 +1,119 @@
package com.vk.core.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebView;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.SwitchCompat;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.OsUtil;
import com.vk.core.view.NavigationSpinner;
import com.vk.core.view.TextViewColorStateListAndAlphaSupportPreV23;
import com.vk.core.view.VKAppBarLayout;
public class VKUILayoutFactory implements LayoutInflater.Factory2 {
private final static int[] FONT_ATTR = { android.R.attr.font };
private AppCompatDelegate mDelegate;
private VKLayoutInflater mInflater;
public VKUILayoutFactory(AppCompatDelegate delegate, VKLayoutInflater inflater) {
mDelegate = delegate;
mInflater = inflater;
}
private void setTypeface(TextView textView, Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, FONT_ATTR, android.R.attr.textViewStyle, 0);
if (ta == null) return;
Font font = Font.Companion.a(ta.getString(0));
if (font != null && Build.VERSION.SDK_INT < font.a())
textView.setTypeface(font.c());
ta.recycle();
}
@Nullable
@Override
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
View view = null;
try {
if (!(parent instanceof NavigationSpinner) && !OsUtil.b())
view = new TextViewColorStateListAndAlphaSupportPreV23(context, attrs, 0);
else if (mDelegate != null)
view = mDelegate.createView(parent, name, context, attrs);
else if (mInflater != null)
view = mInflater.createView(parent, name, context, attrs);
} catch (Throwable unused) {
throw new InflateException(
"parent=" + parent.getClass().getName()
+ ":" + getResourceIdName(view)
+ ", view=" + name
+ ":" + getResourceIdName(context, attrs));
}
if (view == null &&
("com.google.android.material.appbar.AppBarLayout".equals(name)
|| "android.support.design.widget.AppBarLayout".equals(name)))
view = new VKAppBarLayout(context, attrs);
if (view != null) {
if (!(view.getTag() instanceof String)) {
if (view instanceof TextView) {
setTypeface((TextView) view, context, attrs);
if (view instanceof CheckBox)
VKThemeHelper.k.a((CheckBox) view);
else if (view instanceof RadioButton)
VKThemeHelper.k.a((RadioButton) view);
else if (view instanceof SwitchCompat)
VKThemeHelper.k.a((SwitchCompat) view);
else if (view instanceof Switch)
VKThemeHelper.k.a((Switch) view);
} else if (view instanceof WebView) {
VKThemeHelper.a((WebView) view);
}
VKThemeHelper.k.a(view, attrs);
}
}
return view;
}
private String getResourceIdName(View view) {
try {
if (view != null) {
if (view.getId() != -1)
return view.getResources().getResourceName(view.getId());
return "NO_ID";
}
return "null";
} catch (Throwable unused) {
return "FAILED_TO_GET_ID";
}
}
private String getResourceIdName(Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.id });
int resId = ta.getResourceId(0, -1);
ta.recycle();
return resId != -1
? context.getResources().getResourceName(resId)
: "NO_ID";
}
@Nullable
@Override
public View onCreateView(@NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
return onCreateView(null, name, context, attrs);
}
}
@@ -1,225 +0,0 @@
package com.vk.core.util;
import static ru.vtosters.lite.utils.Preferences.getDownloadsDir;
import static ru.vtosters.lite.utils.Preferences.getMusicDir;
import static ru.vtosters.lite.utils.Preferences.getPhotosDir;
import static ru.vtosters.lite.utils.Preferences.getVideosDir;
import android.annotation.SuppressLint;
import android.app.DownloadManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import com.facebook.common.i.MediaUtils;
import com.facebook.x.g.EncodedImage;
import com.vk.core.concurrent.VkExecutors;
import com.vk.imageloader.VKImageLoader;
import com.vk.log.L;
import com.vk.metrics.eventtracking.VkTracker;
import com.vtosters.lite.R;
import java.io.File;
import java.io.InputStream;
import java.net.URI;
import java.util.HashSet;
import b.h.g.m.CameraUtils;
import b.h.g.m.FileUtils;
public class DownloadUtils {
public static final HashSet<Long> a = new HashSet<>();
public static void a(Context context, String str, String str2) {
a(context, str, str2, false);
}
public static void b(Context context, String str, String str2) {
a(context, str, str2, true);
}
private static void a(Context context, String str, String str2, boolean z) {
try {
b(context, str, str2, z);
} catch (Exception e2) {
L.d(e2);
ToastUtils.a(context.getString(R.string.error) + " [" + e2.getMessage() + "]");
}
}
private static void b(final Context context, String str, String str2, boolean z) {
if (TextUtils.isEmpty(str2)) {
return;
}
String file = a(str, str2);
File b2;
boolean c2 = MediaUtils.c(MediaUtils.b(str2));
if (file.endsWith(".jpg") || file.endsWith(".png") || file.endsWith(".jpeg")) {
b2 = new File(getPhotosDir(), file);
} else if (file.endsWith(".mp3") || file.endsWith(".wav") || file.endsWith(".ogg") || file.endsWith(".aac") || file.endsWith(".flac") || file.endsWith(".m4a")) {
b2 = new File(getMusicDir(), file);
} else if (file.endsWith(".mp4") || file.endsWith(".mkv") || file.endsWith(".avi") || file.endsWith(".flv") || file.endsWith(".wmv") || file.endsWith(".mov") || file.endsWith(".3gp")) {
b2 = new File(getVideosDir(), file);
} else {
b2 = new File(getDownloadsDir(), file);
}
if (c2) {
EncodedImage c3 = VKImageLoader.c(Uri.parse(str2));
final InputStream h = c3 == null ? null : c3.h();
if (h != null) {
try {
if (b2.getParentFile() != null) {
b2.createNewFile();
}
if (b2.exists()) {
VkExecutors.x.a().execute(() -> ToastUtils.a(context.getString(R.string.file_saved, b2.getAbsoluteFile())));
}
} catch (Exception e2) {
L.a(e2);
}
CameraUtils.a(context, b2, null);
return;
}
}
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(str2));
request.setDestinationUri(Uri.fromFile(b2));
request.setMimeType(FileUtils.f(new File(str)));
request.setNotificationVisibility(1);
request.allowScanningByMediaScanner();
request.setTitle(str);
DownloadManager a2 = a(context);
if (a2 == null) {
return;
}
try {
long enqueue = a2.enqueue(request);
if (!z) {
return;
}
a.add(enqueue);
} catch (IllegalArgumentException e3) {
L.a(e3);
b(context);
}
}
private static String a(String str, String str2) {
String lastPathSegment = Uri.parse(str2).getLastPathSegment();
if (!TextUtils.isEmpty(str)) {
String replace = str.replace('/', '_');
return !replace.contains(".") ? lastPathSegment : replace;
}
return lastPathSegment;
}
@SuppressLint("Range")
public static boolean a(Context context, Uri uri) {
try {
Cursor query = a(context).query(new DownloadManager.Query().setFilterByStatus(11));
if (query != null && query.moveToFirst()) {
while (!uri.toString().equals(query.getString(query.getColumnIndex("uri")))) {
if (!query.moveToNext()) {
query.close();
return false;
}
}
@SuppressLint("Range")
int i = query.getInt(query.getColumnIndex("status"));
@SuppressLint("Range")
String string = query.getString(query.getColumnIndex("local_uri"));
query.close();
if (i == 1 || i == 2) {
ToastUtils.a(R.string.download_is_in_progress);
query.close();
return true;
} else if (i != 8) {
query.close();
return false;
} else {
boolean a2 = a(context, string);
query.close();
return a2;
}
}
return false;
} catch (SQLiteException e2) {
VkTracker.k.b(e2);
return false;
}
}
private static void b(Context context) {
if (context != null) {
try {
context.startActivity(new Intent("android.settings.APPLICATION_DETAILS_SETTINGS").setData(Uri.parse("package:com.android.providers.downloads")));
} catch (ActivityNotFoundException e2) {
L.a(e2);
context.startActivity(new Intent("android.settings.MANAGE_APPLICATIONS_SETTINGS"));
}
ToastUtils.a("Please enable download manager", true);
}
}
public static boolean a(Context context, String str) {
File file;
try {
try {
file = new File(new URI(str));
try {
if (!file.exists()) {
return false;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
String f2 = FileUtils.f(file);
if (!TextUtils.isEmpty(f2)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(FileUtils.uriFromFile(file), f2);
context.startActivity(intent);
return true;
}
throw new ActivityNotFoundException();
} catch (ActivityNotFoundException unused) {
return a(context, file);
}
} catch (ActivityNotFoundException unused2) {
unused2.printStackTrace();
}
} catch (Throwable th) {
VkTracker.k.b(th);
return false;
}
return false;
}
private static boolean a(Context context, File file) {
if (file != null && file.exists()) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(Uri.parse(file.getAbsolutePath()), "application/*");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
context.startActivity(intent);
return true;
} catch (ActivityNotFoundException e2) {
L.a(e2);
}
}
return false;
}
private static DownloadManager a(Context context) {
return (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
}
}
@@ -34,6 +34,4 @@ public enum DialogAction {
DNT_OFF, DNT_OFF,
pinmsg, pinmsg,
unpinmsg, unpinmsg,
ENCRYPT_SETT,
ENCRYPT
} }
@@ -1,131 +0,0 @@
package com.vk.im.ui.views;
import androidx.annotation.NonNull;
public class Corners{
private int topLeft;
private int topRight;
private int bottomLeft;
private int bottomRight;
public Corners(int i, int i2, int i3, int i4){
this.topLeft = i;
this.topRight = i2;
this.bottomLeft = i3;
this.bottomRight = i4;
}
public Corners(int i, int i2, int i3, int i4, int i5) {
this((i5 & 1) != 0 ? 0 : i, (i5 & 2) != 0 ? 0 : i2, (i5 & 4) != 0 ? 0 : i3, (i5 & 8) != 0 ? 0 : i4);
}
public Corners() {
this(0, 0, 0, 0, 15);
}
public static Corners a(Corners corners, int i, int i2, int i3, int i4, int i5, Object obj){
if ((i5 & 1) != 0) {
i = corners.topLeft;
}
if ((i5 & 2) != 0) {
i2 = corners.topRight;
}
if ((i5 & 4) != 0) {
i3 = corners.bottomLeft;
}
if ((i5 & 8) != 0) {
i4 = corners.bottomRight;
}
corners.a(i, i2, i3, i4);
return corners;
}
public int a(){
return this.bottomLeft;
}
public int b(){
return this.bottomRight;
}
public int c(){
return this.topLeft;
}
public int d(){
return this.topRight;
}
public boolean e(){
int i;
int i2 = this.topLeft;
int i3 = this.topRight;
return i2 == i3 && i3 == (i = this.bottomRight) && this.bottomLeft == i;
}
public boolean equals(Object obj){
if (this != obj) {
if (!(obj instanceof Corners)) {
return false;
}
Corners corners = (Corners) obj;
return this.topLeft == corners.topLeft && this.topRight == corners.topRight && this.bottomLeft == corners.bottomLeft && this.bottomRight == corners.bottomRight;
}
return true;
}
public boolean f(){
return this.topLeft == 0 && e();
}
public void g(){
a(0, 0);
}
public int hashCode(){
return (((((this.topLeft * 31) + this.topRight) * 31) + this.bottomLeft) * 31) + this.bottomRight;
}
@NonNull
public String toString(){
return "Corners(topLeft=" + this.topLeft + ", topRight=" + this.topRight + ", bottomLeft=" + this.bottomLeft + ", bottomRight=" + this.bottomRight + ")";
}
public Corners a(int i, int i2){
if ((i2 & 1) > 0) {
this.topLeft = i;
}
if ((i2 & 2) > 0) {
this.topRight = i;
}
if ((i2 & 4) > 0) {
this.bottomLeft = i;
}
if ((i2 & 8) > 0) {
this.bottomRight = i;
}
if (i2 == 0) {
this.topLeft = 0;
this.topRight = 0;
this.bottomLeft = 0;
this.bottomRight = 0;
}
return this;
}
public Corners a(int i, int i2, int i3, int i4){
this.topLeft = i;
this.topRight = i2;
this.bottomLeft = i3;
this.bottomRight = i4;
return this;
}
public Corners a(Corners corners){
this.topLeft = corners.topLeft;
this.topRight = corners.topRight;
this.bottomLeft = corners.bottomLeft;
this.bottomRight = corners.bottomRight;
return this;
}
}
@@ -1,137 +0,0 @@
package com.vk.im.ui.views.avatars;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.vk.im.ui.o;
public class StoryBorderView extends View {
private boolean B;
private final Paint a;
private LinearGradient f15747b;
private int f15748c;
private int f15749d;
private int f15750e;
private int f15751f;
private final int g;
private final int h;
public StoryBorderView(Context context) {
this(context, null, 0, 6);
}
public StoryBorderView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0, 4);
}
public StoryBorderView(Context context, AttributeSet attributeSet, int i, int i2) {
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
}
public int getBorderColor() {
return this.f15749d;
}
public int getBorderGradientEndColor() {
return this.h;
}
public int getBorderGradientStartColor() {
return this.g;
}
public int getBorderWidth() {
return this.f15750e;
}
public int getPadding() {
return this.f15751f;
}
public int getViewSize() {
return this.f15748c;
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawOval(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(), getHeight() - getPaddingBottom(), this.a);
}
@Override
protected void onMeasure(int i, int i2) {
int i3 = this.f15748c;
setMeasuredDimension(i3, i3);
}
public void setBorderColor(int i) {
if (this.f15749d != i) {
this.f15749d = i;
this.a.setColor(i);
invalidate();
}
}
public void setBorderWidth(int i) {
if (this.f15750e != i) {
this.f15750e = i;
this.a.setStrokeWidth(i);
invalidate();
}
}
@Override
public void setLayoutParams(ViewGroup.LayoutParams layoutParams) {
super.setLayoutParams(layoutParams);
boolean z = false;
this.f15748c = Math.min(layoutParams != null ? layoutParams.width : 0, layoutParams != null ? layoutParams.height : 0);
this.f15747b = new LinearGradient(0.0f, 0.0f, 0.0f, this.f15748c, this.g, this.h, Shader.TileMode.MIRROR);
if (this.f15748c > 0) {
z = true;
}
if (z) {
return;
}
throw new IllegalArgumentException("Only exact size supported, specify avatar sizes in layout params");
}
public void setLive(boolean z) {
if (this.B != z) {
this.a.setShader(z ? this.f15747b : null);
this.a.setColor(z ? -1 : this.f15749d);
this.B = z;
invalidate();
}
}
public void setPadding(int i) {
if (this.f15751f != i) {
this.f15751f = i;
setPadding(i, i, i, i);
}
}
public void setViewSize(int i) {
this.f15748c = i;
}
public StoryBorderView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.STROKE);
this.a = paint;
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, o.StoryBorderView);
setBorderColor(obtainStyledAttributes.getInt(o.StoryBorderView_vkim_borderColor, 0));
this.g = obtainStyledAttributes.getInt(o.StoryBorderView_vkim_borderGradientStartColor, 0);
this.h = obtainStyledAttributes.getInt(o.StoryBorderView_vkim_borderGradientEndColor, 0);
setBorderWidth(obtainStyledAttributes.getDimensionPixelSize(o.StoryBorderView_vkim_borderWidth, 0));
obtainStyledAttributes.recycle();
}
}
File diff suppressed because it is too large Load Diff
@@ -1,106 +0,0 @@
package com.vk.profile.ui.community;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.util.AttributeSet;
import com.vk.core.ui.themes.Themable;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.ContextExtKt;
import com.vk.dto.stories.model.StoriesContainer;
import com.vk.stories.view.BorderedCircleImageView;
import com.vtosters.lite.R;
public final class CommunityBorderedImageView extends BorderedCircleImageView implements Themable{
private boolean f0;
private int g0;
private int h0;
private PorterDuffColorFilter i0;
private PorterDuffColorFilter j0;
private int unread;
private int read;
public CommunityBorderedImageView(Context context){
this(context, null, 0, 6);
}
public CommunityBorderedImageView(Context context, AttributeSet attributeSet){
this(context, attributeSet, 0, 4);
}
public CommunityBorderedImageView(Context context, AttributeSet attributeSet, int i, int i2){
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
}
public CommunityBorderedImageView(Context context, AttributeSet attributeSet, int i){
super(context, attributeSet, i);
this.g0 = VKThemeHelper.d((int) R.attr.accent);
this.h0 = ContextExtKt.a(context, (int) R.color.gray_200);
this.i0 = new PorterDuffColorFilter(this.g0, PorterDuff.Mode.SRC_IN);
this.j0 = new PorterDuffColorFilter(this.h0, PorterDuff.Mode.SRC_IN);
}
public final void c(int unread, int read){ // get unread and read resid
this.unread = unread;
this.read = read;
this.T = BitmapFactory.decodeResource(getResources(), this.unread);
}
public final int getPrimaryColor(){
return this.g0;
}
public final void setPrimaryColor(int i){
this.g0 = i;
this.i0 = new PorterDuffColorFilter(i, PorterDuff.Mode.SRC_IN);
}
public final int getWasViewedColor(){
return this.h0;
}
public final void setWasViewedColor(int i){
this.h0 = i;
this.j0 = new PorterDuffColorFilter(i, PorterDuff.Mode.SRC_IN);
}
public final void o(){
this.f0 = false;
l();
}
@Override // com.vk.stories.view.ClippedImageView, android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas){
super.onDraw(canvas);
if (this.f0) {
a(canvas);
}
}
public final void setStoryContainer(StoriesContainer storiesContainer){
if (storiesContainer.L1()) {
this.f0 = true;
m();
if (storiesContainer.K1()) {
this.T = BitmapFactory.decodeResource(getResources(), this.unread);
setBorderColorFilter(this.i0);
b(getWidth(), getHeight());
invalidate();
return;
}
this.T = BitmapFactory.decodeResource(getResources(), this.read);
setBorderColorFilter(this.j0);
b(getWidth(), getHeight());
invalidate();
return;
}
o();
}
@Override // com.vk.core.ui.themes.Themable
public void v(){
}
}
@@ -1,304 +0,0 @@
package com.vk.sharing.view;
import static b.h.z.f.roboto_medium;
import static ru.vtosters.lite.utils.Preferences.preferences;
import static ru.vtosters.lite.utils.ThemesUtils.getAccentColor;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import androidx.annotation.UiThread;
import androidx.core.content.ContextCompat;
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.view.DraweeHolder;
import com.vk.core.util.ContextExtKt;
import com.vk.core.util.Screen;
import com.vk.im.ui.views.avatars.AbbreviationAvatarDrawable;
import com.vk.imageloader.view.VKMultiImageView;
import com.vk.navigation.NavigatorKeys;
import com.vtosters.lite.R;
import com.vtosters.lite.a0;
import java.util.Arrays;
import ru.vtosters.lite.utils.AndroidUtils;
@UiThread
public class TargetImageView extends VKMultiImageView {
private static final int I = Screen.a(2);
private final int B;
private final int C;
private Drawable D;
private String[] F;
private int G;
private final RectF f21629d;
private final Paint f21630e;
private Canvas f21631f;
private final RectF g;
private final Paint h;
public TargetImageView(Context context, Drawable d) {
this(context, null, 0, 6);
}
public TargetImageView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0, 4);
}
public TargetImageView(Context context, AttributeSet attributeSet, int i, int i2) {
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
}
private void e() {
int i = this.G;
for (int i2 = 0; i2 < i; i2++) {
a(i2, this.F[i2]);
}
}
private void f() {
int paddingLeft = getPaddingLeft();
int paddingTop = getPaddingTop();
int width = (getWidth() - paddingLeft) - getPaddingRight();
int height = (getHeight() - paddingTop) - getPaddingBottom();
int i = width / 2;
int i2 = height / 2;
int i3 = this.G;
if (i3 == 1) {
DraweeHolder<GenericDraweeHierarchy> a2 = this.a.a(0);
Drawable d2 = a2.d();
if (d2 != null) {
d2.setBounds(paddingLeft, paddingTop, width + paddingLeft, height + paddingTop);
}
} else if (i3 == 2) {
DraweeHolder<GenericDraweeHierarchy> a3 = this.a.a(0);
Drawable d3 = a3.d();
if (d3 != null) {
int i4 = i + paddingLeft;
int i5 = height + paddingTop;
d3.setBounds(paddingLeft, paddingTop, i4, i5);
DraweeHolder<GenericDraweeHierarchy> a4 = this.a.a(1);
Drawable d4 = a4.d();
if (d4 != null) {
d4.setBounds(i4, paddingTop, paddingLeft + width, i5);
}
}
} else if (i3 == 3) {
DraweeHolder<GenericDraweeHierarchy> a5 = this.a.a(0);
Drawable d5 = a5.d();
if (d5 != null) {
int i6 = i + paddingLeft;
int i7 = height + paddingTop;
d5.setBounds(paddingLeft, paddingTop, i6, i7);
DraweeHolder<GenericDraweeHierarchy> a6 = this.a.a(1);
Drawable d6 = a6.d();
if (d6 != null) {
int i9 = paddingLeft + width;
int i10 = i2 + paddingTop;
d6.setBounds(i6, paddingTop, i9, i10);
DraweeHolder<GenericDraweeHierarchy> a7 = this.a.a(2);
Drawable d7 = a7.d();
if (d7 != null) {
d7.setBounds(i6, i10, i9, i7);
}
}
}
} else {
DraweeHolder<GenericDraweeHierarchy> a8 = this.a.a(0);
Drawable d8 = a8.d();
if (d8 != null) {
int i11 = i + paddingLeft;
int i13 = i2 + paddingTop;
d8.setBounds(paddingLeft, paddingTop, i11, i13);
DraweeHolder<GenericDraweeHierarchy> a9 = this.a.a(1);
Drawable d9 = a9.d();
if (d9 != null) {
int i16 = height + paddingTop;
d9.setBounds(paddingLeft, i13, i11, i16);
DraweeHolder<GenericDraweeHierarchy> a10 = this.a.a(2);
Drawable d10 = a10.d();
if (d10 != null) {
int i18 = paddingLeft + width;
d10.setBounds(i11, paddingTop, i18, i13);
DraweeHolder<GenericDraweeHierarchy> a11 = this.a.a(3);
Drawable d11 = a11.d();
if (d11 != null) {
d11.setBounds(i11, i13, i18, i16);
}
}
}
}
}
}
private void g() {
if (getWidth() == 0 || getHeight() == 0) {
return;
}
f();
}
private AbbreviationAvatarDrawable getAbbreviationDrawable() {
return a(getContext(), null, 2);
}
private AbbreviationAvatarDrawable a(Context context, Typeface typeface, int i) {
return new AbbreviationAvatarDrawable(context, (i & 2) != 0 ? ContextExtKt.e(context, roboto_medium) : typeface);
}
public void a(String str) {
Arrays.fill(this.F, null);
if (str == null) {
b();
this.G = 1;
g();
e();
return;
}
Uri uri = Uri.parse(str);
if (uri.getScheme().equals("vkchatphoto")) {
this.G = 0;
while (true) {
String queryParameter = uri.getQueryParameter("photo" + this.G);
if (queryParameter != null) {
int i = this.G;
this.G = i + 1;
this.F[i] = queryParameter;
} else {
g();
e();
return;
}
}
} else if (uri.getScheme().equals("vkchatplaceholder")) {
this.G = 1;
g();
AbbreviationAvatarDrawable abbreviationDrawable = getAbbreviationDrawable();
String queryParameter2 = uri.getQueryParameter(NavigatorKeys.Q);
int parseInt = queryParameter2 != null ? Integer.parseInt(queryParameter2) : 0;
String queryParameter3 = uri.getQueryParameter(NavigatorKeys.d);
if (queryParameter3 == null) {
queryParameter3 = "";
}
abbreviationDrawable.a(parseInt, queryParameter3);
a(0, getAbbreviationDrawable());
} else {
this.F[0] = str;
this.G = 1;
g();
e();
}
}
@Override // android.view.View
protected void onDraw(Canvas canvas) {
Canvas canvas2 = this.f21631f;
int pref = preferences.getInt("pic_rounding", 0);
if (canvas2 != null) {
canvas2.drawColor(0, PorterDuff.Mode.CLEAR);
}
int i = this.G;
for (int i2 = 0; i2 < i; i2++) {
DraweeHolder<GenericDraweeHierarchy> a2 = this.a.a(i2);
Drawable d2 = a2.d();
if (d2 != null) {
Canvas canvas3 = this.f21631f;
d2.draw(canvas3);
}
}
if (pref > 0) {
canvas.drawRoundRect(this.f21629d, pref, pref, this.f21630e);
} else {
canvas.drawOval(this.f21629d, this.f21630e);
}
if (isSelected()) {
if (pref > 0) {
canvas.drawRoundRect(this.g.left, this.g.top, this.g.right, this.g.bottom, pref, pref, this.h);
} else {
canvas.drawCircle(this.g.centerX(), this.g.centerY(), this.g.width() / 2, this.h);
}
this.D.draw(canvas);
}
}
@Override // android.view.View
protected void onSizeChanged(int i, int i2, int i3, int i4) {
super.onSizeChanged(i, i2, i3, i4);
int paddingLeft = getPaddingLeft();
int paddingRight = getPaddingRight();
int paddingTop = getPaddingTop();
int i5 = i - paddingRight;
int paddingBottom = i2 - getPaddingBottom();
this.f21629d.set(paddingLeft, paddingTop, i5, paddingBottom);
Bitmap createBitmap = Bitmap.createBitmap(i5, paddingBottom, Bitmap.Config.ARGB_8888);
this.f21631f = new Canvas(createBitmap);
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
this.f21630e.setShader(new BitmapShader(createBitmap, tileMode, tileMode));
float f2 = I / 2;
this.g.set(f2, f2, i - f2, (float) i2 - f2);
float f4 = i / 2;
this.h.setShader(new LinearGradient(f4, 0.0f, f4, (float) i2, this.B, this.C, Shader.TileMode.CLAMP));
Drawable drawable = this.D;
drawable.setBounds(i - drawable.getIntrinsicWidth(), i2 - this.D.getIntrinsicHeight(), i, i2);
f();
}
public TargetImageView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.f21629d = new RectF();
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setDither(true);
paint.setFilterBitmap(true);
this.f21630e = paint;
this.g = new RectF();
Paint paint2 = new Paint();
paint2.setAntiAlias(true);
paint2.setStrokeWidth(I);
paint2.setStyle(Paint.Style.STROKE);
this.h = paint2;
this.B = getAccentColor();
this.C = this.B;
Drawable c2 = ContextExtKt.c(context, R.drawable.ic_check_circle_composite_24_full);
if (c2 != null) {
this.D = c2;
this.F = new String[4];
int i2 = I * 2;
setPadding(i2, i2, i2, i2);
if (attributeSet != null) {
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, a0.TargetImageView);
setSelected(obtainStyledAttributes.getBoolean(0, false));
obtainStyledAttributes.recycle();
}
Drawable drawable = ContextCompat.getDrawable(context, R.drawable.user_placeholder);
for (int i3 = 0; i3 <= 3; i3++) {
a();
DraweeHolder<GenericDraweeHierarchy> a3 = this.a.a(i3);
a3.b().e(drawable);
}
setScaleType(ScalingUtils.b.o);
}
}
}
@@ -1,447 +0,0 @@
package com.vk.stories.view;
import static ru.vtosters.lite.utils.ThemesUtils.getColor2;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.ViewTreeObserver;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.airbnb.lottie.LottieComposition;
import com.airbnb.lottie.LottieCompositionFactory;
import com.airbnb.lottie.LottieDrawable;
import com.airbnb.lottie.LottieListener;
import com.facebook.common.internal.Supplier;
import com.facebook.common.references.CloseableReference;
import com.facebook.datasource.DataSource;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.facebook.u.b.a.PipelineDraweeControllerBuilder;
import com.facebook.x.g.CloseableImage;
import com.vk.core.drawable.BorderDrawable;
import com.vk.core.ui.themes.Themable;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.DrawableUtils;
import com.vk.core.util.ResUtils;
import com.vk.core.util.Screen;
import com.vk.dto.stories.d.StoriesContainerExt;
import com.vk.dto.stories.model.CommunityGroupedStoriesContainer;
import com.vk.dto.stories.model.StoriesContainer;
import com.vk.dto.stories.model.StoryEntry;
import com.vk.im.engine.models.Image;
import com.vk.im.ui.views.avatars.AvatarDataSource;
import com.vk.imageloader.FrescoWrapper;
import com.vk.stories.StoriesController;
import com.vtosters.lite.R;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import ru.vtosters.lite.utils.AndroidUtils;
public class StoryCircleImageView extends BorderedCircleImageView implements Themable{
private static final HashSet<Integer> B0 = new HashSet<>();
private final PipelineDraweeControllerBuilder f0;
private int A0;
private Drawable g0;
private Drawable h0;
private Drawable i0;
private int j0;
private int k0;
private int l0;
private int m0;
private int n0;
private int o0;
private Bitmap p0;
private Bitmap q0;
private Bitmap r0;
private Bitmap s0;
private boolean t0;
private boolean u0;
private boolean v0;
private boolean w0;
private boolean x0;
private String y0;
private LottieDrawable z0;
public StoryCircleImageView(Context context){
this(context, null);
}
public StoryCircleImageView(Context context, AttributeSet attributeSet){
this(context, attributeSet, 0);
}
public StoryCircleImageView(Context context, AttributeSet attributeSet, int i){
super(context, attributeSet, i);
this.f0 = FrescoWrapper.c.d();
a(context, attributeSet, i);
}
private void b(Canvas canvas){
this.z0.draw(canvas);
}
private boolean o(){
return !this.u0 && !this.t0 && this.z0 == null && !this.w0 && !this.v0;
}
private void p(){
this.z0.stop();
this.z0 = null;
invalidate();
}
private void q(){
int i = this.j0;
if (i != 0 && VKThemeHelper.k.a(i)) {
this.k0 = VKThemeHelper.d(this.j0);
}
this.g0 = DrawableUtils.a(this.g0, ColorStateList.valueOf(this.k0));
Drawable drawable = this.g0;
int i2 = this.A0;
this.p0 = DrawableUtils.a(drawable, i2, i2);
int i3 = this.l0;
if (i3 != 0 && VKThemeHelper.k.a(i3)) {
this.m0 = VKThemeHelper.d(this.l0);
}
int i4 = this.m0;
if (i4 != 0) {
this.i0 = DrawableUtils.a(this.i0, ColorStateList.valueOf(i4));
}
int i5 = this.n0;
if (i5 != 0 && VKThemeHelper.k.a(i5)) {
this.o0 = VKThemeHelper.d(this.n0);
}
Drawable a2 = DrawableUtils.a(this.g0, ColorStateList.valueOf(0));
int i6 = this.A0;
DrawableUtils.a(a2, i6, i6);
Drawable a3 = DrawableUtils.a(this.h0, ColorStateList.valueOf(this.o0));
int i7 = this.A0;
this.r0 = DrawableUtils.a(a3, i7, i7);
Drawable a4 = DrawableUtils.a(this.g0, ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.orange)));
int i8 = this.A0;
this.s0 = DrawableUtils.a(a4, i8, i8);
}
private void r(){
this.c0 = Screen.a(o() ? 0 : 2);
m();
q();
}
private void setUploadFailed(boolean z){
this.u0 = z;
invalidate();
}
@Override // com.vk.stories.view.ClippedImageView, android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas){
super.onDraw(canvas);
setBorderAlpha(255);
if (this.u0) {
this.i0.draw(canvas);
} else if (this.t0) {
if (this.z0 != null) {
b(canvas);
return;
}
this.T = this.x0 ? this.s0 : this.p0;
b(getWidth(), getHeight());
a(canvas);
} else if (this.z0 != null) {
p();
} else if (!this.w0) {
} else {
this.T = this.r0;
setBorderAlpha(163);
b(getWidth(), getHeight());
a(canvas);
}
}
@Override // com.vk.stories.view.BorderedCircleImageView, android.view.View
public void onSizeChanged(int i, int i2, int i3, int i4){
super.onSizeChanged(i, i2, i3, i4);
this.i0.setBounds(0, 0, i, i2);
b(i);
}
public void setStoryContainer(@Nullable StoriesContainer storiesContainer){
boolean z = true;
boolean z2 = storiesContainer != null && storiesContainer.Q1();
this.v0 = storiesContainer != null && storiesContainer.S1() && !storiesContainer.L1();
boolean z3 = storiesContainer instanceof CommunityGroupedStoriesContainer;
this.x0 = z3;
if (storiesContainer != null) {
if (!StoriesContainerExt.c(storiesContainer) && !StoriesContainerExt.d(storiesContainer)) {
this.T = this.p0;
} else {
this.T = this.q0;
}
b(getWidth(), getHeight());
if (StoriesContainerExt.e(storiesContainer)) {
a(storiesContainer);
} else if (this.z0 != null) {
p();
}
this.w0 = !storiesContainer.K1() && storiesContainer.L1();
if (z2) {
String h = storiesContainer.h(ResUtils.c(R.dimen.story_preview_image_size));
if (h != null) {
a(h);
} else {
g();
}
if (StoriesController.a(storiesContainer)) {
setUploadFailed(true);
a(false, false);
} else {
setUploadFailed(false);
if (!storiesContainer.K1() && !StoriesContainerExt.c(storiesContainer)) {
a(false, false);
} else {
StoryEntry A1 = storiesContainer.A1();
if (A1 != null) {
a(true, !B0.contains(A1.b));
B0.add(A1.b);
} else {
a(true, false);
}
}
}
} else {
setUploadFailed(false);
if (!storiesContainer.K1() && !StoriesContainerExt.c(storiesContainer)) {
z = false;
}
a(z, false);
if (z3) {
b(((CommunityGroupedStoriesContainer) storiesContainer).j(ResUtils.c(R.dimen.story_preview_image_size)));
} else {
String h2 = storiesContainer.h(ResUtils.c(R.dimen.story_preview_image_size));
if (h2 != null) {
a(h2);
} else {
g();
}
}
}
} else {
g();
a(false, false);
setUploadFailed(false);
this.w0 = false;
}
r();
}
@Override // com.vk.core.ui.themes.Themable
public void v(){
r();
invalidate();
}
private void b(int i){
LottieDrawable lottieDrawable = this.z0;
if (lottieDrawable == null || lottieDrawable.e() == null) {
return;
}
this.z0.d(i / this.z0.e().a().width());
}
protected void a(Context context, AttributeSet attributeSet, int i){
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, com.vtosters.lite.a0.StoryCircleImageView, i, 0);
a(context, attributeSet, obtainStyledAttributes);
obtainStyledAttributes.recycle();
r();
this.T = this.p0;
}
public void b(@Nullable List<String> list){
PipelineDraweeControllerBuilder pipelineDraweeControllerBuilder = this.f0;
pipelineDraweeControllerBuilder.j();
pipelineDraweeControllerBuilder.a(getController());
setControllerListener(pipelineDraweeControllerBuilder);
a(pipelineDraweeControllerBuilder, list);
setController(pipelineDraweeControllerBuilder.k0());
}
@SuppressLint("ResourceType")
private void a(Context context, AttributeSet attributeSet, TypedArray typedArray){ // bullshit vk code is not working with custom bordered circle image
Drawable drawable;
this.A0 = typedArray.getDimensionPixelSize(0, Screen.a(64.0f));
if (typedArray.hasValue(2)) {
this.g0 = typedArray.getDrawable(2);
} else {
this.g0 = ContextCompat.getDrawable(context, R.drawable.bg_stores_unread_border_80);
}
if (typedArray.hasValue(3)) {
this.h0 = typedArray.getDrawable(3);
} else {
this.h0 = ContextCompat.getDrawable(context, R.drawable.bg_stores_read_border_80);
}
int b2 = VKThemeHelper.b(attributeSet, "vk_borderTint");
if (b2 != 0 && VKThemeHelper.k.a(b2)) {
this.j0 = b2;
} else if (typedArray.hasValue(5)) {
this.k0 = typedArray.getColor(5, 0);
} else {
this.j0 = R.attr.accent;
}
int b3 = VKThemeHelper.b(attributeSet, "vk_failBorderTint");
if (b3 != 0 && VKThemeHelper.k.a(b3)) {
this.l0 = b3;
} else if (typedArray.hasValue(7)) {
this.m0 = typedArray.getColor(7, 0);
}
int b4 = VKThemeHelper.b(attributeSet, "vk_borderSeenTint");
if (b4 != 0 && VKThemeHelper.k.a(b4)) {
this.n0 = b4;
} else if (typedArray.hasValue(4)) {
this.o0 = typedArray.getColor(4, 0);
} else {
this.o0 = 0;
}
if (typedArray.hasValue(6)) {
this.i0 = typedArray.getDrawable(6);
} else {
this.i0 = ContextCompat.getDrawable(context, R.drawable.ic_story_error_size64);
}
if (typedArray.hasValue(8)) {
drawable = typedArray.getDrawable(8);
} else {
drawable = ContextCompat.getDrawable(context, R.drawable.bg_live_unread_border);
}
if (typedArray.hasValue(9)) {
this.y0 = typedArray.getString(9);
} else {
this.y0 = "stories_animation_64.json";
}
int i = this.A0;
this.q0 = DrawableUtils.a(Objects.requireNonNull(drawable), i, i);
Drawable drawable2 = this.g0;
int i2 = this.A0;
DrawableUtils.a(drawable2, i2, i2);
Drawable drawable3 = this.h0;
int i3 = this.A0;
this.r0 = DrawableUtils.a(drawable3, i3, i3);
Drawable drawable4 = this.g0;
int i4 = this.A0;
this.s0 = DrawableUtils.a(drawable4, i4, i4);
}
public void a(StoriesContainer storiesContainer){
if (this.z0 == null) {
LottieCompositionFactory.a(getContext(), this.y0).b(new a(storiesContainer));
}
}
public void a(StoriesContainer storiesContainer, LottieComposition lottieComposition){
this.z0 = new LottieDrawable();
this.z0.a(lottieComposition);
this.z0.d(-1);
b(getWidth());
if (!StoriesContainerExt.f(storiesContainer)) {
this.z0.a(new b());
this.z0.start();
return;
}
this.z0.stop();
}
private void a(boolean z, boolean z2){
k();
this.t0 = z;
if (!z2) {
setSelectionAmount(1.0f);
} else {
n();
}
}
private void a(@NonNull PipelineDraweeControllerBuilder pipelineDraweeControllerBuilder, @Nullable final List<String> list){
pipelineDraweeControllerBuilder.b(null);
pipelineDraweeControllerBuilder.a((Supplier<DataSource<CloseableReference<com.facebook.x.g.CloseableImage>>>) null);
if (list != null && !list.isEmpty()) {
if (list.size() == 1) {
ImageRequestBuilder b2 = ImageRequestBuilder.b(Uri.parse(list.get(0)));
b2.a(ImageRequest.CacheChoice.SMALL);
pipelineDraweeControllerBuilder.b(b2.a());
return;
}
pipelineDraweeControllerBuilder.a((Supplier<DataSource<CloseableReference<CloseableImage>>>) () -> StoryCircleImageView.this.a(list));
return;
}
pipelineDraweeControllerBuilder.b(null);
}
public DataSource<CloseableReference<CloseableImage>> a(@Nullable List<String> list){
ArrayList<Image> arrayList = new ArrayList<>();
for (String o : Objects.requireNonNull(list)) {
arrayList.add(new Image(-1, -1, o));
}
return AvatarDataSource.a(arrayList, this.A0, 0);
}
public class a implements LottieListener<LottieComposition>{
final StoriesContainer a;
a(StoriesContainer storiesContainer){
this.a = storiesContainer;
}
@Override // com.airbnb.lottie.LottieListener
public void a(LottieComposition lottieComposition){
if (StoryCircleImageView.this.getWidth() > 0) {
StoryCircleImageView.this.a(this.a, lottieComposition);
} else {
StoryCircleImageView.this.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver$OnGlobalLayoutListenerC0393a(lottieComposition));
}
}
public class ViewTreeObserver$OnGlobalLayoutListenerC0393a implements ViewTreeObserver.OnGlobalLayoutListener{
final LottieComposition a;
ViewTreeObserver$OnGlobalLayoutListenerC0393a(LottieComposition lottieComposition){
this.a = lottieComposition;
}
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
public void onGlobalLayout(){
StoryCircleImageView.this.getViewTreeObserver().removeOnGlobalLayoutListener(this);
a aVar = a.this;
StoryCircleImageView.this.a(aVar.a, this.a);
}
}
}
public class b implements ValueAnimator.AnimatorUpdateListener{
b(){
}
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public void onAnimationUpdate(ValueAnimator valueAnimator){
StoryCircleImageView.this.invalidate();
}
}
}
+20 -20
View File
@@ -3560,26 +3560,26 @@ public class R {
public static final int stickers_notifications_size = 0x7f070285; public static final int stickers_notifications_size = 0x7f070285;
public static final int stickers_tabs_padding = 0x7f070286; public static final int stickers_tabs_padding = 0x7f070286;
public static final int stickers_tabs_size = 0x7f070287; public static final int stickers_tabs_size = 0x7f070287;
public static final int stickers_catalog_button_padding_bottom = 0x7f070288; public static final int stiсkers_catalog_button_padding_bottom = 0x7f070288;
public static final int stickers_catalog_button_padding_left = 0x7f070289; public static final int stiсkers_catalog_button_padding_left = 0x7f070289;
public static final int stickers_catalog_button_padding_right = 0x7f07028a; public static final int stiсkers_catalog_button_padding_right = 0x7f07028a;
public static final int stickers_catalog_button_padding_top = 0x7f07028b; public static final int stiсkers_catalog_button_padding_top = 0x7f07028b;
public static final int stickers_catalog_double_stacked_slider_image_bg_size = 0x7f07028c; public static final int stiсkers_catalog_double_stacked_slider_image_bg_size = 0x7f07028c;
public static final int stickers_catalog_double_stacked_slider_image_corner_radius = 0x7f07028d; public static final int stiсkers_catalog_double_stacked_slider_image_corner_radius = 0x7f07028d;
public static final int stickers_catalog_double_stacked_slider_image_size = 0x7f07028e; public static final int stiсkers_catalog_double_stacked_slider_image_size = 0x7f07028e;
public static final int stickers_catalog_large_slider_image_bg_height = 0x7f07028f; public static final int stiсkers_catalog_large_slider_image_bg_height = 0x7f07028f;
public static final int stickers_catalog_large_slider_image_bg_width = 0x7f070290; public static final int stiсkers_catalog_large_slider_image_bg_width = 0x7f070290;
public static final int stickers_catalog_large_slider_image_corner_radius = 0x7f070291; public static final int stiсkers_catalog_large_slider_image_corner_radius = 0x7f070291;
public static final int stickers_catalog_large_slider_image_size = 0x7f070292; public static final int stiсkers_catalog_large_slider_image_size = 0x7f070292;
public static final int stickers_catalog_small_slider_image_bg_size = 0x7f070293; public static final int stiсkers_catalog_small_slider_image_bg_size = 0x7f070293;
public static final int stickers_catalog_small_slider_image_corner_radius = 0x7f070294; public static final int stiсkers_catalog_small_slider_image_corner_radius = 0x7f070294;
public static final int stickers_catalog_small_slider_image_size = 0x7f070295; public static final int stiсkers_catalog_small_slider_image_size = 0x7f070295;
public static final int stickers_catalog_triple_stacked_slider_image_bg_size = 0x7f070296; public static final int stiсkers_catalog_triple_stacked_slider_image_bg_size = 0x7f070296;
public static final int stickers_catalog_triple_stacked_slider_image_corner_radius = 0x7f070297; public static final int stiсkers_catalog_triple_stacked_slider_image_corner_radius = 0x7f070297;
public static final int stickers_catalog_triple_stacked_slider_image_size = 0x7f070298; public static final int stiсkers_catalog_triple_stacked_slider_image_size = 0x7f070298;
public static final int stickers_catalog_vertical_list_image_bg_size = 0x7f070299; public static final int stiсkers_catalog_vertical_list_image_bg_size = 0x7f070299;
public static final int stickers_catalog_vertical_list_image_corner_radius = 0x7f07029a; public static final int stiсkers_catalog_vertical_list_image_corner_radius = 0x7f07029a;
public static final int stickers_catalog_vertical_list_image_size = 0x7f07029b; public static final int stiсkers_catalog_vertical_list_image_size = 0x7f07029b;
public static final int story_author_title_top_space = 0x7f07029c; public static final int story_author_title_top_space = 0x7f07029c;
public static final int story_cadre_bottom_btn_top_padding = 0x7f07029d; public static final int story_cadre_bottom_btn_top_padding = 0x7f07029d;
public static final int story_camera_tabs_height = 0x7f07029e; public static final int story_camera_tabs_height = 0x7f07029e;
@@ -1,6 +1,5 @@
package com.vtosters.lite.ui.bottomnavigation; package com.vtosters.lite.ui.bottomnavigation;
import static ru.vtosters.lite.utils.Preferences.*;
import static ru.vtosters.lite.utils.ThemesUtils.getCSTDock; import static ru.vtosters.lite.utils.ThemesUtils.getCSTDock;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
@@ -31,7 +30,6 @@ import com.vk.core.ui.themes.VKThemeHelper;
import com.vtosters.lite.R; import com.vtosters.lite.R;
import me.grishka.appkit.utils.V; import me.grishka.appkit.utils.V;
import ru.vtosters.lite.utils.Preferences;
public class BottomNavigationItemView extends FrameLayout implements MenuView.ItemView { public class BottomNavigationItemView extends FrameLayout implements MenuView.ItemView {
private final TextView mSmallLabel; private final TextView mSmallLabel;
@@ -221,19 +219,13 @@ public class BottomNavigationItemView extends FrameLayout implements MenuView.It
// ViewCompat.setScaleY(mLargeLabel, !mStaticModeEnabled && !checked ? mLargeScale : 1.0f); // ViewCompat.setScaleY(mLargeLabel, !mStaticModeEnabled && !checked ? mLargeScale : 1.0f);
ViewCompat.setScaleX(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f); ViewCompat.setScaleX(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f);
ViewCompat.setScaleY(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f); ViewCompat.setScaleY(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f);
// make mLargeLabel and mSmallLabel are bold
mLargeLabel.setTypeface(null, Typeface.BOLD); mLargeLabel.setTypeface(null, Typeface.BOLD);
mSmallLabel.setTypeface(null, Typeface.BOLD); mSmallLabel.setTypeface(null, Typeface.BOLD);
int textsize; // make mLargeLabel and mSmallLabel text size is 10sp
mLargeLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10);
if (vkme()){ mSmallLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10);
textsize = 11;
} else {
textsize = 10;
}
mLargeLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, textsize);
mSmallLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, textsize);
mLargeLabel.setVisibility(/*checked ? VISIBLE :*/ INVISIBLE); mLargeLabel.setVisibility(/*checked ? VISIBLE :*/ INVISIBLE);
mSmallLabel.setVisibility(VISIBLE);//checked ? INVISIBLE : VISIBLE); mSmallLabel.setVisibility(VISIBLE);//checked ? INVISIBLE : VISIBLE);
@@ -1,7 +1,5 @@
package ru.vtosters.lite.deviceinfo; package ru.vtosters.lite.deviceinfo;
import androidx.annotation.NonNull;
public class Device { public class Device {
private String androidId; private String androidId;
private String bluetoothMac; private String bluetoothMac;
@@ -88,7 +86,6 @@ public class Device {
return this; return this;
} }
@NonNull
public String toString() { public String toString() {
return "Device{serialId='" + this.serialId + "', androidId='" + this.androidId + "', wifiMac='" + this.wifiMac + "', bluetoothMac='" + this.bluetoothMac + "'}"; return "Device{serialId='" + this.serialId + "', androidId='" + this.androidId + "', wifiMac='" + this.wifiMac + "', bluetoothMac='" + this.bluetoothMac + "'}";
} }
@@ -1,6 +1,5 @@
package ru.vtosters.lite.deviceinfo; package ru.vtosters.lite.deviceinfo;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
import android.content.Context; import android.content.Context;
import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo;
@@ -29,7 +28,6 @@ public class DeviceInfoCollector {
private String serialId() { private String serialId() {
String str; String str;
try { try {
@SuppressLint("PrivateApi")
Class<?> cls = Class.forName("android.os.SystemProperties"); Class<?> cls = Class.forName("android.os.SystemProperties");
Method method = cls.getMethod("get", String.class); Method method = cls.getMethod("get", String.class);
str = (String) method.invoke(cls, "gsm.sn1"); str = (String) method.invoke(cls, "gsm.sn1");
@@ -55,7 +53,6 @@ public class DeviceInfoCollector {
return null; return null;
} }
@SuppressLint("HardwareIds")
private String androidId(Context context) { private String androidId(Context context) {
return Settings.Secure.getString(context.getContentResolver(), "android_id").toLowerCase(); return Settings.Secure.getString(context.getContentResolver(), "android_id").toLowerCase();
} }
@@ -102,7 +99,7 @@ public class DeviceInfoCollector {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
int length = hardwareAddress.length; int length = hardwareAddress.length;
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
sb.append(String.format("%02X:", hardwareAddress[i])); sb.append(String.format("%02X:", Byte.valueOf(hardwareAddress[i])));
} }
if (sb.length() > 0) { if (sb.length() > 0) {
sb.deleteCharAt(sb.length() - 1); sb.deleteCharAt(sb.length() - 1);
@@ -1,219 +1,96 @@
package ru.vtosters.lite.dnr; package ru.vtosters.lite.dnr;
import static com.vk.im.engine.h.im_ic_done;
import static com.vk.im.engine.h.im_ic_edit_msg;
import static com.vk.im.engine.h.im_ic_more_vertical;
import static com.vk.im.engine.h.im_ic_pinned_msg_hide;
import static com.vk.im.engine.h.im_ic_pinned_msg_show;
import static com.vk.im.engine.h.im_ic_write_msg;
import static com.vk.im.ui.c.im_ic_keyboard;
import static ru.vtosters.lite.dnr.DNRModule.hookDNR; import static ru.vtosters.lite.dnr.DNRModule.hookDNR;
import static ru.vtosters.lite.dnr.DNRModule.hookDNT; import static ru.vtosters.lite.dnr.DNRModule.hookDNT;
import static ru.vtosters.lite.dnr.DNRModule.isDnrEnabledFor; import static ru.vtosters.lite.dnr.DNRModule.isDnrEnabledFor;
import static ru.vtosters.lite.dnr.DNRModule.isDntEnabledFor; import static ru.vtosters.lite.dnr.DNRModule.isDntEnabledFor;
import static ru.vtosters.lite.encryption.EncryptProvider.decryptMessage;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken; import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.sendToast; import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import com.vk.core.network.Network; import com.vk.core.network.Network;
import com.vk.im.engine.ImEngine1;
import com.vk.im.engine.events.OnDialogUpdateEvent;
import com.vk.im.engine.models.EntityIntMap;
import com.vk.im.engine.models.ProfilesSimpleInfo;
import com.vk.im.engine.models.dialogs.Dialog; import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.engine.models.messages.Msg; import com.vk.im.engine.models.messages.Msg;
import com.vk.im.engine.models.messages.MsgFromUser; import com.vk.im.engine.models.messages.MsgFromUser;
import com.vk.im.ui.components.common.DialogAction; import com.vk.im.ui.components.common.DialogAction;
import com.vk.im.ui.components.common.MsgAction; import com.vk.im.ui.components.common.MsgAction;
import com.vk.im.ui.components.viewcontrollers.popup.DelegateMsg; import com.vk.im.ui.components.viewcontrollers.popup.DelegateMsg;
import com.vk.im.ui.views.dialog_actions.DialogActionsListView;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import okhttp3.Headers; import okhttp3.Headers;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import ru.vtosters.lite.encryption.EncryptProvider;
import ru.vtosters.lite.encryption.base.IMProcessor;
import ru.vtosters.lite.hooks.CryptImHook;
import ru.vtosters.lite.ui.dialogs.Translate; import ru.vtosters.lite.ui.dialogs.Translate;
import ru.vtosters.lite.utils.AndroidUtils;
public class DNRInjector { public class DNRInjector {
public static void inject(Dialog dialog, List<DialogAction> list) { public static void inject(Dialog dialog, List<DialogAction> list) {
int peerId = dialog.getId(); int peerId = dialog.getId();
list.add(DialogAction.pinmsg); list.add(DialogAction.valueOf("pinmsg"));
list.add(DialogAction.unpinmsg); list.add(DialogAction.valueOf("unpinmsg"));
if (isDnrEnabledFor(peerId)) { if (isDnrEnabledFor(peerId)) {
list.add(DialogAction.DNR_OFF); list.add(DialogAction.valueOf("DNR_OFF"));
} else { } else {
list.add(DialogAction.DNR_ON); list.add(DialogAction.valueOf("DNR_ON"));
} }
if (isDntEnabledFor(peerId)) { if (isDntEnabledFor(peerId)) {
list.add(DialogAction.DNT_OFF); list.add(DialogAction.valueOf("DNT_OFF"));
} else { } else {
list.add(DialogAction.DNT_ON); list.add(DialogAction.valueOf("DNT_ON"));
}
list.add(DialogAction.ENCRYPT);
IMProcessor prov = EncryptProvider.getProcessorFor(peerId);
if (prov != null && !prov.isPublic()) {
list.add(DialogAction.ENCRYPT_SETT);
} }
} }
public static LinkedHashMap<DialogAction, Integer> injectToHashMap(LinkedHashMap<DialogAction, Integer> hashMap) { public static LinkedHashMap<DialogAction, Integer> injectToHashMap(LinkedHashMap<DialogAction, Integer> hashMap) {
hashMap.put(DialogAction.DNR_ON, getIdentifier("DNR_ON", "string")); hashMap.put(DialogAction.valueOf("DNR_ON"), getIdentifier("DNR_ON", "string"));
hashMap.put(DialogAction.DNR_OFF, getIdentifier("DNR_OFF", "string")); hashMap.put(DialogAction.valueOf("DNR_OFF"), getIdentifier("DNR_OFF", "string"));
hashMap.put(DialogAction.DNT_ON, getIdentifier("DNT_ON", "string")); hashMap.put(DialogAction.valueOf("DNT_ON"), getIdentifier("DNT_ON", "string"));
hashMap.put(DialogAction.DNT_OFF, getIdentifier("DNT_OFF", "string")); hashMap.put(DialogAction.valueOf("DNT_OFF"), getIdentifier("DNT_OFF", "string"));
hashMap.put(DialogAction.ENCRYPT, getIdentifier("encryption", "string"));
hashMap.put(DialogAction.ENCRYPT_SETT, getIdentifier("encryption_sett", "string"));
// hashMap.put(DialogAction.pinmsg, getIdentifier("pinmsg", "string")); hashMap.put(DialogAction.valueOf("pinmsg"), getIdentifier("pinmsg", "string"));
// hashMap.put(DialogAction.unpinmsg, getIdentifier("unpinmsg", "string")); hashMap.put(DialogAction.valueOf("unpinmsg"), getIdentifier("unpinmsg", "string"));
return hashMap; return hashMap;
} }
@SuppressLint("ResourceType")
public static List<Object> injectToList(List<Object> actions) {
var list = new ArrayList<>(actions);
list.add(new DialogActionsListView.b.a(DialogAction.DNR_ON, 2, im_ic_pinned_msg_hide, getIdentifier("DNR_ON", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.DNR_OFF, 2, im_ic_pinned_msg_show, getIdentifier("DNR_OFF", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.DNT_ON, 2, im_ic_edit_msg, getIdentifier("DNT_ON", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.DNT_OFF, 2, im_ic_edit_msg, getIdentifier("DNT_OFF", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.ENCRYPT, 3, im_ic_keyboard, getIdentifier("encryption", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.ENCRYPT_SETT, 3, im_ic_more_vertical, getIdentifier("encryption_sett", "string"))); // DialogAction, Int, Icon, String
list.add(new DialogActionsListView.b.a(DialogAction.MARK_AS_READ, 4, im_ic_done, getIdentifier("vkim_dialogs_list_option_mark_as_read", "string"))); // DialogAction, Int, Icon, String
return list;
}
public static void forceInvalidateDialogActions(Dialog d) {
EntityIntMap<Dialog> map = new EntityIntMap<>();
map.a(d.getId(), d);
ImEngine1.a().a(new OnDialogUpdateEvent(null, map));
}
public static List<DialogAction> injectToListAccess(List<DialogAction> actions, Dialog dialog, ProfilesSimpleInfo profilesSimpleInfo) {
var peerId = dialog.getId();
if (isDnrEnabledFor(peerId)) {
actions.add(DialogAction.DNR_OFF);
} else {
actions.add(DialogAction.DNR_ON);
}
if (isDntEnabledFor(peerId)) {
actions.add(DialogAction.DNT_OFF);
} else {
actions.add(DialogAction.DNT_ON);
}
actions.add(DialogAction.ENCRYPT);
IMProcessor prov = EncryptProvider.getProcessorFor(peerId);
if (prov != null && !prov.isPublic()) {
actions.add(DialogAction.ENCRYPT_SETT);
}
actions.add(DialogAction.MARK_AS_READ);
return actions;
}
public static boolean onClickHeader(DialogAction action, Dialog dialog) {
var id = dialog.getId();
if (action == DialogAction.MARK_AS_READ) {
DNRModule.hookRead(dialog);
forceInvalidateDialogActions(dialog);
}
if (action == DialogAction.DNR_ON) {
setDnr(dialog, true);
forceInvalidateDialogActions(dialog);
return true;
} else if (action == DialogAction.DNR_OFF) {
setDnr(dialog, false);
forceInvalidateDialogActions(dialog);
return true;
}
if (action == DialogAction.DNT_ON) {
setDnt(dialog, true);
forceInvalidateDialogActions(dialog);
return true;
} else if (action == DialogAction.DNT_OFF) {
setDnt(dialog, false);
forceInvalidateDialogActions(dialog);
return true;
}
if (action == DialogAction.ENCRYPT_SETT) {
CryptImHook.hookPref(id);
return true;
} else if (action == DialogAction.ENCRYPT) {
CryptImHook.hook(id, dialog);
return true;
}
return false;
}
public static boolean onClick(Dialog dialog, DialogAction action) { public static boolean onClick(Dialog dialog, DialogAction action) {
var id = dialog.getId(); var id = dialog.getId();
if (action == DialogAction.MARK_AS_READ) { if (action == DialogAction.valueOf("MARK_AS_READ")) {
DNRModule.hookRead(dialog); DNRModule.hookRead(dialog);
} }
if (action == DialogAction.DNR_ON) { if (action == DialogAction.valueOf("DNR_ON")) {
setDnr(dialog, true); setDnr(dialog, true);
return true; return true;
} else if (action == DialogAction.DNR_OFF) { } else if (action == DialogAction.valueOf("DNR_OFF")) {
setDnr(dialog, false); setDnr(dialog, false);
return true; return true;
} }
if (action == DialogAction.DNT_ON) { if (action == DialogAction.valueOf("DNT_ON")) {
setDnt(dialog, true); setDnt(dialog, true);
return true; return true;
} else if (action == DialogAction.DNT_OFF) { } else if (action == DialogAction.valueOf("DNT_OFF")) {
setDnt(dialog, false); setDnt(dialog, false);
return true; return true;
} }
if (action == DialogAction.pinmsg) { if (action == DialogAction.valueOf("pinmsg")) {
pinnedMsg(id, true); pinnedMsg(id, true);
return true; return true;
} else if (action == DialogAction.unpinmsg) { } else if (action == DialogAction.valueOf("unpinmsg")) {
pinnedMsg(id, false); pinnedMsg(id, false);
return true; return true;
} }
if (action == DialogAction.ENCRYPT_SETT) {
CryptImHook.hookPref(id);
return true;
} else if (action == DialogAction.ENCRYPT) {
CryptImHook.hook(id, dialog);
return true;
}
return false; return false;
} }
@@ -225,7 +102,6 @@ public class DNRInjector {
public static boolean onClickMsg(Context context, MsgAction action, Msg msg) { public static boolean onClickMsg(Context context, MsgAction action, Msg msg) {
var text = ((MsgFromUser) msg).f(); var text = ((MsgFromUser) msg).f();
var peerId = msg.v1();
var fullMsg = ((MsgFromUser) msg).j2(); // text + reply var fullMsg = ((MsgFromUser) msg).j2(); // text + reply
var reply = fullMsg.substring(text.length() + 1); var reply = fullMsg.substring(text.length() + 1);
@@ -237,24 +113,15 @@ public class DNRInjector {
var isTextExist = !text.isEmpty() && !text.equals(" "); var isTextExist = !text.isEmpty() && !text.equals(" ");
var isReplyExist = !reply.isEmpty() && !reply.equals(" "); var isReplyExist = !reply.isEmpty() && !reply.equals(" ");
if (isReplyExist) {
reply = decryptMessage(reply, peerId);
}
if (isTextExist) {
text = decryptMessage(text, peerId);
}
if (action == MsgAction.valueOf("TRANSLATE")) { if (action == MsgAction.valueOf("TRANSLATE")) {
if (isTextExist && isReplyExist) { if (isTextExist && isReplyExist) {
Translate.showTranslatedText(context, text + "\n\n" + AndroidUtils.getString("translator_reply") + "\n" + reply); Translate.showTranslatedText(context, text + "\n\nРеплай:\n" + reply);
} else if (isReplyExist) { } else if (isReplyExist) {
Translate.showTranslatedText(context, AndroidUtils.getString("translator_reply") + "\n" + reply); Translate.showTranslatedText(context, "Реплай:\n" + reply);
} else if (isTextExist) { } else if (isTextExist) {
Translate.showTranslatedText(context, text); Translate.showTranslatedText(context, text);
} else { } else {
sendToast(AndroidUtils.getString("translator_no_text")); sendToast("Нет текста для перевода");
} }
} }
@@ -282,7 +149,7 @@ public class DNRInjector {
thread.start(); thread.start();
sendToast(AndroidUtils.getString("pin_dialog") + " " + (needToBePinned ? AndroidUtils.getString("dialog_pinned") : AndroidUtils.getString("dialog_unpinned"))); sendToast("Диалог успешно " + (needToBePinned ? "закреплен" : "откреплен"));
} }
public static void setDnr(Dialog dialog, boolean value) { public static void setDnr(Dialog dialog, boolean value) {
@@ -31,21 +31,11 @@ public class AudioDownloader {
public static void downloadM3U8(MusicTrack track) { public static void downloadM3U8(MusicTrack track) {
if (track.D == null) { if (track.D == null) {
ToastUtils.a(AndroidUtils.getString("link_audio_error")); ToastUtils.a("Не удалось найти ссылку на аудиозапись");
return; return;
} }
var musicPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC).getAbsolutePath(); var musicPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC).getAbsolutePath();
var musicDir = new File(musicPath);
if (!musicDir.exists()) {
if (musicDir.mkdirs()) {
Log.d("AudioDownloader", "Created music dir");
} else {
Log.e("AudioDownloader", "Failed to create music dir");
return;
}
}
var tempId = track.d; var tempId = track.d;
var downloadPath = musicPath + File.separator + tempId; var downloadPath = musicPath + File.separator + tempId;
@@ -64,7 +54,7 @@ public class AudioDownloader {
var success = FFMpeg.convert(downloadPath, musicPath + File.separator + fileName + ".mp3"); var success = FFMpeg.convert(downloadPath, musicPath + File.separator + fileName + ".mp3");
if (success) { if (success) {
notification notification
.setContentText(AndroidUtils.getString("player_download_finished")) .setContentText("Загрузка завершена")
.setProgress(0, 0, false) .setProgress(0, 0, false)
.setSmallIcon(android.R.drawable.stat_sys_download_done); .setSmallIcon(android.R.drawable.stat_sys_download_done);
notificationManager.notify(tempId, notification.build()); notificationManager.notify(tempId, notification.build());
@@ -72,7 +62,7 @@ public class AudioDownloader {
onFailure(); onFailure();
} }
} catch (UnsatisfiedLinkError e) { } catch (UnsatisfiedLinkError e) {
Log.e("AudioDownloader", "native libs"); Log.e("AudioDownloader", "Опять эти нативные либы");
Log.e("AudioDownloader", e.getMessage()); Log.e("AudioDownloader", e.getMessage());
onFailure(); onFailure();
} }
@@ -80,7 +70,7 @@ public class AudioDownloader {
@Override @Override
public void onFailure() { public void onFailure() {
notification.setContentText(AndroidUtils.getString("load_audio_error")).setProgress(0, 0, false); notification.setContentText("Не удалось загрузить аудиозапись").setProgress(0, 0, false);
notificationManager.notify(tempId, notification.build()); notificationManager.notify(tempId, notification.build());
} }
@@ -109,7 +99,7 @@ public class AudioDownloader {
private static NotificationCompat.Builder buildDownloadNotification(MusicTrack track, int id) { private static NotificationCompat.Builder buildDownloadNotification(MusicTrack track, int id) {
var notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), NotificationChannels.MUSIC_DOWNLOAD_CHANNEL_ID) var notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), NotificationChannels.MUSIC_DOWNLOAD_CHANNEL_ID)
.setSmallIcon(android.R.drawable.stat_sys_download) .setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle(AndroidUtils.getString("audio_downloading")) .setContentTitle("Загрузка аудиозаписи")
.setContentText(track.toString()) .setContentText(track.toString())
.setPriority(NotificationCompat.PRIORITY_LOW) .setPriority(NotificationCompat.PRIORITY_LOW)
.setCategory(NotificationCompat.CATEGORY_PROGRESS) .setCategory(NotificationCompat.CATEGORY_PROGRESS)
@@ -46,7 +46,7 @@ public class OTADownloader {
maxIndex = Math.max(maxIndex, Integer.parseInt(name.replaceFirst(".+-(\\d+).+", "$1"))); maxIndex = Math.max(maxIndex, Integer.parseInt(name.replaceFirst(".+-(\\d+).+", "$1")));
} }
File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk"); File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk");
APKInstallActivity.installOta(context, FileUtils.uriFromFile(apk)); APKInstallActivity.installOta(context, FileUtils.n(apk));
} else if (status == DownloadManager.STATUS_FAILED) { } else if (status == DownloadManager.STATUS_FAILED) {
AndroidUtils.sendToast(getString("downloaderr")); AndroidUtils.sendToast(getString("downloaderr"));
} }
@@ -2,7 +2,6 @@ package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.downloaders.VideoDownloader.downloadVideo; import static ru.vtosters.lite.downloaders.VideoDownloader.downloadVideo;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext; import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Preferences.getPhotosDir;
import android.app.DownloadManager; import android.app.DownloadManager;
import android.content.Context; import android.content.Context;
@@ -24,7 +23,7 @@ public class StoryDownloader {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle("photo" + story.E.a); request.setTitle("photo" + story.E.a);
request.setDestinationInExternalPublicDir(getPhotosDir().getAbsolutePath(), "/Stories/photo" + story.E.a + ".jpg"); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DCIM, "/Stories/photo" + story.E.a + ".jpg");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request); ((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
return; return;
} }
@@ -5,7 +5,6 @@ import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext; import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getString; import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.Preferences.getVideosDir;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DownloadManager; import android.app.DownloadManager;
@@ -28,7 +27,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.ExternalLinkParser; import ru.vtosters.lite.utils.ExternalLinkParser;
public class VideoDownloader { public class VideoDownloader {
@@ -106,7 +104,7 @@ public class VideoDownloader {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString()); request.setTitle(videoFile.toString());
request.setDestinationInExternalPublicDir(getVideosDir().getAbsolutePath(), videoFile + ".mp4"); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request); ((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
return; return;
} }
@@ -117,7 +115,7 @@ public class VideoDownloader {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString()); request.setTitle(videoFile.toString());
request.setDestinationInExternalPublicDir(getVideosDir().getAbsolutePath(), videoFile + ".mp4"); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request); ((DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
})); }));
builder.show(); builder.show();
@@ -125,12 +123,12 @@ public class VideoDownloader {
public static void parseVideoLink(String url, Context ctx) { public static void parseVideoLink(String url, Context ctx) {
if (url.contains("vk.com/story")) { if (url.contains("vk.com/story")) {
ToastUtils.a(AndroidUtils.getString("video_dl_stories_not_supported")); ToastUtils.a("Не поддерживается загрузка историй");
return; return;
} }
if (!url.contains("vk.com/video")) { if (!url.contains("vk.com/video")) {
ToastUtils.a(AndroidUtils.getString("video_dl_wrong_link")); ToastUtils.a("Неверная ссылка");
return; return;
} }
@@ -138,7 +136,7 @@ public class VideoDownloader {
String ownerId = videoId.split("_")[0]; String ownerId = videoId.split("_")[0];
final ProgressDialog progressDialog = new ProgressDialog(ctx); final ProgressDialog progressDialog = new ProgressDialog(ctx);
progressDialog.setMessage(AndroidUtils.getString("video_dl_progress")); progressDialog.setMessage("Обработка видео");
progressDialog.show(); progressDialog.show();
makeRequest("https://" + "api.vk.com" + "/method/video.get?owner_id=" + ownerId + "&videos=" + videoId + "&v=5.99&access_token=" + getUserToken(), makeRequest("https://" + "api.vk.com" + "/method/video.get?owner_id=" + ownerId + "&videos=" + videoId + "&v=5.99&access_token=" + getUserToken(),
@@ -154,7 +152,7 @@ public class VideoDownloader {
downloadVideo(videoFile, ctx); downloadVideo(videoFile, ctx);
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(ctx, AndroidUtils.getString("video_dl_error"), Toast.LENGTH_SHORT).show(); Toast.makeText(ctx, "Видео нельзя скачать", Toast.LENGTH_SHORT).show();
} }
}); });
} }
@@ -12,8 +12,8 @@ import ru.vtosters.lite.utils.AndroidUtils;
public class NotificationChannels { public class NotificationChannels {
public static final String MUSIC_DOWNLOAD_CHANNEL_ID = "music_download_channel"; public static final String MUSIC_DOWNLOAD_CHANNEL_ID = "music_download_channel";
public static final String MUSIC_DOWNLOAD_CHANNEL_NAME = AndroidUtils.getString("music_dl_title"); public static final String MUSIC_DOWNLOAD_CHANNEL_NAME = "Загрузка музыки";
public static final String MUSIC_DOWNLOAD_CHANNEL_DESCRIPTION = AndroidUtils.getString("music_dl_progress"); public static final String MUSIC_DOWNLOAD_CHANNEL_DESCRIPTION = "Прогресс загрузки музыки";
@RequiresApi(api = Build.VERSION_CODES.O) @RequiresApi(api = Build.VERSION_CODES.O)
public static void createChannels() { public static void createChannels() {
@@ -1,8 +1,5 @@
package ru.vtosters.lite.encryption; package ru.vtosters.lite.encryption;
import static ru.vtosters.lite.hooks.MessagesHook.injectOwnText;
import static ru.vtosters.lite.hooks.MessagesHook.injectOwnTextAll;
import android.util.Log; import android.util.Log;
import android.util.Pair; import android.util.Pair;
@@ -61,13 +58,12 @@ public class EncryptProvider {
try { try {
for (IMProcessor processor : processors) { for (IMProcessor processor : processors) {
if ((processor.isUsed() || !processor.isPublic()) && processor.isEncrypted(msgBody) && (processor.isPublic() || getKeyForProcessor(processor, peer) != null)) if ((processor.isUsed() || !processor.isPublic()) && processor.isEncrypted(msgBody) && (processor.isPublic() || getKeyForProcessor(processor, peer) != null))
return "\uD83D\uDD12 " + injectOwnTextAll(processor.decode(msgBody, getKeyForProcessor(processor, peer))); return "\uD83D\uDD12 " + processor.decode(msgBody, getKeyForProcessor(processor, peer));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return msgBody;
return injectOwnTextAll(msgBody);
} }
private static byte[] getKeyForProcessor(IMProcessor processor, int peer) { private static byte[] getKeyForProcessor(IMProcessor processor, int peer) {
@@ -88,8 +84,9 @@ public class EncryptProvider {
return keyString.getBytes(); return keyString.getBytes();
} }
// This will use only the processor which was chosen in chat menu // This will use only the processor which was chosen in chat menu [that's why ID is needed, bruh]
public static String encryptMessage(MsgFromUser msg) { public static String encryptMessage(MsgFromUser msg) {
String msgBody = getBody(msg); String msgBody = getBody(msg);
Log.d("EncryptProvider", "encryptMessage: msg = " + msg); Log.d("EncryptProvider", "encryptMessage: msg = " + msg);
@@ -99,11 +96,11 @@ public class EncryptProvider {
for (IMProcessor processor : processors) { for (IMProcessor processor : processors) {
int peer = getPeerId(msg); int peer = getPeerId(msg);
if (processor.isUsedToEncrypt(peer)) { if (processor.isUsedToEncrypt(peer)) {
return injectOwnText(processor.encode(msgBody, getKeyForProcessor(processor, peer))); return processor.encode(msgBody, getKeyForProcessor(processor, peer));
} }
} }
return injectOwnText(msgBody); return msgBody;
} }
// For rendering UI // For rendering UI
@@ -8,7 +8,6 @@ import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.ProxyUtils.apiproxy; import static ru.vtosters.lite.utils.ProxyUtils.apiproxy;
import static ru.vtosters.lite.utils.ProxyUtils.getApi; import static ru.vtosters.lite.utils.ProxyUtils.getApi;
import android.annotation.SuppressLint;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
@@ -23,7 +22,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@@ -60,7 +58,7 @@ public class FoafBase {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Europe/Moscow")); sdf.setTimeZone(TimeZone.getTimeZone("Europe/Moscow"));
Date date = sdf.parse(Objects.requireNonNull(matcher.group(1))); Date date = sdf.parse(matcher.group(1));
sdf.setTimeZone(TimeZone.getDefault()); sdf.setTimeZone(TimeZone.getDefault());
return sdf.parse(sdf.format(date)).getTime() / 1000; return sdf.parse(sdf.format(date)).getTime() / 1000;
} }
@@ -97,8 +95,8 @@ public class FoafBase {
Matcher matcher2 = FOAF_REGEX_LOGIN.matcher(str); Matcher matcher2 = FOAF_REGEX_LOGIN.matcher(str);
matcher.find(); matcher.find();
matcher2.find(); matcher2.find();
String normalHumanDate = getNormalHumanDate(Objects.requireNonNull(matcher.group(1))); String normalHumanDate = getNormalHumanDate(matcher.group(1));
getNormalHumanDate(Objects.requireNonNull(matcher2.group(1))); getNormalHumanDate(matcher2.group(1));
VkAlertDialog.Builder a2 = new VkAlertDialog.Builder(context).setTitle(getIdentifier("addinf", "string")); VkAlertDialog.Builder a2 = new VkAlertDialog.Builder(context).setTitle(getIdentifier("addinf", "string"));
a2.setMessage(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).setPositiveButton(17039370, null).create().show(); a2.setMessage(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).setPositiveButton(17039370, null).create().show();
} catch (Exception e) { } catch (Exception e) {
@@ -109,7 +107,6 @@ public class FoafBase {
private static long daysPassedFromFoafDate(String str) { private static long daysPassedFromFoafDate(String str) {
try { try {
@SuppressLint("SimpleDateFormat")
Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(str.split(" ")[1]); Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(str.split(" ")[1]);
return TimeUnit.DAYS.convert(new Date().getTime() - parse.getTime(), TimeUnit.MILLISECONDS); return TimeUnit.DAYS.convert(new Date().getTime() - parse.getTime(), TimeUnit.MILLISECONDS);
} catch (ParseException e) { } catch (ParseException e) {
@@ -1,116 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.dnr.DNRInjector.forceInvalidateDialogActions;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import static ru.vtosters.lite.utils.LifecycleUtils.getCurrentActivity;
import static ru.vtosters.lite.utils.ThemesUtils.getSTextAttr;
import android.content.Context;
import android.content.res.ColorStateList;
import android.text.Editable;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import androidx.appcompat.app.AlertDialog;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.im.engine.models.dialogs.Dialog;
import java.util.List;
import ru.vtosters.lite.encryption.EncryptProvider;
import ru.vtosters.lite.encryption.base.IMProcessor;
public class CryptImHook{
public static boolean isPrivateProcessor(int peerID){
for (IMProcessor processor : EncryptProvider.processors) {
if (processor.isUsedToEncrypt(peerID)) {
return !processor.isPublic();
}
}
return false;
}
public static void hook(int peerId, Dialog d){
List<IMProcessor> processors = EncryptProvider.processors;
IMProcessor enabled = null;
int enabledPosition = 0;
String[] titles = new String[processors.size() + 1];
titles[0] = getString("encryption_disable");
for (int i = 0; i < processors.size(); i++) {
IMProcessor proc = processors.get(i);
titles[i + 1] = proc.getUIName();
if (proc.isUsedToEncrypt(peerId)) {
enabled = proc;
enabledPosition = i + 1;
}
}
IMProcessor finalEnabled = enabled;
new VkAlertDialog.Builder(getCurrentActivity())
.setTitle(getString("encryption_sett"))
.setSingleChoiceItems(titles, enabledPosition, (dialog, which) -> {
if (which == 0) {
if (finalEnabled != null) finalEnabled.disableEncryptFor(peerId);
} else {
IMProcessor proc = processors.get(which - 1);
if (proc.isUsedToEncrypt(peerId)) {
proc.disableEncryptFor(peerId);
} else {
proc.enableEncryptFor(peerId);
if (finalEnabled != null) finalEnabled.disableEncryptFor(peerId);
}
}
dialog.dismiss();
forceInvalidateDialogActions(d);
}).create().show();
}
public static void hookPref(int peerId){
IMProcessor enabled = null;
for (IMProcessor processor : EncryptProvider.processors) {
if (processor.isUsedToEncrypt(peerId)) {
enabled = processor;
}
}
if (enabled != null && enabled.isPublic()) {
sendToast(getString("encryption_public_algorithm_error"));
return;
}
Context ctx = getCurrentActivity();
LinearLayout linearLayout = new LinearLayout(ctx);
final EditText editText = new EditText(ctx);
editText.setHintTextColor(getSTextAttr());
editText.setBackgroundTintList(ColorStateList.valueOf(getSTextAttr()));
linearLayout.addView(editText);
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) editText.getLayoutParams());
margin.setMargins(dp2px(24f), 0, dp2px(24f), 0);
editText.setLayoutParams(margin);
IMProcessor finalEnabled = enabled;
new AlertDialog.Builder(ctx)
.setTitle(getString("encryption_enter_key"))
.setMessage(String.format(getString("encryption_current_algorithm_title"), enabled.getUIName()))
.setView(linearLayout)
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
Editable edit = editText.getText();
finalEnabled.setEncryptionKeyFor(peerId, edit == null ? null : edit.toString());
}).setNegativeButton(android.R.string.cancel, null).create().show();
}
}
@@ -0,0 +1,17 @@
package ru.vtosters.lite.hooks;
import com.vk.extensions.ViewExtKt;
import com.vk.navigation.right.RightMenuPresenter;
import ru.vtosters.lite.ui.views.VTLCheckableButton;
public class DayNightButtonHook {
public static void injectOnClick(VTLCheckableButton button, RightMenuPresenter presenter) {
button.postOnAnimationDelayed(() -> {
var rect = ViewExtKt.e(button);
presenter.a(new float[] { rect.centerX(), rect.centerY() });
}, 550); // minimal delay for fix toggle animation
button.toggle();
}
}
@@ -53,6 +53,7 @@ import java.util.Map;
import ru.vtosters.lite.ui.components.DockBarEditorManager; import ru.vtosters.lite.ui.components.DockBarEditorManager;
import ru.vtosters.lite.ui.items.DockBarTab; import ru.vtosters.lite.ui.items.DockBarTab;
import ru.vtosters.lite.utils.ThemesUtils;
public class DockBarInjector { public class DockBarInjector {
private static final DockBarEditorManager sManager = DockBarEditorManager.getInstance(); private static final DockBarEditorManager sManager = DockBarEditorManager.getInstance();
@@ -67,6 +68,7 @@ public class DockBarInjector {
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
public static void inject(BottomNavigationView navigationView) { public static void inject(BottomNavigationView navigationView) {
navigationView.setBackgroundColor(ThemesUtils.getBackgroundContent());
Menu menu = navigationView.getMenu(); Menu menu = navigationView.getMenu();
menu.clear(); menu.clear();
try { try {
@@ -86,14 +88,11 @@ public class DockBarInjector {
e.printStackTrace(); e.printStackTrace();
} }
for (DockBarTab tab : sManager.getSelectedTabs()) { for (DockBarTab tab : sManager.getSelectedTabs())
MenuItem add = menu.add(0, tab.id, 0, tab.titleID); menu.add(0, tab.id, 0, tab.titleID)
Drawable drawable = getResources().getDrawable(tab.iconID); .setIcon(tab.iconID)
.setCheckable(true);
add.setIcon(new RecoloredDrawable(drawable, getCSTDock()));
add.setTitle(getGlobalContext().getString(tab.titleID));
add.setCheckable(true);
}
if (getBoolValue("dockbar_tab_titles", true)) { if (getBoolValue("dockbar_tab_titles", true)) {
var menuView = (BottomNavigationMenuView) navigationView.getChildAt(0); var menuView = (BottomNavigationMenuView) navigationView.getChildAt(0);
for (int i = 0; i < menuView.getChildCount(); i++) { for (int i = 0; i < menuView.getChildCount(); i++) {
@@ -2,7 +2,6 @@ package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.foaf.FoafBase.getLastSeen; import static ru.vtosters.lite.foaf.FoafBase.getLastSeen;
import static ru.vtosters.lite.hooks.DateHook.getLocale; import static ru.vtosters.lite.hooks.DateHook.getLocale;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.Base64Utils.decode; import static ru.vtosters.lite.utils.Base64Utils.decode;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCaption; import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCaption;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCopyright; import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCopyright;
@@ -18,11 +17,14 @@ import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.hasVerification; import static ru.vtosters.lite.utils.Preferences.hasVerification;
import static ru.vtosters.lite.utils.Preferences.podcastcatalog; import static ru.vtosters.lite.utils.Preferences.podcastcatalog;
import static ru.vtosters.lite.utils.Preferences.postsrecomm; import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import static ru.vtosters.lite.utils.ThemesUtils.accentColors;
import static ru.vtosters.lite.utils.ThemesUtils.getAccentColor;
import static ru.vtosters.lite.utils.ThemesUtils.hex2;
import static ru.vtosters.lite.utils.VTVerifications.isDeveloper; import static ru.vtosters.lite.utils.VTVerifications.isDeveloper;
import static ru.vtosters.lite.utils.VTVerifications.isPrometheus; import static ru.vtosters.lite.utils.VTVerifications.isPrometheus;
import static ru.vtosters.lite.utils.VTVerifications.isVerified; import static ru.vtosters.lite.utils.VTVerifications.isVerified;
import android.text.TextUtils; import android.graphics.Color;
import android.util.Log; import android.util.Log;
import com.vk.core.network.Network; import com.vk.core.network.Network;
@@ -35,8 +37,7 @@ import org.json.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;
import java.util.Collections; import java.util.Locale;
import java.util.LinkedHashSet;
import java.util.Objects; import java.util.Objects;
import java.util.Random; import java.util.Random;
@@ -67,13 +68,24 @@ public class JsonInjectors {
newItem.put(vktesters(id)); newItem.put(vktesters(id));
} }
// get text color from all items
for (int i = 0; i < newItem.length(); i++) {
var item = newItem.getJSONObject(i);
if (item.has("text_color")) {
var textColor = item.getString("text_color");
if (accentColors.contains(Color.parseColor(textColor.startsWith("#") ? textColor : "#" + textColor))) {
item.put("text_color", hex2(getAccentColor()));
}
}
}
orig.put("buttons", newItem); orig.put("buttons", newItem);
return orig; return orig;
} }
public static JSONObject donateRecomm() throws JSONException { public static JSONObject donateRecomm() throws JSONException {
var title = AndroidUtils.getString("donate_to_vtl"); var title = "Помоги проекту донатом и получи бонус!";
var link = "https://vk.com/vtosters_official"; var link = "https://vk.com/vtosters_official";
var text_color = "2D81E0"; var text_color = "2D81E0";
@@ -114,7 +126,7 @@ public class JsonInjectors {
} }
public static JSONObject vktesters(int id) throws JSONException { public static JSONObject vktesters(int id) throws JSONException {
var title = AndroidUtils.getString("tester_profile"); var title = "Карточка Тестера";
var text_color = "2D81E0"; var text_color = "2D81E0";
var link = "https://static.vk.com/bugs?lang=" + LangUtils.a() + "#/reporter" + id; var link = "https://static.vk.com/bugs?lang=" + LangUtils.a() + "#/reporter" + id;
@@ -158,7 +170,7 @@ public class JsonInjectors {
var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id"); var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id");
var pic = "https://image.pngaaa.com/641/326641-middle.png"; // can be null var pic = "https://image.pngaaa.com/641/326641-middle.png"; // can be null
var text = AndroidUtils.getString("no_data_error"); var text = "Я не загрузил данные (9(9((";
var link = "https://vtosters.app"; // can be null var link = "https://vtosters.app"; // can be null
var linktitle = "Test button"; // can be null var linktitle = "Test button"; // can be null
@@ -175,9 +187,9 @@ public class JsonInjectors {
if (!hasIcon) icon = ""; if (!hasIcon) icon = "";
if (!hasButton) buttons = ""; if (!hasButton) buttons = "";
if (isVerified(peerid)) text = AndroidUtils.getString("i_bought") + " VTosters Premium"; if (isVerified(peerid)) text = "Я купил VTosters Premium";
if (isPrometheus(peerid)) text = AndroidUtils.getString("i_bought") + " VTosters Premium Gold Prime Pro Plus"; if (isPrometheus(peerid)) text = "Я купил VTosters Premium Gold Prime Pro Plus";
if (isDeveloper(peerid)) text = AndroidUtils.getString("i_created_poop"); if (isDeveloper(peerid)) text = "Я создал говно";
if (!isVerified(peerid) || text.equals("")) { if (!isVerified(peerid) || text.equals("")) {
if (getBoolValue("convBarRecomm", false)) { if (getBoolValue("convBarRecomm", false)) {
return null; return null;
@@ -375,37 +387,14 @@ public class JsonInjectors {
} }
public static JSONArray newsfeedlist(JSONArray items) throws JSONException { public static JSONArray newsfeedlist(JSONArray items) throws JSONException {
var selectedItems = getDefaultPrefs().getString("news_feed_selected_items", ""); for (int j = 0; j < items.length(); j++) {
var filtersSet = getDefaultPrefs().getStringSet("news_feed_items_set", null); var list = items.optJSONObject(j);
var mutableFiltersSet = Collections.synchronizedSet(new LinkedHashSet<String>()); var name = list.optString("id");
if (filtersSet != null)
mutableFiltersSet.addAll(filtersSet);
synchronized (mutableFiltersSet) { if (!name.equals("kpop") && !name.equals("foryou") && !name.equals("qazaqstan")) {
for (int i = 0; i < items.length(); i++) { list.put("is_hidden", false).put("is_unavailable", false);
var item = items.optJSONObject(i); if (dev()) Log.d("NewsfeedListInj", "Unlocked " + name + " in newsfeed list");
if (item == null) continue;
var id = item.optString("id");
var title = item.optString("title");
if (TextUtils.isEmpty(id) || TextUtils.isEmpty(title)
// this items not working
|| id.equals("kpop") || id.equals("foryou")
|| id.equals("qazaqstan") || id.equals("podcasts"))
continue;
mutableFiltersSet.add(id + "|" + title);
var hide = selectedItems.contains(id);
Log.d("NewsfeedList", "Added list " + id + " to feed");
item.put("is_hidden", hide)
.put("is_unavailable", hide);
if (dev()) Log.d("NewsfeedListInj", "Unlocked " + id + " in newsfeed list");
} }
getDefaultPrefs().edit().putStringSet("news_feed_items_set", mutableFiltersSet)
.apply();
} }
return items; return items;
@@ -554,7 +543,7 @@ public class JsonInjectors {
Log.d("VKMusic", "title: " + title + " id: " + id + " url: " + url + " value: " + value); Log.d("VKMusic", "title: " + title + " id: " + id + " url: " + url + " value: " + value);
if (url.contains(value) && !value.isEmpty()) { if (url.contains(value)) {
catalog.put("default_section", id); catalog.put("default_section", id);
if (dev()) Log.d("VKMusic", "Added " + title + " as default music section"); if (dev()) Log.d("VKMusic", "Added " + title + " as default music section");
} }
@@ -2,7 +2,6 @@ package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.ui.dialogs.ServerDialog.sendRequest; import static ru.vtosters.lite.ui.dialogs.ServerDialog.sendRequest;
import static ru.vtosters.lite.utils.CacheUtils.getInstance; import static ru.vtosters.lite.utils.CacheUtils.getInstance;
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
import static ru.vtosters.lite.utils.Preferences.checkupdates; import static ru.vtosters.lite.utils.Preferences.checkupdates;
import static ru.vtosters.lite.utils.ThemesUtils.isDarkTheme; import static ru.vtosters.lite.utils.ThemesUtils.isDarkTheme;
import static ru.vtosters.lite.utils.ThemesUtils.setNeededTheme; import static ru.vtosters.lite.utils.ThemesUtils.setNeededTheme;
@@ -19,13 +18,11 @@ import ru.vtosters.lite.ui.dialogs.ServerDialog;
import ru.vtosters.lite.ui.dialogs.Start; import ru.vtosters.lite.ui.dialogs.Start;
public class MainActivityInjector { public class MainActivityInjector {
public static void inject(Activity activity) { public static void inject(Activity activity) {
setNeededTheme(activity); setNeededTheme(activity);
ServerDialog.activity = activity; ServerDialog.activity = activity;
sendRequest(); sendRequest();
if (checkupdates()) OTADialog.checkUpdates(activity); if (checkupdates()) OTADialog.checkUpdates(activity);
reloadMessagesList();
Start.alert(activity); Start.alert(activity);
InstallGMS.alert(activity); InstallGMS.alert(activity);
DisableBattery.alert(activity); DisableBattery.alert(activity);
@@ -37,7 +34,6 @@ public class MainActivityInjector {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannels.createChannels(); NotificationChannels.createChannels();
} }
// VKIDProtection.alert(activity); // VKIDProtection.alert(activity);
} }
} }
@@ -14,10 +14,6 @@ import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isMusicBlock;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isNewsBlock; import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isNewsBlock;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isPostRecommendations; import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isPostRecommendations;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isRecomsGroup; import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isRecomsGroup;
import static ru.vtosters.lite.utils.Preferences.ads;
import static ru.vtosters.lite.utils.Preferences.adsslider;
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
import static ru.vtosters.lite.utils.Preferences.getBoolValue; import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.vkme; import static ru.vtosters.lite.utils.Preferences.vkme;
@@ -27,7 +23,6 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
public class NewsfeedHook { public class NewsfeedHook {
@@ -78,42 +73,4 @@ public class NewsfeedHook {
} }
return list; return list;
} }
public static String[] feedParams(){
HashSet<String> params = new HashSet<>();
params.add("post");
params.add("photo");
params.add("photo_tag");
if (!friendsrecomm()) {
params.add("friends_recomm");
}
if (!ads()) {
params.add("app_widget");
params.add("promo_button");
}
if (!authorsrecomm()) {
params.add("authors_rec");
}
return params.toArray(new String[0]);
}
public static void adsParams(HashSet<String> hashSet) {
if (ads() || adsslider()) {
hashSet.add("ads_disabled");
return;
}
hashSet.add("ads_app");
hashSet.add("ads_site");
hashSet.add("ads_post");
hashSet.add("ads_app_slider");
hashSet.add("ads_site_slider");
hashSet.add("ads_app_video");
hashSet.add("ads_post_pretty_cards");
hashSet.add("ads_post_snippet_video");
}
} }
@@ -17,8 +17,6 @@ import org.json.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;
import ru.vtosters.lite.utils.AndroidUtils;
public class OnlineFormatterHook { public class OnlineFormatterHook {
private static String AppName; private static String AppName;
@@ -61,37 +59,37 @@ public class OnlineFormatterHook {
case 5027722: case 5027722:
return "VK Messenger (Desktop)"; return "VK Messenger (Desktop)";
case 6146827: case 6146827:
return AndroidUtils.getString("vk_messenger") + " (Android)"; // VK Мессенджер (Android) return "VK Мессенджер (Android)";
case 6482950: case 6482950:
return AndroidUtils.getString("vk_messenger") + " (iPhone)"; // VK Мессенджер (iPhone) return "VK Мессенджер (iPhone)";
case 6481715: case 6481715:
return AndroidUtils.getString("vk_messenger") + " Dev (iPhone)"; // VK Мессенджер Dev (iPhone) return "VK Мессенджер Dev (iPhone)";
case 7799655: case 7799655:
return AndroidUtils.getString("vk_mail_online"); // VK Почта return "VK Почта";
case 7598572: case 7598572:
return AndroidUtils.getString("sferum_online") + " (Android)"; // Сферум (Android) return "Сферум (Android)";
case 7571751: case 7571751:
return AndroidUtils.getString("sferum_online") + " (iPhone)"; // Сферум (iPhone) return "Сферум (iPhone)";
case 7556576: case 7556576:
return AndroidUtils.getString("sferum_online"); // Сферум return "Сферум";
case 7497650: case 7497650:
return "VK ID"; return "VK ID";
case 8094476: case 8094476:
return AndroidUtils.getString("vk_calls_online") + " (Android)"; // VK Звонки (Android) return "VK Звонки (Android)";
case 8093730: case 8093730:
return AndroidUtils.getString("vk_calls_online") + " (iPhone)"; // VK Звонки (iPhone) return "VK Звонки (iPhone)";
case 7793118: case 7793118:
return AndroidUtils.getString("vk_calls_online") + " (Desktop)"; // VK Звонки (Desktop) return "VK Звонки (Desktop)";
case 6767438: case 6767438:
return AndroidUtils.getString("vk_music_online") + " (Android)"; // VK Музыка (Android) return "VK Музыка (Android)";
case 8113297: case 8113297:
return AndroidUtils.getString("vk_clips_online") + " (Android)"; // VK Клипы (Android) return "VK Клипы (Android)";
case 8106428: case 8106428:
return AndroidUtils.getString("vk_clips_online") + " (iPhone)"; // VK Клипы (iPhone) return "VK Клипы (iPhone)";
case 5044491: case 5044491:
return "Candy"; return "Candy";
case 8114066: case 8114066:
return AndroidUtils.getString("vk_video_online"); // VK Видео return "VK Видео";
case 4894723: case 4894723:
return "Phoenix Lite"; return "Phoenix Lite";
case 4994316: case 4994316:
@@ -1,82 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.preferences;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import com.facebook.drawee.generic.RoundingParams;
import ru.vtosters.lite.utils.AndroidUtils;
public class PicRoundingHook{
private static final int pref = preferences.getInt("pic_rounding", 0);
public static RoundingParams inject() {
if (pref > 0) {
return customParams();
} else {
return new RoundingParams().a(true);
}
}
public static RoundingParams inject(float orig) {
if (pref > 0) {
return customParams();
} else {
return new RoundingParams().b(orig);
}
}
public static RoundingParams inject(float orig, float orig2, float orig3, float orig4) {
if (pref > 0) {
return new RoundingParams().a(AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref));
} else {
return new RoundingParams().a(orig, orig2, orig3, orig4);
}
}
public static void inject(float orig, Canvas canvas, Paint paint){
if (pref > 0) {
canvas.drawRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), paint);
} else {
canvas.drawCircle(orig, orig, orig, paint);
}
}
public static void inject(Canvas canvas, Paint paint, float orig){
if (pref > 0) {
canvas.drawRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), paint);
} else {
canvas.drawCircle(canvas.getClipBounds().exactCenterX(), canvas.getClipBounds().exactCenterY(), orig, paint);
}
}
public static void inject(Canvas canvas, float orig, float orig2, float orig3, Paint paint){
if (pref > 0) {
canvas.drawRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), paint);
} else {
canvas.drawCircle(orig, orig2, orig3, paint);
}
}
public static void inject(Bitmap bitmap, Bitmap bitmap2, Paint b2) {
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
b2.setShader(new BitmapShader(bitmap2, tileMode, tileMode));
Canvas canvas = new Canvas(bitmap);
float width = bitmap2.getWidth() / 2;
if (pref > 0) {
canvas.drawRoundRect(0, 0, bitmap.getWidth(), bitmap.getHeight(), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), b2);
} else {
canvas.drawCircle(width, width, width, b2);
}
}
private static RoundingParams customParams(){
return RoundingParams.b(AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref));
}
}
@@ -27,12 +27,11 @@ import com.vk.auth.ui.VkAuthTextView;
import com.vk.navigation.Navigator; import com.vk.navigation.Navigator;
import ru.vtosters.lite.ui.fragments.ProxySettingsFragment; import ru.vtosters.lite.ui.fragments.ProxySettingsFragment;
import ru.vtosters.lite.utils.AndroidUtils;
public class ProxyHook { public class ProxyHook {
public static void hookAuth(View v) { public static void hookAuth(View v) {
VkAuthTextView button = (VkAuthTextView) v; VkAuthTextView button = (VkAuthTextView) v;
button.setText(AndroidUtils.getString("proxy_setup")); button.setText("Настроить прокси");
button.setOnClickListener(v1 -> callProxyDialog(v1.getContext())); button.setOnClickListener(v1 -> callProxyDialog(v1.getContext()));
} }
@@ -51,20 +50,20 @@ public class ProxyHook {
rg.setPadding(dp2px(18f), dp2px(12f), dp2px(18f), 0); rg.setPadding(dp2px(18f), dp2px(12f), dp2px(18f), 0);
rgDefault.setText(AndroidUtils.getString("proxy_disable")); rgDefault.setText("Отключить");
rgDefault.setTextColor(getTextAttr()); rgDefault.setTextColor(getTextAttr());
rgProxy.setText(AndroidUtils.getString("proxy_enable") + " (Zaborona)"); rgProxy.setText("Включить (Zaborona)");
rgProxy.setTextColor(getTextAttr()); rgProxy.setTextColor(getTextAttr());
rgProxy.setChecked(isZaboronaEnabled()); rgProxy.setChecked(isZaboronaEnabled());
rgDefault.setChecked(!isZaboronaEnabled()); rgDefault.setChecked(!isZaboronaEnabled());
AlertDialog.Builder builder = new AlertDialog.Builder(ctx, getAlertStyle()); AlertDialog.Builder builder = new AlertDialog.Builder(ctx, getAlertStyle());
builder.setTitle(AndroidUtils.getString("vtlproxy")); builder.setTitle("Прокси");
builder.setMessage(AndroidUtils.getString("proxy_warning")); builder.setMessage("Zaborona никак не связана с ВТостерс и мы не можем гарантировать её работу и безопасность");
builder.setView(rg); builder.setView(rg);
builder.setPositiveButton(AndroidUtils.getString("vtl_confirm"), ((dialog, which) -> { // Применить builder.setPositiveButton("Применить", ((dialog, which) -> {
if (rgProxy.isChecked()) { if (rgProxy.isChecked()) {
edit().putString("proxy", "zaborona").commit(); edit().putString("proxy", "zaborona").commit();
restartApplication(); restartApplication();
@@ -78,7 +77,7 @@ public class ProxyHook {
} }
})); }));
builder.setNeutralButton(AndroidUtils.getString("proxy_settings"), ((dialog, which) -> { builder.setNeutralButton("Настройки прокси", ((dialog, which) -> {
Intent a2 = new Navigator(ProxySettingsFragment.class).b(ctx); Intent a2 = new Navigator(ProxySettingsFragment.class).b(ctx);
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(a2); ctx.startActivity(a2);
@@ -9,7 +9,7 @@ import java.util.LinkedHashMap;
public class RequestDumper{ public class RequestDumper{
public static void addParams(MethodCall.a paramslist, String method, LinkedHashMap params, String apiver) { public static void addParams(MethodCall.a paramslist, String method, LinkedHashMap params, String apiver) {
if (method.contains("execute.getGiftByStickerId") ) { if (method.contains("execute.getGiftByStickerId")) {
apiver = "5.187"; apiver = "5.187";
} }
@@ -5,7 +5,6 @@ import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue; import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.milkshake; import static ru.vtosters.lite.utils.Preferences.milkshake;
import static ru.vtosters.lite.utils.Preferences.superapp; import static ru.vtosters.lite.utils.Preferences.superapp;
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
import static ru.vtosters.lite.utils.Preferences.videonewcatalog; import static ru.vtosters.lite.utils.Preferences.videonewcatalog;
import static ru.vtosters.lite.utils.Preferences.vkme; import static ru.vtosters.lite.utils.Preferences.vkme;
@@ -34,6 +33,8 @@ import com.vtosters.lite.fragments.y2.VideosFragment;
import com.vtosters.lite.general.fragments.GamesFragment; import com.vtosters.lite.general.fragments.GamesFragment;
import com.vtosters.lite.general.fragments.PhotosFragment; import com.vtosters.lite.general.fragments.PhotosFragment;
import ru.vtosters.lite.ui.fragments.VTSettings;
public class StartFragmentHook { public class StartFragmentHook {
public static Class getStartFragment() { public static Class getStartFragment() {
if (vkme()) { if (vkme()) {
@@ -55,7 +56,7 @@ public class StartFragmentHook {
case "videos": case "videos":
return videonewcatalog() ? VideoCatalogFragment.class : VideosFragment.class; return videonewcatalog() ? VideoCatalogFragment.class : VideosFragment.class;
case "settings": case "settings":
return useNewSettings(); return VTSettings.class;
case "apps": case "apps":
return AppsFragment.class; return AppsFragment.class;
case "discover": case "discover":
@@ -41,7 +41,7 @@ public class FFMpeg {
private static void checkFFMpegLibs() { private static void checkFFMpegLibs() {
var lib = new File(AndroidUtils.getGlobalContext().getFilesDir(), "libffmpegkit_abidetect.so"); var lib = new File(AndroidUtils.getGlobalContext().getFilesDir(), "libffmpegkit_abidetect.so");
if (!lib.exists()) { if (!lib.exists()) {
ToastUtils.a(AndroidUtils.getString("ffmpegkit_copy")); ToastUtils.a("Копирование библиотеки ffmpegkit");
copyAssets(); copyAssets();
} }
} }
@@ -1,16 +1,11 @@
package ru.vtosters.lite.music; package ru.vtosters.lite.music;
import static ru.vtosters.lite.utils.Preferences.getMusicDir;
import android.app.DownloadManager; import android.app.DownloadManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.RequiresApi;
import com.vk.dto.music.MusicTrack; import com.vk.dto.music.MusicTrack;
import org.json.JSONException; import org.json.JSONException;
@@ -34,7 +29,7 @@ public class MP3Downloader {
public static void execute(MusicTrack track) { public static void execute(MusicTrack track) {
var token = AndroidUtils.getPreferences().getString("vk_admin_token", ""); var token = AndroidUtils.getPreferences().getString("vk_admin_token", "");
if (token.isEmpty()) { if (token.isEmpty()) {
Toast.makeText(AndroidUtils.getGlobalContext(), AndroidUtils.getString("update_vk_admin_token"), Toast.LENGTH_SHORT).show(); Toast.makeText(AndroidUtils.getGlobalContext(), "Обновите токен VK Admin в настройках", Toast.LENGTH_SHORT).show();
return; return;
} }
var request = new Request.a() var request = new Request.a()
@@ -58,10 +53,12 @@ public class MP3Downloader {
if (responseNode.has("url")) { if (responseNode.has("url")) {
var url = responseNode.optString("url"); var url = responseNode.optString("url");
Log.d("MP3Downloader", url); Log.d("MP3Downloader", url);
if (url.endsWith(".mp3")) { if (url != null) {
downloadMP3(track.toString(), url); if (url.endsWith(".mp3")) {
} else if (VKM3UParser.isM3U8(url)) { downloadMP3(track.toString(), url);
AudioDownloader.downloadM3U8(track); } else if (VKM3UParser.isM3U8(url)) {
AudioDownloader.downloadM3U8(track);
}
} }
} }
} }
@@ -72,14 +69,13 @@ public class MP3Downloader {
}); });
} }
@RequiresApi(api = Build.VERSION_CODES.M)
private static void downloadMP3(String title, String url) { private static void downloadMP3(String title, String url) {
var downloadManager = AndroidUtils.getGlobalContext().getSystemService(DownloadManager.class); var downloadManager = AndroidUtils.getGlobalContext().getSystemService(DownloadManager.class);
var request = new DownloadManager.Request(Uri.parse(url)) var request = new DownloadManager.Request(Uri.parse(url))
.setAllowedOverRoaming(true) .setAllowedOverRoaming(true)
.setTitle("Downloading " + title) .setTitle("Downloading " + title)
.setDestinationInExternalFilesDir(AndroidUtils.getGlobalContext(), .setDestinationInExternalFilesDir(AndroidUtils.getGlobalContext(),
getMusicDir().getAbsolutePath(), Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(),
title + ".mp3") title + ".mp3")
.setVisibleInDownloadsUi(true); .setVisibleInDownloadsUi(true);
downloadManager.enqueue(request); downloadManager.enqueue(request);
@@ -24,7 +24,6 @@ import ru.vtosters.lite.net.NetCallback;
import ru.vtosters.lite.net.NetClient; import ru.vtosters.lite.net.NetClient;
import ru.vtosters.lite.net.NetRequest; import ru.vtosters.lite.net.NetRequest;
import ru.vtosters.lite.net.NetResponse; import ru.vtosters.lite.net.NetResponse;
import ru.vtosters.lite.utils.AndroidUtils;
public class Scrobbler { public class Scrobbler {
private static final String key = "5965d63402414776c54c266db0211746"; private static final String key = "5965d63402414776c54c266db0211746";
@@ -104,7 +103,7 @@ public class Scrobbler {
public static void auth(String login, String pass) { public static void auth(String login, String pass) {
if (login == null || pass == null) { if (login == null || pass == null) {
sendToast(AndroidUtils.getString("lastfm_credentials_empty")); sendToast("Логин или пароль не заданы");
return; return;
} }
@@ -120,7 +119,7 @@ public class Scrobbler {
@Override @Override
public void onFailure(NetCall call, IOException e) { public void onFailure(NetCall call, IOException e) {
Log.d("Scrobbler", "Auth failed", e); Log.d("Scrobbler", "Auth failed", e);
sendToast(AndroidUtils.getString("lastfm_auth_error")); sendToast("Ошибка входа");
} }
@Override @Override
@@ -156,7 +155,7 @@ public class Scrobbler {
edit().remove("username").apply(); edit().remove("username").apply();
edit().remove("sessionKey").apply(); edit().remove("sessionKey").apply();
scrobbled.clear(); scrobbled.clear();
sendToast(AndroidUtils.getString("lastfm_logout_success")); sendToast("Вы успешно вышли из учетной записи");
} }
public static boolean needToBeScrobble(String uid) { public static boolean needToBeScrobble(String uid) {
@@ -22,8 +22,6 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import ru.vtosters.lite.utils.AndroidUtils;
public class LogWriterService extends Service { public class LogWriterService extends Service {
public LogWriterService() { public LogWriterService() {
} }
@@ -46,12 +44,12 @@ public class LogWriterService extends Service {
writeLog(intent, file); writeLog(intent, file);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
makeText(getGlobalContext(), AndroidUtils.getString("logfile_error"), LENGTH_SHORT).show(); makeText(getGlobalContext(), "Не удалось сохранить лог-файл", LENGTH_SHORT).show();
} }
var notificationId = intent.getIntExtra("notificationId", 1); var notificationId = intent.getIntExtra("notificationId", 1);
var manager = (NotificationManager) getGlobalContext().getSystemService(Context.NOTIFICATION_SERVICE); var manager = (NotificationManager) getGlobalContext().getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancel(notificationId); manager.cancel(notificationId);
makeText(getGlobalContext(), AndroidUtils.getString("logfile_saved"), LENGTH_SHORT).show(); makeText(getGlobalContext(), "Лог-файл был сохранен", LENGTH_SHORT).show();
stopSelf(); stopSelf();
return START_NOT_STICKY; return START_NOT_STICKY;
@@ -0,0 +1,38 @@
package ru.vtosters.lite.themes;
import android.content.res.ColorStateList;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import com.vk.core.view.TintTextView;
import ru.vtosters.lite.utils.ThemesUtils;
public class Recolor {
private static int getColor(int original) {
var color = VTLColors.getColor(original);
if (color != -1) return color;
return original;
}
public static void recolorToolbar(Toolbar toolbar) {
if (ThemesUtils.isCustomThemeApplied())
toolbar.setBackgroundColor(ThemesUtils.getHeaderBackground());
}
public static void recolorIconToAccent(ImageView iv) {
if (ThemesUtils.isCustomThemeApplied())
iv.setImageTintList(ColorStateList.valueOf(VTLColors.getAccentColor()));
}
public static void recolorTextToAccent(TextView iv) {
iv.setTextColor(VTLColors.getAccentColor());
}
public static void recolorTintTextViewToAccent(TintTextView ttv) {
ttv.setDrawableTint(VTLColors.getAccentColor());
}
}
@@ -0,0 +1,94 @@
package ru.vtosters.lite.themes;
import android.content.Context;
import android.util.Log;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.ContextExtKt;
import com.vtosters.lite.R;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Preferences;
import ru.vtosters.lite.utils.ThemesUtils;
public class VTLColors {
private static final ThemesManager themesManager = ThemesManager.getInstance();
private static final ThemeModel currentTheme = themesManager.getCurrentTheme();
public static int getAccentColor() {
return getColor(R.attr.accent, R.attr.accentColor, R.attr.colorAccent, R.attr.vk_accent);
}
public static int getTextPrimaryColor() {
return getColor(R.attr.text_primary);
}
public static int getTextSecondaryColor() {
return getColor(R.attr.text_secondary);
}
public static int getTabbarBackground() {
return getColor(R.attr.tabbar_background);
}
public static int getTabbarActiveColor() {
if (ThemesUtils.isCustomThemeApplied())
return getColor(R.attr.tabbar_active_icon);
return Preferences.dockbar_accent()
? getAccentColor()
: AndroidUtils.getResources().getColor(ThemesUtils.isDarkTheme() ? R.color.white : R.color.gray_700);
}
public static int getTabbarInactiveColor() {
if (ThemesUtils.isCustomThemeApplied())
return getColor(R.attr.tabbar_inactive_icon);
return AndroidUtils.getResources().getColor(ThemesUtils.isDarkTheme() ? R.color.gray_500 : R.color.vk_steel_gray_300);
}
public static int getBackgroundContent() {
return getColor(R.attr.background_content);
}
public static int getBackgroundPage() {
return getColor(R.attr.background_page);
}
public static int getHeaderBackground() {
return getColor(R.attr.header_background);
}
public static int getHeaderText() {
return getColor(R.attr.header_text);
}
//region Hooks
public static int getColor(int... attrs) {
return getColor(attrs[0]);
}
public static int getColor(int attr) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = currentTheme.getColor(attr);
if (color != -1)
return color;
}
return VKThemeHelper.d(attr);
}
public static int getColor(Context context, int colorId) {
try {
Log.d("VTLColors", "getColor(Landroid/content/Context;I): " + AndroidUtils.getResources().getResourceEntryName(colorId));
} catch (Throwable ignored) {
}
if (ThemesUtils.isCustomThemeApplied()) {
int color = currentTheme.getColor(colorId);
if (color != -1)
return color;
}
return ContextExtKt.h(context, colorId);
}
//endregion
}
@@ -0,0 +1,140 @@
package ru.vtosters.lite.themes;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.util.SparseIntArray;
import android.util.TypedValue;
import com.vtosters.lite.R;
import java.lang.reflect.Field;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.utils.ReflectionUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class VTLResources {
private static final int STYLE_NUM_ENTRIES = Build.VERSION.SDK_INT >= 29 ? 7 : 6;
public static final SparseIntArray forcedAttrs = new SparseIntArray();
public static final SparseIntArray otherAttrs = new SparseIntArray();
private static Field dataField;
static {
try {
dataField = ReflectionUtils.getDeclaredField(TypedArray.class, "mData");
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
otherAttrs.put(R.attr.vklib_alv_optionIconTint, R.attr.im_dropdown_icon_color);
otherAttrs.put(R.attr.vkim_colorPrimary, R.attr.accent);
otherAttrs.put(R.attr.statusBarColorBack, R.attr.statusBarColorBack);
otherAttrs.put(R.attr.statusBarColorFront, R.attr.statusBarColorFront);
// android attributes
otherAttrs.put(android.R.attr.backgroundTint, R.attr.accent);
otherAttrs.put(android.R.attr.tint, R.attr.accent);
otherAttrs.put(android.R.attr.color, R.attr.accent);
forcedAttrs.put(-0x8e5515, R.attr.accent);
forcedAttrs.put(-0xe6e6e6, R.attr.background_content);
}
public static void prepareTypedArray(TypedArray target, int[] attrs) {
if (!ThemesUtils.isCustomThemeApplied() || attrs == null) return;
var theme = ThemesManager.getInstance().getCurrentTheme();
var data = getData(target);
for (int i = 0; i < attrs.length; i++) {
//var attr = attrs[i];
var off = STYLE_NUM_ENTRIES * i;
var type = data[off];
var replacement = -1;
if (type == TypedValue.TYPE_ATTRIBUTE) {
replacement = theme.getColor(data[off + 0x1]);
} else if (type == TypedValue.TYPE_INT_COLOR_ARGB8 || type == TypedValue.TYPE_INT_COLOR_RGB8) {
replacement = forcedAttrs.get(data[off + 0x1], -1);
if (replacement == -1
&& ThemesUtils.accentColors.contains(data[off + 0x1]))
replacement = ThemesUtils.getAccentColor();
}
if (replacement == -1) continue;
try {
data[off] = TypedValue.TYPE_INT_COLOR_RGB8; // type
data[off + 0x1] = replacement; // data
data[off + 0x2] = 0x0; // asset cookie
data[off + 0x3] = 0x0; // resource id
} catch (Throwable ignored) {
}
}
}
private static int[] getData(TypedArray target) {
try {
return (int[]) dataField.get(target);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return new int[0];
}
//region Hooks
public static TypedArray obtainStyledAttributes(Context context, int[] attrs) {
var target = context.obtainStyledAttributes(attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, int resId, int[] attrs) {
var target = context.obtainStyledAttributes(resId, attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, AttributeSet set, int[] attrs) {
var target = context.obtainStyledAttributes(set, attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
var target = context.obtainStyledAttributes(set, attrs, defStyleAttr, defStyleRes);
prepareTypedArray(target, attrs);
return target;
}
public static int getColor(Resources res, int colorId) {
return VTLColors.getColor(colorId);//res.getColor(colorId);
}
@SuppressLint("NewApi")
public static int getColor(Resources res, int colorId, Resources.Theme theme) {
return VTLColors.getColor(colorId);
}
@SuppressLint("UseCompatLoadingForColorStateLists")
public static ColorStateList getColorStateList(Resources res, int colorId) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = VTLColors.getColor(colorId);
if (color != -1)
return ColorStateList.valueOf(color);
}
return res.getColorStateList(colorId);
}
@SuppressLint("NewApi")
public static ColorStateList getColorStateList(Resources res, int colorId, Resources.Theme theme) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = VTLColors.getColor(colorId);
if (color != -1)
return ColorStateList.valueOf(color);
}
return res.getColorStateList(colorId, theme);
}
//endregion
}
@@ -0,0 +1,97 @@
package ru.vtosters.lite.themes.managers;
import android.os.Environment;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import ru.vtosters.lite.themes.models.PaletteModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils;
public class PalettesManager {
private static PalettesManager instance;
private static File palettesDir = new File(Environment.getExternalStorageDirectory(), "VTL/themes/palettes");
private List<PaletteModel> palettes = new ArrayList<>();
public static PalettesManager getInstance() {
if (instance == null)
instance = new PalettesManager();
return instance;
}
public PalettesManager() {
load();
}
public void load() {
palettes.clear();
if (!palettesDir.exists())
palettesDir.mkdirs();
final var palettes = palettesDir.listFiles((dir, name) -> name.endsWith(".json"));
var check = true;
if (palettes == null || palettes.length == 0)
check = copyPaletteFromAssets();
if (check)
parsePalettes();
}
private boolean copyPaletteFromAssets() {
try {
final var manager = AndroidUtils.getGlobalContext().getAssets();
final var assets = manager.list("vtl_themes/palettes/");
if (assets == null || assets.length == 0) return false;
var i = 0;
for (var asset : assets) {
try {
IOUtils.copyFile(manager.open("vtl_themes/palettes/" + asset), new File(palettesDir, asset));
i++;
} catch (IOException e) {
e.printStackTrace();
}
}
return i > 0;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
private void parsePalettes() {
var arr = palettesDir.listFiles((dir, name) -> name.endsWith(".json"));
if (arr == null || arr.length == 0)
throw new RuntimeException("Can't load palettes");
for (var file : arr) {
try {
var json = new JSONObject(IOUtils.readAllLines(file));
palettes.add(PaletteModel.fromJson(json));
} catch (IOException | JSONException e) {
e.printStackTrace();
}
}
}
public PaletteModel getPalette(String id) {
for (PaletteModel palette : palettes) {
if (id.equals(palette.id))
return palette;
}
return null;
}
public PaletteModel getPalette(int i) {
return palettes.get(i);
}
public int getPalettesCount() {
return palettes.size();
}
}
@@ -0,0 +1,247 @@
package ru.vtosters.lite.themes.managers;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.os.StrictMode;
import android.util.Log;
import com.vtosters.lite.auth.VKAccountManager;
import org.json.JSONException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import ru.vtosters.lite.ui.dialogs.ThemesEditorBottomSheetDialog;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class ThemesManager {
private static File themesDir;
private static ThemesManager instance;
private static ThemeModel currentTheme = null;
private List<ThemeModel> themes = new ArrayList<>();
public static ThemesManager getInstance() {
if (instance == null)
instance = new ThemesManager();
return instance;
}
public ThemesManager() {
init();
}
private void init() {
themes = new ArrayList<>();
currentTheme = new ThemeModel().setName("Тема по умолчанию")
.setAuthor("Разработчики ВК")
.setDarkMode(ThemesUtils.isDarkTheme())
.setId("default");
themes.add(currentTheme);
themesDir = new File(Environment.getExternalStorageDirectory(), "VTL/themes");
if (!themesDir.exists()) {
themesDir.mkdirs();
return;
}
// Support themes from Sova V RE (.svt)
var files = themesDir.listFiles((dir, name) -> name.endsWith(".vtlt") || name.endsWith(".svt") || name.endsWith(".json"));
if (files == null || files.length == 0)
return;
var currentThemeId = AndroidUtils.getPreferences().getString("vtl_theme_id", "default");
for (File file : files) {
try {
ThemeModel theme;
var abs = file.getAbsolutePath();
if (abs.endsWith(".svt") || abs.endsWith(".json"))
theme = svt2vtlt(file);
else
theme = read(file);
if (theme != null) {
Log.d("ThemesManager", theme.toString());
if (currentThemeId.equals(theme.id))
currentTheme = theme;
themes.add(theme);
}
} catch (IOException | JSONException e) {
e.printStackTrace();
}
}
if ("default".equals(currentTheme.id))
setTheme(currentTheme);
}
private ThemeModel svt2vtlt(File file) {
try {
var theme = read(file);
save(theme);
return theme;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public void reload() {
init();
}
public File getThemeFile(ThemeModel theme) throws IOException {
if (!themesDir.exists()) {
themesDir.mkdirs();
throw new FileNotFoundException("theme file not found");
}
var themeFile = new File(themesDir, theme.id + ".svt");
if (!themeFile.exists()) {
themeFile = new File(themesDir, theme.id + ".vtlt");
if (!themeFile.exists())
themeFile.createNewFile();
}
return themeFile;
}
public void setTheme(ThemeModel theme) {
AndroidUtils.getPreferences()
.edit()
.putString("vtl_theme_id", theme.id)
.commit();
}
public ThemeModel getTheme(int i) {
return themes.get(i);
}
public ThemeModel getCurrentTheme() {
return currentTheme;
}
public int getThemesCount() {
return themes.size();
}
public boolean isCurrentTheme(ThemeModel theme) {
return currentTheme.id.equals(theme.id);
}
public boolean hasTheme(ThemeModel theme) {
return hasTheme(theme.id);
}
public boolean hasTheme(String id) {
for (ThemeModel theme : themes) {
if (id.equals(theme.id))
return true;
}
return false;
}
/*
* Theme file storing method from Sova V RE is storing json clearly or compressed with gzip.
* If first byte byte is 0x1 or 0x2 json has been compressed with gzip,
* but if first byte is 0x2 next int is length of json string. */
private ThemeModel read(InputStream fis) throws IOException, JSONException {
InputStream is = fis;
var first = is.read();
if (first > 0x0 && first < 0x3) {
var gzis = new GZIPInputStream(is);
var dis = new DataInputStream(gzis);
if (first == 0x2)
dis.readInt();
is = dis;
}
return ThemeModel.fromJson(IOUtils.readAllLines(is));
}
private ThemeModel read(File file) throws IOException, JSONException {
return read(new FileInputStream(file));
}
public void save(ThemeModel theme) throws IOException, JSONException {
var buffer = theme.toJson().toString().getBytes(StandardCharsets.UTF_8);
var fos = new FileOutputStream(getThemeFile(theme));
// writing with data length
fos.write(0x2);
var gzos = new GZIPOutputStream(fos);
var dos = new DataOutputStream(gzos);
dos.writeInt(buffer.length);
dos.write(buffer);
dos.close();
}
public void delete(ThemeModel theme) {
try {
getThemeFile(theme).delete();
} catch (IOException e) {
e.printStackTrace();
}
themes.remove(theme);
if (isCurrentTheme(theme)) {
setTheme(null);
}
}
public void create(Activity activity, String name) throws JSONException, IOException {
var id = name.toLowerCase().replace(" ", "-");
if (hasTheme(id)) {
var i = 1;
while (hasTheme(id + "-" + i)) {
i++;
}
id += "-" + i;
}
var userProfile = VKAccountManager.d().e1();
ThemeModel theme = new ThemeModel()
.setName(name)
.setAuthor(userProfile.c + " " + userProfile.e)
.setDarkMode(true)
// .setColors(DEFAULT_COLORS)
.setId(id);
themes.add(theme);
ThemesEditorBottomSheetDialog.create(activity, theme, false);
save(theme);
}
public void copy(ContentResolver contentResolver, Uri uri) throws IOException, JSONException {
var theme = read(contentResolver.openInputStream(uri));
if (isCurrentTheme(theme)) {
int i = 1;
while (hasTheme(theme.id + "-" + i)) {
i++;
}
theme.id += "-" + i;
}
themes.add(theme);
save(theme);
}
public void share(Context context, ThemeModel theme) throws Exception {
var vmPolicy = StrictMode.getVmPolicy();
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().build());
var intent = new Intent(Intent.ACTION_SEND)
.setType("file/*")
.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(getThemeFile(theme)));
context.startActivity(Intent.createChooser(intent, ""));
StrictMode.setVmPolicy(vmPolicy);
}
}
@@ -0,0 +1,26 @@
package ru.vtosters.lite.themes.models;
public class ColorModel {
public String resName;
public int id;
public int color;
public ColorModel(int id, int color) {
this.id = id;
this.color = color;
}
public ColorModel(String resName, int id, int color) {
this.resName = resName;
this.id = id;
this.color = color;
}
public static ColorModel create(int id, int color) {
return new ColorModel(id, color);
}
public static ColorModel create(String resName, int id, int color) {
return new ColorModel(resName, id, color);
}
}
@@ -0,0 +1,94 @@
package ru.vtosters.lite.themes.models;
import android.graphics.Color;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class PaletteModel {
public String id;
public String name;
public String author;
public List<ColorModel> colors = new ArrayList<>();
public PaletteModel() {
}
public PaletteModel(String id, String name, String author, List<ColorModel> colors) {
this.id = id;
this.name = name;
this.author = author;
this.colors = colors;
}
public PaletteModel setId(String id) {
this.id = id;
return this;
}
public PaletteModel setName(String name) {
this.name = name;
return this;
}
public PaletteModel setAuthor(String author) {
this.author = author;
return this;
}
public PaletteModel setColors(List<ColorModel> colors) {
this.colors = colors;
return this;
}
public PaletteModel setColor(String name, int color) {
this.colors.add(new ColorModel(name, 0, color));
return this;
}
public int getColor(String name) {
for (var item : colors)
if (name.equals(item.resName))
return item.color;
return -1;
}
public static PaletteModel fromJson(JSONObject json) throws JSONException {
var palette = new PaletteModel()
.setId(json.optString("palette_id"))
.setName(json.optString("name"))
.setAuthor(json.optString("author"));
var paletteNode = json.getJSONArray("palette");
for (int i = 0; i < paletteNode.length(); i++) {
var colorNode = paletteNode.getJSONObject(i);
var name = colorNode.getString("name");
if (colorNode.has("colors")) {
var colorsNode = colorNode.getJSONArray("colors");
for (int j = 0; j < colorsNode.length(); j++) {
var subColorNode = colorsNode.getJSONObject(j);
var index = subColorNode.getString("index");
var subColor = subColorNode.getString("color");
if (!subColor.startsWith("#")) subColor = "#" + subColor;
palette.setColor(name + " " + index, Color.parseColor(subColor));
}
} else {
var color = colorNode.getString("color");
if (!color.startsWith("#")) color = "#" + color;
palette.setColor(name, Color.parseColor(color));
}
}
return palette;
}
public static PaletteModel valuesOf(String id, String name, String author, List<ColorModel> colors) {
return new PaletteModel()
.setId(id)
.setName(name)
.setAuthor(author)
.setColors(colors);
}
}
@@ -0,0 +1,152 @@
package ru.vtosters.lite.themes.models;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.Pair;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import ru.vtosters.lite.themes.managers.PalettesManager;
import ru.vtosters.lite.utils.AndroidUtils;
public class ThemeModel {
public String author;
public String name;
public boolean isDarkMode;
public String id;
public List<ColorModel> colors = new ArrayList<>();
public ThemeModel() {
}
public ThemeModel(String author, String name, boolean darkMode, String id, List<ColorModel> colors) {
this.author = author;
this.name = name;
this.isDarkMode = darkMode;
this.id = id;
this.colors = colors;
}
public ThemeModel setAuthor(String author) {
this.author = author;
return this;
}
public ThemeModel setName(String name) {
this.name = name;
return this;
}
public ThemeModel setDarkMode(boolean b) {
this.isDarkMode = b;
return this;
}
public ThemeModel setId(String id) {
this.id = id;
return this;
}
public ThemeModel setColors(List<ColorModel> colors) {
this.colors = colors;
return this;
}
public ThemeModel setColor(int attrId, int color) {
this.colors.add(new ColorModel(attrId, color));
return this;
}
public int getColor(int attrId) {
for (var item : colors)
if (attrId == item.id)
return item.color;
return -1;
}
public static ThemeModel valuesOf(String author, String name, boolean darkMode, String id, List<ColorModel> colors) {
var theme = new ThemeModel()
.setAuthor(author)
.setName(name)
.setDarkMode(darkMode)
.setId(id)
.setColors(colors);
return theme;
}
public static ThemeModel fromJson(String json) throws JSONException {
return fromJson(new JSONObject(json));
}
public static ThemeModel fromJson(JSONObject json) {
List<String> palettes;
if (json.has("palettes")) {
palettes = new ArrayList<>();
var arr = json.optString("palettes")
.split("\\||,|&|;");
Collections.addAll(palettes, arr);
}
List<ColorModel> colors = new ArrayList<>();
var colorsJson = json.optJSONObject("colors");
var names = colorsJson.names();
for (int i = 0; i < colorsJson.length(); i++) {
var name = names.optString(i);
var value = colorsJson.optString(name);
int attrId;
try {
attrId = AndroidUtils.getIdentifier(name, "attr");
} catch (Resources.NotFoundException e) {
attrId = AndroidUtils.getIdentifier(name, "color");
}
final int color;
if (value.contains(".")) {
var paletteId = value.substring(0, value.indexOf("."));
var palette = PalettesManager.getInstance().getPalette(paletteId);
var paletteColor = value.substring(value.indexOf(".") + 1);
color = palette.getColor(paletteColor);
} else {
color = Color.parseColor(value.startsWith("#") ? value : "#" + value);
}
colors.add(new ColorModel(name, attrId, color));
}
return valuesOf(
json.optString("author"),
json.optString("name"),
json.optBoolean("dark"),
json.optString("id"),
colors
);
}
public JSONObject toJson() throws JSONException {
var colorsJson = new JSONObject();
for (var item : colors)
colorsJson.put(item.resName, Integer.toHexString(item.color).toUpperCase());
return new JSONObject()
.put("author", this.author)
.put("name", this.name)
.put("dark", this.isDarkMode)
.put("id", this.id)
.put("colors", colorsJson);
}
public ThemeModel clone() {
return new ThemeModel(
author,
name,
isDarkMode,
id,
colors.stream()
.map(colorModel -> new ColorModel(colorModel.resName, colorModel.id, colorModel.color))
.collect(Collectors.toList())
);
}
}
@@ -0,0 +1,14 @@
package ru.vtosters.lite.themes.models;
import android.util.Pair;
import androidx.annotation.IdRes;
import java.util.ArrayList;
import java.util.List;
public class ViewModel {
@IdRes public int id;
public List<Pair<Integer, Integer>> attrs = new ArrayList<>();
}
@@ -0,0 +1,67 @@
package ru.vtosters.lite.themes.proxy;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.XmlRes;
import ru.vtosters.lite.themes.VTLResources;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.utils.ThemesUtils;
public class ProxyResources extends Resources {
private final Resources mOriginalResource;
public ProxyResources(Context context, Resources original) {
this(original);
}
public ProxyResources(Resources original) {
super(original.getAssets(), original.getDisplayMetrics(), original.getConfiguration());
mOriginalResource = original;
}
@Override
public int getColor(int id, @Nullable Resources.Theme theme) throws Resources.NotFoundException {
if (ThemesUtils.isCustomThemeApplied()) {
var color = ThemesManager.getInstance().getCurrentTheme().getColor(id);
if (color != -1)
return color;
}
return mOriginalResource.getColor(id, theme);
}
@RequiresApi(api = Build.VERSION_CODES.M)
@NonNull
@Override
public ColorStateList getColorStateList(@XmlRes int id, @Nullable Resources.Theme theme)
throws Resources.NotFoundException {
var target = mOriginalResource.getColorStateList(id, theme);
if (ThemesUtils.isCustomThemeApplied() && ThemesUtils.isAccentedColor(target)) {
return ColorStateList.valueOf(ThemesUtils.getAccentColor());
}
return target;
}
@Nullable
@Override
public Drawable getDrawableForDensity(int id, int density, @Nullable Resources.Theme theme) {
return mOriginalResource.getDrawableForDensity(id, density, theme);
}
@Override
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
var ta = super.obtainAttributes(set, attrs);
VTLResources.prepareTypedArray(ta, attrs);
return ta;
}
}
@@ -11,8 +11,6 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import ru.vtosters.lite.utils.AndroidUtils;
public class APKInstallActivity extends AppCompatActivity { public class APKInstallActivity extends AppCompatActivity {
public static final int REQUEST_INSTALL_PERMISSION = 1; public static final int REQUEST_INSTALL_PERMISSION = 1;
@@ -67,7 +65,7 @@ public class APKInstallActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
} catch (Exception e) { } catch (Exception e) {
Toast.makeText(this, AndroidUtils.getString("apk_install_error") + " " + e.getLocalizedMessage(), Toast.LENGTH_LONG).show(); Toast.makeText(this, "Ошибка установки обновления " + e.getLocalizedMessage(), Toast.LENGTH_LONG).show();
} }
finish(); finish();
@@ -0,0 +1,23 @@
package ru.vtosters.lite.ui.activities;
import android.os.Bundle;
import android.view.MenuInflater;
import com.vk.core.ui.themes.ThemableActivity;
import ru.vtosters.lite.utils.LifecycleUtils;
public class VTLThemableActivity extends ThemableActivity {
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
LifecycleUtils.addActivity(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
LifecycleUtils.removeActivity(this);
}
}
@@ -34,10 +34,10 @@ public class CategorizedAdapter extends RecyclerView.Adapter<CategorizedAdapter.
public static final int SELECTED_STATE = -0x1; public static final int SELECTED_STATE = -0x1;
public static final int DISABLED_STATE = -0x2; public static final int DISABLED_STATE = -0x2;
private final List mSelectedItems; private List mSelectedItems;
private final List mDisabledItems; private List mDisabledItems;
private final List mUnmovedItems; private List mUnmovedItems;
private final IViewHolderBinder mBinder; private IViewHolderBinder mBinder;
private int mMinSelectedItems = -1; private int mMinSelectedItems = -1;
private int mMaxSelectedItems = -1; private int mMaxSelectedItems = -1;
@@ -0,0 +1,81 @@
package ru.vtosters.lite.ui.adapters;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.vk.core.drawable.BorderDrawable;
import com.vk.core.util.Screen;
import com.vk.stories.view.StoryCircleImageView;
import java.util.List;
import ru.vtosters.lite.themes.models.ColorModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.ColorPickerViewHolder> {
private List<ColorModel> mColors;
private OnColorSelectListener mSelectListener;
public ColorPickerAdapter(List<ColorModel> colors, OnColorSelectListener selectListener) {
this.mColors = colors;
this.mSelectListener = selectListener;
}
@NonNull
@Override
public ColorPickerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
var container = LayoutInflater.from(parent.getContext())
.inflate(AndroidUtils.getIdentifier("color_picker_item", "layout"), parent, false);
return new ColorPickerViewHolder(container);
}
@Override
public void onBindViewHolder(@NonNull ColorPickerViewHolder holder, int pos) {
holder.bind(mColors.get(pos));
}
@Override
public int getItemCount() {
return mColors.size();
}
public class ColorPickerViewHolder extends RecyclerView.ViewHolder {
private View mContainer;
private FrameLayout mColorPreviewBorder;
private StoryCircleImageView mColorPreview;
private TextView mColorName;
private TextView mColorValue;
public ColorPickerViewHolder(@NonNull View view) {
super(view);
mContainer = view;
mColorPreviewBorder = view.findViewById(AndroidUtils.getIdentifier("color_preview_border", "id"));
mColorPreview = view.findViewById(AndroidUtils.getIdentifier("color_preview", "id"));
mColorName = view.findViewById(AndroidUtils.getIdentifier("color_name", "id"));
mColorValue = view.findViewById(AndroidUtils.getIdentifier("color_value", "id"));
}
public void bind(ColorModel item) {
mContainer.setOnClickListener(v -> mSelectListener.onColorSelected(ColorPickerAdapter.this, item));
mColorPreviewBorder.setBackground(new BorderDrawable(ThemesUtils.isDarkTheme() ? Color.WHITE : Color.BLACK, Screen.c(24.0f), Screen.c(1.0f)));
mColorPreview.setPlaceholderColor(item.color);
mColorName.setText(item.resName);
mColorValue.setText("#" + Integer.toHexString(item.color).toUpperCase());
}
}
public interface OnColorSelectListener {
void onColorSelected(ColorPickerAdapter adapter, ColorModel colorModel);
}
}
@@ -25,7 +25,7 @@ import ru.vtosters.lite.utils.LayoutUtils;
public class ImagineArrayAdapter extends ArrayAdapter<ImagineArrayAdapter.ImagineArrayAdapterItem> { public class ImagineArrayAdapter extends ArrayAdapter<ImagineArrayAdapter.ImagineArrayAdapterItem> {
private List<ImagineArrayAdapterItem> mItems = new ArrayList<>(); private List<ImagineArrayAdapterItem> mItems = new ArrayList<>();
private final OnClickListener mListener; private OnClickListener mListener;
private int mSelectedIndex = -1; private int mSelectedIndex = -1;
public ImagineArrayAdapter(@NonNull Context context, OnClickListener listener) { public ImagineArrayAdapter(@NonNull Context context, OnClickListener listener) {
@@ -134,8 +134,8 @@ public class ImagineArrayAdapter extends ArrayAdapter<ImagineArrayAdapter.Imagin
} }
public static class ImagineArrayAdapterItem { public static class ImagineArrayAdapterItem {
private final Drawable mIcon; private Drawable mIcon;
private final String mText; private String mText;
public ImagineArrayAdapterItem(Drawable icon, String text) { public ImagineArrayAdapterItem(Drawable icon, String text) {
this.mIcon = icon; this.mIcon = icon;
@@ -167,6 +167,6 @@ public class ImagineArrayAdapter extends ArrayAdapter<ImagineArrayAdapter.Imagin
} }
public interface OnClickListener { public interface OnClickListener {
void onClick(int i); public void onClick(int i);
} }
} }
@@ -20,10 +20,13 @@ import com.vtosters.lite.R;
import ru.vtosters.lite.utils.AndroidUtils; import ru.vtosters.lite.utils.AndroidUtils;
public class MessagesPreviewAdapter extends RecyclerView.Adapter<MessagesPreviewAdapter.MessagePreviewViewHolder> { public class MessagesPreviewAdapter extends RecyclerView.Adapter<MessagesPreviewAdapter.MessagePreviewViewHolder> {
private static final int ME = 0x0; private static final int ME = 0x0;
private static final int ANONYMOUS = -0x1; private static final int ANONYMOUS = -0x1;
private final String[] mMessages = AndroidUtils.getArray("wallpaper_change_dialog"); private final String[] mMessages = {
"Доброе время", "Доброе утро, день, вечер. ночь", "Как живёшь?", "Не мёртвый, и то хорошо"
};
@Override @Override
public int getItemViewType(int i) { public int getItemViewType(int i) {
@@ -0,0 +1,63 @@
package ru.vtosters.lite.ui.adapters;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.vtosters.lite.R;
import ru.vtosters.lite.themes.managers.PalettesManager;
import ru.vtosters.lite.ui.dialogs.PalettesBottomSheetDialog;
import ru.vtosters.lite.themes.models.PaletteModel;
import ru.vtosters.lite.utils.AndroidUtils;
public class PalettesAdapter extends RecyclerView.Adapter<PalettesAdapter.PaletteViewHolder> {
private PalettesManager manager = PalettesManager.getInstance();
@NonNull
@Override
public PaletteViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
var container = LayoutInflater.from(parent.getContext()).inflate(
AndroidUtils.getIdentifier("palette_manager_item", "layout"), parent, false
);
return new PaletteViewHolder(container);
}
@Override
public void onBindViewHolder(@NonNull PaletteViewHolder holder, int pos) {
holder.bind(manager.getPalette(pos));
}
@Override
public int getItemCount() {
return manager.getPalettesCount();
}
public static class PaletteViewHolder extends RecyclerView.ViewHolder {
private View mContainer;
private TextView mName;
private TextView mAuthor;
public PaletteViewHolder(@NonNull View view) {
super(view);
mContainer = view;
mName = view.findViewById(R.id.name);
mAuthor = view.findViewById(AndroidUtils.getIdentifier("author", "id"));
}
public void bind(PaletteModel palette) {
mContainer.setOnClickListener(v -> {
PalettesBottomSheetDialog.create((Activity) v.getContext(), palette);
});
mName.setText(palette.name);
mAuthor.setText(palette.author);
}
}
}
@@ -7,7 +7,6 @@ import static ru.vtosters.lite.utils.ThemesUtils.getSTextAttr;
import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr; import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr;
import static ru.vtosters.lite.utils.ThemesUtils.recolorDrawable; import static ru.vtosters.lite.utils.ThemesUtils.recolorDrawable;
import android.annotation.SuppressLint;
import android.net.Uri; import android.net.Uri;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -29,9 +28,8 @@ import ru.vtosters.lite.tgs.TGPref;
import ru.vtosters.lite.utils.AndroidUtils; import ru.vtosters.lite.utils.AndroidUtils;
public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.StickerPackViewHolder> { public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.StickerPackViewHolder> {
private static final TelegramStickersService sService = TelegramStickersService.getInstance(getGlobalContext()); private static TelegramStickersService sService = TelegramStickersService.getInstance(getGlobalContext());
@SuppressLint("UseCompatLoadingForDrawables")
@NonNull @NonNull
@Override @Override
public StickerPackViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public StickerPackViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@@ -63,13 +61,13 @@ public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.
} }
public class StickerPackViewHolder extends RecyclerView.ViewHolder { public class StickerPackViewHolder extends RecyclerView.ViewHolder {
private final LinearLayout mContainer; private LinearLayout mContainer;
private final ImageView mStickerPreview; private ImageView mStickerPreview;
private final ImageView mUpdateButton; private ImageView mUpdateButton;
private final ImageView mDeleteButton; private ImageView mDeleteButton;
private final TextView mName; private TextView mName;
private final TextView mStickersCount; private TextView mStickersCount;
private final SwitchCompat mSwitch; private SwitchCompat mSwitch;
public StickerPackViewHolder(@NonNull View view) { public StickerPackViewHolder(@NonNull View view) {
@@ -84,7 +82,6 @@ public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.
mStickersCount = view.findViewWithTag("vkim_cancel_label_text"); mStickersCount = view.findViewWithTag("vkim_cancel_label_text");
} }
@SuppressLint("SetTextI18n")
public void bind(int position) { public void bind(int position) {
final TelegramStickersPack pack = sService.getPacksListReference().get(position); final TelegramStickersPack pack = sService.getPacksListReference().get(position);
if (pack.state != TelegramStickersPack.DOWNLOADED) return; if (pack.state != TelegramStickersPack.DOWNLOADED) return;
@@ -0,0 +1,166 @@
package ru.vtosters.lite.ui.adapters;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.vk.core.drawable.BorderDrawable;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.Screen;
import com.vk.core.util.ToastUtils;
import com.vtosters.lite.R;
import org.json.JSONException;
import java.io.IOException;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.ui.dialogs.EditTextDialog;
import ru.vtosters.lite.ui.dialogs.ThemesEditorBottomSheetDialog;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.ui.views.NoTouchRadioButton;
import ru.vtosters.lite.ui.vkui.VKUIActionPopup;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class ThemesAdapter extends RecyclerView.Adapter<ThemesAdapter.ThemeViewHolder> {
public ThemesManager mManager = ThemesManager.getInstance();
@NonNull
@Override
public ThemeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
var container = LayoutInflater.from(parent.getContext()).inflate(
AndroidUtils.getIdentifier("theme_manager_item", "layout"), parent, false
);
return new ThemeViewHolder(container);
}
@Override
public void onBindViewHolder(@NonNull ThemeViewHolder holder, int pos) {
holder.bind(mManager.getTheme(pos));
}
@Override
public int getItemCount() {
return mManager.getThemesCount();
}
public class ThemeViewHolder extends RecyclerView.ViewHolder {
private ConstraintLayout mContainer;
private FrameLayout mThemeModePreviewBorder;
private ImageView mThemeModePreview;
private TextView mName;
private TextView mAuthor;
private NoTouchRadioButton mRadioButton;
public ThemeViewHolder(@NonNull View view) {
super(view);
mContainer = (ConstraintLayout) view;
mThemeModePreviewBorder = view.findViewById(AndroidUtils.getIdentifier("theme_mode_preview_border", "id"));
mThemeModePreview = view.findViewById(AndroidUtils.getIdentifier("theme_mode_preview", "id"));
mName = view.findViewById(R.id.name);
mAuthor = view.findViewById(AndroidUtils.getIdentifier("author", "id"));
mRadioButton = view.findViewById(AndroidUtils.getIdentifier("selection", "id"));
}
public void bind(ThemeModel theme) {
var accent = getAccentColorFromCustomTheme(theme);
mThemeModePreviewBorder.setBackground(new BorderDrawable(accent, Screen.c(24.0f), Screen.c(1.0f)));
mThemeModePreview.setImageResource(AndroidUtils.getIdentifier(
"vk_icon_" + (theme.isDarkMode ? "moon" : "sun") + "_outline_28",
"drawable"));
mThemeModePreview.setImageTintList(ColorStateList.valueOf(accent));
var isCurrentTheme = mManager.isCurrentTheme(theme);
if (!isCurrentTheme)
mContainer.setOnClickListener(v -> {
mManager.setTheme(theme);
LifecycleUtils.restartApplication();
});
if (!"default".equals(theme.id))
mContainer.setOnLongClickListener(v -> {
showActionPopup(v.getContext(), v, isCurrentTheme, theme);
return true;
});
else
mContainer.setOnLongClickListener(null);
mRadioButton.setChecked(isCurrentTheme);
mName.setText(theme.name);
mAuthor.setText(theme.author);
}
private void showActionPopup(Context context, View anchorView, boolean isCurrentTheme, ThemeModel theme) {
var builder = new VKUIActionPopup(context, anchorView, true, R.color.colorAccent)
.setItem("Редактировать название",
() -> showEditThemeNameDialog(context, theme))
.setItem("Изменить цвета",
() -> ThemesEditorBottomSheetDialog.create((Activity) context, theme, isCurrentTheme))
.setItem("Поделиться темой", () -> {
try {
mManager.share(context, theme);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.a("Не удалось поделиться темой");
}})
.setItem("Удалить тему", () -> {
mManager.delete(theme);
if (isCurrentTheme)
LifecycleUtils.restartApplication();
else
notifyDataSetChanged();
});
builder.create().d();
}
private void showEditThemeNameDialog(Context context, ThemeModel theme) {
EditTextDialog.create(context, "Редактирование названия темы", "Название темы", theme.name, (dialog, which, editText) -> {
var newName = editText.getText().toString();
if (TextUtils.isEmpty(newName)) {
ToastUtils.a("Название не может быть пустым");
return;
}
if (newName.equals(theme.name)) {
ToastUtils.a("Вы не изменили название");
return;
}
theme.setName(newName);
try {
mManager.save(theme);
notifyDataSetChanged();
} catch (IOException | JSONException e) {
e.printStackTrace();
ToastUtils.a("Не удалось изменить название темы");
}
});
}
}
private int getAccentColorFromCustomTheme(ThemeModel theme) {
if (!"default".equals(theme.id)) {
int color = theme.getColor(R.attr.accent);
if (color != -1)
return color;
color = theme.getColor(R.attr.colorAccent);
if (color != -1)
return color;
color = theme.getColor(R.attr.vk_accent);
if (color != -1)
return color;
}
return VKThemeHelper.d((R.attr.accent));
}
}
@@ -23,7 +23,6 @@ import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils; import ru.vtosters.lite.utils.IOUtils;
import ru.vtosters.lite.utils.Preferences; import ru.vtosters.lite.utils.Preferences;
@@ -43,7 +42,7 @@ public class BackupManager {
public static void backupOnlines() throws IOException { public static void backupOnlines() throws IOException {
if (getPrefContent("onlines.xml") == null) { if (getPrefContent("onlines.xml") == null) {
Toast.makeText(getGlobalContext(), AndroidUtils.getString("no_data_to_backup"), LENGTH_SHORT).show(); Toast.makeText(getGlobalContext(), "Нет данных для резервного копирования", LENGTH_SHORT).show();
return; return;
} }
@@ -55,10 +54,10 @@ public class BackupManager {
FileWriter out = new FileWriter(file); FileWriter out = new FileWriter(file);
out.write(getPrefContent("onlines.xml")); out.write(getPrefContent("onlines.xml"));
out.close(); out.close();
Toast.makeText(getGlobalContext(), AndroidUtils.getString("backup_saved_in") + " " + file.getAbsolutePath(), LENGTH_LONG).show(); Toast.makeText(getGlobalContext(), "Сохранено в файл " + file.getAbsolutePath(), LENGTH_LONG).show();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(getGlobalContext(), AndroidUtils.getString("backup_save_error"), LENGTH_SHORT).show(); Toast.makeText(getGlobalContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
} }
} }
@@ -71,10 +70,10 @@ public class BackupManager {
FileWriter out = new FileWriter(file); FileWriter out = new FileWriter(file);
out.write(getPrefContent("com.vtosters.lite_preferences.xml")); out.write(getPrefContent("com.vtosters.lite_preferences.xml"));
out.close(); out.close();
Toast.makeText(getGlobalContext(), AndroidUtils.getString("backup_saved_in") + " " + file.getAbsolutePath(), LENGTH_LONG).show(); Toast.makeText(getGlobalContext(), "Сохранено в файл " + file.getAbsolutePath(), LENGTH_LONG).show();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(getGlobalContext(), AndroidUtils.getString("backup_save_error"), LENGTH_SHORT).show(); Toast.makeText(getGlobalContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
} }
} }
@@ -5,7 +5,6 @@ import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getString; import static ru.vtosters.lite.utils.AndroidUtils.getString;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
@@ -58,7 +57,6 @@ public class CrashReporter {
var saveLogIntent = new Intent(getGlobalContext(), LogWriterService.class); var saveLogIntent = new Intent(getGlobalContext(), LogWriterService.class);
saveLogIntent.putExtra("log", logString); saveLogIntent.putExtra("log", logString);
saveLogIntent.putExtra("notificationId", 1); saveLogIntent.putExtra("notificationId", 1);
@SuppressLint("UnspecifiedImmutableFlag")
var psaveLogIntent = PendingIntent.getService(getGlobalContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT); var psaveLogIntent = PendingIntent.getService(getGlobalContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
var builder = new Notification.Builder(getGlobalContext()); var builder = new Notification.Builder(getGlobalContext());
@@ -67,8 +65,12 @@ public class CrashReporter {
builder.setContentText(logString); builder.setContentText(logString);
builder.setStyle(new Notification.BigTextStyle().bigText(logString)); builder.setStyle(new Notification.BigTextStyle().bigText(logString));
builder.setAutoCancel(true); builder.setAutoCancel(true);
builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getGlobalContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT))); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
builder.addAction(new Notification.Action(0, getString("vtl_crash_save"), psaveLogIntent)); builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getGlobalContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, getString("vtl_crash_save"), psaveLogIntent));
} else {
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
}
if (Build.VERSION.SDK_INT >= 26) { if (Build.VERSION.SDK_INT >= 26) {
builder.setChannelId("crashes"); builder.setChannelId("crashes");
@@ -5,13 +5,10 @@ import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import static ru.vtosters.lite.utils.Preferences.getBoolValue; import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.milkshake; import static ru.vtosters.lite.utils.Preferences.milkshake;
import static ru.vtosters.lite.utils.Preferences.superapp; import static ru.vtosters.lite.utils.Preferences.superapp;
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
import static ru.vtosters.lite.utils.Preferences.videonewcatalog; import static ru.vtosters.lite.utils.Preferences.videonewcatalog;
import static ru.vtosters.lite.utils.Preferences.vkme; import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Preferences.vkme_notifs; import static ru.vtosters.lite.utils.Preferences.vkme_notifs;
import android.os.Build;
import com.vk.apps.AppsFragment; import com.vk.apps.AppsFragment;
import com.vk.discover.ThemedFeedFragment; import com.vk.discover.ThemedFeedFragment;
import com.vk.fave.fragments.FaveTabFragment; import com.vk.fave.fragments.FaveTabFragment;
@@ -45,6 +42,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import ru.vtosters.lite.ui.fragments.VTSettings;
import ru.vtosters.lite.ui.items.DockBarTab; import ru.vtosters.lite.ui.items.DockBarTab;
import ru.vtosters.lite.utils.AndroidUtils; import ru.vtosters.lite.utils.AndroidUtils;
@@ -103,28 +101,14 @@ public class DockBarEditorManager {
mSelectedTabs.add(getTabByTag(tag)); mSelectedTabs.add(getTabByTag(tag));
allTags.remove(tag); allTags.remove(tag);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { allTags.forEach(tag -> mDisabledTabs.add(getTabByTag(tag)));
allTags.forEach(tag -> mDisabledTabs.add(getTabByTag(tag)));
} else {
for (String tag : allTags) {
mDisabledTabs.add(getTabByTag(tag));
}
}
} }
public void save() { public void save() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { AndroidUtils.getPreferences().edit().putString("dockbar_tabs", mSelectedTabs.stream()
getPreferences().edit().putString("dockbar_tabs", mSelectedTabs.stream() .map(tab -> tab.tag)
.map(tab -> tab.tag) .collect(Collectors.joining(",")))
.collect(Collectors.joining(","))) .commit();
.commit();
} else {
StringBuilder sb = new StringBuilder();
for (DockBarTab tab : mSelectedTabs) {
sb.append(tab.tag).append(",");
}
getPreferences().edit().putString("dockbar_tabs", sb.toString()).commit();
}
} }
public void reset() { public void reset() {
@@ -277,7 +261,7 @@ public class DockBarEditorManager {
R.drawable.ic_settings_outline_28, R.drawable.ic_settings_outline_28,
R.string.menu_settings, R.string.menu_settings,
R.id.menu_settings, R.id.menu_settings,
useNewSettings()); VTSettings.class);
} }
} }
} }
@@ -1,6 +1,7 @@
package ru.vtosters.lite.ui.components; package ru.vtosters.lite.ui.components;
public interface IItemMovingListener { public interface IItemMovingListener {
void onItemDismiss(int index); void onItemDismiss(int index);
boolean onItemMove(int fromPosition, int toPosition); boolean onItemMove(int fromPosition, int toPosition);
@@ -1,63 +0,0 @@
package ru.vtosters.lite.ui.components;
import static ru.vtosters.lite.ui.vkui.VBListBuilder.VBListItem;
import static ru.vtosters.lite.ui.vkui.VBListBuilder.buildListOf;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import android.app.Activity;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import ru.vtosters.lite.ui.vkui.VBottomSheetBuilder;
import ru.vtosters.lite.utils.AndroidUtils;
public class NewsfeedListManager {
public static void callEditorPopup(Activity activity) {
var selectedItems = getDefaultPrefs().getString("news_feed_selected_items", "");
var filtersSet = getDefaultPrefs().getStringSet("news_feed_items_set", Collections.synchronizedSet(new LinkedHashSet<>()));
var list = new ArrayList<VBListItem>();
if (filtersSet.size() == 0) {
sendToast(AndroidUtils.getString("newsfeed_update_feed"));
return;
}
synchronized (filtersSet) {
for (String item : filtersSet) {
var id = item.substring(0, item.indexOf("|"));
var title = item.substring(item.indexOf("|") + 1);
list.add(new VBListItem(id, title, selectedItems.contains(id)));
}
}
VBottomSheetBuilder.show(activity, new VBottomSheetBuilder.VBSContent(
AndroidUtils.getString("newsfeed_list_choose_to_hide"),
buildListOf(activity, list),
new VBottomSheetBuilder.VBSContent.VBSButton(
AndroidUtils.getString("save"),
() -> {
var newSelectedItems = "";
for (VBListItem item : list)
if (item.checked)
newSelectedItems += item.id + ",";
getDefaultPrefs().edit()
.putString("news_feed_selected_items", newSelectedItems)
.apply();
sendToast(AndroidUtils.getString("newsfeed_list_update_feed_to_work"));
}
)
));
}
public static void resetHideItems() {
getDefaultPrefs().edit()
.putString("news_feed_selected_items", "")
.apply();
sendToast(AndroidUtils.getString("newsfeed_list_hidden_reseted"));
}
}
@@ -2,14 +2,11 @@ package ru.vtosters.lite.ui.components;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences; import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import android.os.Build;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import ru.vtosters.lite.ui.items.DockBarTab;
import ru.vtosters.lite.ui.items.SuperAppItem; import ru.vtosters.lite.ui.items.SuperAppItem;
import ru.vtosters.lite.utils.AndroidUtils; import ru.vtosters.lite.utils.AndroidUtils;
@@ -43,30 +40,15 @@ public class SuperAppEditorManager {
mSelectedItems.add(getItemByTag(tag)); mSelectedItems.add(getItemByTag(tag));
allTags.remove(tag); allTags.remove(tag);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { allTags.forEach(tag -> mDisabledItems.add(getItemByTag(tag)));
allTags.forEach(tag -> mDisabledItems.add(getItemByTag(tag)));
} else {
for (String tag : allTags) {
mDisabledItems.add(getItemByTag(tag));
}
}
} }
public void save() { public void save() {
if (mSelectedItems.size() > 0) if (mSelectedItems.size() > 0)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { getPreferences().edit().putString("superapp_items", mSelectedItems.stream()
getPreferences().edit().putString("superapp_items", mSelectedItems.stream() .map(item -> item.type)
.map(item -> item.type) .collect(Collectors.joining(",")))
.collect(Collectors.joining(","))) .commit();
.commit();
} else {
StringBuilder sb = new StringBuilder();
for (SuperAppItem item : mSelectedItems) {
sb.append(item.type);
sb.append(",");
}
getPreferences().edit().putString("superapp_items", sb.toString()).commit();
}
else else
reset(); reset();
} }
@@ -89,33 +71,33 @@ public class SuperAppEditorManager {
private SuperAppItem getItemByTag(String tag) { private SuperAppItem getItemByTag(String tag) {
switch (tag) { switch (tag) {
case "menu": case "menu":
return SuperAppItem.valuesOf("menu", AndroidUtils.getString("superapp_menu")); return SuperAppItem.valuesOf("menu", "Меню приложения");
case "miniapps": case "miniapps":
return SuperAppItem.valuesOf("miniapps", AndroidUtils.getString("superapp_miniapps")); return SuperAppItem.valuesOf("miniapps", "Mini Apps: виджет");
case "vkpay_slim": case "vkpay_slim":
return SuperAppItem.valuesOf("vkpay_slim", AndroidUtils.getString("superapp_vkpay")); return SuperAppItem.valuesOf("vkpay_slim", "VK Pay");
case "greeting": case "greeting":
return SuperAppItem.valuesOf("greeting", AndroidUtils.getString("superapp_greeting")); return SuperAppItem.valuesOf("greeting", "Приветствие");
case "promo": case "promo":
return SuperAppItem.valuesOf("promo", AndroidUtils.getString("superapp_miniapps_promo")); return SuperAppItem.valuesOf("promo", "Mini Apps: промо");
case "holiday": case "holiday":
return SuperAppItem.valuesOf("holiday", AndroidUtils.getString("superapp_holiday")); return SuperAppItem.valuesOf("holiday", "Дни рождения у друзей");
case "weather": case "weather":
return SuperAppItem.valuesOf("weather", AndroidUtils.getString("superapp_weather")); return SuperAppItem.valuesOf("weather", "Погода");
case "sport": case "sport":
return SuperAppItem.valuesOf("sport", AndroidUtils.getString("superapp_sport")); return SuperAppItem.valuesOf("sport", "Спортивные события");
case "games": case "games":
return SuperAppItem.valuesOf("games", AndroidUtils.getString("superapp_games")); return SuperAppItem.valuesOf("games", "Игры");
case "informer": case "informer":
return SuperAppItem.valuesOf("informer", AndroidUtils.getString("superapp_informer")); return SuperAppItem.valuesOf("informer", "Информер");
case "food": case "food":
return SuperAppItem.valuesOf("food", AndroidUtils.getString("superapp_food")); return SuperAppItem.valuesOf("food", "Еда");
case "event": case "event":
return SuperAppItem.valuesOf("event", AndroidUtils.getString("superapp_event")); return SuperAppItem.valuesOf("event", "Мероприятия");
case "music": case "music":
return SuperAppItem.valuesOf("music", AndroidUtils.getString("superapp_music")); return SuperAppItem.valuesOf("music", "Музыка");
case "vk_run": case "vk_run":
return SuperAppItem.valuesOf("vk_run", AndroidUtils.getString("superapp_vk_run")); return SuperAppItem.valuesOf("vk_run", "VK Run");
default: default:
return null; return null;
} }
@@ -0,0 +1,58 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.themes.VTLColors.getTextSecondaryColor;
import static ru.vtosters.lite.themes.VTLColors.getTextPrimaryColor;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import android.content.Context;
import android.content.DialogInterface;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.vk.core.dialogs.alert.VkAlertDialog;
import ru.vtosters.lite.ui.vkui.VKUIEditText;
import ru.vtosters.lite.ui.vkui.VKUITextView;
import ru.vtosters.lite.utils.LayoutUtils;
public class EditTextDialog {
public static void create(Context context, String title, String hint, String text, OnClickListener clickListener) {
var container = new LinearLayout(context);
container.setOrientation(LinearLayout.VERTICAL);
container.setPadding(
dp2px(8), dp2px(12), dp2px(8), dp2px(12)
);
if (!TextUtils.isEmpty(hint)) {
var hitText = new VKUITextView(context, VKUITextView.STYLE_SUBHEAD_1);
hitText.setText(hint);
hitText.setPadding(dp2px(8), 0, 0, dp2px(8));
container.addView(hitText, LayoutUtils.createLinear(-2, -2));
}
var editText = new VKUIEditText(context);
if (!TextUtils.isEmpty(text))
editText.setText(text);
editText.setTextColor(getTextPrimaryColor());
editText.setHintTextColor(getTextSecondaryColor());
editText.setPadding(dp2px(8), 0, dp2px(8), 0);
var editTextParams = LayoutUtils.createLinear(-1, dp2px(44));
container.addView(editText, editTextParams);
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(context);
if (!TextUtils.isEmpty(title))
builder.setTitle(title);
builder.setPositiveButton("OK", (dialog, which) -> clickListener.onClick(dialog, which, editText));
builder.setNegativeButton("Отмена", (dialog, which) -> dialog.cancel());
var alert = builder.create();
alert.setView(container);
alert.show();
}
public interface OnClickListener {
void onClick(DialogInterface dialog, int which, EditText editText);
}
}
@@ -15,7 +15,6 @@ import androidx.appcompat.widget.SwitchCompat;
import com.vk.core.dialogs.alert.VkAlertDialog; import com.vk.core.dialogs.alert.VkAlertDialog;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LayoutUtils; import ru.vtosters.lite.utils.LayoutUtils;
public class MessageSettings { public class MessageSettings {
@@ -51,12 +50,12 @@ public class MessageSettings {
four.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f)); four.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
five.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f)); five.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
zero.setText(AndroidUtils.getString("proxy_disable")); // Отключить zero.setText("Отключить");
one.setText(AndroidUtils.getString("message_self_destruct_15sec")); one.setText("15 секунд");
two.setText(AndroidUtils.getString("message_self_destruct_1min")); two.setText("1 минута");
three.setText(AndroidUtils.getString("message_self_destruct_5min")); three.setText("5 минут");
four.setText(AndroidUtils.getString("message_self_destruct_1hour")); four.setText("1 час");
five.setText(AndroidUtils.getString("message_self_destruct_24hours")); five.setText("24 часа");
zero.setTextColor(getTextAttr()); zero.setTextColor(getTextAttr());
one.setTextColor(getTextAttr()); one.setTextColor(getTextAttr());
@@ -88,7 +87,7 @@ public class MessageSettings {
@SuppressLint("UseSwitchCompatOrMaterialCode") @SuppressLint("UseSwitchCompatOrMaterialCode")
var silentSwitch = new SwitchCompat(new ContextThemeWrapper(context, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_Switch)); var silentSwitch = new SwitchCompat(new ContextThemeWrapper(context, com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_Switch));
silentSwitch.setText(AndroidUtils.getString("silent_messages")); silentSwitch.setText("Бесшумные сообщения");
silentSwitch.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f)); silentSwitch.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
silentSwitch.setTextColor(getTextAttr()); silentSwitch.setTextColor(getTextAttr());
silentSwitch.setChecked(isSilentEnabled); silentSwitch.setChecked(isSilentEnabled);
@@ -105,12 +104,12 @@ public class MessageSettings {
mContainer.addView(silentSwitch, LayoutUtils.createLinear(-1, -2)); mContainer.addView(silentSwitch, LayoutUtils.createLinear(-1, -2));
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(context); VkAlertDialog.Builder builder = new VkAlertDialog.Builder(context);
builder.setTitle(AndroidUtils.getString("message_send_settings_title")); builder.setTitle("Настройки отправки");
builder.setMessage(AndroidUtils.getString("silent_messages_time_select")); builder.setMessage("Выберите время исчезновения сообщения");
builder.setCancelable(true); builder.setCancelable(true);
builder.setNegativeButton(AndroidUtils.getString("cancel"), null); builder.setNegativeButton("Отмена", null);
builder.setView(mContainer); builder.setView(mContainer);
builder.setPositiveButton(AndroidUtils.getString("vtl_confirm"), (dialog, which) -> { // Применить builder.setPositiveButton("Применить", (dialog, which) -> {
var checked = rg.getCheckedRadioButtonId(); var checked = rg.getCheckedRadioButtonId();
if (checked == zero.getId()) { if (checked == zero.getId()) {
@@ -9,6 +9,7 @@ import ru.vtosters.lite.ui.vkui.ModalBottomSheetWrapper;
import ru.vtosters.lite.utils.OTAUtils; import ru.vtosters.lite.utils.OTAUtils;
public class OTADialog implements OTAUtils.OTAListener { public class OTADialog implements OTAUtils.OTAListener {
private final Activity mActivity; private final Activity mActivity;
private final OTAUtils mHelper; private final OTAUtils mHelper;
@@ -20,21 +21,21 @@ public class OTADialog implements OTAUtils.OTAListener {
mHelper.loadData(); mHelper.loadData();
} }
public static void checkUpdates(Activity activity) { public static OTADialog checkUpdates(Activity activity) {
new OTADialog(activity); return new OTADialog(activity);
} }
@Override @Override
public void onUpdateApplied() { public void onUpdateApplied() {
mActivity.runOnUiThread(() -> { mActivity.runOnUiThread(() -> {
// Toast.makeText(mActivity, "Обновления найдены", Toast.LENGTH_SHORT).show(); // Toast.makeText(mActivity, "Обновления найдены", Toast.LENGTH_SHORT).show();
new ModalBottomSheetWrapper(mActivity) // new ModalBottomSheetWrapper(mActivity)
.setTitle(getString("newversion") + " " + mHelper.getNewVersionName()) // .setTitle(getString("newversion") + " " + mHelper.getNewVersionName())
.setUpdateInfoView(mHelper.getUpdateDescription()) // // .setUpdateInfoView(mHelper.getUpdateDescription())
.setPositiveButton(getString("updateanddownload"), () -> { // .setPositiveButton(getString("updateanddownload"), () -> {
OTADownloader.downloadBuild(mHelper.getDownloadUrl()); // OTADownloader.downloadBuild(mHelper.getDownloadUrl());
}) // })
.show(); // .show();
}); });
} }
@@ -0,0 +1,29 @@
package ru.vtosters.lite.ui.dialogs;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import com.vk.core.util.ToastUtils;
import ru.vtosters.lite.ui.adapters.ColorPickerAdapter;
import ru.vtosters.lite.themes.models.PaletteModel;
public class PalettesBottomSheetDialog {
private static final String TAG = "palettes_copy_color";
public static void create(Activity activity, PaletteModel palette) {
var instance = new VTColorPickerBottomSheetDialog(activity);
var colorPickerAdapter = new ColorPickerAdapter(palette.colors, (adapter, color) -> {
var manager = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
manager.setPrimaryClip(ClipData.newPlainText("color", Integer.toHexString(color.color).toUpperCase()));
ToastUtils.a("Скопировано в буфер обмена");
instance.dismiss();
});
instance.setTitle(palette.name)
.setAdapter(colorPickerAdapter, true)
.show(TAG, true);
}
}
@@ -1,4 +1,5 @@
package ru.vtosters.lite.ui.dialogs; package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px; import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.edit; import static ru.vtosters.lite.utils.AndroidUtils.edit;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences; import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
@@ -8,10 +9,8 @@ import android.content.Context;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.SeekBar; import android.widget.SeekBar;
import com.vk.core.dialogs.alert.VkAlertDialog; import com.vk.core.dialogs.alert.VkAlertDialog;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LayoutUtils; import ru.vtosters.lite.utils.LayoutUtils;
public class RoundingSeekbarDialog{ public class RoundingSeekbarDialog{
@@ -26,12 +25,12 @@ public class RoundingSeekbarDialog{
mContainer.addView(seek, LayoutUtils.createLinear(-1, -2)); mContainer.addView(seek, LayoutUtils.createLinear(-1, -2));
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(context); VkAlertDialog.Builder builder = new VkAlertDialog.Builder(context);
builder.setTitle(AndroidUtils.getString("pic_rounding_title")); builder.setTitle("Выберите размер закругления углов");
builder.setMessage(AndroidUtils.getString("pic_rounding_info")); builder.setMessage("Для отключения функции закругления углов введите 0");
builder.setCancelable(true); builder.setCancelable(true);
builder.setNegativeButton(AndroidUtils.getString("cancel"), null); builder.setNegativeButton("Отмена", null);
builder.setView(mContainer); builder.setView(mContainer);
builder.setPositiveButton(AndroidUtils.getString("vtl_confirm"), (dialog, which) -> { builder.setPositiveButton("Применить", (dialog, which) -> {
edit().putInt("pic_rounding", seek.getProgress()).commit(); edit().putInt("pic_rounding", seek.getProgress()).commit();
restartApplicationWithTimer(); restartApplicationWithTimer();
}); });
@@ -77,6 +77,8 @@ public class ServerDialog {
private static void getResponse(String body) throws Exception { private static void getResponse(String body) throws Exception {
JSONObject jSONObject = new JSONObject(body); JSONObject jSONObject = new JSONObject(body);
Log.d("VTLOG", "getResponse: " + jSONObject);
if (jSONObject.getString("title").equals("")) { if (jSONObject.getString("title").equals("")) {
showAlert = false; showAlert = false;
return; return;
@@ -95,18 +97,18 @@ public class ServerDialog {
if (activity != null) { if (activity != null) {
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(activity); // VkAlertDialog.Builder builder = new VkAlertDialog.Builder(activity);
builder.setTitle(title); // builder.setTitle(title);
builder.setMessage(message); // builder.setMessage(message);
builder.setCancelable(cancelable); // builder.setCancelable(cancelable);
builder.setPositiveButton(positiveButton, (dialogInterface, i) -> edit().putBoolean(key, false).apply()); // builder.setPositiveButton(positiveButton, (dialogInterface, i) -> edit().putBoolean(key, false).apply());
builder.setNeutralButton(neutralButton, (dialogInterface, i) -> { // builder.setNeutralButton(neutralButton, (dialogInterface, i) -> {
edit().putBoolean(key, false).apply(); // edit().putBoolean(key, false).apply();
activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse(link))); // activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse(link)));
}); // });
if (getBoolValue(key, true) && showForNotVerified() && showAlert) { // if (getBoolValue(key, true) && showForNotVerified() && showAlert) {
builder.show(); // builder.show();
} // }
}); });
} }
} }
@@ -0,0 +1,212 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import android.app.Activity;
import android.view.Gravity;
import android.widget.LinearLayout;
import androidx.appcompat.widget.SwitchCompat;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.core.util.ToastUtils;
import org.json.JSONException;
import java.io.IOException;
import ru.vtosters.lite.themes.VTLColors;
import ru.vtosters.lite.themes.managers.PalettesManager;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.themes.models.ColorModel;
import ru.vtosters.lite.ui.adapters.ColorPickerAdapter;
import ru.vtosters.lite.themes.models.PaletteModel;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.ui.views.flask.builder.ColorPickerDialogBuilder;
import ru.vtosters.lite.ui.views.rarepebble.ColorPickerView;
import ru.vtosters.lite.utils.LayoutUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
public class ThemesEditorBottomSheetDialog {
private static final String THEME_EDITOR_TAG = "theme_editor";
private static final String PALETTES_EDITOR_TAG = "palettes_editor";
private static final String[] COLOR_PICKERS = {
"Wheel Color Picker by QuadFlask",
"Palettes",
"Advanced Color Picker by Martin Stone"
};
public static void create(Activity activity, ThemeModel theme, boolean currentTheme) {
var newTheme = theme.clone();
var colorPickerAdapter = new ColorPickerAdapter(newTheme.colors, (adapter, color) -> {
new VkAlertDialog.Builder(activity)
.setItems(COLOR_PICKERS, (dialog, which) -> {
if (which == 0) {
showQuadFlashWheelColorPicker(activity, adapter, color);
} else if (which == 1) {
showPaletteChoiceDialog(activity, adapter, color);
} else if (which == 2) {
showMartinStoneColorPicker(activity, adapter, color);
}
})
.create()
.show();
});
var instance = new VTColorPickerBottomSheetDialog(activity);
addSwitches(instance.getContainer(), newTheme, colorPickerAdapter);
instance.setAdapter(colorPickerAdapter, false)
.setTitle("Редактирование " + theme.name)
.setPositiveButton("Применить", () -> {
String message;
try {
ThemesManager.getInstance().save(newTheme);
message = "Тема изменена";
} catch (IOException | JSONException e) {
e.printStackTrace();
message = "Ошибка при изменении темы";
}
if (currentTheme) {
LifecycleUtils.restartApplication();
return;
}
ToastUtils.a(message);
instance.dismiss();
})
.show(THEME_EDITOR_TAG, true);
}
private static void addSwitches(LinearLayout container, ThemeModel theme, ColorPickerAdapter adapter) {
var context = container.getContext();
var switchesContainer = new LinearLayout(context);
switchesContainer.setOrientation(LinearLayout.HORIZONTAL);
switchesContainer.setPadding(0, dp2px(5), 0, dp2px(5));
container.addView(switchesContainer, LayoutUtils.createLinear(-1, -2));
var amoledTheme = new SwitchCompat(context);
amoledTheme.setTextColor(VTLColors.getTextPrimaryColor());
amoledTheme.setTextSize(16.0f);
amoledTheme.setText("AMOLED-тема");
amoledTheme.setEnabled(theme.isDarkMode);
amoledTheme.setGravity(Gravity.CENTER);
amoledTheme.setOnCheckedChangeListener((buttonView, isChecked) -> {
theme.isDarkMode = isChecked;
if (isChecked) {
replaceToAmoled(theme, adapter);
} else {
replaceToLight(theme, adapter);
}
adapter.notifyDataSetChanged();
});
var darkTheme = new SwitchCompat(context);
darkTheme.setChecked(theme.isDarkMode);
darkTheme.setTextColor(VTLColors.getTextPrimaryColor());
darkTheme.setGravity(Gravity.CENTER);
darkTheme.setTextSize(16.0f);
darkTheme.setText("Темная тема");
darkTheme.setOnCheckedChangeListener((buttonView, isChecked) -> {
theme.isDarkMode = isChecked;
if (isChecked) {
amoledTheme.setEnabled(true);
replaceToDark(theme, adapter);
} else {
amoledTheme.setChecked(false);
amoledTheme.setEnabled(false);
replaceToLight(theme, adapter);
}
adapter.notifyDataSetChanged();
});
var darkThemeParams = LayoutUtils.createLinear(-1, -2);
darkThemeParams.weight = 1.0f;
switchesContainer.addView(darkTheme, darkThemeParams);
var amoledThemeParams = LayoutUtils.createLinear(-1, -2);
amoledThemeParams.weight = 1.0f;
switchesContainer.addView(amoledTheme, amoledThemeParams);
}
private static void replaceToLight(ThemeModel theme, ColorPickerAdapter adapter) {
}
private static void replaceToDark(ThemeModel theme, ColorPickerAdapter adapter) {
}
private static void replaceToAmoled(ThemeModel theme, ColorPickerAdapter adapter) {
}
private static void showMartinStoneColorPicker(
Activity activity,
ColorPickerAdapter adapter,
ColorModel dest) {
var colorPickerView = new ColorPickerView(activity);
colorPickerView.setColor(dest.color);
var alertDialog = new VkAlertDialog.Builder(activity)
.setTitle("Выберите цвет")
.setPositiveButton("Выбрать", (dialog, which) -> {
dest.color = colorPickerView.getColor();
adapter.notifyDataSetChanged();
dialog.dismiss();
})
.create();
alertDialog.setView(colorPickerView);
alertDialog.show();
}
private static void showQuadFlashWheelColorPicker(
Activity activity,
ColorPickerAdapter adapter,
ColorModel dest) {
ColorPickerDialogBuilder
.with(activity)
.setTitle("Выберите цвет")
.showBorder(true)
.setOnColorSelectedListener((dialog, selectedColor) -> {
dest.color = selectedColor;
adapter.notifyDataSetChanged();
dialog.cancel();
})
.build()
.show();
}
private static void showPaletteChoiceDialog(
Activity activity,
ColorPickerAdapter adapter,
ColorModel dest
) {
var palettesManager = PalettesManager.getInstance();
var titles = new String[palettesManager.getPalettesCount()];
for (int i = 0; i < titles.length; i++)
titles[i] = palettesManager.getPalette(i).name;
new VkAlertDialog.Builder(activity)
.setItems(titles, (dialog, which) -> createPaletteColorPicker(
activity,
adapter,
dest,
palettesManager.getPalette(which)))
.create()
.show();
}
private static void createPaletteColorPicker(
Activity activity,
ColorPickerAdapter themeEditAdapter,
ColorModel dest,
PaletteModel palette
) {
var instance = new VTColorPickerBottomSheetDialog(activity);
var colorPickerAdapter = new ColorPickerAdapter(palette.colors, (adapter, color) -> {
dest.color = color.color;
ToastUtils.a("Цвет был изменён");
themeEditAdapter.notifyDataSetChanged();
instance.dismiss();
});
instance.setTitle(palette.name)
.setAdapter(colorPickerAdapter, true)
.show(PALETTES_EDITOR_TAG, true);
}
}
@@ -10,7 +10,6 @@ import android.util.Log;
import com.vk.core.dialogs.alert.VkAlertDialog; import com.vk.core.dialogs.alert.VkAlertDialog;
import ru.vtosters.lite.translators.BaseTranslator; import ru.vtosters.lite.translators.BaseTranslator;
import ru.vtosters.lite.utils.AndroidUtils;
public class Translate { public class Translate {
public static void showTranslatedText(Context context, String text) { public static void showTranslatedText(Context context, String text) {
@@ -28,16 +27,16 @@ public class Translate {
private static void showDialog(Context context, String text) { private static void showDialog(Context context, String text) {
VkAlertDialog.Builder alertDialog = new VkAlertDialog.Builder(context); VkAlertDialog.Builder alertDialog = new VkAlertDialog.Builder(context);
alertDialog.setTitle(AndroidUtils.getString("translator_title")); alertDialog.setTitle("Переводчик");
alertDialog.setMessage(text); alertDialog.setMessage(text);
alertDialog.setPositiveButton(AndroidUtils.getString("close"), (dialog, which) -> { alertDialog.setPositiveButton("Закрыть", (dialog, which) -> {
dialog.cancel(); dialog.cancel();
}); });
alertDialog.setNeutralButton(AndroidUtils.getString("copy"), (dialog, which) -> { alertDialog.setNeutralButton("Скопировать", (dialog, which) -> {
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("Copied Text", text); android.content.ClipData clip = android.content.ClipData.newPlainText("Copied Text", text);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
sendToast(AndroidUtils.getString("copied_to_clipboard")); sendToast("Скопировано в буфер обмена");
}); });
var alert = alertDialog.create(); var alert = alertDialog.create();
alert.show(); alert.show();
@@ -0,0 +1,49 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.themes.VTLColors.getTextPrimaryColor;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import android.app.Activity;
import android.widget.LinearLayout;
import android.widget.TextView;
import ru.vtosters.lite.downloaders.OTADownloader;
import ru.vtosters.lite.ui.vkui.ModalBottomSheetWrapper;
import ru.vtosters.lite.utils.OTAUtils;
public class UpdateBottomSheetDialog extends ModalBottomSheetWrapper<UpdateBottomSheetDialog> {
private static final String TAG = "ota";
private Activity mActivity;
public UpdateBottomSheetDialog(Activity activity) {
super(activity);
this.mActivity = activity;
}
public UpdateBottomSheetDialog setUpdateDescriptionText(String changelog) {
var container = new LinearLayout(mActivity);
var changelogView = new TextView(mActivity);
container.setOrientation(LinearLayout.VERTICAL);
changelogView.setPadding(0, dp2px(8), 0, 0);
changelogView.setText(getString("changelog") + ": \n" + changelog);
changelogView.setTextColor(getTextPrimaryColor());
container.addView(changelogView, new LinearLayout.LayoutParams(-1, -2));
return setView(container);
}
public static void create(Activity activity, OTAUtils helper) {
new UpdateBottomSheetDialog(activity)
.setTitle(getString("newversion") + " " + helper.getNewVersionName())
.setUpdateDescriptionText(helper.getUpdateDescription())
.setPositiveButton(getString("updateanddownload"), () -> {
OTADownloader.downloadBuild(helper.getDownloadUrl());
})
.show(TAG);
}
}
@@ -0,0 +1,41 @@
package ru.vtosters.lite.ui.dialogs;
import android.app.Activity;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import ru.vtosters.lite.ui.adapters.ColorPickerAdapter;
import ru.vtosters.lite.ui.vkui.ModalBottomSheetWrapper;
import ru.vtosters.lite.utils.LayoutUtils;
public class VTColorPickerBottomSheetDialog extends ModalBottomSheetWrapper<VTColorPickerBottomSheetDialog> {
private Activity mActivity;
private LinearLayout mContainer;
public VTColorPickerBottomSheetDialog(Activity activity) {
super(activity);
this.mActivity = activity;
mContainer = new LinearLayout(mActivity);
mContainer.setLayoutParams(LayoutUtils.createLinear(-1, -1));
mContainer.setOrientation(LinearLayout.VERTICAL);
}
public VTColorPickerBottomSheetDialog setAdapter(ColorPickerAdapter adapter, boolean searchMode) {
var recyclerView = new RecyclerView(mActivity);
recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
var recyclerViewParams = LayoutUtils.createLinear(-1, -1);
mContainer.addView(recyclerView, recyclerViewParams);
mBuilder.a(mContainer);
return setView(mContainer);
}
public LinearLayout getContainer() {
return mContainer;
}
}
@@ -22,8 +22,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.vtosters.lite.R; import com.vtosters.lite.R;
import java.util.Objects;
import ru.vtosters.lite.ui.adapters.CategorizedAdapter; import ru.vtosters.lite.ui.adapters.CategorizedAdapter;
import ru.vtosters.lite.ui.components.DockBarEditorManager; import ru.vtosters.lite.ui.components.DockBarEditorManager;
import ru.vtosters.lite.ui.components.ItemMovingCallback; import ru.vtosters.lite.ui.components.ItemMovingCallback;
@@ -85,7 +83,7 @@ public class DockBarEditorFragment extends BaseToolbarFragment {
}); });
adapter.setMinAndMaxCounts(DockBarEditorManager.MIN_SELECTED_TABS, DockBarEditorManager.MAX_SELECTED_TABS); adapter.setMinAndMaxCounts(DockBarEditorManager.MIN_SELECTED_TABS, DockBarEditorManager.MAX_SELECTED_TABS);
var recyclerView = new RecyclerView(requireContext()); var recyclerView = new RecyclerView(getContext());
recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
@@ -1,14 +1,12 @@
package ru.vtosters.lite.ui.fragments; package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.copyright_post; import static ru.vtosters.lite.utils.Preferences.copyright_post;
import static ru.vtosters.lite.utils.Preferences.offline;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import androidx.preference.Preference; import androidx.preference.Preference;
@@ -16,9 +14,6 @@ import com.vk.navigation.Navigator;
import com.vk.newsfeed.NewsfeedSettingsFragment; import com.vk.newsfeed.NewsfeedSettingsFragment;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
import ru.vtosters.lite.ui.components.NewsfeedListManager;
import ru.vtosters.lite.utils.AndroidUtils;
public class FeedFragment extends MaterialPreferenceToolbarFragment { public class FeedFragment extends MaterialPreferenceToolbarFragment {
@Override @Override
public void onCreate(Bundle bundle) { public void onCreate(Bundle bundle) {
@@ -30,33 +25,6 @@ public class FeedFragment extends MaterialPreferenceToolbarFragment {
private void prefs() { private void prefs() {
findPreference("officialnewssett").setOnPreferenceClickListener(new openofficialsett()); findPreference("officialnewssett").setOnPreferenceClickListener(new openofficialsett());
findPreference("cringecopyright").setEnabled(!copyright_post()); findPreference("cringecopyright").setEnabled(!copyright_post());
findPreference("spamfilters").setSummary(count(getPrefsValue("spamfilters")));
findPreference("sourcenamefilter").setSummary(count(getPrefsValue("sourcenamefilter")));
findPreference("linkfilter").setSummary(count(getPrefsValue("linkfilter")));
findPreference("newsfeedlistmanager").setOnPreferenceClickListener(preference -> {
NewsfeedListManager.callEditorPopup(getActivity());
return true;
});
var str = getDefaultPrefs().getString("news_feed_selected_items", "");
findPreference("newsfeedlistmanager").setSummary(
String.format(AndroidUtils.getString("feed_hidden"), (!TextUtils.isEmpty(str) ? str.split(",").length : 0))
);
findPreference("newsfeedlistmanager_reset").setOnPreferenceClickListener(preference -> {
NewsfeedListManager.resetHideItems();
return true;
});
}
private String count(String text) {
// count comma separated words in string
var count = text.split(", ").length;
if (count < 1 || text.isEmpty()) {
return AndroidUtils.getString("feed_no_elements");
} else {
return String.format(AndroidUtils.getString("feed_elements_count"), count);
}
} }
@Override @Override
@@ -37,8 +37,6 @@ import androidx.core.content.res.ResourcesCompat;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
import ru.vtosters.lite.utils.AndroidUtils;
public class IconsFragment extends MaterialPreferenceToolbarFragment { public class IconsFragment extends MaterialPreferenceToolbarFragment {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
public static void callSelectDialog(Context ctx, String appicon) { public static void callSelectDialog(Context ctx, String appicon) {
@@ -64,7 +62,7 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
rgVK.setText("VK"); rgVK.setText("VK");
rgVK.setTextColor(getTextAttr()); rgVK.setTextColor(getTextAttr());
rgVKontakte.setText(AndroidUtils.getString("app_name_alter")); rgVKontakte.setText("ВКонтакте");
rgVKontakte.setTextColor(getTextAttr()); rgVKontakte.setTextColor(getTextAttr());
rgVKontakte.setChecked(isZaboronaEnabled()); rgVKontakte.setChecked(isZaboronaEnabled());
@@ -72,9 +70,9 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
rgDefault.setChecked(!isZaboronaEnabled()); rgDefault.setChecked(!isZaboronaEnabled());
AlertDialog.Builder builder = new AlertDialog.Builder(ctx, getAlertStyle()); AlertDialog.Builder builder = new AlertDialog.Builder(ctx, getAlertStyle());
builder.setTitle(AndroidUtils.getString("app_name_select_title")); builder.setTitle("Выберите название приложения");
builder.setView(rg); builder.setView(rg);
builder.setPositiveButton(AndroidUtils.getString("vtl_confirm"), ((dialog, which) -> { builder.setPositiveButton("Применить", ((dialog, which) -> {
var defname = preferences.getString("appname", "vt"); var defname = preferences.getString("appname", "vt");
var deficon = preferences.getString("selectedicon", "vt"); var deficon = preferences.getString("selectedicon", "vt");
@@ -95,7 +93,7 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
switchComponent(appicon, "vkontakte", deficon, defname); switchComponent(appicon, "vkontakte", deficon, defname);
} }
})); }));
builder.setNegativeButton(AndroidUtils.getString("cancel"), ((dialog, which) -> { builder.setNegativeButton("Отмена", ((dialog, which) -> {
dialog.dismiss(); dialog.dismiss();
})); }));
@@ -116,13 +114,13 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
this.addPreferencesFromResource(vtosterXml); this.addPreferencesFromResource(vtosterXml);
if (!hasVerification() && !getBoolValue("dialogrecomm", false)) { if (!hasVerification() && !getBoolValue("dialogrecomm", false)) {
addPreference(this, "", AndroidUtils.getString("icons_warning"), AndroidUtils.getString("icons_warning_info"), "ic_about_outline_28", preference -> { addPreference(this, "", "Доступны не все функции!", "Для разблокировки необходимо сделать пожертование от 99р", "ic_about_outline_28", preference -> {
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://vtosters.app/donate/"))); getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://vtosters.app")));
return false; return false;
}); });
} }
addPreferenceCategory(this, AndroidUtils.getString("icons_title")); addPreferenceCategory(this, "Иконки");
for (var i = 0; i < icons().size(); i++) { for (var i = 0; i < icons().size(); i++) {
if (icons().get(i) == null || iconsValues().get(i) == null) return; if (icons().get(i) == null || iconsValues().get(i) == null) return;
@@ -153,7 +151,7 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
} }
if (!hasVerification() && !getBoolValue("dialogrecomm", false)) { if (!hasVerification() && !getBoolValue("dialogrecomm", false)) {
addPreferenceCategory(this, AndroidUtils.getString("unavailable_icons")); addPreferenceCategory(this, "Недоступные иконки");
for (var i = 2; i < sIconsPlusNames.size(); i++) { for (var i = 2; i < sIconsPlusNames.size(); i++) {
if (sIconsPlusNames.get(i) == null || sIconsPlus.get(i) == null) return; if (sIconsPlusNames.get(i) == null || sIconsPlus.get(i) == null) return;
@@ -178,7 +176,7 @@ public class IconsFragment extends MaterialPreferenceToolbarFragment {
} }
addPreferenceDrawable(this, icon, iconname, "", drawable, preference -> { addPreferenceDrawable(this, icon, iconname, "", drawable, preference -> {
sendToast(AndroidUtils.getString("unavailable_icon_warning")); sendToast("Иконка доступна только обладателям верификации");
return false; return false;
}); });
} }
@@ -1,7 +1,6 @@
package ru.vtosters.lite.ui.fragments; package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import static ru.vtosters.lite.utils.LifecycleUtils.restartApplicationWithTimer; import static ru.vtosters.lite.utils.LifecycleUtils.restartApplicationWithTimer;
import android.os.Bundle; import android.os.Bundle;
@@ -10,9 +9,6 @@ import androidx.preference.Preference;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
import ru.vtosters.lite.ui.dialogs.RoundingSeekbarDialog;
import ru.vtosters.lite.utils.AndroidUtils;
public class InterfaceFragment extends MaterialPreferenceToolbarFragment { public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
@Override @Override
public void onCreate(Bundle bundle) { public void onCreate(Bundle bundle) {
@@ -25,17 +21,6 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
findPreference("stories").setOnPreferenceClickListener(new restart()); findPreference("stories").setOnPreferenceClickListener(new restart());
findPreference("swipe").setOnPreferenceClickListener(new restart()); findPreference("swipe").setOnPreferenceClickListener(new restart());
findPreference("is_likes_on_right").setOnPreferenceClickListener(new restart()); findPreference("is_likes_on_right").setOnPreferenceClickListener(new restart());
findPreference("customrounding").setOnPreferenceClickListener(preference -> {
RoundingSeekbarDialog.dialog(getContext());
return true;
});
if (getPreferences().getInt("pic_rounding", 0) == 0) {
findPreference("customrounding").setSummary(AndroidUtils.getString("disabled"));
} else {
findPreference("customrounding").setSummary(String.format(AndroidUtils.getString("rounding_size"), getPreferences().getInt("pic_rounding", 0)));
}
} }
public boolean restart(Preference preference) { public boolean restart(Preference preference) {
@@ -13,10 +13,8 @@ import static ru.vtosters.lite.utils.ThemesUtils.getAlertStyle;
import static ru.vtosters.lite.utils.ThemesUtils.getSTextAttr; import static ru.vtosters.lite.utils.ThemesUtils.getSTextAttr;
import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr; import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
@@ -42,16 +40,104 @@ import okhttp3.Request;
import ru.vtosters.lite.downloaders.VideoDownloader; import ru.vtosters.lite.downloaders.VideoDownloader;
import ru.vtosters.lite.music.Scrobbler; import ru.vtosters.lite.music.Scrobbler;
import ru.vtosters.lite.ui.adapters.ImagineArrayAdapter; import ru.vtosters.lite.ui.adapters.ImagineArrayAdapter;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.FileUriUtils;
import ru.vtosters.lite.utils.Preferences;
public class MediaFragment extends MaterialPreferenceToolbarFragment { public class MediaFragment extends MaterialPreferenceToolbarFragment {
private final int REQUEST_CODE_SET_DOWNLOAD_DIRECTORY = 665; public static void download(Context ctx) {
private final int REQUEST_CODE_SET_MUSIC_DIRECTORY = 666; AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx, getAlertStyle());
private final int REQUEST_CODE_SET_PHOTOS_DIRECTORY = 667; alertDialog.setTitle("Введите ссылку на видео");
private final int REQUEST_CODE_SET_VIDEOS_DIRECTORY = 668;
final EditText input = new EditText(ctx);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
input.setLayoutParams(lp);
input.setTextColor(getTextAttr());
input.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
alertDialog.setView(input);
alertDialog.setPositiveButton("Скачать", (dialog, which) -> VideoDownloader.parseVideoLink(input.getText().toString(), ctx));
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
}
private void logout(Context ctx) {
VkAlertDialog.Builder alertDialog = new VkAlertDialog.Builder(ctx);
alertDialog.setTitle("Вы уверены?");
alertDialog.setMessage("Вы действительно хотите выйти из аккаунта?");
alertDialog.setPositiveButton("Да", (dialog, which) -> {
Scrobbler.logout();
});
alertDialog.setNeutralButton("Нет", (dialog, which) -> {
dialog.cancel();
});
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
alert.getButton(DialogInterface.BUTTON_NEUTRAL).setTextColor(getResources().getColor(com.vtosters.lite.R.color.red));
}
private void lastfmAuth(Context ctx) {
LinearLayout linearLayout = new LinearLayout(ctx);
linearLayout.setOrientation(LinearLayout.VERTICAL);
final EditText fn = new EditText(ctx);
fn.setHint("Логин");
fn.setTextColor(getTextAttr());
fn.setHintTextColor(getSTextAttr());
fn.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
linearLayout.addView(fn);
fn.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) fn.getLayoutParams());
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
fn.setLayoutParams(margin);
final EditText ln = new EditText(ctx);
ln.setHint("Пароль");
ln.setTextColor(getTextAttr());
ln.setHintTextColor(getSTextAttr());
ln.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
linearLayout.addView(ln);
ln.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ln.setLayoutParams(margin);
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx, getAlertStyle());
alertDialog.setTitle("Введите логин и пароль");
alertDialog.setView(linearLayout);
alertDialog.setPositiveButton("Войти", (dialog, which) -> {
String login = fn.getText().toString();
String pass = ln.getText().toString();
Scrobbler.auth(login, pass);
});
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
}
public static void deleteVideoHistory() {
Thread thread = new Thread(() -> {
try {
var request = new Request.a()
.b("https://api.vk.com/method/" + "video.clearViewingHistoryRecords" + "?https=1" + "&access_token=" + getUserToken() + "&v=5.187")
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"))
.a();
try {
var response = new OkHttpClient().a(request).execute().a().g();
Log.d("VideoHistory", response);
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
});
thread.start();
sendToast("История просмотра видео очищена");
}
@Override @Override
public void onCreate(Bundle bundle) { public void onCreate(Bundle bundle) {
@@ -60,43 +146,6 @@ public class MediaFragment extends MaterialPreferenceToolbarFragment {
prefs(); prefs();
} }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
var path = data.getData();
if (path != null) {
var prefs = getPreferences();
var editor = prefs.edit();
var actualPath = FileUriUtils.getFullPathFromTreeUri(path, getContext());
Log.d("MediaFragment", "onActivityResult: " + actualPath);
Log.d("MediaFragment", "onActivityResult: " + requestCode);
switch (requestCode) {
case REQUEST_CODE_SET_DOWNLOAD_DIRECTORY:
editor.putString("downloads_directory", actualPath);
break;
case REQUEST_CODE_SET_MUSIC_DIRECTORY:
editor.putString("music_directory", actualPath);
break;
case REQUEST_CODE_SET_PHOTOS_DIRECTORY:
editor.putString("photos_directory", actualPath);
break;
case REQUEST_CODE_SET_VIDEOS_DIRECTORY:
editor.putString("videos_directory", actualPath);
break;
default:
return;
}
editor.apply();
}
}
}
@Override
public void onResume() {
super.onResume();
prefs();
}
private void prefs() { private void prefs() {
findPreference("download_video").setOnPreferenceClickListener(new MediaFragment.download()); findPreference("download_video").setOnPreferenceClickListener(new MediaFragment.download());
findPreference("clearvideohistory").setOnPreferenceClickListener(preference -> { findPreference("clearvideohistory").setOnPreferenceClickListener(preference -> {
@@ -113,52 +162,8 @@ public class MediaFragment extends MaterialPreferenceToolbarFragment {
return true; return true;
}); });
findPreference("downloads_directory").setSummary(
AndroidUtils.getString("current_download_folder") + " " + Preferences.getDownloadsDir()
);
findPreference("photos_directory").setSummary(
AndroidUtils.getString("current_download_folder") + " " + Preferences.getPhotosDir()
);
findPreference("videos_directory").setSummary(
AndroidUtils.getString("current_download_folder") + " " + Preferences.getVideosDir()
);
findPreference("music_directory").setSummary(
AndroidUtils.getString("current_download_folder") + " " + Preferences.getMusicDir()
);
findPreference("downloads_directory").setOnPreferenceClickListener(preference -> {
var intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivityForResult(intent, REQUEST_CODE_SET_DOWNLOAD_DIRECTORY);
return true;
});
findPreference("photos_directory").setOnPreferenceClickListener(preference -> {
var intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivityForResult(intent, REQUEST_CODE_SET_PHOTOS_DIRECTORY);
return true;
});
findPreference("videos_directory").setOnPreferenceClickListener(preference -> {
var intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivityForResult(intent, REQUEST_CODE_SET_VIDEOS_DIRECTORY);
return true;
});
findPreference("music_directory").setOnPreferenceClickListener(preference -> {
var intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivityForResult(intent, REQUEST_CODE_SET_MUSIC_DIRECTORY);
return true;
});
if (isLoggedIn()) { if (isLoggedIn()) {
findPreference("lastfm_auth").setSummary(AndroidUtils.getString("lastfm_authorized_as") + " " + Scrobbler.getUserName()); findPreference("lastfm_auth").setSummary("Вы авторизованы как " + Scrobbler.getUserName());
} else { } else {
findPreference("lastfm_enabled").setEnabled(false); findPreference("lastfm_enabled").setEnabled(false);
} }
@@ -187,103 +192,6 @@ public class MediaFragment extends MaterialPreferenceToolbarFragment {
}); });
} }
private void lastfmAuth(Context ctx) {
LinearLayout linearLayout = new LinearLayout(ctx);
linearLayout.setOrientation(LinearLayout.VERTICAL);
final EditText fn = new EditText(ctx);
fn.setHint(AndroidUtils.getString("lastfm_login"));
fn.setTextColor(getTextAttr());
fn.setHintTextColor(getSTextAttr());
fn.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
linearLayout.addView(fn);
fn.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) fn.getLayoutParams());
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
fn.setLayoutParams(margin);
final EditText ln = new EditText(ctx);
ln.setHint(AndroidUtils.getString("lastfm_password"));
ln.setTextColor(getTextAttr());
ln.setHintTextColor(getSTextAttr());
ln.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
linearLayout.addView(ln);
ln.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ln.setLayoutParams(margin);
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx, getAlertStyle());
alertDialog.setTitle(AndroidUtils.getString("lastfm_enter_credentials"));
alertDialog.setView(linearLayout);
alertDialog.setPositiveButton(AndroidUtils.getString("lastfm_enter"), (dialog, which) -> {
String login = fn.getText().toString();
String pass = ln.getText().toString();
Scrobbler.auth(login, pass);
});
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
}
private void logout(Context ctx) {
VkAlertDialog.Builder alertDialog = new VkAlertDialog.Builder(ctx);
alertDialog.setTitle(AndroidUtils.getString("lastfm_logout_title"));
alertDialog.setMessage(AndroidUtils.getString("lastfm_logout_confirm"));
alertDialog.setPositiveButton(AndroidUtils.getString("vkim_yes"), (dialog, which) -> {
Scrobbler.logout();
});
alertDialog.setNeutralButton(AndroidUtils.getString("vkim_no"), (dialog, which) -> {
dialog.cancel();
});
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
alert.getButton(DialogInterface.BUTTON_NEUTRAL).setTextColor(getResources().getColor(com.vtosters.lite.R.color.red));
}
public static void deleteVideoHistory() {
Thread thread = new Thread(() -> {
try {
var request = new Request.a()
.b("https://api.vk.com/method/" + "video.clearViewingHistoryRecords" + "?https=1" + "&access_token=" + getUserToken() + "&v=5.187")
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"))
.a();
try {
var response = new OkHttpClient().a(request).execute().a().g();
Log.d("VideoHistory", response);
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
});
thread.start();
sendToast(AndroidUtils.getString("video_history_cleaned"));
}
public static void download(Context ctx) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx, getAlertStyle());
alertDialog.setTitle(AndroidUtils.getString("video_dl_enter_link"));
final EditText input = new EditText(ctx);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
input.setLayoutParams(lp);
input.setTextColor(getTextAttr());
input.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
alertDialog.setView(input);
alertDialog.setPositiveButton(AndroidUtils.getString("download"), (dialog, which) -> VideoDownloader.parseVideoLink(input.getText().toString(), ctx));
var alert = alertDialog.create();
alert.show();
alert.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(getAccentColor());
}
private class download implements Preference.OnPreferenceClickListener { private class download implements Preference.OnPreferenceClickListener {
@Override // android.support.v7.preference.Preference.c @Override // android.support.v7.preference.Preference.c
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
@@ -1,14 +1,11 @@
package ru.vtosters.lite.ui.fragments; package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.AndroidUtils.*;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences; import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import static ru.vtosters.lite.utils.LifecycleUtils.restartApplicationWithTimer; import static ru.vtosters.lite.utils.LifecycleUtils.restartApplicationWithTimer;
import static ru.vtosters.lite.utils.Preferences.autoalltranslate; import static ru.vtosters.lite.utils.Preferences.autoalltranslate;
import static ru.vtosters.lite.utils.Preferences.vkme; import static ru.vtosters.lite.utils.Preferences.offline;
import static ru.vtosters.lite.utils.ThemesUtils.*;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@@ -22,12 +19,9 @@ import com.vk.navigation.Navigator;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects;
import ru.vtosters.lite.ui.adapters.ImagineArrayAdapter; import ru.vtosters.lite.ui.adapters.ImagineArrayAdapter;
import ru.vtosters.lite.ui.wallpapers.WallpaperMenuFragment; import ru.vtosters.lite.ui.wallpapers.WallpaperMenuFragment;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class MessagesFragment extends MaterialPreferenceToolbarFragment { public class MessagesFragment extends MaterialPreferenceToolbarFragment {
@Override @Override
@@ -37,7 +31,6 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
prefs(); prefs();
} }
@SuppressLint("UseCompatLoadingForDrawables")
private void prefs() { private void prefs() {
findPreference("vkme").setOnPreferenceClickListener(new MessagesFragment.restart()); findPreference("vkme").setOnPreferenceClickListener(new MessagesFragment.restart());
findPreference("vkme_notifs").setOnPreferenceClickListener(new MessagesFragment.restart()); findPreference("vkme_notifs").setOnPreferenceClickListener(new MessagesFragment.restart());
@@ -57,7 +50,7 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
.create(); .create();
var listView = (ListView) LayoutInflater.from(getContext()).inflate(com.vtosters.lite.R.layout.abc_select_dialog_material, null, false); var listView = (ListView) LayoutInflater.from(getContext()).inflate(com.vtosters.lite.R.layout.abc_select_dialog_material, null, false);
var adapter = new ImagineArrayAdapter(requireContext(), items, i -> { var adapter = new ImagineArrayAdapter(getContext(), items, i -> {
getPreferences().edit().putInt("translator", i).apply(); getPreferences().edit().putInt("translator", i).apply();
alert.dismiss(); alert.dismiss();
}); });
@@ -68,20 +61,15 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
return true; return true;
}); });
findPreference("vkme_notifs").setEnabled(vkme());
findPreference("wallpapers").setIcon(recolorDrawable(getGlobalContext().getDrawable(getIdentifier("ic_media_outline_28", "drawable"))));
findPreference("vkme").setIcon(getIdentifier("ic_vkme_28", "drawable"));
} }
@Override @Override
public boolean onPreferenceTreeClick(Preference preference) { public boolean onPreferenceTreeClick(Preference preference) {
findPreference("autotranslate").setEnabled(!autoalltranslate()); findPreference("autotranslate").setEnabled(!autoalltranslate());
findPreference("vkme_notifs").setEnabled(vkme());
return super.onPreferenceTreeClick(preference); return super.onPreferenceTreeClick(preference);
} }
public boolean restart() { public boolean restart(Preference preference) {
restartApplicationWithTimer(); restartApplicationWithTimer();
return true; return true;
} }
@@ -89,14 +77,14 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
public class restart implements Preference.OnPreferenceClickListener { public class restart implements Preference.OnPreferenceClickListener {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
return MessagesFragment.this.restart(); return MessagesFragment.this.restart(preference);
} }
} }
public class clearCache implements Preference.OnPreferenceClickListener { public class clearCache implements Preference.OnPreferenceClickListener {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
return MessagesFragment.this.restart(); return MessagesFragment.this.restart(preference);
} }
} }
@@ -9,7 +9,6 @@ import static ru.vtosters.lite.ui.components.BackupManager.deletePrefs;
import static ru.vtosters.lite.ui.components.BackupManager.restoreBackup; import static ru.vtosters.lite.ui.components.BackupManager.restoreBackup;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken; import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px; import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.edit;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs; import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.CacheUtils.deleteCache; import static ru.vtosters.lite.utils.CacheUtils.deleteCache;
@@ -77,7 +76,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
String token = data.getStringExtra("token"); String token = data.getStringExtra("token");
AndroidUtils.getPreferences().edit().putString("vk_admin_token", token).apply(); AndroidUtils.getPreferences().edit().putString("vk_admin_token", token).apply();
Log.d("VkAdminToken", token); Log.d("VkAdminToken", token);
Toast.makeText(getContext(), AndroidUtils.getString("token_saved"), LENGTH_SHORT).show(); Toast.makeText(getContext(), "Токен успешно сохранён", LENGTH_SHORT).show();
} }
} }
} }
@@ -96,31 +95,25 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
return true; return true;
}); });
findPreference("resetfolders").setOnPreferenceClickListener(preference -> {
edit().remove("photos_directory").remove("videos_directory").remove("audios_directory").remove("downloads_directory").apply();
Toast.makeText(getContext(), AndroidUtils.getString("download_folders_reseted"), LENGTH_SHORT).show();
return true;
});
var pref = getDefaultPrefs().getString("autoclearcache", "Default"); var pref = getDefaultPrefs().getString("autoclearcache", "Default");
switch (pref) { switch (pref) {
case "Default": case "Default":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_disabled")); findPreference("autoclearcache").setSummary("Не включено");
break; break;
case "100mb": case "100mb":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_100mb")); findPreference("autoclearcache").setSummary("Очищать кеш при не менее 100 Мб");
break; break;
case "500mb": case "500mb":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_500mb")); findPreference("autoclearcache").setSummary("Очищать кеш при не менее 500 Мб");
break; break;
case "1gb": case "1gb":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_1gb")); findPreference("autoclearcache").setSummary("Очищать кеш при не менее 1 Гб");
break; break;
case "2gb": case "2gb":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_2gb")); findPreference("autoclearcache").setSummary("Очищать кеш при не менее 2 Гб");
break; break;
case "5gb": case "5gb":
findPreference("autoclearcache").setSummary(AndroidUtils.getString("cache_5gb")); findPreference("autoclearcache").setSummary("Очищать кеш при не менее 5 Гб");
break; break;
} }
@@ -192,12 +185,12 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
five.setChecked(val == 5); five.setChecked(val == 5);
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(getContext()); VkAlertDialog.Builder builder = new VkAlertDialog.Builder(getContext());
builder.setTitle(AndroidUtils.getString("cache_clean_title")); builder.setTitle("Очистка кеша");
builder.setMessage(AndroidUtils.getString("cache_select_size")); builder.setMessage("Выберите объём кеша для очистки");
builder.setCancelable(true); builder.setCancelable(true);
builder.setNegativeButton(AndroidUtils.getString("cancel"), null); builder.setNegativeButton("Отмена", null);
builder.setView(rg); builder.setView(rg);
builder.setPositiveButton(AndroidUtils.getString("save"), (dialog, which) -> { builder.setPositiveButton("Сохранить", (dialog, which) -> {
var pref = getDefaultPrefs().edit(); var pref = getDefaultPrefs().edit();
var checked = rg.getCheckedRadioButtonId(); var checked = rg.getCheckedRadioButtonId();
@@ -228,8 +221,8 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
private void cacheCleanDialog() { private void cacheCleanDialog() {
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(getContext()); VkAlertDialog.Builder builder = new VkAlertDialog.Builder(getContext());
builder.setTitle(AndroidUtils.getString("select_which_clean")); builder.setTitle("Выберите что вы хотите очистить");
builder.setItems(AndroidUtils.getArray("cache_cleaner"), (dialog, which) -> { builder.setItems(new String[]{"Очистить весь кеш", "Очистить кеш стикеров", "Очистить кеш изображений", "Очистить кеш видео", "Очистить кеш сообщений", "Очистить кеш WebView"}, (dialog, which) -> {
switch (which) { switch (which) {
case 0: { case 0: {
SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE); SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE);
@@ -244,6 +237,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
ImEngineExt.a(ImEngine1.a()); ImEngineExt.a(ImEngine1.a());
AutoPlayCacheHolder.d.a(); AutoPlayCacheHolder.d.a();
MediaStorage.a(); MediaStorage.a();
deleteCache();
break; break;
} }
case 1: { case 1: {
@@ -270,7 +264,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
break; break;
} }
Toast.makeText(getContext(), AndroidUtils.getString("cache_cleaned"), LENGTH_SHORT).show(); Toast.makeText(getContext(), "Кеш очищен", LENGTH_SHORT).show();
}); });
builder.create().show(); builder.create().show();
} }
@@ -289,7 +283,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
try { try {
backupOnlines(); backupOnlines();
} catch (IOException e) { } catch (IOException e) {
Toast.makeText(getContext(), AndroidUtils.getString("no_data_to_backup"), LENGTH_SHORT).show(); Toast.makeText(getContext(), "Нет данных для резервного копирования", LENGTH_SHORT).show();
} }
return true; return true;
} }
@@ -359,14 +353,14 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
var arr = BackupManager.getBackupsNames(); var arr = BackupManager.getBackupsNames();
var adapter = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, arr); var adapter = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, arr);
new VkAlertDialog.Builder(getContext()) new VkAlertDialog.Builder(getContext())
.setTitle(AndroidUtils.getString("select_backup")) .setTitle("Выберите бэкап")
.setAdapter(adapter, (dialog, which) -> { .setAdapter(adapter, (dialog, which) -> {
try { try {
restoreBackup(arr[which]); restoreBackup(arr[which]);
Toast.makeText(getContext(), AndroidUtils.getString("backup_success"), LENGTH_LONG).show(); Toast.makeText(getContext(), "Настройки восстановлены", LENGTH_LONG).show();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(getContext(), AndroidUtils.getString("backup_error"), LENGTH_LONG).show(); Toast.makeText(getContext(), "Ошибка, Настройки не восстановлены", LENGTH_LONG).show();
} }
}).create().show(); }).create().show();
return true; return true;
@@ -0,0 +1,38 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import ru.vtosters.lite.themes.managers.PalettesManager;
import ru.vtosters.lite.ui.adapters.PalettesAdapter;
import ru.vtosters.lite.utils.LayoutUtils;
public class PalettesManagerFragment extends BaseToolbarFragment {
private final PalettesManager mManager = PalettesManager.getInstance();
private PalettesAdapter mAdapter;
@Override
public View onCreateContent(@NonNull LayoutInflater inflater, @Nullable Bundle bundle) {
setTitle("Палитры");
var container = new FrameLayout(getContext());
mAdapter = new PalettesAdapter();
var recyclerView = new RecyclerView(getContext());
recyclerView.setAdapter(mAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
container.addView(recyclerView, LayoutUtils.createFrame(-1, -1));
return container;
}
}
@@ -4,7 +4,6 @@ import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier; import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.LifecycleUtils.restartApplication; import static ru.vtosters.lite.utils.LifecycleUtils.restartApplication;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.Gravity; import android.view.Gravity;
@@ -47,9 +46,9 @@ public class SuperAppEditorFragment extends BaseToolbarFragment {
message.setTextAlignment(View.TEXT_ALIGNMENT_CENTER); message.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
message.setTextColor(ThemesUtils.getTextAttr()); message.setTextColor(ThemesUtils.getTextAttr());
message.setPadding( message.setPadding(
dp2px(10), AndroidUtils.dp2px(10),
dp2px(10), AndroidUtils.dp2px(10),
dp2px(10), AndroidUtils.dp2px(10),
0 0
); );
container.addView(message, LayoutUtils.createLinear(-1, -2)); container.addView(message, LayoutUtils.createLinear(-1, -2));
@@ -95,29 +94,16 @@ public class SuperAppEditorFragment extends BaseToolbarFragment {
: manager.getDisabledTabs().get(pos - manager.getSelectedTabs().size() - 2); : manager.getDisabledTabs().get(pos - manager.getSelectedTabs().size() - 2);
holder.bindMovingItem(item.title); holder.bindMovingItem(item.title);
}); });
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { manager.getSelectedTabs().forEach(item -> {
manager.getSelectedTabs().forEach(item -> { if (item.type.equals("menu"))
if (item.type.equals("menu")) adapter.addUnmovedItem(item);
adapter.addUnmovedItem(item); });
}); manager.getDisabledTabs().forEach(item -> {
if (item.type.equals("menu"))
adapter.addUnmovedItem(item);
});
manager.getDisabledTabs().forEach(item -> { var recyclerView = new RecyclerView(getContext());
if (item.type.equals("menu"))
adapter.addUnmovedItem(item);
});
} else {
for (var item : manager.getSelectedTabs()) {
if (item.type.equals("menu"))
adapter.addUnmovedItem(item);
}
for (var item : manager.getDisabledTabs()) {
if (item.type.equals("menu"))
adapter.addUnmovedItem(item);
}
}
var recyclerView = new RecyclerView(requireContext());
recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
@@ -14,9 +14,9 @@ import androidx.preference.Preference;
import com.vk.navigation.Navigator; import com.vk.navigation.Navigator;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.utils.LifecycleUtils; import ru.vtosters.lite.utils.LifecycleUtils;
public class ThemesFragment extends MaterialPreferenceToolbarFragment { public class ThemesFragment extends MaterialPreferenceToolbarFragment {
@Override @Override
@@ -27,6 +27,17 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
} }
private void prefs() { private void prefs() {
var themesPreference = findPreference("themes");
var themesManager = ThemesManager.getInstance();
// if (themesManager.getThemesCount() > 0)
// themesPreference.setSummary(themesManager.getCurrentTheme().name);
themesPreference.setOnPreferenceClickListener(preference -> {
var intent = new Navigator(ThemesManagerFragment.class).b(getContext());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
return false;
});
findPreference("navbar").setOnPreferenceClickListener(new restart()); findPreference("navbar").setOnPreferenceClickListener(new restart());
findPreference("milkshake").setOnPreferenceClickListener(new restart()); findPreference("milkshake").setOnPreferenceClickListener(new restart());
findPreference("darktheme").setOnPreferenceChangeListener(new restartdark()); findPreference("darktheme").setOnPreferenceChangeListener(new restartdark());
@@ -0,0 +1,142 @@
package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.themes.VTLColors.getAccentColor;
import android.app.Activity;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.vk.core.util.ToastUtils;
import com.vk.navigation.Navigator;
import com.vtosters.lite.R;
import org.json.JSONException;
import java.io.IOException;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.ui.adapters.ThemesAdapter;
import ru.vtosters.lite.ui.dialogs.EditTextDialog;
import ru.vtosters.lite.utils.LayoutUtils;
public class ThemesManagerFragment extends BaseToolbarFragment {
private static final int IMPORT_REQUEST_CODE = 0x1;
private ThemesAdapter mAdapter;
private ThemesManager mManager = ThemesManager.getInstance();
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
switch (requestCode) {
case IMPORT_REQUEST_CODE:
if (resultCode != Activity.RESULT_OK)
return;
try {
var data = intent.getData();
if (data != null) {
mManager.copy(getContext().getContentResolver(), data);
mAdapter.notifyDataSetChanged();
} else {
throw new IOException("Error while getting file path");
}
} catch (IOException | JSONException e) {
e.printStackTrace();
ToastUtils.a("Не удалось импортировать тему");
}
break;
}
}
@Override
public View onCreateContent(@NonNull LayoutInflater inflater, @Nullable Bundle bundle) {
setTitle("Темы");
var container = new FrameLayout(getContext());
mAdapter = new ThemesAdapter();
var recyclerView = new RecyclerView(getContext());
recyclerView.setAdapter(mAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
container.addView(recyclerView, LayoutUtils.createFrame(-1, -1));
var buttonsContainer = new LinearLayout(getContext());
buttonsContainer.setOrientation(LinearLayout.HORIZONTAL);
var params = LayoutUtils.createFrame(-2, -2);
params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
params.setMargins(0, 0, 0, dp2px(12f));
container.addView(buttonsContainer, params);
var addNewTheme = new FloatingActionButton(getContext());
addNewTheme.setImageResource(getIdentifier("ic_add_24", "drawable"));
addNewTheme.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
addNewTheme.setOnClickListener(v -> {
EditTextDialog.create(v.getContext(), "Новая тема", "Название новой темы", null, (dialog, which, editText) -> {
var name = editText.getText().toString();
if (TextUtils.isEmpty(name)) {
ToastUtils.a("Название не может быть пустым");
return;
}
try {
mManager.create(requireActivity(), name);
mAdapter.notifyDataSetChanged();
} catch (IOException | JSONException e) {
e.printStackTrace();
ToastUtils.a("Не удалось изменить название темы");
}
});
});
buttonsContainer.addView(addNewTheme, LayoutUtils.createLinear(-2, -2));
buttonsContainer.addView(new View(getContext()), LayoutUtils.createLinear(dp2px(5), 0));
var importTheme = new FloatingActionButton(getContext());
importTheme.setImageResource(getIdentifier("ic_import", "drawable"));
importTheme.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
importTheme.setImageTintList(ColorStateList.valueOf(Color.WHITE));
importTheme.setOnClickListener(v -> {
var intent = new Intent(Intent.ACTION_GET_CONTENT)
.setType("*/*")
.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(Intent.createChooser(intent, "Выберите тему (.vtlt, .svt)"), IMPORT_REQUEST_CODE);
ToastUtils.a("Возможен импорт тем из сторонней модификации ВК Sova V RE");
});
buttonsContainer.addView(importTheme, LayoutUtils.createLinear(-2, -2));
buttonsContainer.addView(new View(getContext()), LayoutUtils.createLinear(dp2px(5), 0));
var openPalettes = new FloatingActionButton(getContext());
openPalettes.setImageResource(R.drawable.ic_palette_outline_28);
openPalettes.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
openPalettes.setOnClickListener(v -> {
var intent = new Navigator(PalettesManagerFragment.class, new Bundle()).b(getContext());
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
});
buttonsContainer.addView(openPalettes, LayoutUtils.createLinear(-2, -2));
return container;
}
}
@@ -65,6 +65,8 @@ import ru.vtosters.lite.utils.CacheUtils;
import ru.vtosters.lite.utils.SSFSUtils; import ru.vtosters.lite.utils.SSFSUtils;
public class VTSettings extends MaterialPreferenceToolbarFragment { public class VTSettings extends MaterialPreferenceToolbarFragment {
public int hideitems = 0;
public static String getValAsString(String stringid, Boolean value) { public static String getValAsString(String stringid, Boolean value) {
if (disableSettingsSumms()) return null; if (disableSettingsSumms()) return null;
@@ -114,7 +116,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
public static String getSuperappsumm() { public static String getSuperappsumm() {
if (disableSettingsSumms()) return null; if (disableSettingsSumms()) return null;
return AndroidUtils.getString("elements_hidden_count") + ": " + SuperAppEditorManager.getInstance().getDisabledTabs().size(); return "Скрыто элементов" + ": " + SuperAppEditorManager.getInstance().getDisabledTabs().size();
} }
public static String getCachesumm() { public static String getCachesumm() {
@@ -330,7 +332,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
}); });
} }
} else { } else {
addPreference(this, "", AndroidUtils.getString("debug_warning"), AndroidUtils.getString("vkme_mode_info"), "ic_about_outline_28", preference -> false); addPreference(this, "", "Внимание!", "Некоторые пункты настроек были скрыты из-за режима VK Me \n\nДля отключения режима перейдите в настройки Сообщений", "ic_about_outline_28", preference -> false);
} }
addPreference(this, "", AndroidUtils.getString("vtlmedia"), mediasumm, "ic_media_outline_28", preference -> { addPreference(this, "", AndroidUtils.getString("vtlmedia"), mediasumm, "ic_media_outline_28", preference -> {
@@ -40,7 +40,6 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.vk.navigation.Navigator; import com.vk.navigation.Navigator;
import java.io.File; import java.io.File;
import java.util.Objects;
import ru.vtosters.lite.tgs.TGPref; import ru.vtosters.lite.tgs.TGPref;
import ru.vtosters.lite.ui.adapters.StickerPackAdapter; import ru.vtosters.lite.ui.adapters.StickerPackAdapter;
@@ -48,6 +47,7 @@ import ru.vtosters.lite.ui.fragments.BaseToolbarFragment;
import ru.vtosters.lite.utils.AndroidUtils; import ru.vtosters.lite.utils.AndroidUtils;
public class StickersFragment extends BaseToolbarFragment { public class StickersFragment extends BaseToolbarFragment {
public final static String ACTION_RELOAD = "com.vtosters.lite.action.RELOAD_TGS_LIST"; public final static String ACTION_RELOAD = "com.vtosters.lite.action.RELOAD_TGS_LIST";
private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2; private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2;
@@ -147,7 +147,7 @@ public class StickersFragment extends BaseToolbarFragment {
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
requireContext().unregisterReceiver(mReceiver); getContext().unregisterReceiver(mReceiver);
} }
private void fabClick() { private void fabClick() {
@@ -0,0 +1,26 @@
package ru.vtosters.lite.ui.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.appcompat.widget.AppCompatRadioButton;
public class NoTouchRadioButton extends AppCompatRadioButton {
public NoTouchRadioButton(Context context) {
super(context);
}
public NoTouchRadioButton(Context context, AttributeSet attrs) {
super(context, attrs);
}
public NoTouchRadioButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
return false;
}
}
@@ -0,0 +1,95 @@
package ru.vtosters.lite.ui.views;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Checkable;
import androidx.appcompat.widget.AppCompatImageButton;
public class VTLCheckableButton extends AppCompatImageButton implements Checkable {
private boolean mIsChecked;
public VTLCheckableButton(Context context) {
super(context);
}
public VTLCheckableButton(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public VTLCheckableButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
@Override
public Parcelable onSaveInstanceState() {
var state = new CustomState(super.onSaveInstanceState());
state.setChecked(mIsChecked);
return state;
}
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof CustomState) {
var customState = ((CustomState) state);
super.onRestoreInstanceState(customState.getSuperState());
mIsChecked = customState.isChecked();
return;
}
super.onRestoreInstanceState(state);
}
@Override
public boolean isChecked() {
return this.mIsChecked;
}
@Override
public void setChecked(boolean checked) {
mIsChecked = checked;
refreshDrawableState();
}
@Override
public int[] onCreateDrawableState(int extraSpace) {
return mIsChecked
? View.mergeDrawableStates(super.onCreateDrawableState(extraSpace + 1), new int[] { android.R.attr.state_checked })
: super.onCreateDrawableState(extraSpace);
}
@Override
public void toggle() {
setChecked(!mIsChecked);
}
static class CustomState extends View.BaseSavedState {
private boolean checked;
public CustomState(Parcelable source) {
super(source);
}
public CustomState(Parcel source) {
super(source);
checked = source.readInt() != 0;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
@Override
public void writeToParcel(Parcel out, int flags) {
super.writeToParcel(out, flags);
out.writeInt(checked ? 1 : 0);
}
}
}
@@ -0,0 +1,54 @@
package ru.vtosters.lite.ui.views.flask;
import android.graphics.Color;
public class ColorCircle {
private float x, y;
private float[] hsv = new float[3];
private float[] hsvClone;
private int color;
public ColorCircle(float x, float y, float[] hsv) {
set(x, y, hsv);
}
public double sqDist(float x, float y) {
double dx = this.x - x;
double dy = this.y - y;
return dx * dx + dy * dy;
}
public float getX() {
return x;
}
public float getY() {
return y;
}
public float[] getHsv() {
return hsv;
}
public float[] getHsvWithLightness(float lightness) {
if (hsvClone == null)
hsvClone = hsv.clone();
hsvClone[0] = hsv[0];
hsvClone[1] = hsv[1];
hsvClone[2] = lightness;
return hsvClone;
}
public void set(float x, float y, float[] hsv) {
this.x = x;
this.y = y;
this.hsv[0] = hsv[0];
this.hsv[1] = hsv[1];
this.hsv[2] = hsv[2];
this.color = Color.HSVToColor(this.hsv);
}
public int getColor() {
return color;
}
}
@@ -0,0 +1,39 @@
package ru.vtosters.lite.ui.views.flask;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import ru.vtosters.lite.ui.views.flask.builder.PaintBuilder;
public class ColorCircleDrawable extends ColorDrawable {
private float strokeWidth;
private Paint strokePaint = PaintBuilder.newPaint().style(Paint.Style.STROKE).stroke(strokeWidth).color(0xff9e9e9e).build();
private Paint fillPaint = PaintBuilder.newPaint().style(Paint.Style.FILL).color(0).build();
private Paint fillBackPaint = PaintBuilder.newPaint().shader(PaintBuilder.createAlphaPatternShader(26)).build();
public ColorCircleDrawable(int color) {
super(color);
}
@Override
public void draw(Canvas canvas) {
canvas.drawColor(0);
int width = canvas.getWidth();
float radius = width / 2f;
strokeWidth = radius / 8f;
this.strokePaint.setStrokeWidth(strokeWidth);
this.fillPaint.setColor(getColor());
canvas.drawCircle(radius, radius, radius - strokeWidth, fillBackPaint);
canvas.drawCircle(radius, radius, radius - strokeWidth, fillPaint);
canvas.drawCircle(radius, radius, radius - strokeWidth, strokePaint);
}
@Override
public void setColor(int color) {
super.setColor(color);
invalidateSelf();
}
}
@@ -0,0 +1,433 @@
package ru.vtosters.lite.ui.views.flask;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.appcompat.app.AlertDialog;
import java.util.ArrayList;
import ru.vtosters.lite.ui.views.flask.builder.PaintBuilder;
import ru.vtosters.lite.ui.views.flask.render.ColorWheelRenderOption;
import ru.vtosters.lite.ui.views.flask.render.ColorWheelRenderer;
import ru.vtosters.lite.ui.views.flask.render.SimpleColorWheelRenderer;
public class ColorPickerView extends View {
private static final float STROKE_RATIO = 1.5f;
private AlertDialog dialog;
private Bitmap colorWheel;
private Canvas colorWheelCanvas;
private Bitmap currentColor;
private Canvas currentColorCanvas;
private boolean showBorder;
private int density = 8;
private float lightness = 1;
private float alpha = 1;
private int backgroundColor = 0x00000000;
private Integer initialColors[] = new Integer[]{null, null, null, null, null};
private int colorSelection = 0;
private Integer initialColor;
private Paint colorWheelFill = PaintBuilder.newPaint().color(0).build();
private Paint selectorStroke = PaintBuilder.newPaint().color(0).build();
private Paint alphaPatternPaint = PaintBuilder.newPaint().build();
private ColorCircle currentColorCircle;
private ArrayList<OnColorChangedListener> colorChangedListeners = new ArrayList<>();
private ArrayList<OnColorSelectedListener> listeners = new ArrayList<>();
private LinearLayout colorPreview;
private ColorWheelRenderer renderer;
public ColorPickerView(Context context) {
super(context);
initWith();
}
private void initWith() {
density = 10;
initialColor = 0xffffffff;
renderer = new SimpleColorWheelRenderer();
setDensity(density);
setInitialColor(initialColor, true);
}
public void setDialog(AlertDialog dialog) {
this.dialog = dialog;
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
updateColorWheel();
currentColorCircle = findNearestByColor(initialColor);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
updateColorWheel();
currentColorCircle = findNearestByColor(initialColor);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
updateColorWheel();
}
private void updateColorWheel() {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
if (height < width)
width = height;
if (width <= 0)
return;
if (colorWheel == null || colorWheel.getWidth() != width) {
colorWheel = Bitmap.createBitmap(width, width, Bitmap.Config.ARGB_8888);
colorWheelCanvas = new Canvas(colorWheel);
alphaPatternPaint.setShader(PaintBuilder.createAlphaPatternShader(26));
}
if (currentColor == null || currentColor.getWidth() != width) {
currentColor = Bitmap.createBitmap(width, width, Bitmap.Config.ARGB_8888);
currentColorCanvas = new Canvas(currentColor);
}
drawColorWheel();
invalidate();
}
private void drawColorWheel() {
colorWheelCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
currentColorCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
if (renderer == null) return;
float half = colorWheelCanvas.getWidth() / 2f;
float strokeWidth = STROKE_RATIO * (1f + ColorWheelRenderer.GAP_PERCENTAGE);
float maxRadius = half - strokeWidth - half / density;
float cSize = maxRadius / (density - 1) / 2;
ColorWheelRenderOption colorWheelRenderOption = renderer.getRenderOption();
colorWheelRenderOption.density = this.density;
colorWheelRenderOption.maxRadius = maxRadius;
colorWheelRenderOption.cSize = cSize;
colorWheelRenderOption.strokeWidth = strokeWidth;
colorWheelRenderOption.alpha = alpha;
colorWheelRenderOption.lightness = lightness;
colorWheelRenderOption.targetCanvas = colorWheelCanvas;
renderer.initWith(colorWheelRenderOption);
renderer.draw();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int width = 0;
if (widthMode == MeasureSpec.UNSPECIFIED)
width = widthMeasureSpec;
else if (widthMode == MeasureSpec.AT_MOST)
width = MeasureSpec.getSize(widthMeasureSpec);
else if (widthMode == MeasureSpec.EXACTLY)
width = MeasureSpec.getSize(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int height = 0;
if (heightMode == MeasureSpec.UNSPECIFIED)
height = heightMeasureSpec;
else if (heightMode == MeasureSpec.AT_MOST)
height = MeasureSpec.getSize(heightMeasureSpec);
else if (heightMode == MeasureSpec.EXACTLY)
height = MeasureSpec.getSize(heightMeasureSpec);
int squareDimen = width;
if (height < width)
squareDimen = height;
setMeasuredDimension(squareDimen, squareDimen);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE: {
int lastSelectedColor = getSelectedColor();
currentColorCircle = findNearestByPosition(event.getX(), event.getY());
int selectedColor = getSelectedColor();
callOnColorChangedListeners(lastSelectedColor, selectedColor);
initialColor = selectedColor;
updateColorWheel();
invalidate();
break;
}
case MotionEvent.ACTION_UP: {
int selectedColor = getSelectedColor();
if (listeners != null) {
for (OnColorSelectedListener listener : listeners) {
try {
listener.onColorSelected(dialog, selectedColor);
} catch (Exception e) {
e.printStackTrace();
}
}
}
setColorPreviewColor(selectedColor);
invalidate();
break;
}
}
return true;
}
protected void callOnColorChangedListeners(int oldColor, int newColor) {
if (colorChangedListeners != null && oldColor != newColor) {
for (OnColorChangedListener listener : colorChangedListeners) {
try {
listener.onColorChanged(newColor);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawColor(backgroundColor);
float maxRadius = canvas.getWidth() / (1f + ColorWheelRenderer.GAP_PERCENTAGE);
float size = maxRadius / density / 2;
if (colorWheel != null && currentColorCircle != null) {
colorWheelFill.setColor(Color.HSVToColor(currentColorCircle.getHsvWithLightness(this.lightness)));
colorWheelFill.setAlpha((int) (alpha * 0xff));
// a separate canvas is used to erase an issue with the alpha pattern around the edges
// draw circle slightly larger than it needs to be, then erase edges to proper dimensions
currentColorCanvas.drawCircle(currentColorCircle.getX(), currentColorCircle.getY(), size + 4, alphaPatternPaint);
currentColorCanvas.drawCircle(currentColorCircle.getX(), currentColorCircle.getY(), size + 4, colorWheelFill);
selectorStroke = PaintBuilder.newPaint().color(0xffffffff).style(Paint.Style.STROKE).stroke(size * (STROKE_RATIO - 1)).xPerMode(PorterDuff.Mode.CLEAR).build();
if (showBorder) colorWheelCanvas.drawCircle(currentColorCircle.getX(), currentColorCircle.getY(), size + (selectorStroke.getStrokeWidth() / 2f), selectorStroke);
canvas.drawBitmap(colorWheel, 0, 0, null);
currentColorCanvas.drawCircle(currentColorCircle.getX(), currentColorCircle.getY(), size + (selectorStroke.getStrokeWidth() / 2f), selectorStroke);
canvas.drawBitmap(currentColor, 0, 0, null);
}
}
private ColorCircle findNearestByPosition(float x, float y) {
ColorCircle near = null;
double minDist = Double.MAX_VALUE;
for (ColorCircle colorCircle : renderer.getColorCircleList()) {
double dist = colorCircle.sqDist(x, y);
if (minDist > dist) {
minDist = dist;
near = colorCircle;
}
}
return near;
}
private ColorCircle findNearestByColor(int color) {
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
ColorCircle near = null;
double minDiff = Double.MAX_VALUE;
double x = hsv[1] * Math.cos(hsv[0] * Math.PI / 180);
double y = hsv[1] * Math.sin(hsv[0] * Math.PI / 180);
for (ColorCircle colorCircle : renderer.getColorCircleList()) {
float[] hsv1 = colorCircle.getHsv();
double x1 = hsv1[1] * Math.cos(hsv1[0] * Math.PI / 180);
double y1 = hsv1[1] * Math.sin(hsv1[0] * Math.PI / 180);
double dx = x - x1;
double dy = y - y1;
double dist = dx * dx + dy * dy;
if (dist < minDiff) {
minDiff = dist;
near = colorCircle;
}
}
return near;
}
public int getSelectedColor() {
int color = 0;
if (currentColorCircle != null)
color = Utils.colorAtLightness(currentColorCircle.getColor(), this.lightness);
return Utils.adjustAlpha(this.alpha, color);
}
public Integer[] getAllColors() {
return initialColors;
}
public void setInitialColors(Integer[] colors, int selectedColor) {
this.initialColors = colors;
this.colorSelection = selectedColor;
Integer initialColor = this.initialColors[this.colorSelection];
if (initialColor == null) initialColor = 0xffffffff;
setInitialColor(initialColor, true);
}
public void setInitialColor(int color, boolean updateText) {
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
this.alpha = Utils.getAlphaPercent(color);
this.lightness = hsv[2];
this.initialColors[this.colorSelection] = color;
this.initialColor = color;
setColorPreviewColor(color);
currentColorCircle = findNearestByColor(color);
}
public void setLightness(float lightness) {
int lastSelectedColor = getSelectedColor();
this.lightness = lightness;
if (currentColorCircle != null) {
this.initialColor = Color.HSVToColor(Utils.alphaValueAsInt(this.alpha), currentColorCircle.getHsvWithLightness(lightness));
callOnColorChangedListeners(lastSelectedColor, this.initialColor);
updateColorWheel();
invalidate();
}
}
public void setColor(int color, boolean updateText) {
setInitialColor(color, updateText);
updateColorWheel();
invalidate();
}
public void setAlphaValue(float alpha) {
int lastSelectedColor = getSelectedColor();
this.alpha = alpha;
this.initialColor = Color.HSVToColor(Utils.alphaValueAsInt(this.alpha), currentColorCircle.getHsvWithLightness(this.lightness));
callOnColorChangedListeners(lastSelectedColor, this.initialColor);
updateColorWheel();
invalidate();
}
public void addOnColorChangedListener(OnColorChangedListener listener) {
this.colorChangedListeners.add(listener);
}
public void addOnColorSelectedListener(OnColorSelectedListener listener) {
this.listeners.add(listener);
}
public void setDensity(int density) {
this.density = Math.max(2, density);
invalidate();
}
public void setColorPreview(LinearLayout colorPreview, Integer selectedColor) {
if (colorPreview == null)
return;
this.colorPreview = colorPreview;
if (selectedColor == null)
selectedColor = 0;
int children = colorPreview.getChildCount();
if (children == 0 || colorPreview.getVisibility() != View.VISIBLE)
return;
for (int i = 0; i < children; i++) {
View childView = colorPreview.getChildAt(i);
if (!(childView instanceof LinearLayout))
continue;
LinearLayout childLayout = (LinearLayout) childView;
if (i == selectedColor) {
childLayout.setBackgroundColor(Color.WHITE);
}
ImageView childImage = childLayout.findViewWithTag("image_preview");
childImage.setClickable(true);
childImage.setTag(i);
childImage.setOnClickListener(v -> {
if (v == null)
return;
Object tag = v.getTag();
if (tag == null || !(tag instanceof Integer))
return;
setSelectedColor((int) tag);
});
}
}
public void setSelectedColor(int previewNumber) {
if (initialColors == null || initialColors.length < previewNumber)
return;
this.colorSelection = previewNumber;
setHighlightedColor(previewNumber);
Integer color = initialColors[previewNumber];
if (color == null)
return;
setColor(color, true);
}
public void setShowBorder(boolean showBorder) {
this.showBorder = showBorder;
}
private void setHighlightedColor(int previewNumber) {
int children = colorPreview.getChildCount();
if (children == 0 || colorPreview.getVisibility() != View.VISIBLE)
return;
for (int i = 0; i < children; i++) {
View childView = colorPreview.getChildAt(i);
if (!(childView instanceof LinearLayout))
continue;
LinearLayout childLayout = (LinearLayout) childView;
if (i == previewNumber) {
childLayout.setBackgroundColor(Color.WHITE);
} else {
childLayout.setBackgroundColor(Color.TRANSPARENT);
}
}
}
private void setColorPreviewColor(int newColor) {
if (colorPreview == null || initialColors == null || colorSelection > initialColors.length || initialColors[colorSelection] == null)
return;
int children = colorPreview.getChildCount();
if (children == 0 || colorPreview.getVisibility() != View.VISIBLE)
return;
View childView = colorPreview.getChildAt(colorSelection);
if (!(childView instanceof LinearLayout))
return;
LinearLayout childLayout = (LinearLayout) childView;
ImageView childImage = childLayout.findViewWithTag("image_preview");
childImage.setImageDrawable(new ColorCircleDrawable(newColor));
}
}

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