Compare commits

..
737 Commits
Author SHA1 Message Date
Akinwale Ariwodola 0380e35966 bumpversion 0.15.5 --> 0.15.6 2020-05-26 10:58:47 +01:00
Akinwale Ariwodola 5de0906fc1 make splash view clickable to prevent clicking views underneath 2020-05-26 10:57:12 +01:00
Akinwale Ariwodola c2f17b6230 Add Italian strings. Save and resume from last media playback position. 2020-05-26 10:38:16 +01:00
Akinwale Ariwodola 6a3bbe6c0d bumpversion 0.15.4 --> 0.15.5 2020-05-25 20:10:34 +01:00
Akinwale Ariwodola 82307c9f98 Increase timeout for remote user requests. Wrap long pre lines in markdown display. 2020-05-25 20:08:24 +01:00
Akinwale Ariwodola d2ec0e2aa1 Display reposts on following page. Update Spanish strings. 2020-05-25 15:15:48 +01:00
Akinwale Ariwodola 3951b1080d different new publish from publish update 2020-05-25 12:14:12 +01:00
Akinwale Ariwodola ef7caeeead Fix subsequent web view display. Add Estonian and Russian strings. 2020-05-25 11:33:12 +01:00
Akinwale Ariwodola 7ef8e2029e Tweak transaction pending text display 2020-05-25 06:03:46 +01:00
Akinwale Ariwodola aaec6ac6a3 wait for uploads to finish before saving channel form 2020-05-25 06:00:34 +01:00
Akinwale Ariwodola 731960da7c bumpversion 0.15.3 --> 0.15.4 2020-05-25 05:50:02 +01:00
Akinwale Ariwodola ac282d2667 log cleanup 2020-05-25 05:48:26 +01:00
Akinwale Ariwodola 7a79601cfc don't enable fullscreen mode when entering PIP mode 2020-05-25 05:47:14 +01:00
Akinwale Ariwodola d1167e4d2b Disable selection mode for purchases. Check additional cases for displaying unsupported content message. 2020-05-25 05:38:25 +01:00
Akinwale Ariwodola 613634adcf get transaction id for first_publish and new_channel rewards 2020-05-25 00:32:21 +01:00
Akinwale Ariwodola acbe33c66d Limit gallery items to 150. Download filtering. Open rewards page from Invites reward driver card. 2020-05-25 00:04:40 +01:00
Akinwale Ariwodola 053ebbd70b dDisplay better error message if authentication fails on first run. Change lineHeight to lineSpacingMultiplier. 2020-05-24 21:27:49 +01:00
Akinwale Ariwodola f5dc4fa4e7 Remove new intent debug logs. Update packages in build.gradle 2020-05-24 20:48:01 +01:00
Akinwale Ariwodola 343270b757 Show auto-claim rewards message at activity level. Add German strings. 2020-05-24 20:34:19 +01:00
Akinwale Ariwodola 65f5626aba More tweaks to PIP mode restore. 2020-05-24 20:29:11 +01:00
Akinwale Ariwodola a051a73c2b Tweak PIP restore. Fix Library wunderbar value. 2020-05-24 18:54:33 +01:00
Akinwale Ariwodola 6840997793 Add 'subscription' to special URLs map. Fix PIP restore for onNewIntent. 2020-05-24 18:46:47 +01:00
Akinwale Ariwodola 2c98ed2d8d Always display rewards driver on Invites page. Rewards drivers minimum display amounts. 2020-05-24 18:37:05 +01:00
Akinwale Ariwodola 6a083c4152 Update Afrikaans strings. Add Vietnamese strings. 2020-05-24 18:18:39 +01:00
Akinwale Ariwodola b60b5d16c3 fix crash bugs reported in Play Store 2020-05-24 10:11:31 +01:00
Akinwale Ariwodola 52cfe8dc12 add blocking param to txo_spend 2020-05-24 05:02:55 +01:00
Akinwale Ariwodola 737afca031 fix onNewIntent logging 2020-05-24 04:50:13 +01:00
Akinwale Ariwodola 456f41d28d Prevent image click through. Add Romanian strings. 2020-05-24 04:43:39 +01:00
Akinwale Ariwodola 238f59ad71 display correct label and amount for tip unlocks in tx history 2020-05-24 00:08:14 +01:00
Akinwale Ariwodola cf6d567193 unify button font 2020-05-23 23:47:32 +01:00
Akinwale Ariwodola 20f8f3852d Merge pull request #888 from lbryio/unlock-tips
add option to unlock all tips
2020-05-23 23:39:16 +01:00
Akinwale Ariwodola 4bb9f5cb43 add option to unlock all tips 2020-05-23 23:37:57 +01:00
Akinwale Ariwodola 540a841255 Fix pip restore and fullscreen quirks. French and Portuguese strings added. 2020-05-23 19:42:30 +01:00
Akinwale Ariwodola 3544637405 Fix reward code claiming. Remove broken French strings file. 2020-05-23 17:48:58 +01:00
Akinwale Ariwodola 651448dfa1 Merge pull request #886 from lbryio/reward-drivers
Add reward drivers. French, Indonesian, Malay and Turkish strings.
2020-05-23 17:46:16 +01:00
Akinwale Ariwodola 4bac266b8b Add reward drivers. French, Indonesian, Malay and Turkish strings. 2020-05-23 17:45:19 +01:00
Akinwale Ariwodola f86b61741d Merge pull request #885 from lbryio/visual-tweaks
Use thin divider in transaction history. Set font for action bar title.
2020-05-23 15:18:43 +01:00
Akinwale Ariwodola 6c60d299af Use thin divider in transaction history page. Set font for action bar title. 2020-05-23 15:17:43 +01:00
Akinwale Ariwodola 08582238c3 Merge pull request #884 from lbryio/dark-theme-fix
Fix dark theme reset error due to WebView. Apply dark theme to web views.
2020-05-23 09:41:59 +01:00
Akinwale Ariwodola b931d0ce7d Fix dark theme reset error due to WebView. Apply dark theme to web views. 2020-05-23 09:37:58 +01:00
Akinwale Ariwodola 5e1fc9dbd8 Merge pull request #883 from lbryio/fullscreen-on-rotate
switch to fullscreen mode on rotate when viewing media
2020-05-23 09:03:00 +01:00
Akinwale Ariwodola de4e6eee25 switch to fullscreen mode on rotate when viewing media 2020-05-23 09:01:30 +01:00
Akinwale Ariwodola d5b4e6990f update material components version 2020-05-23 07:53:58 +01:00
Akinwale Ariwodola 26703815b2 cleanup top level directory 2020-05-23 07:51:56 +01:00
Akinwale Ariwodola 40c36df414 Native rewrite (#878)
* initial native rewrite commit
* update gitlab CI script
* add printVersionName gradle task
* fix Gitlab CI script
* Fix first time wallet sync. add Discover dialog to  Following page.
* Finish Following and All Content views. Add customize your tags view.
* Wallet sync get and set preferences, update interval.
* Editor's Choice. Reposts. Some ontent page tweaks.
* display no related content view when none loaded
* Search cache. File view updates. Floating wallet balance.
* Send tip dialog. Channel page share and follow/unfollow.
* Handle lbry:// url scheme. Properly set URL bar values. SDK 0.71.0.
* Channel follow/unfollow fixes. Display stream cost.
* Channel management and channel creation / editing
* phone number verification and rewards page
* add Invites page
* tweak player loading and playback when loading new claims
* tweak about page layout
* display text and markdown content
* purchase_uri for free content
* don't display invites history if none exist
* fix channel list adapters
* change launch mode from singleInstance to singleTask
* url history and player fixes
* Library page. URL and view history.
* bumpversion 0.15.0 --> 0.15.1
* Make file view a fragment to prevent headaches with multiple Android task recents
* Better handling of file view URLs. Some issue list fixes.
* Abandon channels and bulk delete files tasks. Some visual tweaks.
* bumpversion 0.15.1 --> 0.15.2
* fix some events
* Some visual tweaks. Wunderbar clear focus hotfix for some devices.
* sdk 0.74.0. Publish and Publishes pages.
* Fix displayed amounts. Send Firebase token with install_new.
* Some dark theme and crash fixes. Implement publish form.
* Fix minor typo for string in 'generate_address_hint'.
* Publish form and publish creation flow. UI tweaks and fixes.
* Basic native mobile publishing
* remove closeDatabase calls causing crashes
* Implement file and channel page delete actions. UI action cleanup.
* publish drivers for unresolved file page and featured search result item
* show URL suggestions and data network (DHT) settings
* Filter own claims from downloads. Fix address input.
* fix edit channel crash
* fix for possible blank / invalid video thumbnails
* adjust minimum deposit. fix channel edit mode.
* quick skip and playback speed media controls
* change play and pause icons
* Fix file size display. Tweak playback speed control.
* Add exoplayer mediasession extension. Set player auto attributes.
* Inline publish address validation error. Increase image upload request timeout.
* fix no related content display
* Claim new_android reward. Use canonical_url for share links.
* force US locale for amount / bid values sent with sdk requests
* Afrikaans and Spanish strings
* Add media player error handling policy. Use : in share links.
* don't proceed with publish if optimization is in progress.
2020-05-23 07:49:00 +01:00
Akinwale Ariwodola 6eb20d0e08 sdk 0.73.1 patch 2020-05-14 14:40:12 +01:00
Akinwale Ariwodola cc3055f1c9 bumpversion 0.14.1 --> 0.14.2 2020-03-31 21:32:35 +01:00
Akinwale Ariwodola 25a1eac43b sdk 0.67.1 2020-03-31 21:18:19 +01:00
Akinwale Ariwodola ff30e7f6a4 bumpversion 0.14.0 --> 0.14.1 2020-03-26 19:06:51 +01:00
Akinwale Ariwodola 3fcc01597d sdk 0.65.0 2020-03-26 19:03:47 +01:00
Akinwale Ariwodola cbc4a662e6 bumpversion 0.13.4 --> 0.14.0 2020-03-23 09:45:21 +01:00
Akinwale Ariwodola 5aa0513324 add getNativeBooleanSetting method 2020-03-21 09:18:48 +01:00
Akinwale Ariwodola 4d1f142f9c check sdk ready 2020-03-20 11:15:41 +01:00
Akinwale Ariwodola e9c8f9432f fix service notification not opening the app 2020-03-20 09:27:54 +01:00
Akinwale Ariwodola 56c375f344 lbry.tv hybrid mode (#869)
* lbry.tv experiment build
* add task for checking if the sdk is ready
* fix for special urls
* send onSdkStatusResponse events
* persist dht setting to file system
2020-03-20 08:30:34 +01:00
Akinwale Ariwodola 5b165a2339 remove dht debug logs 2020-03-17 23:10:10 +01:00
Akinwale Ariwodola bfd3c711ab 0.13.4 patch (#868)
* 0.13.4 patch
* update gitlab CI
2020-03-16 18:50:17 +01:00
Akinwale Ariwodola 4627e284fa sdk 0.64.0. check dht setting on startup. 2020-03-13 17:06:05 +01:00
Akinwale Ariwodola ea8ac783a8 bumpversion 0.13.2 --> 0.13.3 2020-03-13 08:32:09 +01:00
Akinwale Ariwodola 966dd2bf2c add log method to utility module 2020-03-13 02:03:39 +01:00
Akinwale Ariwodola 364de592fa use snake case for payload keys 2020-03-12 21:16:39 +01:00
Akinwale Ariwodola d38241f0d1 check for contentTitle and channelUrl in payload 2020-03-11 15:55:35 +01:00
Akinwale Ariwodola e217be6b67 Fast lite mode (native code) (#864)
* fast loading lite mode
* add react methods for lbrynet dir and platform
* send additional url parameters for cold start
* pending intent
* update gitlab CI
2020-03-11 15:21:41 +01:00
Akinwale Ariwodola 37f84f0399 versionCode for productFlavors 2020-03-03 16:48:22 +01:00
Akinwale Ariwodola b618b9fa2b sdk 0.62.0. update secret files. 2020-03-02 18:39:35 +01:00
Akinwale Ariwodola 37b893103d readme: lbrynet-daemon -> LBRY SDK 2020-03-02 16:45:23 +01:00
Akinwale Ariwodola e2d4852df7 include google-services.sample.json for test / debug builds 2020-03-02 16:41:10 +01:00
Akinwale Ariwodola 1e0298d73a update readme 2020-03-02 16:22:19 +01:00
Akinwale Ariwodola 64c13295d6 update release.sh for unsigned APKs 2020-03-01 21:37:57 +01:00
Akinwale Ariwodola 0261ece709 remove release signingConfig since we sign with jarsigner 2020-03-01 21:18:26 +01:00
Akinwale Ariwodola a5799347ad New build (#854)
* new project structure compatiable with Android Studio
2020-02-27 19:20:06 +01:00
Akinwale Ariwodola 6c7c4d1a88 app head: following page sign in message 2020-02-25 19:39:58 +01:00
Akinwale Ariwodola f5390316a7 app head: fix suggested subscriptions state handling 2020-02-25 19:35:54 +01:00
Akinwale Ariwodola da1ea77aa9 pass conf to get_loggly_handler 2020-02-25 08:34:50 +01:00
Akinwale Ariwodola 8ea48977ae sdk 0.61.0 2020-02-24 20:29:09 +01:00
Akinwale Ariwodola 6721db54e2 bumpversion 0.13.0 --> 0.13.1 2020-02-24 15:59:57 +01:00
Akinwale Ariwodola 6a7079c8b2 app head: basic repost redirect handling 2020-02-24 15:58:33 +01:00
Akinwale Ariwodola 8cc7e9d6c9 Following rework (#852)
* app head: following rework
* sdk 0.60.0. app head: following rework changes.
* app head: search and related content fixes
* app head: following rework updates
2020-02-24 15:21:13 +01:00
Akinwale Ariwodola d0ac41c242 app head: timing 2020-02-17 18:34:28 +01:00
Akinwale Ariwodola bc8f476ef1 Merge pull request #850 from lbryio/app-timing
app cold and warm start timing
2020-02-17 07:32:49 +01:00
Akinwale Ariwodola 2d01b63cfe app cold and warm start timing 2020-02-17 07:19:16 +01:00
Akinwale Ariwodola 88dc31e9af Merge pull request #832 from michaeltintiuc/fix-npm-install
Fix npm install
2020-02-07 16:26:05 +01:00
Thomas Zarebczan 8d1e5eb64d Merge pull request #834 from ykris45/patch-3
Update LICENSE
2020-02-03 17:04:42 -05:00
Akinwale Ariwodola 8113ef3f8a app head: fix splash screen stuck on authenticating 2020-02-03 09:21:22 +01:00
Akinwale Ariwodola a74ed0e93b bumpversion 0.12.3 --> 0.13.0 2020-02-03 07:28:28 +01:00
Akinwale Ariwodola 11f42bf71e app head: resolved search nsfw 2020-02-03 07:27:40 +01:00
YULIUS KURNIAWAN KRISTIANTO 8eb96025ec Update LICENSE 2020-02-03 04:38:17 +07:00
Akinwale Ariwodola 1ece7ff433 sdk 0.56.0 fixes 2020-01-31 19:43:49 +01:00
Michael Tintiuc e312c451f8 Fix npm install 2020-01-31 19:51:32 +02:00
Akinwale Ariwodola bb64e91648 sdk 0.56.0 2020-01-31 16:47:25 +01:00
Akinwale Ariwodola 69398f6a2c app head: search page fixes 2020-01-31 09:15:37 +01:00
Akinwale Ariwodola bef7aa0ae9 app head: Invites page 2020-01-29 12:26:57 +01:00
Akinwale Ariwodola 2776696501 app head: fix thumbnailUrl check 2020-01-23 02:16:12 +01:00
Akinwale Ariwodola fa075df278 app head: additional thumbnailUrl check 2020-01-23 00:56:11 +01:00
Akinwale Ariwodola 05311fd3a1 app head: fix additional channel creator edit error 2020-01-22 21:21:42 +01:00
Akinwale Ariwodola 79001239d9 app head: fix channel creator edit error 2020-01-22 18:40:19 +01:00
Akinwale Ariwodola e344733bf0 sdk 0.54.1 2020-01-22 15:04:44 +01:00
Akinwale Ariwodola 282fdbb903 app head: download confirmation dialog 2020-01-20 23:36:35 +01:00
Akinwale Ariwodola ee7c571101 download manager tweaks 2020-01-20 23:11:46 +01:00
Akinwale Ariwodola 87e42d6b7e app head: error on publish to existing content address 2020-01-20 21:53:57 +01:00
Akinwale Ariwodola 8fcf135280 add Stop action to download notifications 2020-01-20 21:42:25 +01:00
Akinwale Ariwodola ae9364ad7e add filter to only get active downloads on service startup 2020-01-20 18:55:02 +01:00
Akinwale Ariwodola 6aa44d8a9e tweak sdkCall params and sdk poll interval 2020-01-17 07:24:50 +01:00
Akinwale Ariwodola 3f013d1272 bumpversion 0.12.2 --> 0.12.3 2020-01-17 06:53:51 +01:00
Akinwale Ariwodola 94d1f5a4eb fix queued download file_list response handling 2020-01-17 06:44:43 +01:00
Akinwale Ariwodola 1d8a7d838b Merge pull request #818 from lbryio/sdk-0.53
sdk 0.53
2020-01-17 06:00:08 +01:00
Akinwale Ariwodola c5d441fa1f sdk 0.53.3 2020-01-17 05:59:04 +01:00
Akinwale Ariwodola 4276a78a81 sdk 0.53.2 service updates 2020-01-16 22:34:36 +01:00
Akinwale Ariwodola 36c24a448f Playable downloads (#817) 2020-01-16 22:05:22 +01:00
Akinwale Ariwodola 4bf1051549 app head: playable downloads update 2020-01-16 22:03:19 +01:00
Akinwale Ariwodola fc4ab3128c app headd: fix error on opening related content or urls 2020-01-14 02:30:35 +01:00
Akinwale Ariwodola 65d32ea13e app head: react navigation drawer workaround 2020-01-13 12:24:32 +01:00
Akinwale Ariwodola 4cd8c80226 optimise download manager update broadcasts 2020-01-13 12:05:02 +01:00
Akinwale Ariwodola 7adcdc43cf app head: remove calls to doCheckSubscriptionsInit 2020-01-10 23:41:47 +01:00
Akinwale Ariwodola 77852dc135 app head: style fixes 2020-01-10 00:38:25 +01:00
Akinwale Ariwodola 746ca62ca7 app head: fix claim result item channel render checks 2020-01-09 20:34:52 +01:00
Akinwale Ariwodola 5e993f0fcc spinner dropdown styling 2020-01-09 20:20:22 +01:00
Akinwale Ariwodola 168dbba62c app head: fullscreen media player restore tweak 2020-01-09 19:00:25 +01:00
Akinwale Ariwodola 4db7bf814c app head: latest changes 2020-01-09 18:18:41 +01:00
Akinwale Ariwodola 21a3ff318b update font files 2020-01-09 15:44:10 +01:00
Akinwale Ariwodola 116de67d4c app head: downgrade drawer navigator 2020-01-07 11:21:30 +01:00
Akinwale Ariwodola c6b8dfd539 app head: download and open file button fixes 2020-01-07 08:50:24 +01:00
Akinwale Ariwodola 37f33e9943 fix WebView package 2020-01-07 08:35:06 +01:00
Akinwale Ariwodola 4bae7fdf94 app head: fix tag search result 2020-01-06 23:02:06 +01:00
Akinwale Ariwodola c455bde154 app head: performance and fixes. disable hermes engine. 2020-01-06 21:55:59 +01:00
Akinwale Ariwodola 5aa4321787 app head: merge resolved search commits 2020-01-05 19:08:52 +01:00
Akinwale Ariwodola 27a2100c72 app head: resolved search updates 2020-01-05 18:12:49 +01:00
Akinwale Ariwodola 4fc82c6527 app head: resolved search 2020-01-05 13:58:12 +01:00
Akinwale Ariwodola 56486ad274 app head: storage permission checks 2020-01-04 07:11:50 +01:00
Akinwale Ariwodola 99a38e655b bumpversion 0.12.1 --> 0.12.2 2020-01-03 19:12:14 +01:00
Akinwale Ariwodola 262050147d sdk 0.51.2 2020-01-03 18:55:47 +01:00
Akinwale Ariwodola 5ff2e608c2 app head: reactotron and search improvements 2019-12-29 11:17:13 +01:00
Akinwale Ariwodola 4e305faf5b app head: remove console.log 2019-12-29 07:24:26 +01:00
Akinwale Ariwodola 0bdbb843fb add android:exported to activity definition in manifest 2019-12-29 07:20:48 +01:00
Akinwale Ariwodola c8736ad26e update gradle dependencies 2019-12-29 07:15:14 +01:00
Akinwale Ariwodola 57d6b72f5a First run changes (#809)
* don't request for storage permission on first startup
* app head: download button tweaks
* fix download manager
2019-12-28 16:06:14 +01:00
Akinwale Ariwodola d0117b14db React Native 0.61 (#808)
* support for RN 0.61.5
* update gradle_dependencies
2019-12-28 15:42:26 +01:00
Akinwale Ariwodola 6729842ed8 app head: channel name and follower background 2019-12-20 18:55:10 +01:00
Akinwale Ariwodola 723ade8ba6 bumpversion 0.12.0 --> 0.12.1 2019-12-20 09:03:00 +01:00
Akinwale Ariwodola 83066232b6 sdk 0.50.1 2019-12-20 09:02:10 +01:00
Akinwale Ariwodola 4dc0b19c5d Merge pull request #800 from lbryio/snackbars
snackbar support
2019-12-20 08:00:07 +01:00
Akinwale Ariwodola a58cc820ef app head: update master 2019-12-18 16:51:07 +01:00
Akinwale Ariwodola 2b3397bc85 snackbar support 2019-12-18 11:48:29 +01:00
Akinwale Ariwodola a519b5c0b1 app head: display balance on LBC input focus 2019-12-13 17:36:01 +01:00
Akinwale Ariwodola fb3a34c871 disable sound on download notifications 2019-12-13 15:10:02 +01:00
Akinwale Ariwodola a1bc3fcd7e fix notification icon 2019-12-13 14:51:44 +01:00
Akinwale Ariwodola 7daf3c6f55 add headers download to CI for 64-bit build 2019-12-11 17:06:28 +01:00
Akinwale Ariwodola 7d032179ef fix CI build 2019-12-11 16:20:45 +01:00
Akinwale Ariwodola 156507f8f7 remove headers file and dynamically download for build 2019-12-11 16:15:16 +01:00
Akinwale Ariwodola 032a1927db bumpversion 0.11.1 --> 0.12.0 2019-12-11 09:08:42 +01:00
Akinwale Ariwodola f24bf570ef app head: fixes before release 2019-12-11 09:08:26 +01:00
Akinwale Ariwodola 75c2ece016 add headers file to package (#792)
* latest headers
2019-12-11 08:46:34 +01:00
Akinwale Ariwodola 0c1c1a6c79 sdk 0.49.0 2019-12-10 16:30:18 +01:00
Akinwale Ariwodola 5af25a9d43 app head: update 2019-12-06 17:24:34 +01:00
Akinwale Ariwodola 55fec0f578 sdk 0.48.0 2019-12-05 13:42:42 +01:00
Akinwale Ariwodola b61fc3a148 Merge pull request #786 from lbryio/i18n
add language constant for app launch
2019-12-05 13:20:18 +01:00
Akinwale Ariwodola e3cd0fc2b1 add language constant for app launch 2019-12-05 13:19:22 +01:00
g1tman fe01f50c65 Perf: Use of sort and sorted functions optimized (#748)
* Update mixer.py
* Update graph.py
* Update mixer.py
* Update mixer.py
* Update bdistapk.py
* Update toolchain.py
* Update build.py
* Update build.py
2019-11-25 11:28:16 +01:00
Akinwale Ariwodola cd378d16e3 app head: fetching cost info fix 2019-11-12 21:10:57 +01:00
Akinwale Ariwodola e951fabf1c bumpversion 0.11.0 --> 0.11.1 2019-11-12 16:21:22 +01:00
Akinwale Ariwodola 48543a48fb log events for received and opened notifications (#760)
* log events for received and opened notifications
* app head: update to master
2019-11-12 15:50:47 +01:00
Akinwale Ariwodola 2699893581 bumpversion 0.10.2 --> 0.11.0 2019-11-04 08:49:41 +01:00
Akinwale Ariwodola 21914a0bd7 Merge pull request #752 from lbryio/fcm-data
handle FCM data-only messages
2019-11-04 08:48:50 +01:00
Akinwale Ariwodola d83667682d handle FCM data-only messages 2019-11-01 06:54:32 +01:00
Akinwale Ariwodola a5dc01f589 app head: hide notification settings 2019-10-31 17:35:18 +01:00
Akinwale Ariwodola fb497cebfe app head: fix launch urls and notification target urls 2019-10-31 07:55:36 +01:00
Akinwale Ariwodola 9ffaba4358 app head: normalise tag name from search result 2019-10-30 13:05:44 +01:00
Akinwale Ariwodola be85307fe8 sdk 0.43.4 2019-10-30 11:24:04 +01:00
Akinwale Ariwodola b55961bd83 bumpversion 0.10.1 --> 0.10.2 2019-10-30 11:21:26 +01:00
Akinwale Ariwodola f4911394ba app head: master 2019-10-30 10:36:10 +01:00
Akinwale Ariwodola 42cf11358e handle remote notification payloads (#737)
* handle remote notification payloads
* handle intent extras for background notifications
2019-10-30 10:34:57 +01:00
Akinwale Ariwodola 6e6ed07890 app head: rc 2019-10-30 10:33:09 +01:00
Thomas Zarebczan 22327bf33e Merge pull request #723 from mohatagarvit/master
Update google-services.json path in BUILD.md #722
2019-10-28 10:31:15 -04:00
Thomas Zarebczan 57d8bc3311 Merge pull request #721 from sidhyatikku/patch-1
Initialised a GitHub PR Template
2019-10-28 10:30:17 -04:00
Thomas Zarebczan 6589799a2a Update PULL_REQUEST_TEMPLATE.md 2019-10-28 10:29:43 -04:00
Thomas Zarebczan 7d6370163b Merge pull request #734 from Janith96/patch-1
Update QUICKSTART.md
2019-10-28 10:28:17 -04:00
Thomas Zarebczan 9a5d63b7fc Update QUICKSTART.md 2019-10-28 10:27:48 -04:00
Thomas Zarebczan 2d872a57ee Merge pull request #715 from StrikerRUS/patch-1
Delete .travis.yml
2019-10-28 10:25:53 -04:00
Thomas Zarebczan f9c0850acd Merge pull request #724 from EricBrianAnil/patch-1
Updated screenshots
2019-10-23 17:38:42 -04:00
Janith Udayanga 994ec732a4 Update QUICKSTART.md
Corrected Typos, Added Links to the mentioned Repos, Made Topics more clear & more readable.
2019-10-23 10:48:48 +05:30
Akinwale Ariwodola b44770c77f Navigation drawer fix (#729)
* app head: downgrade react-navigation-drawer package
* app head: adjust drawer width
2019-10-21 18:42:12 +01:00
Akinwale Ariwodola 7ea836e249 app head: fix blank password wallet state 2019-10-21 15:56:22 +01:00
Eric Brian Anil 16d2401e38 Added gif as requested
Updated the old image with the gif from https://lbry.com/android as requested
2019-10-21 11:00:33 +05:30
Akinwale Ariwodola 259dc4c7cc bumpversion 0.10.0 --> 0.10.1 2019-10-20 19:33:58 +01:00
Akinwale Ariwodola 3bcd67b8fb sdk 0.43.3 2019-10-20 19:33:22 +01:00
Eric Brian Anil 648d9103b7 Updated screenshots
Updated the file with the screenshots of the most recent version of the app. The  existing screenshot had been of a previous version .
2019-10-20 23:02:27 +05:30
Garvit Mohata faac434d33 Update google-services.json path in BUILD.md #722
Updates the google-services.json path as per the current directory structure
2019-10-20 16:28:06 +05:30
Sidhya Tikku f558cc49f7 Create PULL_REQUEST_TEMPLATE.md 2019-10-20 00:27:38 +05:30
Akinwale Ariwodola 5add227e55 sdk 0.43.2 2019-10-17 20:27:55 +01:00
Akinwale Ariwodola 4519a5d174 app head: fix for devices without Firebase support 2019-10-17 19:55:55 +01:00
Akinwale Ariwodola 095bed4482 app head: proceed from splash if Firebase doesn't work 2019-10-17 19:12:49 +01:00
Akinwale Ariwodola 07dc95b639 app head: remove getSync wait before navigation to main 2019-10-17 18:20:38 +01:00
Akinwale Ariwodola edc3ebcff1 bumpversion 0.9.3 --> 0.10.0 2019-10-17 16:04:56 +01:00
Akinwale Ariwodola 0f7055ca5b Revert "bumpversion 0.9.3 --> 0.9.4"
This reverts commit f426321e15.
2019-10-17 16:03:39 +01:00
Akinwale Ariwodola f426321e15 bumpversion 0.9.3 --> 0.9.4 2019-10-17 14:57:49 +01:00
Akinwale Ariwodola 70d5cb3e2b RC 0.9.4 (#712)
* sdk 0.43.1
2019-10-17 14:55:44 +01:00
Nikita Titov 15e4dca984 Delete .travis.yml 2019-10-16 02:10:12 +03:00
Thomas Zarebczan 3a7221d71b Merge pull request #705 from sumitkharche/master
Added license badge
2019-10-15 12:18:57 -04:00
Thomas Zarebczan e8cb3afb34 Update README.md 2019-10-15 12:18:40 -04:00
Thomas Zarebczan 2b7a580001 Merge pull request #708 from akshitsarin/patch-1
Fixed a typo in QUICKSTART.md
2019-10-13 17:58:47 -04:00
Akshit Sarin b5d327581b Fixed a typo in QUICKSTART.md
Signed-off-by: Akshit Sarin <akshitsarin99@gmail.com>

'*toolcahin* to toolchain'
2019-10-14 03:11:31 +05:30
Sumit Kharche c0ca45e949 Added license and build badges 2019-10-13 00:41:09 +05:30
Akinwale Ariwodola 4acc107d3a Share (#704)
* use native share interface for sharing LBRY URLs
2019-10-11 17:22:39 +01:00
Akinwale Ariwodola 1070dba0ae sdk 0.42.1 (#703)
* sdk 0.42.1
2019-10-11 17:15:26 +01:00
Akinwale Ariwodola 7ae5d48767 add Firebase Cloud Messaging support (#702)
* add Firebase Cloud Messaging support
* add default notification channel for FCM
2019-10-11 14:18:45 +01:00
Akinwale Ariwodola e5c05fac48 Merge pull request #700 from StrikerRUS/license
bump year in license
2019-10-11 13:58:37 +01:00
StrikerRUS f7c4b94546 bump year in license 2019-10-09 00:00:31 +03:00
Akinwale Ariwodola a58af97216 bumpversion 0.9.2 --> 0.9.3 2019-10-04 16:19:37 +01:00
Akinwale Ariwodola 3759a9703a app head: suggested subs and improvements 2019-10-03 16:50:02 +01:00
Akinwale Ariwodola 2d3ed191fd app head: fix channel creator edit mode 2019-09-27 00:50:12 +01:00
Akinwale Ariwodola 425817b896 bumpversion 0.9.1 --> 0.9.2 2019-09-27 00:04:23 +01:00
Akinwale Ariwodola aaf3be2f7b app head: code cleanup 2019-09-27 00:02:59 +01:00
Akinwale Ariwodola bc810c80d6 app head: fix publishing 2019-09-27 00:00:35 +01:00
Akinwale Ariwodola e7a6f6f921 app head: fix typo 2019-09-26 09:54:42 +01:00
Akinwale Ariwodola 26542abc4d app head: channel creator fixes. fix wallet sync disable / re-enable errors. 2019-09-26 07:26:22 +01:00
Akinwale Ariwodola 46fd7f40d4 bumpversion 0.9.0 --> 0.9.1 2019-09-26 00:13:45 +01:00
Akinwale Ariwodola 40eaa80f4b app head: fix channel creator canSave flag 2019-09-25 23:35:24 +01:00
Akinwale Ariwodola ea8f93061d app head: post-0.9.0 fixes 2019-09-25 23:22:12 +01:00
Akinwale Ariwodola 2ec2593704 app head: fix channel creator text input errors 2019-09-25 19:24:04 +01:00
Akinwale Ariwodola c4949c7794 app head: back navigation tweak 2019-09-25 17:57:24 +01:00
Akinwale Ariwodola 7572a0da5a app head: blank passwords 2019-09-25 16:37:54 +01:00
Akinwale Ariwodola 678b9c3184 app head: fix back navigation and channel name validation 2019-09-25 14:45:19 +01:00
Akinwale Ariwodola 2900b18cce bumpversion 0.8.4 --> 0.9.0 2019-09-24 19:03:43 +01:00
Akinwale Ariwodola 580e78afab app head: show delete button for owned claims 2019-09-24 18:59:34 +01:00
Akinwale Ariwodola ace430abe6 0.9.0 rc (#679)
* app head: sync user settings
* app head: fix errors and user shared state
* sdk 0.40.1
* app head: empty state views. fix publishing state.
2019-09-24 17:31:00 +01:00
Akinwale Ariwodola 54c6089bdc app head: better handling of pending form states 2019-09-15 12:47:38 +01:00
Akinwale Ariwodola 8b308abfb8 Merge pull request #676 from lbryio/publish-channel-selector
app head: fix channel selector issues on publish page
2019-09-15 12:06:23 +01:00
Akinwale Ariwodola 53696970a7 app head: fix channel selector issues on publish page 2019-09-13 08:50:45 +01:00
Akinwale Ariwodola 18e2d8ad5e app head: channel creator updates 2019-09-13 08:17:17 +01:00
Akinwale Ariwodola 46cf9ad4ad bumpversion 0.8.3 --> 0.8.4 2019-09-06 19:44:54 +01:00
Akinwale Ariwodola a11f560183 app head: 0.8.4 rc 2019-09-06 19:43:58 +01:00
Akinwale Ariwodola 23fbde6df4 app head: pin lbryinc commit 2019-09-06 16:24:34 +01:00
Akinwale Ariwodola 512e4988d2 app head: unlock after set default account 2019-09-06 16:13:39 +01:00
Akinwale Ariwodola eb41a5e529 app head: fix featured search item 2019-09-06 15:03:34 +01:00
Akinwale Ariwodola cefc126ffe app head: account unlock after sync apply 2019-09-06 14:52:27 +01:00
Akinwale Ariwodola 29286efbd4 sdk 0.40.0. fix merge conflicts. 2019-09-05 16:48:18 +01:00
Akinwale Ariwodola ea30ad5974 Channel creator (#663)
* app head: channel creator page
* remove react-native-document-picker
* app head: support optional parameters
* app head: channel creator updates. upload image assets.
2019-09-05 15:59:51 +01:00
Akinwale Ariwodola 5f30cca79b app head: channel creator page 2019-08-30 18:31:49 +01:00
Akinwale Ariwodola d76cf4457e app head: cleanup 2019-08-27 07:10:34 +01:00
Akinwale Ariwodola 88d58f4344 app head: fix all content filter selectors 2019-08-27 06:52:16 +01:00
Akinwale Ariwodola 93819b3afd app head: fix: pin react-native-gesture-handler version 2019-08-26 21:18:37 +01:00
Akinwale Ariwodola 7b438db34f app head: fix not_tags and npm packages 2019-08-26 21:02:09 +01:00
Akinwale Ariwodola f526d797f8 app head: fix buildURI calls 2019-08-26 20:46:29 +01:00
Akinwale Ariwodola 05f7b07449 bumpversion 0.8.2 --> 0.8.3 2019-08-26 09:41:34 +01:00
Akinwale Ariwodola ddf7c66933 app head: master 2019-08-26 09:00:44 +01:00
Akinwale Ariwodola 715a52b291 app head: edit published content (#653) 2019-08-26 08:58:10 +01:00
Akinwale Ariwodola 660adb4a6f setCurrentScreen tweaks 2019-08-25 16:36:25 +01:00
Akinwale Ariwodola e47a1e0bf2 add screen class override for setCurrentScreen 2019-08-23 14:39:08 +01:00
Akinwale Ariwodola 7b2044d2a4 sdk 0.39.0. app head: publish / featured search tweaks 2019-08-21 16:52:28 +01:00
Akinwale Ariwodola 1d3c961c3c app head: tweak video loading indicator 2019-08-21 07:06:09 +01:00
Akinwale Ariwodola dc59a1270f sdk 0.39.2 2019-08-21 05:18:56 +01:00
Akinwale Ariwodola 7452efa047 app head: tweak publish page grid 2019-08-21 05:15:24 +01:00
Akinwale Ariwodola 8517f74c6d fix githubrelease command 2019-08-20 19:57:47 +01:00
Akinwale Ariwodola 637a62ea21 app head: fix your tags and wallet route navigation 2019-08-20 18:49:55 +01:00
Akinwale Ariwodola 16f270fb9f bumpversion 0.8.1 --> 0.8.2 2019-08-20 17:54:40 +01:00
Akinwale Ariwodola c4f016c912 0.8.2 rc with sdk 0.39.0 update (#640)
* sdk 0.39.0
* update aioupnp commit hash
* add defusedxml dependency for aioupnp
2019-08-20 17:54:02 +01:00
Akinwale Ariwodola e63bc44055 tweak fresco gradle dependencies. fail build if the bundle doesn't build. 2019-08-17 02:23:17 +01:00
Akinwale Ariwodola 99c8e14773 Merge pull request #637 from lbryio/gallery-thumbnails
app head: gallery thumbnails and publish style tweaks
2019-08-15 19:06:40 +01:00
Akinwale Ariwodola d84fb51f6f app head: gallery thumbnails and publish style tweaks 2019-08-15 06:08:53 +01:00
Akinwale Ariwodola a8309ffaf5 add ReactMethod to call firebase setCurrentScreen 2019-08-14 16:15:20 +01:00
Akinwale Ariwodola fd97ba3ae9 Drawer menu stutter (#633)
* app head: fix drawer menu stuttering and getting stuck
* fix release script
* fix 32-bit gradle template
2019-08-13 12:32:38 +01:00
Akinwale Ariwodola 305e62746c different version codes for 32- and 64-bit 2019-08-12 16:43:51 +01:00
Akinwale Ariwodola bf57de9d96 only include arm64-v8a for arm64 2019-08-12 15:11:53 +01:00
Akinwale Ariwodola 07e52d2a83 remove arm64-v8a folder from 32-bit builds 2019-08-12 15:07:09 +01:00
Akinwale Ariwodola 36a0450c1d fix last step in release apk stage 2019-08-12 14:33:19 +01:00
Akinwale Ariwodola f49e8134dd app head: fix remaining publish bugs 2019-08-12 13:23:11 +01:00
Akinwale Ariwodola a54037270b app head: fix navigate back to trending and claim_search end detection 2019-08-11 18:38:16 +01:00
Akinwale Ariwodola 4a6b091496 app head: yet more fixes. 2019-08-11 17:16:17 +01:00
Akinwale Ariwodola 03addf41c7 app head: misc fixes 2019-08-11 08:53:26 +01:00
Akinwale Ariwodola 9440855bf2 app head: fix publishing bugs 2019-08-11 00:08:06 +01:00
Akinwale Ariwodola d53b1b94e5 Merge pull request #629 from lbryio/multi-arch-builds
build 32-bit and 64-bit APKs
2019-08-10 19:06:30 +01:00
Akinwale Ariwodola 16ebf7bb11 build 32-bit and 64-bit APKs 2019-08-10 12:25:57 +01:00
Akinwale Ariwodola c8e7194a94 app head: display remaining discover tags and fix publish cancel bug 2019-08-10 10:14:44 +01:00
Akinwale Ariwodola c6527fc57a app head: don't show anonymous while resolving file item 2019-08-10 08:13:23 +01:00
Akinwale Ariwodola bf906479d8 app head: Daemon (lbrynet) --> LBRY SDK 2019-08-10 08:02:14 +01:00
Akinwale Ariwodola 938512f826 bumpversion 0.8.0 --> 0.8.1 2019-08-10 07:58:00 +01:00
Akinwale Ariwodola bbc068b889 0.8.1 rc (#628)
* app head: fix first set of release blockers
* sdk 0.38.6
* app head: pin lbryinc version
* app head: fix error on tag page
* app head: update pinned lbry-redux version
* app head: fix tag page back navigation and routes
* app head: fix nsfw functionality. add GA events.
* app head: fix release blockers
2019-08-10 07:57:06 +01:00
Akinwale Ariwodola 0ae9fd44d2 app head: react navigation tweaks 2019-08-09 07:55:43 +01:00
Akinwale Ariwodola d266b9f55b Performance (#626) 2019-08-09 07:42:21 +01:00
Akinwale Ariwodola 57691fcd99 app head: hide blacklisted and filtered outpoints from lists 2019-07-31 12:18:52 +01:00
Akinwale Ariwodola 8cd41aae27 app head: pin new lbry-redux commit 2019-07-30 19:46:30 +01:00
Akinwale Ariwodola 8ac3efeedc Merge branch 'master' of https://github.com/lbryio/lbry-android 2019-07-30 19:37:19 +01:00
Akinwale Ariwodola 642c80779a app head: fixes and style tweaks 2019-07-30 19:36:28 +01:00
Alex Grin 17d43fcb7e Update .gitlab-ci.yml 2019-07-30 12:00:37 -04:00
Akinwale Ariwodola 6bc67dd303 bumpversion 0.7.5 --> 0.8.0 2019-07-30 15:44:41 +01:00
Akinwale Ariwodola 2926225133 app head: use master branch 2019-07-30 15:43:27 +01:00
Akinwale Ariwodola 8fe078cc29 Merge pull request #620 from lbryio/release-0.8.0
app head: updates for next release
2019-07-30 15:42:52 +01:00
Akinwale Ariwodola b721a52584 app head: updates for next release 2019-07-30 15:39:22 +01:00
Akinwale Ariwodola e7eeb0bacd sdk 0.38.5. app head: final discovery fixes. (#618) 2019-07-29 23:48:45 +01:00
Akinwale Ariwodola 710abb1206 Merge pull request #617 from lbryio/publishes-page
app head: add publishes page
2019-07-29 23:44:14 +01:00
Akinwale Ariwodola 82c3efba07 app head: add publishes page 2019-07-26 17:13:02 +01:00
Akinwale Ariwodola 12a3b50e35 app head: fast-forward master 2019-07-26 15:36:25 +01:00
Akinwale Ariwodola 48884bc2de app head: pull master 2019-07-26 09:15:24 +01:00
Akinwale Ariwodola d02689fc67 Discovery (#610)
* discovery changes
* app head: tag page and content sorting
* app head: fix styles and tag page load
* app head: update subscriptions view using claim_search results
* app head: add horizontal subscribed channels list
* app head: add tag customisation to explore and trending pages
* update to sdk 0.38.3. app head: subscriptions and suggested channels
2019-07-26 09:14:25 +01:00
Akinwale Ariwodola 9751b18c54 Merge pull request #608 from EnigmaCurry/docker-build2
DOCKER-DEV: Add arm64 glibc headers from #606 and other refactors
2019-07-17 18:55:08 +01:00
Ryan McGuire f6a4ca42b1 DOCKER-DEV: Add arm64 glibc headers from #606 2019-07-15 17:36:31 -04:00
Akinwale Ariwodola 0f2d6bfa9b fix buildozer.spec.ci 2019-07-13 04:36:33 +01:00
Akinwale Ariwodola 84a7b930a8 gitlab CI force submodule update 2019-07-13 04:09:56 +01:00
Akinwale Ariwodola 7549ecbf45 update app HEAD 2019-07-13 01:27:57 +01:00
Akinwale Ariwodola 99f6150bdc Merge pull request #607 from lbryio/rn-0.59.10
upgrade to React Native 0.59.10
2019-07-13 01:26:08 +01:00
Akinwale Ariwodola dab8aec81c upgrade to React Native 0.59.10 2019-07-12 15:54:33 +01:00
Ryan McGuire b0ddacbe89 DOCKER-DEV: Local development in a docker container (#595)
* DOCKER-DEV: Local lbry-android development via docker.
* DOCKER-DEV: Add git submodule init
2019-07-11 02:30:41 +01:00
Akinwale Ariwodola 530923640c arm64 (#606)
* 64-bit support
* update gitlab CI build
* update android.arch in buildozer.spec
2019-07-10 21:34:52 +01:00
Akinwale Ariwodola c977d2ed86 React Native codebase as a submodule (#604) 2019-07-09 05:34:46 +01:00
Akinwale Ariwodola 8459d10dc7 Publishing (#577)
* create gallery module for retrieving media from device
* gallery and ui flow for publishing
* publishing. add channel selector component.
* enable record and take photo buttons
* create thumbnails for camera media
* upload thumbnails. check publish success status.
* update to sdk 0.38.0. add tags / tag selection to publish.
2019-07-09 01:43:30 +01:00
Akinwale Ariwodola 60836ec5ec Update wallet sync status display (#597)
* update wallet sync status display
* add disable wallet sync confirmation
* add wallet sync title
* use python 3.7 venv
2019-07-09 01:39:10 +01:00
Akinwale Ariwodola 20cd4affee Merge pull request #598 from lbryio/blank-password-warning
add warning for proceeding with a blank password
2019-07-09 01:38:43 +01:00
Akinwale Ariwodola 120c3ca52f add warning for proceeding with a blank password 2019-07-08 04:22:02 +01:00
Akinwale Ariwodola 455dadd30d use python 3.7 venv 2019-07-07 16:59:15 +01:00
Akinwale Ariwodola 01534caf13 handle account unlock failure (#594)
* display information to the user upon account_unlock failure
* remove trailing dots in messages
2019-07-07 15:26:20 +01:00
Akinwale Ariwodola 4186081fdc Merge pull request #596 from lbryio/sdk-0.38
upgrade to sdk 0.38.0
2019-07-07 15:25:43 +01:00
Akinwale Ariwodola 88a7a9b6b1 upgrade to sdk 0.38.0 2019-07-07 15:19:21 +01:00
Jeremy Kauffman b4267d8d8b Merge pull request #581 from lbryio/build-doc-update
updated Android build instructions
2019-06-25 10:09:12 -04:00
Akinwale Ariwodola fdac63a299 increase status call timeout to 1000ms 2019-06-21 17:14:32 +01:00
Akinwale Ariwodola 0a210b6e09 bumpversion 0.7.4 --> 0.7.5 2019-06-21 10:20:44 +01:00
Akinwale Ariwodola 945308dfbc formatting 2019-06-21 10:19:25 +01:00
Akinwale Ariwodola aa285f90ae Merge pull request #588 from lbryio/wallet-send-paste
add paste button beside wallet address input
2019-06-21 10:17:59 +01:00
Akinwale Ariwodola 64bf12718a Merge pull request #587 from lbryio/first-run-analytics
additional events to track first run flow
2019-06-21 10:17:49 +01:00
Akinwale Ariwodola dd9677ea3b add paste button beside wallet address input 2019-06-21 09:46:27 +01:00
Akinwale Ariwodola ea60df592f additional events to track first run flow 2019-06-21 08:21:14 +01:00
Akinwale Ariwodola c140aa32b6 updated Android build instructions 2019-06-17 17:13:52 +01:00
netop:// ウェッブ 9d6cf369d6 Added updated Docker instructions (#574) 2019-06-17 16:03:02 +01:00
Akinwale Ariwodola 41c124e042 bumpversion 0.7.3 --> 0.7.4 2019-06-14 08:44:11 +01:00
Akinwale Ariwodola eca962ad68 sdk 0.37.4 update (#579)
* sdk 0.37.4 update
* pin lbry-redux commit hash
* hide save file button
2019-06-14 08:42:46 +01:00
Akinwale Ariwodola 89c653e613 Merge pull request #578 from lbryio/prettier
add prettier and eslint
2019-06-12 16:39:35 +01:00
Akinwale Ariwodola 964ed2d129 add prettier and eslint 2019-06-12 08:56:08 +01:00
Akinwale Ariwodola 6a1287d1b0 Merge pull request #576 from lbryio/first-run-restart
do not proceed past Setup account without an email address
2019-06-08 22:18:12 +01:00
Akinwale Ariwodola d3f4abc50e allow blank passwords (#575) 2019-06-08 22:17:27 +01:00
Akinwale Ariwodola 20da1b6461 do not proceed past Setup account without an email address 2019-06-07 06:21:09 +01:00
Akinwale Ariwodola 044947d4ae Save audio/video files (#564)
* add save file button for audio/video
* set state for downloads initiated using the save file button
* allow actions to be shown if there's a download_path in fileInfo
* do not auto play downloaded media
2019-06-05 15:53:11 +01:00
Akinwale Ariwodola a2c0851ac7 bumpversion 0.7.2 --> 0.7.3 2019-06-04 05:57:36 +01:00
Akinwale Ariwodola 7e136faea5 perform user authentication on first page of first run (#572)
* perform user authentication on first page of first run
* additional firebase events for first run
2019-06-04 05:56:45 +01:00
Akinwale Ariwodola 309b1e70e6 bumpversion 0.7.1 --> 0.7.2 2019-06-03 09:02:00 +01:00
Akinwale Ariwodola e2399c257d Merge pull request #566 from lbryio/custom-drawer-content
add custom drawer content to navigate to the topmost item in nested stacks
2019-06-03 08:14:21 +01:00
Akinwale Ariwodola c892b51ff8 add custom drawer content to navigate to the topmost item in nested stacks 2019-05-31 05:41:44 +01:00
Akinwale Ariwodola 8b3a0d22be bumpversion 0.7.0 --> 0.7.1 2019-05-29 18:04:42 +01:00
Akinwale Ariwodola f4fe9294f0 fix backspace in search uri bar 2019-05-29 17:45:14 +01:00
Akinwale Ariwodola 67a2b76e41 create progress bar component (#560) 2019-05-29 16:40:59 +01:00
Akinwale Ariwodola 499e406c5d Merge pull request #563 from lbryio/search-uri-bar-fix
fix typing in uri bar on search page
2019-05-29 16:40:22 +01:00
Akinwale Ariwodola 90ccf18fbf fix typing in uri bar on search page 2019-05-29 16:39:34 +01:00
Akinwale Ariwodola 7f57447e57 change the appearance of the uri bar input (#561)
* change the appearance of the uri bar input
* improve no search results display
2019-05-29 11:53:27 +01:00
Akinwale Ariwodola 10beb9935f change manual reward verification message 2019-05-28 20:41:57 +01:00
Akinwale Ariwodola 5fc2e1247b Set default account upon wallet sync restore (#556) 2019-05-28 19:26:53 +01:00
Akinwale Ariwodola 67d4e97582 add reveal password icon and more UI tweaks (#554)
* add reveal password icon and more UI tweaks
* navigation workaround. more UI updates and tweaks.
* update control colours. fix search.
* optimise launcher icon. file page style tweak.
* optimise media player buffer values
2019-05-28 16:00:15 +01:00
Akinwale Ariwodola abeadd858e sdk 0.37.2 update for release (#547) 2019-05-27 10:30:33 +01:00
Akinwale Ariwodola 5a737ce38d wait for user to complete email verification (#548)
* wait for user to complete email verification on first run
* add password strength meter. fix auth bugs in first run.
2019-05-23 22:11:52 +01:00
Akinwale Ariwodola 97f1b530b2 additional rewards page changes and new verification flow (#542) 2019-05-15 11:00:15 +01:00
Akinwale Ariwodola f1393ae707 Merge branch 'master' of https://github.com/lbryio/lbry-android 2019-05-03 19:32:39 +01:00
Akinwale Ariwodola 0c274617cb fix settings page background 2019-05-03 19:31:13 +01:00
Akinwale Ariwodola f33a8c3829 Merge pull request #538 from lbryio/rewards-rework
optimise display of rewards verification requirements
2019-05-03 12:27:00 +01:00
Akinwale Ariwodola c243645124 optimise display of rewards verification requirements 2019-05-03 12:21:56 +01:00
Akinwale Ariwodola 4655678481 Merge branch 'master' of https://github.com/lbryio/lbry-android 2019-05-03 11:58:08 +01:00
Akinwale Ariwodola cec8ddeeee change launcher icon. remove unused images. 2019-05-03 11:57:21 +01:00
Akinwale Ariwodola 8d987a02aa Merge pull request #537 from lbryio/quickstart
add quick start build instructions
2019-05-02 23:46:00 +01:00
Akinwale Ariwodola a6d87d570f add quick start build instructions 2019-05-02 23:41:22 +01:00
Akinwale Ariwodola f3b07be01f bumpversion 0.6.2 --> 0.7.0 2019-05-02 07:10:23 +01:00
Akinwale Ariwodola 07f23ba927 Channel page redesign (#528)
* channel page redesign changes
* add constants. change publisher thumbnail resize mode.
2019-05-02 07:07:26 +01:00
Akinwale Ariwodola 7a7e96388b Replace Mixpanel with Firebase (Google) analytics (#535)
* replace mixpanel with firebase analytics
* add encrypted google-services.json file
2019-05-02 07:06:42 +01:00
Akinwale Ariwodola 73d91f7268 Merge pull request #536 from lbryio/player-fullscreen-overlay-fix
fix transparent player background covering touchable items
2019-05-01 16:36:58 +01:00
Akinwale Ariwodola 6371296b28 fix transparent player background covering touchable items 2019-05-01 12:45:04 +01:00
Akinwale Ariwodola cdeadf9d6d update .gitignore 2019-05-01 12:29:32 +01:00
Akinwale Ariwodola c332acb2c1 Merge pull request #529 from lbryio/media-player-update
update react native video version
2019-04-29 21:10:08 +01:00
Akinwale Ariwodola 0d68f1a24b update react native video version 2019-04-29 21:07:58 +01:00
Akinwale Ariwodola 1666ea88fc File view tags (#527)
* display claim tags below description
2019-04-29 11:26:30 +01:00
Akinwale Ariwodola ff163a31bf sdk 0.36 updates (#526)
* add requirements to support sdk 0.36
* updates for sdk 0.36
2019-04-29 10:38:17 +01:00
Akinwale Ariwodola 73d469dc8d Explore page redesign (#518) 2019-04-24 15:31:44 +01:00
Akinwale Ariwodola d0226ab4cc Cross-device sync implementation (#505)
* first run updates for sync
* finish sync implementation and fix build for openssl 1.1.1b required for sdk
* fix openssl recipe and tweak build
* fix NativeModules import on wallet page
* display total wallet balance. fix dispatch prop.
* add pipeline status to README.md
* remove unused build recipes
* hide 'No, thanks' button during email new request
* bumpversion 0.6.0 --> 0.6.1
* move unclaimed reward amount to the left of floating wallet balance
* Upgrade to React Native 0.59.3 (#513)
* upgrade to react native 0.59.3
* add FOREGROUND_SERVICE permission for Android 9 Pie (target sdk 28)
* put android.permission.FOREGROUND_SERVICE permission directly in AndroidManifest
* allow cleartext traffic
* minor copy changes
* enable secure password input and auto account_unlock on startup
2019-04-22 13:42:47 +01:00
Akinwale Ariwodola 3d1b07f11c Merge pull request #517 from lbryio/rewards-rework
streamline reward summary
2019-04-19 05:41:55 +01:00
Akinwale Ariwodola f98d7c26dc streamline reward summary 2019-04-17 16:37:55 +01:00
YULIUS KURNIAWAN KRISTIANTO c5fca74e39 change io to com (#504)
* Update README.md
* Update issue_template.md
2019-04-05 15:54:56 +01:00
Akinwale Ariwodola f79ad3dabc Upgrade to React Native 0.59.3 (#513)
* upgrade to react native 0.59.3
* add FOREGROUND_SERVICE permission for Android 9 Pie (target sdk 28)
* put android.permission.FOREGROUND_SERVICE permission directly in AndroidManifest
* allow cleartext traffic
2019-04-05 09:13:35 +01:00
Akinwale Ariwodola c5ebfa5021 fix navigate to main on splash page 2019-04-02 22:38:55 +01:00
Akinwale Ariwodola 534a966ee8 bumpversion 0.6.1 --> 0.6.2 2019-04-02 22:17:52 +01:00
Akinwale Ariwodola 7484596fb4 0.6.1 fixes (#512)
* fix issues with 0.6.1 release
2019-04-02 22:16:53 +01:00
Akinwale Ariwodola 1637752b02 Merge pull request #510 from lbryio/release-0.6.1 2019-04-02 14:51:57 +01:00
Akinwale Ariwodola 4ce424d4db move unclaimed reward amount to the left of floating wallet balance 2019-04-02 12:00:33 +01:00
Akinwale Ariwodola 916af88c53 bumpversion 0.6.0 --> 0.6.1 2019-04-02 11:40:58 +01:00
Akinwale Ariwodola b21776c517 Merge pull request #509 from lbryio/sdk-requirements-cleanup
clean up python sdk requirements
2019-03-31 06:51:37 +01:00
Akinwale Ariwodola 6bb128e38a clean up python sdk requirements 2019-03-30 23:51:38 +01:00
Akinwale Ariwodola 8b2694efb7 New build (#508)
* fix build for openssl 1.1.1b required for sdk
(cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977)

* use js code from master

* fix openssl recipe and tweak build
(cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e)

* remove unused build recipes
(cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
2019-03-30 21:58:45 +01:00
Akinwale Ariwodola f853132e9b use different gradle output (until sync build update) 2019-03-30 21:19:31 +01:00
Akinwale Ariwodola 39e8d5513a add modified mangled-glibc-syscalls.h for crystax build 2019-03-30 20:43:15 +01:00
Akinwale Ariwodola 6feadf73dd revert to default gradle apk output folder 2019-03-30 20:36:56 +01:00
Akinwale Ariwodola d683c48338 add pipeline status to README.md 2019-03-30 10:24:20 +01:00
Akinwale Ariwodola 4a684b0bec Merge pull request #502 from lbryio/search-fix
fix search and related content
2019-03-28 18:01:47 +01:00
Akinwale Ariwodola 6d7768e904 Merge pull request #503 from lbryio/file-page-tweaks
some pre-redesign tweaks to the file page
2019-03-27 10:17:16 +01:00
Akinwale Ariwodola a645c4530f some pre-redesign tweaks to the file page 2019-03-27 10:13:13 +01:00
Akinwale Ariwodola 4d61462290 fix search and related content 2019-03-27 08:13:09 +01:00
Akinwale Ariwodola 877ce8d008 fix imports on trending page 2019-03-26 16:21:38 +01:00
Akinwale Ariwodola fbff91774e use pipeline number as build number 2019-03-26 15:49:08 +01:00
Akinwale Ariwodola 53fb072373 Collapse description (#490)
* collapse file description by default and add display toggle
2019-03-26 15:10:07 +01:00
Akinwale Ariwodola f30f1f47d5 Gitlab CI (#498) 2019-03-26 15:08:50 +01:00
Akinwale Ariwodola d8b0e89c6c Build update (#495)
* package and build updates
* add sdk preview license to build
* use build tools 26.0.2
* use different libgmp mirror
2019-03-25 07:45:19 +01:00
Akinwale Ariwodola a353f13ebb Merge pull request #494 from lbryio/lbry-dependencies
update to use new imports from lbryinc and lbry-redux
2019-03-22 08:22:29 +01:00
Akinwale Ariwodola 0d3415441f update to use new imports from lbryinc and lbry-redux 2019-03-20 15:37:14 +01:00
Akinwale Ariwodola 860d509d0f Merge pull request #492 from lbryio/lbry.com
update lbry.io references to lbry.com
2019-03-20 15:02:20 +01:00
Akinwale Ariwodola c86fdec8e6 Save media position (#489) 2019-03-20 15:01:21 +01:00
Akinwale Ariwodola ca6fedd05c Merge pull request #488 from lbryio/search-hint
shorten search hint
2019-03-15 14:37:14 +01:00
Akinwale Ariwodola 07209a79de Merge pull request #487 from lbryio/channel-page-header
add channel name to channel page
2019-03-15 14:36:39 +01:00
Akinwale Ariwodola 4132416f0d shorten search hint 2019-03-15 13:18:45 +01:00
Akinwale Ariwodola e62d5741c2 add channel name to channel page 2019-03-15 12:50:58 +01:00
Akinwale Ariwodola 81dca20b17 Merge pull request #480 from lbryio/playable-content
fix Play icon being displayed for non-playable content
2019-03-15 11:58:28 +01:00
Akinwale Ariwodola f203f63c36 update lbry.io references to lbry.com 2019-03-11 18:16:17 +01:00
Akinwale Ariwodola 26cd218ec0 fix play icon being displayed for non-playable content 2019-03-11 12:11:42 +01:00
Akinwale Ariwodola e402a0376a implement direct search and show featured claim result (#468) 2019-03-11 12:09:08 +01:00
Akinwale Ariwodola bac202d4ec Pending Rewards (#467)
* show unclaimed rewards amount beside floating wallet balance
2019-03-11 09:47:14 +01:00
Akinwale Ariwodola bb8d856d17 Merge pull request #469 from lbryio/send-log-android6
fix send log error on devices running Android 6 and lower
2019-03-09 08:41:14 +01:00
Akinwale Ariwodola 42075291ce fix send log error on devices running Android 6 and lower 2019-03-08 17:23:09 +01:00
Akinwale Ariwodola 32b128fe40 upgrade to sdk 0.32.4 (#458)
* upgrade to sdk 0.32.4
* update aiohttp version
* fix top margin on explore page
2019-03-06 15:11:26 +01:00
Akinwale Ariwodola df63ab5f91 fix lodash vulnerability 2019-03-06 12:37:56 +01:00
Akinwale Ariwodola 88e3670493 fix merge module in package.json 2019-03-06 07:30:34 +01:00
Akinwale Ariwodola eceeed8290 bumpversion 0.5.0 --> 0.6.0 2019-03-05 14:46:59 +01:00
Akinwale Ariwodola caa9c80d44 Improved uri bar (#450)
* add descriptions to uri bar items
2019-03-05 10:17:50 +01:00
Akinwale Ariwodola 7e76e47d77 Merge pull request #449 from lbryio/improve-suggested-subs
add button to view subscriptions from the suggested subscriptions view
2019-03-05 10:17:22 +01:00
Akinwale Ariwodola ba76c9c17e fix missing import on transaction history page 2019-03-04 17:14:55 +01:00
Akinwale Ariwodola 9555c6fa76 add button to view subscriptions from the suggested subscriptions view 2019-03-04 16:06:51 +01:00
Akinwale Ariwodola c37a6f5c27 move uri omnibar to top (#444) 2019-03-01 19:25:16 +01:00
Akinwale Ariwodola b5af71d798 improved back navigation with file URIs and drawer menu items (#443) 2019-03-01 19:25:01 +01:00
Akinwale Ariwodola 8f609fa900 0.5.0 rc (#436)
* fixes for release
* fix subscriptions view. change Latest First to Latest Only.
* fix channel subscription uri
* fix subscription notifications
* some iconography and label changes
* change sdk log level for release builds
* sort all subscriptions by newest first
* fix crash with Picasso thumbnail fetch operation
* add check for null / undefined filenames after stopping download
* update sdk to 0.32.3. fix download notification.
2019-02-22 04:28:11 +01:00
Akinwale Ariwodola 5329154121 updates for lbry sdk 0.32.0 (#427) 2019-02-18 20:43:14 +01:00
Akinwale Ariwodola 3a9187d795 App rating reminder (#428)
* updates for lbry sdk 0.32.0
* update package.json
* update interval to 7 days
2019-02-18 19:19:18 +01:00
Akinwale Ariwodola e4e23e8017 added subscription view options - all and latest first (#425)
* added subscription view options - all and latest first
* persist subscriptions view mode
2019-02-18 09:30:06 +01:00
Akinwale Ariwodola 9638ad4f06 handle new email verification links (#426)
* handle new email verification links
* some updates to work with new auth flow
2019-02-18 07:50:32 +01:00
Akinwale Ariwodola c8de700460 bumpversion 0.4.0 --> 0.5.0 2019-02-16 06:07:11 +01:00
Akinwale Ariwodola e0f746b5ae Rename 'My LBRY' to Downloads 2019-02-11 17:40:24 +01:00
Akinwale Ariwodola 9efcc36e15 Merge pull request #424 from lbryio/channel-page-tweaks
* optimise space usage by the page navigation buttons on the channel page
* use full URIs for channel name links
2019-02-11 17:32:19 +01:00
Akinwale Ariwodola 918a7e64bd use full URIs for channelname links 2019-02-11 11:56:14 +01:00
Akinwale Ariwodola 7f6874b791 Suggested subscriptions (#423)
* suggested subscriptions implementation
* some style and loading tweaks
* add subscribe buttons and style tweaks
2019-02-08 16:48:35 +01:00
Akinwale Ariwodola 1731462b41 optimise space usage by the page navigation buttons on the channel page 2019-02-08 14:01:22 +01:00
Akinwale Ariwodola 654d50cd1b change app title to LBRY 2019-02-06 12:22:58 +01:00
Akinwale Ariwodola f631dd5c7b bumpversion 0.3.1 --> 0.4.0 2019-01-31 15:58:33 +01:00
Akinwale Ariwodola 4c5558fa29 Merge pull request #420 from lbryio/pre-release-fixes
some tweaks before release
2019-01-31 15:57:02 +01:00
Akinwale Ariwodola 2892abc7a8 log final settings 2019-01-31 00:55:37 +01:00
Akinwale Ariwodola 529385bc5b display publish date on file page 2019-01-30 20:31:22 +01:00
Akinwale Ariwodola e3bb5d0fb5 truncate long channel names on file page 2019-01-30 19:39:23 +01:00
Akinwale Ariwodola 2da930cd41 fix: claim content download path 2019-01-30 19:27:29 +01:00
Jack Robison f41983a7b6 update and clean up lbrynetservice.py (#367) 2019-01-30 00:59:07 +01:00
Akinwale Ariwodola 198791ca27 display a thumbnail while the media player is loading (#413)
* show an overlay with the video thumbnail in the media player
2019-01-28 14:55:25 +01:00
Akinwale Ariwodola 5b02ed9b0b Merge pull request #415 from lbryio/relative-publish-time
display relative published time for claims
2019-01-25 18:35:48 +01:00
Akinwale Ariwodola 760bad821b View images or text claims immediately after downloading (#414)
* enable the download button to open images and text file types immediately after download
* change display text to View for downloaded image or text file claims
2019-01-24 23:01:19 +01:00
Akinwale Ariwodola b8b2aab9bb display relative published time for claims 2019-01-24 21:22:12 +01:00
Akinwale Ariwodola a2b08606f1 Merge pull request #412 from lbryio/recommendations-after-video-playback
automatically scroll to related content when a media file finishes playing
2019-01-23 23:02:15 +01:00
Akinwale Ariwodola 5d40bd6f8e fix: navigateBack missing variable on about page 2019-01-23 06:15:17 +01:00
Akinwale Ariwodola 91639d887f automatically scroll to related content when a media file finishes playing 2019-01-23 05:02:43 +01:00
Akinwale Ariwodola 6d234672b8 reorder items in drawer menu to match the desktop app menu (#410)
* reorder items in drawer menu to match the desktop app menu
* change icon for Explore
2019-01-22 21:17:21 +01:00
Akinwale Ariwodola 4e22b53907 Merge pull request #411 from lbryio/show-custom-reward-always
Always show the custom reward card
2019-01-22 20:23:34 +01:00
Akinwale Ariwodola f389e315a6 dismiss soft keyboard upon claim button press 2019-01-22 14:33:30 +01:00
Akinwale Ariwodola 7f54c02a1c make the claim custom reward card always visible 2019-01-22 14:29:59 +01:00
Akinwale Ariwodola eaaa2b97b4 Merge pull request #409 from lbryio/phone-verification-fail
show message for manual verification when phone verification fails
2019-01-21 20:26:37 +01:00
Akinwale Ariwodola d1362f2ea3 show message for manual verification when phone verification fails 2019-01-21 18:53:01 +01:00
Akinwale Ariwodola 2c56c78467 Subscription notifications implementation (#407)
* add notifications for unread subscriptions
2019-01-21 17:11:31 +01:00
Akinwale Ariwodola ec928c943d better back button navigation handling (#408)
* better back button navigation handling
* add console=plain option to gradlew
2019-01-21 14:35:11 +01:00
Akinwale Ariwodola 53bfba0320 bumpversion 0.3.0 --> 0.3.1 2019-01-08 19:14:38 +01:00
Akinwale Ariwodola 847c3e85fa Add backup warning to wallet page. Sort subscriptions. 2019-01-08 18:39:10 +01:00
Akinwale Ariwodola c96b4afcc7 Merge pull request #387 from lbryio/channel-page-pagination
add previous and next buttons to navigate channel pages
2019-01-08 03:03:09 +01:00
Akinwale Ariwodola 4c741b9ac9 remove the RECEIVE_SMS permission (#386) 2019-01-07 11:28:19 +01:00
Akinwale Ariwodola 6b184c49ad add previous and next buttons to navigate channel pages 2019-01-07 11:00:30 +01:00
Akinwale Ariwodola 6991b99ea9 Mobile subscriptions (#382)
* add subscribe button to file page
* add My Subscriptions page
* get module resolve babel plugin working to eliminate ugly imports
2019-01-07 08:26:47 +01:00
Akinwale Ariwodola 0cc2b4e368 fix for duplicates appearing on My LBRY page 2018-12-27 12:25:44 +01:00
Akinwale Ariwodola c51f834636 update seeker circle colour 2018-12-27 09:08:34 +01:00
Akinwale Ariwodola 9a567ff5d0 Python 3.7 build (#381)
* Updated for Python 3.7.1
2018-12-27 09:04:21 +01:00
Akinwale Ariwodola bb420542ef bumpversion 0.2.3 --> 0.3.0 2018-12-13 00:15:29 +01:00
Akinwale Ariwodola 14ec13a2e6 use transaction_id as the key for the list of claimed rewards 2018-12-13 00:15:29 +01:00
Akinwale Ariwodola bf2b038632 reverse order of claimed rewards 2018-12-13 00:15:29 +01:00
Akinwale Ariwodola b2fa6bb3a9 change font to Inter-UI. change LBRY green colour. 2018-12-13 00:15:29 +01:00
Akinwale Ariwodola 53166d9bba pin lbrynet to v0.30.1. set build_type to dev or release based on build config. 2018-12-13 00:15:29 +01:00
Akinwale Ariwodola 1560e44d36 Merge pull request #374 from lbryio/custom-reward-codes
Custom reward codes
2018-12-12 19:45:44 +01:00
Akinwale Ariwodola 1dbc8847b1 pin torba branch with fix for current_task 2018-12-11 20:14:31 +01:00
Akinwale Ariwodola 8bbfd1007d add support for custom reward codes 2018-12-11 19:37:48 +01:00
Akinwale Ariwodola 851e117381 Merge pull request #371 from lbryio/share-log-file
enable easy sharing of lbrynet log file
2018-12-03 12:35:55 +01:00
Akinwale Ariwodola 2e31a7fbdb enable easy sharing of lbrynet log file 2018-12-02 00:34:57 +01:00
Akinwale Ariwodola f3316160fb add support for special links (#369) 2018-12-01 23:56:33 +01:00
Akinwale Ariwodola 48b92ed2a6 fix for drawer menu and title text on OnePlus devices (#370)
* use Metropolis font for drawer menu items
* change title font to Metropolis
2018-12-01 23:07:21 +01:00
Akinwale Ariwodola 4d075095ad implement send tip functionality (#366) 2018-11-28 15:44:08 +01:00
Akinwale Ariwodola 9c1985bab3 remove unused package-lock.json 2018-11-24 14:47:17 +01:00
Akinwale Ariwodola e11e1a0d5b Merge pull request #363 from lbryio/new-notifications
* move to new notification logic
* updates to handle the updated notification implementation in lbry-redux
2018-11-24 14:45:58 +01:00
Akinwale Ariwodola f202797954 merge with master to fix package-lock.json conflict 2018-11-24 14:22:56 +01:00
Akinwale Ariwodola f1ee7586f9 updates to handle the updated notification implementation in lbry-redux 2018-11-24 14:19:44 +01:00
Akinwale Ariwodola 6cc74488a3 Merge pull request #365 from lbryio/confirm-send-lbc
add confirmation dialog for sending LBC
2018-11-22 15:39:17 +01:00
Akinwale Ariwodola dbf9760780 add confirmation dialog for sending LBC 2018-11-21 11:23:38 +01:00
Akinwale Ariwodola 6de1e41628 some updates to work with the latest lbrynet master (#364)
* build with lbrynet v0.30.1
* updates to use latest lbrynet master
* Disable DHT and hash announcer components.
* fix playback bug after download has started
2018-11-21 11:13:19 +01:00
Akinwale Ariwodola 9977aac9f6 make reward icon red 2018-11-21 11:09:54 +01:00
Sean Yesmunt eb4995da86 move to new notificaion logic - UNTESTED 2018-11-20 12:07:12 -05:00
Alyssa Callahan dffff47a9f added dod 2018-11-12 14:48:16 -05:00
Thomas Zarebczan 96cc982e01 remove ? 2018-11-06 15:55:15 -05:00
Akinwale Ariwodola 116ab4fcfb Merge pull request #355 from preserveddarnell/newcopyedits
Update typos & minor edits.
2018-11-01 05:33:22 +01:00
Akinwale Ariwodola c9c0249d4f React native error handling (#350)
* added react native error handler package
* implement Mixpanel error tracking
2018-11-01 05:31:38 +01:00
preserveddarnell 85833f91e3 Update typos & minor edits. 2018-10-29 15:56:35 -04:00
Akinwale Ariwodola b76498852e daemon 0.30 changes (#346) 2018-10-28 22:44:52 +01:00
Akinwale Ariwodola e75b0e51d9 show Continue if an email is already set upon return (#347) 2018-10-28 22:43:48 +01:00
Akinwale Ariwodola 6b746bc0b3 Merge pull request #349 from lbryio/gradle-travis-fix
try setting JAVA_HOME
2018-10-28 20:06:15 +01:00
Akinwale Ariwodola dd31a59524 try setting JAVA_HOME 2018-10-28 19:39:40 +01:00
Akinwale Ariwodola ca75b44d3b Merge pull request #348 from lbryio/pyjnius-recipe
update PyJNIus recipe
2018-10-28 19:21:31 +01:00
Akinwale Ariwodola d9a9a310a8 update PyJNIus recipe 2018-10-28 19:20:40 +01:00
Akinwale Ariwodola 8ece8cc14d Python 3 asyncio selectors fix (#344) 2018-10-28 19:12:40 +01:00
Akinwale Ariwodola 425a83faec Improved stop download handling (#342) 2018-10-23 15:53:08 +01:00
Akinwale Ariwodola f034b313b3 increased button touch areas and improved soft keyboard touch handling (#335) 2018-10-23 15:52:44 +01:00
Akinwale Ariwodola b600cbdc34 update gradle compileJava configuration 2018-10-22 10:38:53 +01:00
Akinwale Ariwodola ad3fce5b17 Merge pull request #337 from lbryio/faq
add android basics FAQ
2018-10-19 13:25:58 +01:00
Akinwale Ariwodola 25604657b6 Merge pull request #339 from lbryio/build-doc-updates
updated build instructions
2018-10-15 04:46:29 +01:00
Akinwale Ariwodola 996ff027e5 updated build instructions 2018-10-15 04:44:58 +01:00
Akinwale Ariwodola 71c595df15 Merge pull request #338 from lbryio/build-doc-updates
build documentation updates
2018-10-14 15:38:10 +01:00
Akinwale Ariwodola 70d00b7d62 build documentation updates 2018-10-14 11:23:04 +01:00
Thomas Zarebczan e8828d8658 add android basics FAQ 2018-10-10 13:53:43 -04:00
Akinwale Ariwodola e08f6ee73c add / update recipes and build changes for Python 3.6.6 compatibility (#315)
* add / update recipes and build changes for Python 3.6.6 compatibility
* include Python 3 apt packages in travis build script
* use Python 3.6 in Travis
* Enable _blake2 and _sha3 in Python 3. Remove unnecessary files.
* change zope.interface version
* update cffi version
2018-10-07 15:59:03 +01:00
Akinwale Ariwodola f12460e83a display connected email on About page (#327)
* display connected email on About page
* add mailing preferences link
2018-10-07 15:55:01 +01:00
Akinwale Ariwodola baef12a26d refresh the reward list upon a successful reward claim (#329) 2018-10-07 14:23:45 +01:00
Akinwale Ariwodola 79400dd2b1 Merge pull request #328 from lbryio/reward-card-touch-area
make the entire reward card area respond to touch
2018-10-05 15:55:40 +01:00
Akinwale Ariwodola 4409849143 make the entire reward card area respond to touch 2018-10-04 13:57:15 +01:00
Akinwale Ariwodola 3d77756da0 bumpversion 0.2.2 --> 0.2.3 2018-10-03 07:16:02 +01:00
Akinwale Ariwodola d45dac4587 bumpversion 0.2.1 --> 0.2.2 2018-09-30 17:00:39 +01:00
Akinwale Ariwodola 38292bcbcc Merge pull request #316 from lbryio/stop-download-tweaks
improve stop download experience
2018-09-28 20:58:22 +01:00
Akinwale Ariwodola 8b8cf9cd7a improve stop download experience 2018-09-26 21:11:55 +01:00
Akinwale Ariwodola 7c969cbe93 fix for red screen during phone number verification 2018-09-26 17:55:03 +01:00
Akinwale Ariwodola 3283cc447e Merge pull request #303 from ykris45/patch-1
add telegram link
2018-09-25 15:00:58 +01:00
Akinwale Ariwodola 810ba74e75 Merge pull request #313 from lbryio/blacklist
show blocked message for blacklisted content
2018-09-25 14:47:17 +01:00
Akinwale Ariwodola 5e1a20c5de Merge pull request #314 from lbryio/dismiss-reward-summary
dismiss button added to reward summary, and some style tweaks.
2018-09-25 14:46:33 +01:00
Akinwale Ariwodola 975c59a114 dismiss button added to reward summary, and some style tweaks. 2018-09-24 14:59:00 +01:00
Akinwale Ariwodola 51fcf04b0b show blocked message for blacklisted content 2018-09-24 14:19:34 +01:00
Akinwale Ariwodola d921347d73 updated readme for beta 2018-09-24 13:30:06 +01:00
YULIUS KURNIAWAN KRISTIANTO 5e25b542fb add telegram link 2018-09-18 00:48:44 +07:00
Akinwale Ariwodola 9b4ef98a3d bumpversion 0.2.0 --> 0.2.1 2018-09-14 14:10:30 -04:00
Akinwale Ariwodola 8a862439cc do not display reward summary if the user is approved for rewards 2018-09-14 13:39:18 -04:00
Akinwale Ariwodola 6719953cf1 fix React Native bundle 2018-09-14 11:52:56 -04:00
Akinwale Ariwodola 2bf73eb961 update state if user data changed 2018-09-14 11:28:34 -04:00
Akinwale Ariwodola fe5d711fea Merge pull request #293 from lbryio/rewards-eligible-check
do not display phone verification action for users who are already reward approved
2018-09-14 08:58:07 -04:00
Akinwale Ariwodola 33c8aaf36f do not display phone verification action for users who are already reward approved 2018-09-14 04:06:23 -04:00
Akinwale Ariwodola d5366b10fa Merge pull request #292 from lbryio/build-doc-fix
update build instructions with missing packages
2018-09-14 03:56:56 -04:00
Akinwale Ariwodola 50d07fd31f update build instructions with missing packages 2018-09-10 15:43:27 -04:00
Akinwale Ariwodola 792d64a33a Merge pull request #285 from lbryio/download-failed-callback
display the play / download button again upon a failure condition
2018-09-08 10:40:54 +01:00
Akinwale Ariwodola adc9550e58 display the play / download button again upon a failure condition 2018-09-08 10:11:52 +01:00
Akinwale Ariwodola 0638b9f133 ongoing pre-beta tasks (#284)
* tapping on the player controls container while it is visible should hide the container
* change 'click' to 'tap'
* add related content component
* file list item resolving display tweaks
* increase number of search results to 25
* fix name display for identity claims in search results
2018-09-05 14:43:39 +01:00
Akinwale Ariwodola 05531e0bc5 change 'alpha' to 'beta' in wallet warning 2018-09-03 20:53:09 +01:00
Akinwale Ariwodola 44ec2270f2 update lbryinc in package.json 2018-09-03 20:47:01 +01:00
Akinwale Ariwodola ffd4f474ed bumpversion 0.1.10 --> 0.2.0 2018-09-03 20:44:12 +01:00
Akinwale Ariwodola 2c22780c91 Merge pull request #281 from lbryio/mobile-platform
send Platform.OS as operating system value for the install/new request
2018-09-03 20:35:32 +01:00
Akinwale Ariwodola 1d03d09119 send Platform.OS as operating system value for the install/new request 2018-09-03 20:19:12 +01:00
Akinwale Ariwodola 404647c4cb add storage stats card to My LBRY downloads page (#278)
* add storage stats card to My LBRY downloads page
* add decimalPoints parameter to formatBytes method
* some more tweaks to notifications and startup
* cancel all notifications if the service is not running when the activity is destroyed
2018-09-03 03:00:54 +01:00
Akinwale Ariwodola c0b464ae36 implement phone verification (#274)
* implement phone verification
* update permissions in buildozer.spec
2018-09-03 02:57:54 +01:00
Akinwale Ariwodola e8185e0f9c cancel specific notifications instead of using cancelAll 2018-09-02 17:54:37 +01:00
Akinwale Ariwodola 0592c42df0 Unify notification channels for background service and background media player 2018-09-02 11:38:15 +01:00
Akinwale Ariwodola 87a50c494f use openDrawer in react-navigation v2. Tweak hardware back button behaviour. 2018-09-02 08:32:09 +01:00
Akinwale Ariwodola 8257d7b41d more navigation tweaks (#277)
* upgrade react-navigation module, implement associated code updates
* call resolveUri for a file list item if the claim is not yet resolved
2018-09-02 08:12:21 +01:00
Akinwale Ariwodola 77e471d671 Merge pull request #276 from lbryio/bg-media-notification-intent
group the background service and background media player notifications
2018-09-02 03:05:11 +01:00
Akinwale Ariwodola 92f5e6e77c group the background service and background media player notifications 2018-09-01 22:45:20 +01:00
Akinwale Ariwodola 4b7be60c27 better performance on lower end devices with react-native-fast-image (#275)
* thumbnail aspect ratio sizing tweaks
* show approximate values for formatted bytes
* truncate titles over 80 characters in the file item list component
2018-09-01 22:04:50 +01:00
Akinwale Ariwodola e9abbf256e implement my LBRY downloads page (#273) 2018-08-31 08:56:41 +01:00
Akinwale Ariwodola 002d8c7430 Merge pull request #272 from lbryio/search-results-tweaks
update thumbnail display in search results and add channel links
2018-08-31 00:51:00 +01:00
Akinwale Ariwodola 346c7a027d update thumbnail display in search results and add channel links 2018-08-31 00:39:25 +01:00
Akinwale Ariwodola 7313e2d1c4 implement touch to seek for media playback using the seek bar (#271) 2018-08-31 00:15:13 +01:00
Akinwale Ariwodola a34a8136c2 add time to start (in seconds) to Play track event for new downloads (#269)
* add time to start (in seconds) to Play track event for new downloads
* send time_to_start parameter with file/view call
2018-08-30 18:11:03 +01:00
Akinwale Ariwodola 3b76dca8f1 Merge pull request #270 from lbryio/ux-tweaks
some file page UX tweaks
2018-08-30 14:39:41 +01:00
Akinwale Ariwodola 30682bf8f5 Merge pull request #267 from lbryio/back-navigation-part-deux
create navigation button component and handle onPress events properly
2018-08-30 14:38:46 +01:00
Akinwale Ariwodola e7b83326d0 some file page UX tweaks 2018-08-30 13:48:29 +01:00
Akinwale Ariwodola ef55bd2719 create navigation button component and handle onPress events properly 2018-08-29 21:19:49 +01:00
Akinwale Ariwodola 0c29785a7e Merge pull request #265 from lbryio/thumbnails
tweak thumbnail aspect ratio and sizing on discover and search pages
2018-08-29 06:19:46 +01:00
Akinwale Ariwodola a5b67d4923 Merge pull request #266 from lbryio/blob-delete-revisited
do not delete the sd hash blob when deleting file blobs
2018-08-29 01:01:00 +01:00
Akinwale Ariwodola 34a4df96fc do not delete the sd hash blob when deleting file blobs 2018-08-28 21:10:11 +01:00
Akinwale Ariwodola eeacbbb979 tweak thumbnail aspect ratio and sizing on discover and search pages 2018-08-28 20:23:48 +01:00
Akinwale Ariwodola 2a010e2643 update package.json 2018-08-28 19:25:18 +01:00
Akinwale Ariwodola c25785ccf4 Mobile rewards (#251) 2018-08-28 11:59:14 +01:00
Akinwale Ariwodola 050fc2b29e tweaks to the download notifications (#260) 2018-08-28 07:29:12 +01:00
Akinwale Ariwodola e1e8fa410a escape special characters for the encoded path (#262) 2018-08-27 18:14:29 +01:00
Akinwale Ariwodola becf21b7ea Merge pull request #263 from lbryio/fix-search
submit search queries from the omnibar on the search page
2018-08-27 16:53:36 +01:00
Akinwale Ariwodola 9c3f2f44da show animated activity indicator after the user presses the Play button (#261) 2018-08-27 16:53:03 +01:00
Akinwale Ariwodola 793541474a submit search queries from the omnibar on the search page 2018-08-27 09:01:05 +01:00
Akinwale Ariwodola 94f9ad6cc4 display floating wallet balance (#252)
* display floating wallet balance
2018-08-24 11:10:30 +01:00
Sean Yesmunt 9a89d4c44c Merge pull request #250 from lbryio/search-selector
use new search suggestion selector
2018-08-22 11:13:41 -04:00
Akinwale Ariwodola b99ffa0395 add stop action button to LBRY service notification (#248) 2018-08-22 13:50:59 +01:00
Akinwale Ariwodola f926dc28be Merge pull request #249 from lbryio/omnibar-text-alignment
URI bar text visible from the left when it's not focused
2018-08-21 06:10:10 +01:00
Sean Yesmunt 5b92d477e2 use new search suggestion selector 2018-08-21 00:30:36 -04:00
Akinwale Ariwodola df561cc582 Background media controls (#242)
* create background control notification when background play is enabled
2018-08-20 16:00:16 +01:00
Akinwale Ariwodola da60aeb71b delete individual blob files for completed file downloads to save space (#234) 2018-08-17 19:11:15 +01:00
Akinwale Ariwodola 684f4867c3 URI bar text visible from the left when it's not focused 2018-08-17 15:08:19 +01:00
Akinwale Ariwodola 82a7846e6d Merge pull request #238 from lbryio/hide-navigation-bar-fix
obtain the proper activity reference in the utility module
2018-08-16 19:27:54 +01:00
Akinwale Ariwodola a9199661a4 obtain the proper activity reference in the utility module 2018-08-16 18:42:07 +01:00
Akinwale Ariwodola d07fc29a96 Merge pull request #237 from lbryio/video-aspect-ratio-tweak
better media aspect ratio handling
2018-08-16 18:04:46 +01:00
Akinwale Ariwodola 066919259c better media aspect ratio handling 2018-08-16 17:50:59 +01:00
Akinwale Ariwodola a094ba7d5c Merge pull request #236 from lbryio/email-verify-tweak
tweaks to the user email verification process
2018-08-16 13:43:02 +01:00
Akinwale Ariwodola 76a9485f0b tweaks to the user email verification process 2018-08-16 13:21:28 +01:00
Akinwale Ariwodola 413ef66701 complete authentication flow and email verification link implementation (#232)
* complete authentication flow and email verification link implementation
* send appVersion and deviceId with authentication request
2018-08-16 10:48:34 +01:00
Akinwale Ariwodola 1e91a53a8a Merge pull request #233 from lbryio/python-requirements-tweak
Update Twisted version. Remove pycrypto recipe.
2018-08-15 17:02:21 +01:00
Akinwale Ariwodola 0db7e51d69 bumpversion 0.1.9 --> 0.1.10 2018-08-14 18:23:59 +01:00
Akinwale Ariwodola cdf7f75058 Merge pull request #231 from lbryio/notification-channel-hotfix
Fix service notification channel for older Android versions (prior to Oreo)
2018-08-14 18:19:32 +01:00
Akinwale Ariwodola 84e4151f42 use new libgmp mirror for builds 2018-08-14 17:45:54 +01:00
Akinwale Ariwodola 3a9729de06 Fix service notification channel for older Android versions (prior to Oreo) 2018-08-14 16:15:04 +01:00
Akinwale Ariwodola 93e8882433 bumpversion 0.1.8 --> 0.1.9 2018-08-14 08:13:38 +01:00
Akinwale Ariwodola 56a49e323a Merge pull request #229 from lbryio/uri-encode-paths
Uri encode filenames with spaces for the media player
2018-08-14 07:51:05 +01:00
Akinwale Ariwodola de97703128 Merge pull request #230 from lbryio/daemon-status-tweaks
update status call on About page and some style tweaks
2018-08-13 22:04:37 +01:00
Akinwale Ariwodola f820d19f55 search results style tweak 2018-08-13 21:51:17 +01:00
Akinwale Ariwodola a2094e9953 update status call on About page and some style tweaks 2018-08-13 21:40:46 +01:00
Akinwale Ariwodola e5000f6502 splash screen downloading_headers flag tweak 2018-08-13 15:49:12 +01:00
Akinwale Ariwodola 9d63c50a2d Uri encode filenames with spaces for the media player 2018-08-13 10:04:02 +01:00
Akinwale Ariwodola ee90951945 Use redux-persist-filesystem-storage engine due to AsyncStorage size limitation on Android (#227) 2018-08-13 10:00:02 +01:00
Akinwale Ariwodola 8ed87d0739 Merge pull request #228 from lbryio/media-aspect-ratio
improved aspect ratio for videos on the file page
2018-08-13 09:59:32 +01:00
Akinwale Ariwodola 1ebac0df21 improved aspect ratio for videos on the file page 2018-08-13 08:48:06 +01:00
Akinwale Ariwodola a4e6025607 Daemon 0.21 updates (#223) 2018-08-13 07:12:13 +01:00
Akinwale Ariwodola 6ef03b8921 Merge pull request #226 from lbryio/animated-gifs
ImageView animated gif support
2018-08-12 23:33:06 +01:00
Akinwale Ariwodola fdd6c87a31 ImageView animated gif support 2018-08-12 14:45:38 +01:00
Akinwale Ariwodola 89bfc845f6 Build and package modifications for react-native-video module updates (#225)
* Build and package modifications for react-native-video module updates
* change Android appcompat v7 lib version to 27.1.1
2018-08-11 20:48:54 +01:00
Akinwale Ariwodola 9af5c0e0f4 Merge pull request #224 from lbryio/download-notification-icon
change download notification icon
2018-08-09 22:44:58 +01:00
Akinwale Ariwodola 8e92b21d60 change download notification icon 2018-08-09 21:42:17 +01:00
Akinwale Ariwodola 9882d9d1c9 FontAwesome 5 everywhere 2018-08-08 18:11:25 +01:00
Akinwale Ariwodola 55275e48de Update react-native-vector-icons package to 5.0.0 for FontAwesome 5 (#222) 2018-08-08 17:52:26 +01:00
Akinwale Ariwodola 3da896d369 Merge pull request #221 from lbryio/delete-button
Delete and Stop download button tweaks
2018-08-08 17:27:07 +01:00
Akinwale Ariwodola 745aa61466 Delete and Stop download button tweaks 2018-08-08 16:22:56 +01:00
Akinwale Ariwodola 2672144dbe Merge pull request #220 from lbryio/play-icon
Add play icon to the Play button for media
2018-08-08 15:53:09 +01:00
Akinwale Ariwodola ccbad4be1b Merge pull request #219 from lbryio/desc-divider
add visual break before file description (if present)
2018-08-08 15:39:43 +01:00
Akinwale Ariwodola dad3b86ba7 Add play icon to the Play button for media 2018-08-08 15:29:01 +01:00
Akinwale Ariwodola cfb81fc530 add visual break before file description (if present) 2018-08-08 15:12:33 +01:00
Akinwale Ariwodola 56afde24db update service description 2018-08-06 18:16:50 +01:00
Akinwale Ariwodola 88fdc1b503 Android Oreo tweaks (#217)
* display notifications on Android 8.0 Oreo and higher using required notification channels
* fix daemon background service implementation for Android Oreo
2018-08-06 11:51:55 +01:00
Akinwale Ariwodola 338cd20132 Merge pull request #215 from lbryio/social-drivers
added Discord and social media links to the About page
2018-07-31 19:10:04 +01:00
Akinwale Ariwodola ad38a09052 added Discord and social media links to the About page 2018-07-31 15:45:33 +01:00
Akinwale Ariwodola 078e010c54 Merge pull request #212 from lbryio/splash-screen-back
prevent an error upon pressing the back button on the splash screen
2018-07-31 15:39:30 +01:00
Akinwale Ariwodola 4ae4a7366a Merge pull request #214 from lbryio/fullscreen-navigation-bar
hide navigation bar in fullscreen playback mode
2018-07-31 15:27:11 +01:00
Akinwale Ariwodola bfefc53040 hide navigation bar in fullscreen playback mode 2018-07-29 09:12:45 +01:00
Akinwale Ariwodola f8af04ba4b prevent an error upon pressing the back button on the splash screen 2018-07-24 14:37:31 +01:00
Akinwale Ariwodola e8a572032a Fullscreen scrubber (#205)
* fix problems with fullscreen scrubber adjustments
2018-07-24 14:28:45 +01:00
Shawn Khameneh 5ef300b4a4 Add Vagrantfile for easier development environments (#138)
* Add Vagrantfile for easier development envrionments
* Adjust Vagrantfile and create buildozer.spec.vagrant, sucessful builds
* Fix permissions
2018-07-23 15:16:55 +01:00
Akinwale Ariwodola 5e3275e547 Merge pull request #204 from lbryio/keep-awake 2018-07-18 13:23:16 +01:00
Akinwale Ariwodola 5a55beee7b Merge remote-tracking branch 'origin/master' into keep-awake 2018-07-18 13:00:08 +01:00
Akinwale Ariwodola b8e52e2117 tweaks to media display in landscape mode (#197)
* tweaks to media display in landscape mode
2018-07-17 17:59:58 +01:00
Akinwale Ariwodola 541f824909 Merge pull request #198 from lbryio/media-player-scrubber
added a delay to seeking state reset
2018-07-17 17:18:10 +01:00
Daniel Dominguez 4e763be6ec Add Java module to keep the screen awake when needed. 2018-07-11 23:15:40 -03:00
Akinwale Ariwodola afaa00d635 Link effect (#199)
* Add style to link on video file on tap. Adds a timeout to set it to false as Linking has a weird behavior when chrome vs youtube page is open.
* Add link to be semi-transparent onPress instead of green background.
2018-07-06 02:00:24 +01:00
Akinwale Ariwodola 1aa03edf6e added a delay to seeking state reset 2018-07-05 17:45:55 +01:00
Akinwale Ariwodola cafada6ede Use HTML for screenshot in README 2018-06-30 12:30:48 +01:00
Akinwale Ariwodola 36e0127e2b changed image width 2018-06-30 12:28:49 +01:00
Akinwale Ariwodola 0af369bf23 added screenshot to README 2018-06-30 12:25:57 +01:00
Akinwale Ariwodola a133f7d82d Merge pull request #190 from lbryio/media-play-button
Use Play as button text on the file page for audio/video
2018-06-28 09:15:55 +01:00
Akinwale Ariwodola f66b8affb1 Use Play as button text on the file page for audio/video 2018-06-24 09:33:02 +01:00
Akinwale Ariwodola 45ab233d01 Merge pull request #188 from lbryio/headers-download-progress
add blockchain_headers download progress bar to splash screen
2018-06-22 18:54:37 +01:00
Akinwale Ariwodola 676617ef19 Merge pull request #186 from lbryio/discover-resolve
display activity indicator for discover and trending items while resolving
2018-06-22 18:43:34 +01:00
Akinwale Ariwodola af3baa99b8 Merge pull request #189 from lbryio/phone-state-permission-fix
request for READ_PHONE_STATE permission after storage permission is granted
2018-06-22 02:27:34 +01:00
Akinwale Ariwodola 33abefdd14 request for READ_PHONE_STATE permission after storage permission is granted 2018-06-22 02:18:38 +01:00
Akinwale Ariwodola 1cbebd0c9e add blockchain_headers download progress bar to splash screen 2018-06-22 02:06:21 +01:00
Akinwale Ariwodola 245942ff14 added method to MainActivity to obtain a device ID (#182) 2018-06-20 19:07:20 +01:00
Akinwale Ariwodola 608a08d2e8 display activity indicator for discover and trending items while resolving 2018-06-20 05:52:04 +01:00
Akinwale Ariwodola fbb0d7090b Merge pull request #185 from lbryio/link-styling
make all links green
2018-06-19 22:46:34 +01:00
Akinwale Ariwodola 40c890e644 make all links green 2018-06-19 21:58:26 +01:00
Akinwale Ariwodola 35cf4255a6 Merge pull request #183 from lbryio/start-blockchain-dl
Start daemon service immediately app starts (even for first run)
2018-06-18 15:01:09 +01:00
Akinwale Ariwodola 0da47c409f Start daemon service immediately app starts (even for first run) 2018-06-18 14:20:37 +01:00
Akinwale Ariwodola 541f582ac1 Build on commit (#181)
* Build release APK on every commit
2018-06-14 21:12:44 +01:00
Akinwale Ariwodola 191bc33fa3 bumpversion 0.1.7 --> 0.1.8 2018-06-11 19:24:26 +01:00
Akinwale Ariwodola 31168d9ed8 Merge pull request #166 from lbryio/first-run-improvements
implement extendable first run experience starting with welcome page
2018-06-11 04:41:55 +01:00
Akinwale Ariwodola 468c41c526 implement extendable first run experience starting with welcome page 2018-06-08 09:13:45 +01:00
Akinwale Ariwodola bc684b6ae3 Merge pull request #158 from lbryio/about-page-text
add a paragraph and links to the About page
2018-06-08 06:30:10 +01:00
Akinwale Ariwodola 399ec8d108 Make channel names displayed on file items and the file page touchable (#165) 2018-06-07 06:57:41 +01:00
Akinwale Ariwodola 1820710f06 Merge pull request #160 from lbryio/linkify-description
make links in file descriptions clickable
2018-06-07 05:00:33 +01:00
Akinwale Ariwodola 51d86148e8 Merge pull request #164 from lbryio/navigation-tweaks
set the unique navigation keys for the file pages to the URIs.
2018-06-06 09:29:24 +01:00
Akinwale Ariwodola e8f973531b set the unique navigation keys for the file pages to the URIs. 2018-06-06 09:25:51 +01:00
Akinwale Ariwodola 4a01cf0608 Merge pull request #162 from lbryio/trending-page
add trending page
2018-06-06 01:25:16 +01:00
Akinwale Ariwodola 929a057e1e add trending page 2018-06-05 19:52:10 +01:00
Akinwale Ariwodola d24a18023d make links in file descriptions clickable 2018-06-05 19:03:40 +01:00
Akinwale Ariwodola 4d8085a0db add a paragraph and links to the About page 2018-06-05 15:53:10 +01:00
Akinwale Ariwodola 8c3ca2161d Merge pull request #156 from lbryio/search-result-urls
Add URI to search result items. Update omnibar URI suggestions display.
2018-06-04 17:34:38 +01:00
Akinwale Ariwodola 26720dead0 Wallet page improvements (#155)
* wallet page send form improvements
* style tweaks for the send form input fields
2018-06-04 17:34:03 +01:00
Akinwale Ariwodola cda7e81485 Merge pull request #157 from lbryio/omnibar-file-suggestion
change icon for URIs linking to actual file claims
2018-06-03 13:53:10 +01:00
Akinwale Ariwodola 0cffb26dfc change icon for URIs linking to actual file claims 2018-06-03 13:51:02 +01:00
Akinwale Ariwodola d21e4aa830 Add URI to search result items. Update omnibar URI suggestions display. 2018-06-03 13:46:43 +01:00
Akinwale Ariwodola a5dfe0c586 Update Twisted version. Remove pycrypto recipe. 2018-06-03 12:20:15 +01:00
Akinwale Ariwodola 00f4745d46 bumpversion 0.1.6 --> 0.1.7 2018-05-27 22:00:46 +01:00
Akinwale Ariwodola 062e7cef24 Merge pull request #143 from lbryio/fix-uri-bar-errors
blur text input and hide suggestions when the soft keyboard is closed
2018-05-27 21:55:51 +01:00
Akinwale Ariwodola efc710d796 blur text input and hide suggestions when the soft keyboard is closed 2018-05-27 21:48:06 +01:00
Akinwale Ariwodola fd2d20af94 bumpversion 0.1.5 --> 0.1.6 2018-05-26 00:33:37 +01:00
Akinwale Ariwodola 51065d1b57 Merge pull request #142 from lbryio/uri-bar-improvements
Improvements to the UriBar implementation and some navigation tweaks.
2018-05-26 00:32:13 +01:00
Akinwale Ariwodola 6a60ce07e9 Improvements to the UriBar implementation and some navigation tweaks. 2018-05-26 00:20:44 +01:00
Akinwale Ariwodola 7c8f9a6662 Merge pull request #141 from lbryio/image-and-html-file-types
add support for viewing images, HTML and text files in the app
2018-05-25 19:53:33 +01:00
Akinwale Ariwodola ed61f470f7 Implement channel page with just the first page of results (#140) 2018-05-25 19:52:08 +01:00
Akinwale Ariwodola a89d8ac229 add support for viewing images, HTML and text files in the app 2018-05-25 18:39:02 +01:00
akinwale 3c8e7d13e0 enable purchases for paid content (#133) 2018-05-25 08:16:01 +01:00
akinwale 7d2e4c1e8c Handle lbry:// url scheme, and download notification fixes. (#139) 2018-05-25 08:13:05 +01:00
akinwale 4fbf90654e implement direct URI navigation (#134) 2018-05-24 23:47:55 +01:00
Daniel Alejandro Dominguez Diaz 077af85181 Add development information to the documentation (#123)
*
2018-05-23 14:09:57 +01:00
akinwale 1b77a8dd8b Merge pull request #135 from lbryio/navigation-perf
replaced FeaturedCategory with SectionList on discover page to improve performance
2018-05-21 19:02:36 +01:00
akinwale 28071a10b5 Merge pull request #137 from lbryio/debug-check
add debug build checks
2018-05-19 23:37:01 +01:00
Akinwale Ariwodola 1a6e3bf214 add debug build checks 2018-05-19 23:35:43 +01:00
Akinwale Ariwodola 16db19fac7 Increase storage requirement toast display duration 2018-05-19 23:03:03 +01:00
akinwale c533e7832b Merge pull request #136 from lbryio/keep-daemon-running-default
display the correct default value for the keep daemon running option
2018-05-19 21:11:42 +01:00
Akinwale Ariwodola 0cd33ddada display the correct default value for the keep daemon running option 2018-05-19 21:10:27 +01:00
Akinwale Ariwodola 140d405aa9 replaced FeaturedCategory with SectionList on discover page to improve performance 2018-05-19 20:50:09 +01:00
akinwale ceeef6324e Video fullscreen switch (#132)
* file page download progress display and media loading / playback tweaks
* Moved MediaPlayer component to be a child of the top-level view
* hide tracking controls when player controls are hidden in fullscreen mode
2018-05-19 16:11:59 +01:00
akinwale f850be1eca Merge pull request #131 from lbryio/download-progress-video-playing
file page download progress display and media loading / playback tweaks
2018-05-19 15:01:28 +01:00
Daniel Alejandro Dominguez Diaz 28c5b01596 Clear search results after closing search as reported on issue #113 (#124) 2018-05-18 19:13:27 +01:00
Akinwale Ariwodola 59f5b5ede3 file page download progress display and media loading / playback tweaks 2018-05-18 12:00:58 +01:00
akinwale 8db8083e32 Merge pull request #130 from lbryio/selectable-description
add selectable flag for file title, channel name and description
2018-05-18 09:50:18 +01:00
Akinwale Ariwodola a2c3f36065 add selectable flag for file title, channel name and description 2018-05-18 09:49:04 +01:00
Akinwale Ariwodola 0483e67026 Remove postinstall step which is no longer needed in RN 0.55.3. Update react-navigation version. 2018-05-18 08:07:18 +01:00
akinwale 872fafbb50 Merge pull request #129 from lbryio/python-requirements-tweak
* Fix service_identity requirements
* Add certifi for Twisted SSL veriication
2018-05-16 00:55:53 +01:00
Akinwale Ariwodola 4d57d72980 Fix service_identity requirements. Add certifi for Twisted SSL verification. 2018-05-16 00:49:47 +01:00
Akinwale Ariwodola 77f5d5cf05 Updated React Native version to fix startup error. Updated buildozer requirements to match latest lbryio/lbry requirements.txt. 2018-05-15 22:14:08 +01:00
Akinwale Ariwodola 5e6dfb18f7 bumpversion 0.1.4 --> 0.1.5 2018-05-15 19:00:18 +01:00
akinwale fe8b7ec5b3 Fix missing react-native-cli tools for build (#128) 2018-05-15 18:59:04 +01:00
akinwale f6503dc367 Travis tweaks (#122) 2018-05-11 08:09:53 +01:00
Akinwale Ariwodola 491782a88e bumpversion 0.1.3 --> 0.1.4 2018-05-10 23:08:22 +01:00
akinwale 13fb52478f Merge pull request #119 from lbryio/empty-tx-list-fix
fix for transactionList empty error on history page
2018-05-10 23:04:03 +01:00
Akinwale Ariwodola 15125159bb fix for transactionList empty error on history page 2018-05-10 23:02:10 +01:00
akinwale 614069e342 wallet alpha warning (#118) 2018-05-10 22:10:12 +01:00
akinwale 48350ff175 Added text view to display URIs at the bottom of the file page (#116)
* Added text view to display URIs at the bottom of the file page
* added color constants
2018-05-10 21:18:18 +01:00
akinwale 3d3f1e0ff0 splash screen removed from stack after initial display (#117) 2018-05-10 21:07:18 +01:00
akinwale 6abf511ef4 added link component with some tweaks to transaction list (#98) 2018-05-10 18:38:07 +01:00
akinwale fffa136b3f Merge pull request #115 from dan1d/update-docs
Update dependencies needed on docs.
2018-05-10 17:27:55 +01:00
Daniel Dominguez 8c4c554a1c Update dependencies needed. 2018-05-09 19:01:15 -03:00
akinwale 5c1e542dab Travis CI deployment to AWS and Github releases (#114) 2018-05-09 19:26:57 +01:00
Akinwale Ariwodola 766290a2a3 updated build doc to refer to lbryio/buildozer fork 2018-05-03 20:00:41 +01:00
akinwale 3706bc5936 Wallet implementation (#92)
* Created walletAddress and walletBalance components
* Added walletSend and transaction list components.
* added transaction history page
2018-05-03 19:58:31 +01:00
Jeremy Kauffman 351e39826b light build update 2018-04-30 15:29:12 -04:00
Jeremy Kauffman 808217d41e buildozer link 2018-04-30 15:25:08 -04:00
Jeremy Kauffman 1c8f75ec88 further clarify alpha 2018-04-30 15:24:05 -04:00
Jeremy Kauffman 296f8b2363 light README cleanup 2018-04-30 15:23:34 -04:00
Akinwale Ariwodola 4960b9e2ec README formatting fix 2018-04-30 20:16:46 +01:00
Jeremy Kauffman 3bba3c5689 Merge pull request #86 from lbryio/doc-standardisation
standardised README.md. Created BUILD.md for full build instructions.
2018-04-30 15:12:32 -04:00
Akinwale Ariwodola 297b2e0826 added npm instructions 2018-04-29 17:09:39 +01:00
Akinwale Ariwodola 9ed8a67c5c standardised README.md. Created BUILD.md for full build instructions. 2018-04-28 00:36:03 +01:00
Akinwale Ariwodola b8ad99b2a1 bumpversion 2018-04-24 21:02:50 +01:00
akinwale 68cec1659a Merge pull request #84 from lbryio/release-script
created a release script
2018-04-24 21:01:58 +01:00
Akinwale Ariwodola a7264e506a created a release script 2018-04-24 21:01:11 +01:00
akinwale 90d17604fc First run timing (#83)
* first run time tracking implementation
* Fix values in AsyncStorage calls. Some tweaks to Mixpanel event properties.
* remove first launch related items in AsyncStorage after final retrieval
2018-04-24 20:32:17 +01:00
akinwale 77a86da984 Merge pull request #79 from lbryio/service-notification
Removed service foreground notification
2018-04-24 15:59:20 +01:00
akinwale 41becae272 Merge pull request #80 from lbryio/background-play
added new setting to toggle background media play
2018-04-23 22:22:40 +01:00
akinwale 21640e4264 Merge pull request #81 from lbryio/search-drawer-locked
keep navigation drawer locked in the closed state on the search screen
2018-04-23 17:23:37 +01:00
Akinwale Ariwodola 1366dc0996 keep navigation drawer locked in the closed state on the search screen 2018-04-23 10:34:45 +01:00
Akinwale Ariwodola c6129ffc31 added new setting to toggle background media play 2018-04-23 10:26:09 +01:00
Akinwale Ariwodola d018e9b577 Removed service foreground notification. Tapping on the download progress notification should open the app. 2018-04-23 05:32:19 +01:00
akinwale 496ec53f8a About page (#78)
* added about page with version info
* lock drawer to closed state for About screen. Added About screen hardware back button handling.
2018-04-23 05:10:18 +01:00
akinwale b9e0065aad added single page header with back button and some styling (#75)
* added single page header with back button and some styling
* lock drawer mode state to closed for settings screen
2018-04-23 05:01:33 +01:00
akinwale a4798c3cf9 Merge pull request #68 from lbryio/mixpanel
Implemented Mixpanel analytics
2018-04-23 05:00:38 +01:00
Sean Yesmunt 7a335515f6 Merge pull request #76 from lbryio/splash-screen-title
change Lbry. to LBRY on splash screen
2018-04-22 23:14:27 -04:00
Akinwale Ariwodola a8457a748a change Lbry. to LBRY on splash screen 2018-04-21 10:58:25 +01:00
Akinwale Ariwodola bb7fa61c33 Implemented Mixpanel analytics 2018-04-20 03:14:44 +01:00
akinwale 5d8d832e99 Merge pull request #67 from lbryio/dismissable-and-grouped-notifications
Allow download notifications to be dismissed. Group active download notifications.
2018-04-19 23:59:05 +01:00
Akinwale Ariwodola 0bb215a803 Allow download notifications to be dismissed. Group active download notifications. 2018-04-19 22:43:15 +01:00
akinwale 173920d9eb Merge pull request #63 from lbryio/delete-button-fullscreen-fix
fix action buttons displaying in full screen video mode
2018-04-12 13:11:14 -04:00
akinwale 1fb5ce87ea Merge pull request #64 from lbryio/crash-on-start
Integrate fixes from https://github.com/kivy/python-for-android/pull/1197
2018-04-11 12:05:40 -04:00
Akinwale Ariwodola 43deedd994 Integrate fixes from https://github.com/kivy/python-for-android/pull/1197 for minimum Android API support. Minimum Android API set to 21. 2018-04-11 11:30:16 -04:00
Akinwale Ariwodola 2d72afe1f0 fix action buttons displaying in full screen video mode 2018-04-11 11:13:32 -04:00
1188 changed files with 47196 additions and 66949 deletions

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
## PR Checklist
<!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" -->
Please check all that apply to this PR using "x":
- [ ] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
- [ ] I have checked that this PR does not introduce a breaking change
- [ ] This PR introduces breaking changes and I have provided a detailed explanation below
## PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting)
- [ ] Refactoring (no functional changes)
- [ ] Documentation changes
- [ ] Other - Please describe:
## Fixes
Issue Number:
## What is the current behavior?
## What is the new behavior?
## Other information
<!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
+20 -1
View File
@@ -5,7 +5,7 @@ To make it possible for us to help you, please fill out below information carefu
Before reporting any issues, please make sure that you're using the latest version.
We are also available on live chat at https://chat.lbry.io
We are also available on live chat at https://chat.lbry.com
-->
@@ -34,3 +34,22 @@ Tell us what happens instead
## Screenshots
<!-- If a screenshot would help explain the bug, please include one or two here -->
## Internal Use
### Acceptance Criteria
1.
2.
3.
### Definition of Done
- [ ] Tested against acceptance criteria
- [ ] Tested against the assumptions of the user story
- [ ] The project builds without errors
- [ ] Unit tests are written and passing
- [ ] Tests on devices/browsers listed in the issue have passed
- [ ] QA performed & issues resolved
- [ ] Refactoring completed
- [ ] Any configuration or build changes documented
- [ ] Documentation updated
- [ ] Peer Code Review performed
+66 -8
View File
@@ -1,9 +1,67 @@
.buildozer
app/node_modules/
bin
buildozer.spec
build.log
recipes/**/*.pyc
src/main/assets/index.android.bundle
src/main/assets/index.android.bundle.meta
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifact
*.jsbundle
# CocoaPods
/ios/Pods/
# Other Files
app/google-services.json
*.log
.vagrant
*.hprof
app/build
bin
+67
View File
@@ -0,0 +1,67 @@
stages:
- build
- deploy
- release
build apk:
stage: build
image: lbry/android-base:platform-28
before_script:
- apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign
- chmod u+x $CI_PROJECT_DIR/gradlew
- export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
artifacts:
paths:
- bin/browser-*-release__arm.apk
- bin/browser-*-release__arm64.apk
expire_in: 1 week
script:
- export PATH=/usr/bin:$PATH
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install git-secret
- git secret reveal
- yarn
- chmod u+x ./release.sh
- ./release.sh
- cp bin/browser-$BUILD_VERSION-release__arm.apk /dev/null
- cp bin/browser-$BUILD_VERSION-release__arm64.apk /dev/null
deploy build.lbry.io:
image: python:stretch
stage: deploy
dependencies:
- build apk
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
- pip install awscli
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__64
- aws s3 cp bin/$BUILD_APK_FILENAME__32 s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__32
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/push.apk
release apk:
image: python:stretch
stage: release
only:
- tags
dependencies:
- build apk
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
- pip install awscli githubrelease
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME__64 bin/$BUILD_APK_FILENAME__32
- githubrelease release lbryio/lbry-android edit $CI_COMMIT_TAG --draft
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/latest.apk
+1
View File
@@ -0,0 +1 @@
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
lbry-android.keystore:0d958c531870694624cc877ea98ca1c583485f8ebbb3a5acca58b1930c190d65
app/google-services.json:896a0bee8294a36d061f10fa926129d8a780528b34d0a2f03113400c4246d67c
-39
View File
@@ -1,39 +0,0 @@
sudo: required
dist: trusty
language: python
python:
- "2.7"
install:
- deactivate
- export PATH=/usr/bin:$PATH
- sudo dpkg --add-architecture i386
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 npm nodejs
- sudo pip install --upgrade cython==0.25.2 pip setuptools
- git clone https://github.com/akinwale/buildozer.git
- cd app
- npm config set registry="http://registry.npmjs.org/"
- npm install --silent --save react@16.2.0 react-native@0.52.0 react-native-video@2.0.0
- cd ..
- cd buildozer
- sudo python setup.py install
- cd ..
- mv buildozer.spec.travis buildozer.spec
- mkdir -p cd ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/android-23_r02.zip' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P ~/.buildozer/android/platform/
- unzip -qq ~/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/
- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
- unzip -qq ~/.buildozer/android/platform/android-23_r02.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
- mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-6.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-23
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
- mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
script:
- ./build.sh | grep -Fv -e 'working:' -e 'copy' --line-buffered
- cp bin/*.apk /dev/null
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017-2018 LBRY Inc
Copyright (c) 2017-2020 LBRY Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+25 -67
View File
@@ -1,75 +1,33 @@
[![Build Status](https://travis-ci.org/lbryio/lbry-android.svg?branch=master)](https://travis-ci.org/lbryio/lbry-android)
## 64-bit Ubuntu 16.04 LTS build instructions
# LBRY Android
[![pipeline status](https://ci.lbry.tech/lbry/lbry-android/badges/master/pipeline.svg)](https://ci.lbry.tech/lbry/lbry-android/commits/master)
[![GitHub license](https://img.shields.io/github/license/lbryio/lbry-android)](https://github.com/lbryio/lbry-android/blob/master/LICENSE)
### Install Prerequisites
#### Requirements
* JDK 1.8
* Android SDK
* Android NDK
* Buildozer
#### Apt Packages
Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386
```
Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package.
**Additional package for building libgmp**
```
sudo apt-get install m4
```
**Additional package for the pycrypto recipe**
This had to be installed due to an error regarding the `<gnu/stubs.h>` include not found.
```
sudo apt-get install libc6-dev-i386
```
An Android browser and wallet for the [LBRY](https://lbry.com) network. This app bundles [LBRY SDK](https://github.com/lbryio/lbry) as a background service with a UI layer built with React Native.
#### Install Cython
```
sudo pip install --upgrade cython==0.25.2
```
#### Install buildozer
```
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python2.7 setup.py install
```
#### Create buildozer.spec
Assuming `lbrydroid` as the current working folder:
* Copy `buildozer.spec.sample` to `buildozer.spec` in the `lbry-android` folder. Running `buildozer init` instead will create a new `buildozer.spec` file.
* Update `buildozer.spec` settings to match your environment. Basic recommended settings are outlined below.
<img src="https://spee.ch/@lbry:3f/android-08-homepage.gif" alt="LBRY Android GIF" width="384px" />
| Setting | Description |
|:------------------- |:-----------------------------|
| title | application title |
| package.name | package name (eg. lbrynet) |
| package.domain | package domain (eg. io.lbry) |
| source.dir | the location of the application main.py |
| version | application version |
| requirements | the module requirements for building the application |
| services | list of Android background services and their corresponding Python entry points |
| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity |
| android.api | Android API version (21 and 24 have been tested to result in a successful build) |
| android.sdk | Android SDK version (21 and 24 have been tested to result in a successful build) |
| android.ndk | Android NDK version (13b has been tested to result in a successful build) |
| android.ndk_path | Android NDK path. buildozer will automatically download this if not set |
| android.sdk_path | Android SDK path. buildozer will automatically download this if not set |
| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder |
| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build |
## Installation
The minimum supported Android version is 5.0 Lollipop. There are two ways to install:
#### Build and deploy the APK
Run `buildozer android debug` to build a debug APK, or `buildozer android release` to build a release APK.
1. Via the Google Play Store. Anyone can join the [open beta](https://play.google.com/apps/testing/io.lbry.browser) in order to install the app from the Play Store.
1. Direct APK install available at [http://build.lbry.io/android/latest.apk](http://build.lbry.io/android/latest.apk). You will need to enable installation from third-party sources on your device in order to install from this source.
To deploy and run the APK on a connected Android device, you can run `buildozer android debug deploy run`.
## Usage
The app can be launched by opening **LBRY** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
Run `buildozer android clean` to clean the package if you intend to rebuild.
## Running from Source
Please refer to https://github.com/lbryio/lbry-react-native/blob/master/README.md
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
## License
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
## Contact
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)
+1
View File
@@ -0,0 +1 @@
/build
+108
View File
@@ -0,0 +1,108 @@
import com.google.gms.googleservices.GoogleServicesPlugin
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
flavorDimensions "default"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "io.lbry.browser"
minSdkVersion 21
targetSdkVersion 29
versionCode 1506
versionName "0.15.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
productFlavors {
__32bit {
versionCode android.defaultConfig.versionCode * 10 + 1
ndk {
abiFilter "armeabi-v7a"
}
}
__64bit {
versionCode android.defaultConfig.versionCode * 10 + 2
ndk {
abiFilter "arm64-v8a"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
task printVersionName {
doLast {
println android.defaultConfig.versionName
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha06'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.webkit:webkit:1.3.0-alpha02'
implementation 'androidx.camera:camera-core:1.0.0-beta03'
implementation 'androidx.camera:camera-camera2:1.0.0-beta03'
implementation 'androidx.camera:camera-lifecycle:1.0.0-beta03'
implementation 'androidx.camera:camera-view:1.0.0-alpha10'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.google.firebase:firebase-analytics:17.4.1'
implementation 'com.google.android.gms:play-services-base:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.1.7'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.4'
implementation 'com.google.android.exoplayer:extension-cast:2.11.4'
implementation 'com.google.android.exoplayer:extension-mediasession:2.11.4'
implementation 'com.google.android:flexbox:2.0.1'
implementation 'com.hbb20:ccp:2.3.8'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.atlassian.commonmark:commonmark:0.14.0'
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1.LTS'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
__32bitImplementation files('libs/lbrysdk-0.74.0-release__arm.aar')
__64bitImplementation files('libs/lbrysdk-0.74.0-release__arm64.aar')
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
react-native bundle --platform android --dev false --entry-file src/index.js --bundle-output ../src/main/assets/index.android.bundle --assets-dest ../src/main/res/
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
{
"project_info": {
"project_number": "861521963586",
"firebase_url": "https://lbry-mobile-builds-debug.firebaseio.com",
"project_id": "lbry-mobile-builds-debug",
"storage_bucket": "lbry-mobile-builds-debug.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:861521963586:android:592958d248940ab2",
"android_client_info": {
"package_name": "io.lbry.browser"
}
},
"oauth_client": [
{
"client_id": "861521963586-60cmvg5nmnrqkrc11a7bpmpv5ra2d50q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC7A3BYcIdZP9-Q-VNHoexYJWgZA7WzsPI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "861521963586-60cmvg5nmnrqkrc11a7bpmpv5ra2d50q.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
-3
View File
@@ -1,3 +0,0 @@
import LBRYApp from './src/index';
export default LBRYApp;
Binary file not shown.
Binary file not shown.
-10579
View File
File diff suppressed because it is too large. Load diff
-25
View File
@@ -1,25 +0,0 @@
{
"name": "LBRYApp",
"version": "0.0.1",
"private": "true",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"postinstall": "cp ./patch/ReactNativeRenderer-dev.js.patch ./node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js; rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json"
},
"dependencies": {
"lbry-redux": "lbryio/lbry-redux#common-components-refactor",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-vector-icons": "^4.5.0",
"react-native-video": "2.0.0",
"react-navigation": "^1.0.3",
"react-navigation-redux-helpers": "^1.0.1",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-logger": "3.0.6",
"redux-persist": "^4.8.0",
"redux-persist-transform-compress": "^4.2.0",
"redux-persist-transform-filter": "0.0.10",
"redux-thunk": "^2.2.0"
}
}
File diff suppressed because it is too large. Load diff
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,27 @@
package io.lbry.browser;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("io.lbry.browser", appContext.getPackageName());
}
}
-127
View File
@@ -1,127 +0,0 @@
import React from 'react';
import DiscoverPage from '../page/discover';
import FilePage from '../page/file';
import SearchPage from '../page/search';
import SettingsPage from '../page/settings';
import SplashScreen from '../page/splash';
import SearchInput from '../component/searchInput';
import {
addNavigationHelpers,
DrawerNavigator,
StackNavigator,
NavigationActions
} from 'react-navigation';
import { connect } from 'react-redux';
import { addListener } from '../utils/redux';
import { AppState, BackHandler, NativeModules, TextInput } from 'react-native';
import { SETTINGS } from 'lbry-redux';
import { makeSelectClientSetting } from '../redux/selectors/settings';
import Feather from 'react-native-vector-icons/Feather';
import discoverStyle from '../styles/discover';
import searchStyle from '../styles/search';
const discoverStack = StackNavigator({
Discover: {
screen: DiscoverPage,
navigationOptions: ({ navigation }) => ({
title: 'Discover',
headerLeft: <Feather name="menu" size={24} style={discoverStyle.drawerHamburger} onPress={() => navigation.navigate('DrawerOpen')} />,
headerRight: <Feather name="search" size={24} style={discoverStyle.rightHeaderIcon} onPress={() => navigation.navigate('Search')} />
})
},
File: {
screen: FilePage,
navigationOptions: {
header: null,
drawerLockMode: 'locked-closed'
}
},
Search: {
screen: SearchPage,
navigationOptions: ({ navigation }) => ({
headerTitle: <SearchInput style={searchStyle.searchInput} />,
headerRight: <Feather name="x" size={24} style={discoverStyle.rightHeaderIcon} onPress={() => navigation.dispatch(NavigationActions.back())} />
})
}
}, {
headerMode: 'screen',
});
const drawer = DrawerNavigator({
Discover: { screen: discoverStack },
Settings: {
screen: SettingsPage,
headerMode: 'screen'
}
}, {
drawerWidth: 300,
headerMode: 'none'
});
export const AppNavigator = new StackNavigator({
Splash: {
screen: SplashScreen,
navigationOptions: {
drawerLockMode: 'locked-closed'
}
},
Main: {
screen: drawer
}
}, {
headerMode: 'none'
});
class AppWithNavigationState extends React.Component {
componentWillMount() {
AppState.addEventListener('change', this._handleAppStateChange);
BackHandler.addEventListener('hardwareBackPress', function() {
const { dispatch, navigation, nav } = this.props;
if (nav.routes.length === 2 && nav.routes[1].routeName === 'Main') {
if (nav.routes[1].routes[0].routes[0].index > 0) {
dispatch({ type: 'Navigation/BACK' });
return true;
}
}
return false;
}.bind(this));
}
componentWillUnmount() {
AppState.removeEventListener('change', this._handleAppStateChange);
BackHandler.removeEventListener('hardwareBackPress');
}
_handleAppStateChange = (nextAppState) => {
const { keepDaemonRunning } = this.props;
if (AppState.currentState &&
AppState.currentState.match(/inactive|background/) &&
NativeModules.DaemonServiceControl) {
if (!keepDaemonRunning) {
// terminate the daemon background service when is suspended / inactive
NativeModules.DaemonServiceControl.stopService();
}
}
}
render() {
const { dispatch, nav } = this.props;
return (
<AppNavigator
navigation={addNavigationHelpers({
dispatch,
state: nav,
addListener,
})}
/>
);
}
}
const mapStateToProps = state => ({
nav: state.nav,
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state)
});
export default connect(mapStateToProps)(AppWithNavigationState);
@@ -1,7 +0,0 @@
import { connect } from 'react-redux';
import FeaturedCategory from './view';
const select = state => ({});
const perform = dispatch => ({});
export default connect(select, perform)(FeaturedCategory);
@@ -1,27 +0,0 @@
import React from 'react';
import { Text, View } from 'react-native';
import { normalizeURI } from 'lbry-redux';
import FileItem from '../fileItem';
import discoverStyle from '../../styles/discover';
class FeaturedCategory extends React.PureComponent {
render() {
const { category, names, categoryLink, navigation } = this.props;
return (
<View>
<Text style={discoverStyle.categoryName}>{category}</Text>
{names &&
names.map(name => (
<FileItem
style={discoverStyle.fileItem}
key={name}
uri={normalizeURI(name)}
navigation={navigation} />
))}
</View>
);
}
}
export default FeaturedCategory;
@@ -1,23 +0,0 @@
import { connect } from 'react-redux';
import {
makeSelectFileInfoForUri,
makeSelectDownloadingForUri,
makeSelectLoadingForUri,
makeSelectCostInfoForUri
} from 'lbry-redux';
import { doPurchaseUri, doStartDownload } from '../../redux/actions/file';
import FileDownloadButton from './view';
const select = (state, props) => ({
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
downloading: makeSelectDownloadingForUri(props.uri)(state),
costInfo: makeSelectCostInfoForUri(props.uri)(state),
loading: makeSelectLoadingForUri(props.uri)(state),
});
const perform = dispatch => ({
purchaseUri: uri => dispatch(doPurchaseUri(uri)),
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint))
});
export default connect(select, perform)(FileDownloadButton);
@@ -1,80 +0,0 @@
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import fileDownloadButtonStyle from '../../styles/fileDownloadButton';
class FileDownloadButton extends React.PureComponent {
componentWillReceiveProps(nextProps) {
//this.checkAvailability(nextProps.uri);
this.restartDownload(nextProps);
}
restartDownload(props) {
const { downloading, fileInfo, uri, restartDownload } = props;
if (
!downloading &&
fileInfo &&
!fileInfo.completed &&
fileInfo.written_bytes !== false &&
fileInfo.written_bytes < fileInfo.total_bytes
) {
restartDownload(uri, fileInfo.outpoint);
}
}
render() {
const {
fileInfo,
downloading,
uri,
purchaseUri,
costInfo,
loading,
doPause,
style,
} = this.props;
const openFile = () => {
//openInShell(fileInfo.download_path);
//doPause();
};
if (loading || downloading) {
const progress =
fileInfo && fileInfo.written_bytes ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
label = fileInfo ? progress.toFixed(0) + '% complete' : 'Connecting...';
return (
<View style={[style, fileDownloadButtonStyle.container]}>
<View style={{ width: `${progress}%`, backgroundColor: '#ff0000', position: 'absolute', left: 0, top: 0 }}></View>
<Text style={fileDownloadButtonStyle.text}>{label}</Text>
</View>
);
} else if (fileInfo === null && !downloading) {
if (!costInfo) {
return (
<View style={[style, fileDownloadButtonStyle.container]}>
<Text>Fetching cost info...</Text>
</View>
);
}
return (
<TouchableOpacity style={[style, fileDownloadButtonStyle.container]} onPress={() => {
purchaseUri(uri);
}}>
<Text style={fileDownloadButtonStyle.text}>Download</Text>
</TouchableOpacity>
);
} else if (fileInfo && fileInfo.download_path) {
return (
<TouchableOpacity style={[style, fileDownloadButtonStyle.container]} onPress={() => openFile()}>
<Text style={fileDownloadButtonStyle.text}>Open</Text>
</TouchableOpacity>
);
}
return null;
}
}
export default FileDownloadButton;
-26
View File
@@ -1,26 +0,0 @@
import { connect } from 'react-redux';
import {
doResolveUri,
makeSelectClaimForUri,
makeSelectMetadataForUri,
makeSelectFileInfoForUri,
makeSelectIsUriResolving,
selectRewardContentClaimIds
} from 'lbry-redux';
import { selectShowNsfw } from '../../redux/selectors/settings';
import FileItem from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
rewardedContentClaimIds: selectRewardContentClaimIds(state, props),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
obscureNsfw: !selectShowNsfw(state)
});
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri)),
});
export default connect(select, perform)(FileItem);
-76
View File
@@ -1,76 +0,0 @@
import React from 'react';
import { normalizeURI } from 'lbry-redux';
import { NavigationActions } from 'react-navigation';
import { Text, View, TouchableOpacity } from 'react-native';
import FileItemMedia from '../fileItemMedia';
import FilePrice from '../filePrice';
import NsfwOverlay from '../nsfwOverlay';
import discoverStyle from '../../styles/discover';
class FileItem extends React.PureComponent {
constructor(props) {
super(props);
}
componentWillMount() {
this.resolve(this.props);
}
componentWillReceiveProps(nextProps) {
this.resolve(nextProps);
}
resolve(props) {
const { isResolvingUri, resolveUri, claim, uri } = props;
if (!isResolvingUri && claim === undefined && uri) {
resolveUri(uri);
}
}
render() {
const {
claim,
fileInfo,
metadata,
isResolvingUri,
rewardedContentClaimIds,
style,
navigation
} = this.props;
const uri = normalizeURI(this.props.uri);
const title = metadata && metadata.title ? metadata.title : uri;
const thumbnail = metadata && metadata.thumbnail ? metadata.thumbnail : null;
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
const channelName = claim ? claim.channel_name : null;
let description = '';
if (isResolvingUri && !claim) {
description = 'Loading...';
} else if (metadata && metadata.description) {
description = metadata.description;
} else if (claim === null) {
description = 'This address contains no content.';
}
return (
<View style={style}>
<TouchableOpacity style={discoverStyle.container} onPress={() => {
navigation.navigate('File', { uri: uri });
}
}>
<FileItemMedia title={title} thumbnail={thumbnail} blurRadius={obscureNsfw ? 15 : 0} resizeMode="cover" />
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />
<Text style={discoverStyle.fileItemName}>{title}</Text>
{channelName &&
<Text style={discoverStyle.channelName}>{channelName}</Text>}
</TouchableOpacity>
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate('Settings')} />}
</View>
);
}
}
export default FileItem;
-7
View File
@@ -1,7 +0,0 @@
import { connect } from 'react-redux';
import FileItemMedia from './view';
const select = state => ({});
const perform = dispatch => ({});
export default connect(select, perform)(FileItemMedia);
-59
View File
@@ -1,59 +0,0 @@
import React from 'react';
import { Text, Image, View } from 'react-native';
import fileItemMediaStyle from '../../styles/fileItemMedia';
class FileItemMedia extends React.PureComponent {
static AUTO_THUMB_STYLES = [
fileItemMediaStyle.autothumbPurple,
fileItemMediaStyle.autothumbRed,
fileItemMediaStyle.autothumbPink,
fileItemMediaStyle.autothumbIndigo,
fileItemMediaStyle.autothumbBlue,
fileItemMediaStyle.autothumbLightBlue,
fileItemMediaStyle.autothumbCyan,
fileItemMediaStyle.autothumbTeal,
fileItemMediaStyle.autothumbGreen,
fileItemMediaStyle.autothumbYellow,
fileItemMediaStyle.autothumbOrange,
];
componentWillMount() {
this.setState({
autoThumbStyle:
FileItemMedia.AUTO_THUMB_STYLES[
Math.floor(Math.random() * FileItemMedia.AUTO_THUMB_STYLES.length)
],
});
}
render() {
let style = this.props.style;
const { title, thumbnail, blurRadius, resizeMode } = this.props;
const atStyle = this.state.autoThumbStyle;
if (thumbnail && ((typeof thumbnail) === 'string')) {
if (style == null) {
style = fileItemMediaStyle.thumbnail;
}
return (
<Image source={{uri: thumbnail}}
blurRadius={blurRadius}
resizeMode={resizeMode ? resizeMode : "cover"}
style={style} />
);
}
return (
<View style={[style ? style : fileItemMediaStyle.autothumb, atStyle]}>
<Text style={fileItemMediaStyle.autothumbText}>{title &&
title
.replace(/\s+/g, '')
.substring(0, Math.min(title.replace(' ', '').length, 5))
.toUpperCase()}</Text>
</View>
);
}
}
export default FileItemMedia;
-20
View File
@@ -1,20 +0,0 @@
import { connect } from 'react-redux';
import {
doFetchCostInfoForUri,
makeSelectCostInfoForUri,
makeSelectFetchingCostInfoForUri,
makeSelectClaimForUri
} from 'lbry-redux';
import FilePrice from './view';
const select = (state, props) => ({
costInfo: makeSelectCostInfoForUri(props.uri)(state),
fetching: makeSelectFetchingCostInfoForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
});
const perform = dispatch => ({
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
});
export default connect(select, perform)(FilePrice);
-120
View File
@@ -1,120 +0,0 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Text, View } from 'react-native';
import { formatCredits, formatFullPrice } from 'lbry-redux';
class CreditAmount extends React.PureComponent {
static propTypes = {
amount: PropTypes.number.isRequired,
precision: PropTypes.number,
isEstimate: PropTypes.bool,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
showFree: PropTypes.bool,
showFullPrice: PropTypes.bool,
showPlus: PropTypes.bool,
look: PropTypes.oneOf(['indicator', 'plain', 'fee']),
};
static defaultProps = {
precision: 2,
label: true,
showFree: false,
look: 'indicator',
showFullPrice: false,
showPlus: false,
};
render() {
const minimumRenderableAmount = Math.pow(10, -1 * this.props.precision);
const { amount, precision, showFullPrice, style } = this.props;
let formattedAmount;
const fullPrice = formatFullPrice(amount, 2);
if (showFullPrice) {
formattedAmount = fullPrice;
} else {
formattedAmount =
amount > 0 && amount < minimumRenderableAmount
? `<${minimumRenderableAmount}`
: formatCredits(amount, precision);
}
let amountText;
if (this.props.showFree && parseFloat(this.props.amount) === 0) {
amountText = 'FREE';
} else {
if (this.props.label) {
const label =
typeof this.props.label === 'string'
? this.props.label
: parseFloat(amount) == 1 ? 'credit' : 'credits';
amountText = `${formattedAmount} ${label}`;
} else {
amountText = formattedAmount;
}
if (this.props.showPlus && amount > 0) {
amountText = `+${amountText}`;
}
}
/*{this.props.isEstimate ? (
<span
className="credit-amount__estimate"
title={__('This is an estimate and does not include data fees')}
>
*
</span>
) : null}*/
return (
<Text style={style}>{amountText}</Text>
);
}
}
class FilePrice extends React.PureComponent {
componentWillMount() {
this.fetchCost(this.props);
}
componentWillReceiveProps(nextProps) {
this.fetchCost(nextProps);
}
fetchCost(props) {
const { costInfo, fetchCostInfo, uri, fetching, claim } = props;
if (costInfo === undefined && !fetching && claim) {
fetchCostInfo(uri);
}
}
render() {
const { costInfo, look = 'indicator', showFullPrice = false, style, textStyle } = this.props;
const isEstimate = costInfo ? !costInfo.includesData : null;
if (!costInfo) {
return (
<View style={style}>
<Text style={textStyle}>???</Text>
</View>
)
}
return (
<View style={style}>
<CreditAmount
style={textStyle}
label={false}
amount={costInfo.cost}
isEstimate={isEstimate}
showFree
showFullPrice={showFullPrice}>???</CreditAmount>
</View>
);
}
}
export default FilePrice;
-7
View File
@@ -1,7 +0,0 @@
import { connect } from 'react-redux';
import MediaPlayer from './view';
const select = state => ({});
const perform = dispatch => ({});
export default connect(select, perform)(MediaPlayer);
-274
View File
@@ -1,274 +0,0 @@
import React from 'react';
import { Lbry } from 'lbry-redux';
import { PanResponder, Text, View, ScrollView, TouchableOpacity } from 'react-native';
import Video from 'react-native-video';
import Icon from 'react-native-vector-icons/FontAwesome';
import FileItemMedia from '../fileItemMedia';
import mediaPlayerStyle from '../../styles/mediaPlayer';
class MediaPlayer extends React.PureComponent {
static ControlsTimeout = 3000;
seekResponder = null;
seekerWidth = 0;
video = null;
state = {
rate: 1,
volume: 1,
muted: false,
resizeMode: 'stretch',
duration: 0.0,
currentTime: 0.0,
paused: true,
fullscreenMode: false,
areControlsVisible: true,
controlsTimeout: -1,
seekerOffset: 0,
seekerPosition: 0,
firstPlay: true
};
formatTime(time) {
let str = '';
let minutes = 0, hours = 0, seconds = parseInt(time, 10);
if (seconds > 60) {
minutes = parseInt(seconds / 60, 10);
seconds = seconds % 60;
if (minutes > 60) {
hours = parseInt(minutes / 60, 10);
minutes = minutes % 60;
}
str = (hours > 0 ? this.pad(hours) + ':' : '') + this.pad(minutes) + ':' + this.pad(seconds);
} else {
str = '00:' + this.pad(seconds);
}
return str;
}
pad(value) {
if (value < 10) {
return '0' + String(value);
}
return value;
}
onLoad = (data) => {
this.setState({
duration: data.duration
});
if (this.props.onMediaLoaded) {
this.props.onMediaLoaded();
}
}
onProgress = (data) => {
this.setState({ currentTime: data.currentTime });
if (!this.state.seeking) {
this.setSeekerPosition(this.calculateSeekerPosition());
}
if (this.state.firstPlay) {
this.setState({ firstPlay: false });
this.hidePlayerControls();
}
}
clearControlsTimeout = () => {
if (this.state.controlsTimeout > -1) {
clearTimeout(this.state.controlsTimeout)
}
}
showPlayerControls = () => {
this.clearControlsTimeout();
if (!this.state.areControlsVisible) {
this.setState({ areControlsVisible: true });
}
this.hidePlayerControls();
}
hidePlayerControls() {
const player = this;
let timeout = setTimeout(() => {
player.setState({ areControlsVisible: false });
}, MediaPlayer.ControlsTimeout);
player.setState({ controlsTimeout: timeout });
}
togglePlay = () => {
this.showPlayerControls();
this.setState({ paused: !this.state.paused });
}
toggleFullscreenMode = () => {
this.showPlayerControls();
const { onFullscreenToggled } = this.props;
this.setState({ fullscreenMode: !this.state.fullscreenMode }, () => {
this.setState({ resizeMode: this.state.fullscreenMode ? 'contain' : 'stretch' });
if (onFullscreenToggled) {
onFullscreenToggled(this.state.fullscreenMode);
}
});
}
onEnd = () => {
this.setState({ paused: true });
this.video.seek(0);
}
setSeekerPosition(position = 0) {
position = this.checkSeekerPosition(position);
this.setState({ seekerPosition: position });
if (!this.state.seeking) {
this.setState({ seekerOffset: position });
}
}
checkSeekerPosition(val = 0) {
if (val < 0) {
val = 0;
} else if (val >= this.seekerWidth) {
return this.seekerWidth;
}
return val;
}
seekTo(time = 0) {
if (time > this.state.duration) {
return;
}
this.video.seek(time);
this.setState({ currentTime: time });
}
initSeeker() {
this.seekResponder = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onPanResponderGrant: (evt, gestureState) => {
this.clearControlsTimeout();
this.setState({ seeking: true });
},
onPanResponderMove: (evt, gestureState) => {
const position = this.state.seekerOffset + gestureState.dx;
this.setSeekerPosition(position);
},
onPanResponderRelease: (evt, gestureState) => {
const time = this.getCurrentTimeForSeekerPosition();
if (time >= this.state.duration) {
this.setState({ paused: true });
this.onEnd();
} else {
this.seekTo(time);
this.setState({ seeking: false });
}
this.hidePlayerControls();
}
});
}
getCurrentTimeForSeekerPosition() {
return this.state.duration * (this.state.seekerPosition / this.seekerWidth);
}
calculateSeekerPosition() {
return this.seekerWidth * this.getCurrentTimePercentage();
}
getCurrentTimePercentage() {
if (this.state.currentTime > 0) {
return parseFloat(this.state.currentTime) / parseFloat(this.state.duration);
}
return 0;
};
componentWillMount() {
this.initSeeker();
}
componentWillUnmount() {
this.clearControlsTimeout();
this.setState({ paused: true, fullscreenMode: false });
const { onFullscreenToggled } = this.props;
if (onFullscreenToggled) {
onFullscreenToggled(false);
}
}
renderPlayerControls() {
if (this.state.areControlsVisible) {
return (
<View style={mediaPlayerStyle.playerControlsContainer}>
<TouchableOpacity style={mediaPlayerStyle.playPauseButton}
onPress={this.togglePlay}>
{this.state.paused && <Icon name="play" size={32} color="#ffffff" />}
{!this.state.paused && <Icon name="pause" size={32} color="#ffffff" />}
</TouchableOpacity>
<TouchableOpacity style={mediaPlayerStyle.toggleFullscreenButton} onPress={this.toggleFullscreenMode}>
{this.state.fullscreenMode && <Icon name="compress" size={16} color="#ffffff" />}
{!this.state.fullscreenMode && <Icon name="expand" size={16} color="#ffffff" />}
</TouchableOpacity>
<Text style={mediaPlayerStyle.elapsedDuration}>{this.formatTime(this.state.currentTime)}</Text>
<Text style={mediaPlayerStyle.totalDuration}>{this.formatTime(this.state.duration)}</Text>
</View>
);
}
return null;
}
render() {
const { fileInfo, title, thumbnail, style, fullScreenStyle } = this.props;
const flexCompleted = this.getCurrentTimePercentage() * 100;
const flexRemaining = (1 - this.getCurrentTimePercentage()) * 100;
return (
<View style={[style, mediaPlayerStyle.container]}>
<Video source={{ uri: 'file:///' + fileInfo.download_path }}
ref={(ref: Video) => { this.video = ref }}
resizeMode={this.state.resizeMode}
playInBackground={true}
style={mediaPlayerStyle.player}
rate={this.state.rate}
volume={this.state.volume}
paused={this.state.paused}
onLoad={this.onLoad}
onProgress={this.onProgress}
onEnd={this.onEnd}
/>
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.showPlayerControls}>
{this.renderPlayerControls()}
</TouchableOpacity>
<View style={mediaPlayerStyle.trackingControls}>
<View style={mediaPlayerStyle.progress} onLayout={(evt) => this.seekerWidth = evt.nativeEvent.layout.width}>
<View style={[mediaPlayerStyle.innerProgressCompleted, { flex: flexCompleted }]} />
<View style={[mediaPlayerStyle.innerProgressRemaining, { flex: flexRemaining }]} />
</View>
</View>
{this.state.areControlsVisible &&
<View style={[mediaPlayerStyle.seekerHandle, { left: this.state.seekerPosition }]} { ...this.seekResponder.panHandlers }>
<View style={this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle} />
</View>}
</View>
);
}
}
export default MediaPlayer;
-6
View File
@@ -1,6 +0,0 @@
import { connect } from 'react-redux';
import NsfwOverlay from './view';
const perform = dispatch => ({});
export default connect(null, perform)(NsfwOverlay);
-15
View File
@@ -1,15 +0,0 @@
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
import discoverStyle from '../../styles/discover';
class NsfwOverlay extends React.PureComponent {
render() {
return (
<TouchableOpacity style={discoverStyle.overlay} activeOpacity={0.95} onPress={this.props.onPress}>
<Text style={discoverStyle.overlayText}>This content is Not Safe For Work. To view adult content, please change your Settings.</Text>
</TouchableOpacity>
)
}
}
export default NsfwOverlay;
-10
View File
@@ -1,10 +0,0 @@
import { connect } from 'react-redux';
import { doSearch, doUpdateSearchQuery } from 'lbry-redux';
import SearchInput from './view';
const perform = dispatch => ({
search: search => dispatch(doSearch(search)),
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query, false))
});
export default connect(null, perform)(SearchInput);
-40
View File
@@ -1,40 +0,0 @@
import React from 'react';
import { TextInput } from 'react-native';
class SearchInput extends React.PureComponent {
static INPUT_TIMEOUT = 500;
state = {
changeTextTimeout: -1
};
handleChangeText = text => {
clearTimeout(this.state.changeTextTimeout);
if (!text || text.trim().length < 2) {
// only perform a search if 2 or more characters have been input
return;
}
const { search, updateSearchQuery } = this.props;
updateSearchQuery(text);
let timeout = setTimeout(() => {
search(text);
}, SearchInput.INPUT_TIMEOUT);
this.setState({ changeTextTimeout: timeout });
}
render() {
const { style, value } = this.props;
return (
<TextInput
style={style}
placeholder="Search"
underlineColorAndroid="transparent"
value={value}
onChangeText={text => this.handleChangeText(text)} />
);
}
}
export default SearchInput;
@@ -1,24 +0,0 @@
import { connect } from 'react-redux';
import {
doResolveUri,
makeSelectClaimForUri,
makeSelectMetadataForUri,
makeSelectFileInfoForUri,
makeSelectIsUriResolving,
} from 'lbry-redux';
import { selectShowNsfw } from '../../redux/selectors/settings';
import SearchResultItem from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
isDownloaded: !!makeSelectFileInfoForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
obscureNsfw: !selectShowNsfw(state)
});
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri))
});
export default connect(select, perform)(SearchResultItem);
@@ -1,53 +0,0 @@
import React from 'react';
import { normalizeURI, parseURI } from 'lbry-redux';
import { Text, TouchableOpacity, View } from 'react-native';
import FileItemMedia from '../fileItemMedia';
import NsfwOverlay from '../../component/nsfwOverlay';
import searchStyle from '../../styles/search';
class SearchResultItem extends React.PureComponent {
render() {
const {
claim,
metadata,
isResolvingUri,
showUri,
isDownloaded,
style,
onPress,
navigation
} = this.props;
const uri = normalizeURI(this.props.uri);
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
const title = metadata && metadata.title ? metadata.title : parseURI(uri).contentName;
let name;
let channel;
if (claim) {
name = claim.name;
channel = claim.channel_name;
}
return (
<View style={style}>
<TouchableOpacity style={style} onPress={onPress}>
<View style={searchStyle.thumbnailContainer}>
<FileItemMedia style={searchStyle.thumbnail}
blurRadius={obscureNsfw ? 15 : 0}
title={title}
thumbnail={metadata ? metadata.thumbnail : null} />
</View>
<View style={searchStyle.detailsContainer}>
{isResolvingUri && <Text style={searchStyle.loading}>Loading...</Text>}
{!isResolvingUri && <Text style={searchStyle.title}>{title || name}</Text>}
{!isResolvingUri && channel && <Text style={searchStyle.publisher}>{channel}</Text>}
</View>
</TouchableOpacity>
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate('Settings')} />}
</View>
);
}
}
export default SearchResultItem;
-119
View File
@@ -1,119 +0,0 @@
import React from 'react';
import { Provider, connect } from 'react-redux';
import DiscoverPage from './page/discover';
import { AppRegistry, AppState, StyleSheet, Text, View, AsyncStorage, NativeModules } from 'react-native';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import {
StackNavigator, addNavigationHelpers
} from 'react-navigation';
import { AppNavigator } from './component/AppNavigator';
import AppWithNavigationState from './component/AppNavigator';
import { persistStore, autoRehydrate } from 'redux-persist';
import createCompressor from 'redux-persist-transform-compress';
import createFilter from 'redux-persist-transform-filter';
import thunk from 'redux-thunk';
import {
Lbry,
claimsReducer,
costInfoReducer,
fileInfoReducer,
searchReducer,
walletReducer
} from 'lbry-redux';
import settingsReducer from './redux/reducers/settings';
import { reactNavigationMiddleware } from './utils/redux';
function isFunction(object) {
return typeof object === 'function';
}
function isNotFunction(object) {
return !isFunction(object);
}
function createBulkThunkMiddleware() {
return ({ dispatch, getState }) => next => action => {
if (action.type === 'BATCH_ACTIONS') {
action.actions.filter(isFunction).map(actionFn => actionFn(dispatch, getState));
}
return next(action);
};
}
function enableBatching(reducer) {
return function batchingReducer(state, action) {
switch (action.type) {
case 'BATCH_ACTIONS':
return action.actions.filter(isNotFunction).reduce(batchingReducer, state);
default:
return reducer(state, action);
}
};
}
const router = AppNavigator.router;
const navAction = router.getActionForPathAndParams('Splash');
const initialNavState = router.getStateForAction(navAction);
const navigatorReducer = (state = initialNavState, action) => {
const nextState = AppNavigator.router.getStateForAction(action, state);
return nextState || state;
};
const reducers = combineReducers({
claims: claimsReducer,
costInfo: costInfoReducer,
fileInfo: fileInfoReducer,
search: searchReducer,
wallet: walletReducer,
nav: navigatorReducer,
settings: settingsReducer
});
const bulkThunk = createBulkThunkMiddleware();
const middleware = [thunk, bulkThunk, reactNavigationMiddleware];
// eslint-disable-next-line no-underscore-dangle
const composeEnhancers = compose;
const store = createStore(
enableBatching(reducers),
{}, // initial state,
composeEnhancers(
autoRehydrate(),
applyMiddleware(...middleware)
)
);
const compressor = createCompressor();
const saveClaimsFilter = createFilter('claims', ['byId', 'claimsByUri']);
const subscriptionsFilter = createFilter('subscriptions', ['subscriptions']);
const settingsFilter = createFilter('settings', ['clientSettings']);
const persistOptions = {
whitelist: ['claims', 'subscriptions', 'settings'],
// Order is important. Needs to be compressed last or other transforms can't
// read the data
transforms: [saveClaimsFilter, subscriptionsFilter, settingsFilter, compressor],
debounce: 10000,
storage: AsyncStorage
};
persistStore(store, persistOptions, err => {
if (err) {
console.log('Unable to load saved SETTINGS');
}
});
class LBRYApp extends React.Component {
render() {
return (
<Provider store={store}>
<AppWithNavigationState />
</Provider>
);
}
}
AppRegistry.registerComponent('LBRYApp', () => LBRYApp);
export default LBRYApp;
+91
View File
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.lbry.browser"
android:installLocation="auto">
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider"/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_lbry" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/lbryGreen" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id"/>
<meta-data android:name="wakelock" android:value="0"/>
<activity
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:name=".MainActivity"
android:label="@string/app_name"
android:supportsPictureInPicture="true"
android:theme="@style/AppTheme.NoActionBar"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="lbry" />
</intent-filter>
</activity>
<activity
android:name=".FirstRunActivity"
android:launchMode="singleTask"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme.NoActionBarTranslucent" />
<activity
android:name=".VerificationActivity"
android:launchMode="singleTask"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme.NoActionBarTranslucent"
android:windowSoftInputMode="adjustResize" />
<service
android:name="io.lbry.browser.LbrynetMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<provider
android:name="io.lbry.browser.LocalFileProvider"
android:authorities="io.lbry.browser.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
</application>
</manifest>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@@ -0,0 +1,139 @@
package io.lbry.browser;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.text.HtmlCompat;
import androidx.preference.PreferenceManager;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.Lbryio;
public class FirstRunActivity extends AppCompatActivity {
private BroadcastReceiver sdkReadyReceiver;
private BroadcastReceiver authReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_first_run);
TextView welcomeTos = findViewById(R.id.welcome_text_view_tos);
welcomeTos.setMovementMethod(LinkMovementMethod.getInstance());
welcomeTos.setText(HtmlCompat.fromHtml(getString(R.string.welcome_tos), HtmlCompat.FROM_HTML_MODE_LEGACY));
findViewById(R.id.welcome_link_use_lbry).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finishFirstRun();
}
});
registerAuthReceiver();
if (!Lbry.SDK_READY) {
findViewById(R.id.welcome_wait_container).setVisibility(View.VISIBLE);
IntentFilter filter = new IntentFilter();
filter.addAction(MainActivity.ACTION_SDK_READY);
sdkReadyReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// authenticate after we receive the sdk ready event
authenticate();
}
};
registerReceiver(sdkReadyReceiver, filter);
} else {
authenticate();
}
}
public void onResume() {
super.onResume();
LbryAnalytics.setCurrentScreen(this, "First Run", "FirstRun");
}
private void registerAuthReceiver() {
IntentFilter filter = new IntentFilter();
filter.addAction(MainActivity.ACTION_USER_AUTHENTICATION_SUCCESS);
filter.addAction(MainActivity.ACTION_USER_AUTHENTICATION_FAILED);
authReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (MainActivity.ACTION_USER_AUTHENTICATION_SUCCESS.equals(intent.getAction())) {
handleAuthenticationSuccess();
} else {
handleAuthenticationFailed();
}
}
};
registerReceiver(authReceiver, filter);
}
private void handleAuthenticationSuccess() {
// first_auth completed event
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
boolean firstAuthCompleted = sp.getBoolean(MainActivity.PREFERENCE_KEY_INTERNAL_FIRST_AUTH_COMPLETED, false);
if (!firstAuthCompleted) {
LbryAnalytics.logEvent(LbryAnalytics.EVENT_FIRST_USER_AUTH);
sp.edit().putBoolean(MainActivity.PREFERENCE_KEY_INTERNAL_FIRST_AUTH_COMPLETED, true).apply();
}
findViewById(R.id.welcome_wait_container).setVisibility(View.GONE);
findViewById(R.id.welcome_display).setVisibility(View.VISIBLE);
findViewById(R.id.welcome_link_use_lbry).setVisibility(View.VISIBLE);
}
private void handleAuthenticationFailed() {
findViewById(R.id.welcome_progress_bar).setVisibility(View.GONE);
((TextView) findViewById(R.id.welcome_wait_text)).setText(R.string.startup_failed);
}
private void authenticate() {
new AuthenticateTask(this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void finishFirstRun() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
sp.edit().putBoolean(MainActivity.PREFERENCE_KEY_INTERNAL_FIRST_RUN_COMPLETED, true).apply();
// first_run_completed event
LbryAnalytics.logEvent(LbryAnalytics.EVENT_FIRST_RUN_COMPLETED);
finish();
}
@Override
public void onBackPressed() {
return;
}
@Override
protected void onDestroy() {
Helper.unregisterReceiver(authReceiver, this);
Helper.unregisterReceiver(sdkReadyReceiver, this);
super.onDestroy();
}
private static class AuthenticateTask extends AsyncTask<Void, Void, Void> {
private Context context;
public AuthenticateTask(Context context) {
this.context = context;
}
protected Void doInBackground(Void... params) {
Lbryio.authenticate(context);
return null;
}
}
}
@@ -0,0 +1,161 @@
package io.lbry.browser;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.PreferenceManager;
import android.util.Log;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.lbrysdk.LbrynetService;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class LbrynetMessagingService extends FirebaseMessagingService {
private static final String TAG = "LbrynetMessagingService";
private static final String NOTIFICATION_CHANNEL_ID = "io.lbry.browser.LBRY_ENGAGEMENT_CHANNEL";
private static final String TYPE_SUBSCRIPTION = "subscription";
private static final String TYPE_REWARD = "reward";
private static final String TYPE_INTERESTS = "interests";
private static final String TYPE_CREATOR = "creator";
private FirebaseAnalytics firebaseAnalytics;
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (firebaseAnalytics == null) {
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
Map<String, String> payload = remoteMessage.getData();
if (payload != null) {
String type = payload.get("type");
String url = payload.get("target");
String title = payload.get("title");
String body = payload.get("body");
String name = payload.get("name"); // notification name
String contentTitle = payload.get("content_title");
String channelUrl = payload.get("channel_url");
//String publishTime = payload.get("publish_time");
String publishTime = null;
if (type != null && getEnabledTypes().indexOf(type) > -1 && body != null && body.trim().length() > 0) {
// only log the receive event for valid notifications received
if (firebaseAnalytics != null) {
Bundle bundle = new Bundle();
bundle.putString("name", name);
firebaseAnalytics.logEvent(LbryAnalytics.EVENT_LBRY_NOTIFICATION_RECEIVE, bundle);
}
sendNotification(title, body, type, url, name, contentTitle, channelUrl, publishTime);
}
}
}
@Override
public void onNewToken(String token) {
Log.d(TAG, "Refreshed token: " + token);
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
// Instance ID token to your app server.
sendRegistrationToServer(token);
}
/**
* Persist token to third-party servers.
*
* Modify this method to associate the user's FCM InstanceID token with any server-side account
* maintained by your application.
*
* @param token The new token.
*/
private void sendRegistrationToServer(String token) {
// TODO: Implement this method to send token to your app server.
}
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String title, String messageBody, String type, String url, String name,
String contentTitle, String channelUrl, String publishTime) {
//Intent intent = new Intent(this, MainActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (url == null) {
if (TYPE_REWARD.equals(type)) {
url = "lbry://?rewards";
} else {
// default to home page
url = "lbry://?discover";
}
}
Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
launchIntent.putExtra("notification_name", name);
launchIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setColor(ContextCompat.getColor(this, R.color.lbryGreen))
.setSmallIcon(R.drawable.ic_lbry)
.setContentTitle(title)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// Since android Oreo notification channel is needed.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID, "LBRY Engagement", NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
notificationManager.notify(3, notificationBuilder.build());
}
public List<String> getEnabledTypes() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
List<String> enabledTypes = new ArrayList<String>();
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_SUBSCRIPTIONS, true)) {
enabledTypes.add(TYPE_SUBSCRIPTION);
}
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_REWARDS, true)) {
enabledTypes.add(TYPE_REWARD);
}
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_CONTENT_INTERESTS, true)) {
enabledTypes.add(TYPE_INTERESTS);
}
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_CREATOR, true)) {
enabledTypes.add(TYPE_CREATOR);
}
return enabledTypes;
}
}
@@ -0,0 +1,7 @@
package io.lbry.browser;
import androidx.core.content.FileProvider;
public class LocalFileProvider extends FileProvider {
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,272 @@
package io.lbry.browser;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.snackbar.Snackbar;
import java.util.Arrays;
import io.lbry.browser.adapter.VerificationPagerAdapter;
import io.lbry.browser.listener.SignInListener;
import io.lbry.browser.listener.WalletSyncListener;
import io.lbry.browser.model.lbryinc.User;
import io.lbry.browser.tasks.lbryinc.FetchCurrentUserTask;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.Lbryio;
public class VerificationActivity extends FragmentActivity implements SignInListener, WalletSyncListener {
public static final int VERIFICATION_FLOW_SIGN_IN = 1;
public static final int VERIFICATION_FLOW_REWARDS = 2;
public static final int VERIFICATION_FLOW_WALLET = 3;
private String email;
private boolean signedIn;
private int flow;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
signedIn = Lbryio.isSignedIn();
Intent intent = getIntent();
if (intent != null) {
flow = intent.getIntExtra("flow", -1);
if (flow == -1 || (flow == VERIFICATION_FLOW_SIGN_IN && signedIn)) {
// no flow specified (or user is already signed in), just exit
setResult(signedIn ? RESULT_OK : RESULT_CANCELED);
finish();
return;
}
}
if (!Arrays.asList(VERIFICATION_FLOW_SIGN_IN, VERIFICATION_FLOW_REWARDS, VERIFICATION_FLOW_WALLET).contains(flow)) {
// invalid flow specified
setResult(RESULT_CANCELED);
finish();
return;
}
setContentView(R.layout.activity_verification);
ViewPager2 viewPager = findViewById(R.id.verification_pager);
viewPager.setUserInputEnabled(false);
viewPager.setSaveEnabled(false);
viewPager.setAdapter(new VerificationPagerAdapter(this));
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
findViewById(R.id.verification_close_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setResult(RESULT_CANCELED);
finish();
}
});
}
public void onResume() {
super.onResume();
LbryAnalytics.setCurrentScreen(this, "Verification", "Verification");
checkFlow();
}
public void checkFlow() {
ViewPager2 viewPager = findViewById(R.id.verification_pager);
if (Lbryio.isSignedIn()) {
boolean flowHandled = false;
if (flow == VERIFICATION_FLOW_WALLET) {
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_WALLET, false);
flowHandled = true;
} else if (flow == VERIFICATION_FLOW_REWARDS) {
User user = Lbryio.currentUser;
if (!user.isIdentityVerified()) {
// phone number verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_PHONE, false);
flowHandled = true;
} else if (!user.isRewardApproved()) {
// manual verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_MANUAL, false);
flowHandled = true;
}
}
if (!flowHandled) {
// user has already been verified and or reward approved
setResult(RESULT_CANCELED);
finish();
return;
}
}
}
public void showLoading() {
findViewById(R.id.verification_loading_progress).setVisibility(View.VISIBLE);
findViewById(R.id.verification_pager).setVisibility(View.INVISIBLE);
findViewById(R.id.verification_close_button).setVisibility(View.GONE);
}
public void hideLoading() {
findViewById(R.id.verification_loading_progress).setVisibility(View.GONE);
findViewById(R.id.verification_pager).setVisibility(View.VISIBLE);
}
@Override
public void onBackPressed() {
// ignore back press
return;
}
public void onEmailAdded(String email) {
this.email = email;
findViewById(R.id.verification_close_button).setVisibility(View.GONE);
Bundle bundle = new Bundle();
bundle.putString("email", email);
LbryAnalytics.logEvent(LbryAnalytics.EVENT_EMAIL_ADDED, bundle);
}
public void onEmailEdit() {
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
}
public void onEmailVerified() {
Snackbar.make(findViewById(R.id.verification_pager), R.string.sign_in_successful, Snackbar.LENGTH_LONG).show();
sendBroadcast(new Intent(MainActivity.ACTION_USER_SIGN_IN_SUCCESS));
Bundle bundle = new Bundle();
bundle.putString("email", email);
LbryAnalytics.logEvent(LbryAnalytics.EVENT_EMAIL_VERIFIED, bundle);
if (flow == VERIFICATION_FLOW_SIGN_IN) {
final Intent resultIntent = new Intent();
resultIntent.putExtra("flow", VERIFICATION_FLOW_SIGN_IN);
resultIntent.putExtra("email", email);
// only sign in required, don't do anything else
showLoading();
FetchCurrentUserTask task = new FetchCurrentUserTask(new FetchCurrentUserTask.FetchUserTaskHandler() {
@Override
public void onSuccess(User user) {
Lbryio.currentUser = user;
setResult(RESULT_OK, resultIntent);
finish();
}
@Override
public void onError(Exception error) {
showFetchUserError(error.getMessage());
hideLoading();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
// change pager view depending on flow
showLoading();
FetchCurrentUserTask task = new FetchCurrentUserTask(new FetchCurrentUserTask.FetchUserTaskHandler() {
@Override
public void onSuccess(User user) {
hideLoading();
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
Lbryio.currentUser = user;
ViewPager2 viewPager = findViewById(R.id.verification_pager);
// for rewards, (show phone verification if not done, or manual verification if required)
if (flow == VERIFICATION_FLOW_REWARDS) {
if (!user.isIdentityVerified()) {
// phone number verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_PHONE, false);
} else if (!user.isRewardApproved()) {
// manual verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_MANUAL, false);
} else {
// fully verified
setResult(RESULT_OK);
finish();
}
} else if (flow == VERIFICATION_FLOW_WALLET) {
// for wallet sync, if password unlock is required, show password entry page
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_WALLET, false);
}
}
@Override
public void onError(Exception error) {
showFetchUserError(error.getMessage());
hideLoading();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
@Override
public void onPhoneAdded(String countryCode, String phoneNumber) {
}
@Override
public void onPhoneVerified() {
showLoading();
FetchCurrentUserTask task = new FetchCurrentUserTask(new FetchCurrentUserTask.FetchUserTaskHandler() {
@Override
public void onSuccess(User user) {
Lbryio.currentUser = user;
if (user.isIdentityVerified() && user.isRewardApproved()) {
// verified for rewards
LbryAnalytics.logEvent(LbryAnalytics.EVENT_REWARD_ELIGIBILITY_COMPLETED);
setResult(RESULT_OK);
finish();
return;
}
// show manual verification page if the user is still not reward approved
ViewPager2 viewPager = findViewById(R.id.verification_pager);
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_MANUAL, false);
hideLoading();
}
@Override
public void onError(Exception error) {
showFetchUserError(error.getMessage());
hideLoading();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void showFetchUserError(String message) {
Snackbar.make(findViewById(R.id.verification_pager), message, Snackbar.LENGTH_LONG).
setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
@Override
public void onManualVerifyContinue() {
setResult(RESULT_OK);
finish();
}
@Override
public void onWalletSyncProcessing() {
findViewById(R.id.verification_close_button).setVisibility(View.GONE);
}
@Override
public void onWalletSyncWaitingForInput() {
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
}
@Override
public void onWalletSyncEnabled() {
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
setResult(RESULT_OK);
finish();
}
@Override
public void onWalletSyncFailed(Exception error) {
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
}
}
@@ -0,0 +1,125 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.Claim;
import io.lbry.browser.listener.ChannelItemSelectionListener;
import io.lbry.browser.utils.Helper;
import lombok.Getter;
import lombok.Setter;
public class ChannelFilterListAdapter extends RecyclerView.Adapter<ChannelFilterListAdapter.ViewHolder> {
private Context context;
private List<Claim> items;
@Getter
@Setter
private Claim selectedItem;
@Setter
private ChannelItemSelectionListener listener;
public ChannelFilterListAdapter(Context context) {
this.context = context;
this.items = new ArrayList<>();
// Always list the placeholder as the first item
Claim claim = new Claim();
claim.setPlaceholder(true);
items.add(claim);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected View mediaContainer;
protected View alphaContainer;
protected View allView;
protected ImageView thumbnailView;
protected TextView alphaView;
protected TextView titleView;
public ViewHolder(View v) {
super(v);
mediaContainer = v.findViewById(R.id.channel_filter_media_container);
alphaContainer = v.findViewById(R.id.channel_filter_no_thumbnail);
alphaView = v.findViewById(R.id.channel_filter_alpha_view);
thumbnailView = v.findViewById(R.id.channel_filter_thumbnail);
titleView = v.findViewById(R.id.channel_filter_title);
allView = v.findViewById(R.id.channel_filter_all_container);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public boolean isClaimSelected(Claim claim) {
return claim.equals(selectedItem);
}
public void clearClaims() {
items = new ArrayList<>(items.subList(0, 1));
notifyDataSetChanged();
}
public void addClaims(List<Claim> claims) {
for (Claim claim : claims) {
if (!items.contains(claim)) {
items.add(claim);
}
}
notifyDataSetChanged();
}
@Override
public ChannelFilterListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_channel_filter, root, false);
return new ChannelFilterListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(ChannelFilterListAdapter.ViewHolder vh, int position) {
Claim claim = items.get(position);
vh.alphaView.setVisibility(claim.isPlaceholder() ? View.GONE : View.VISIBLE);
vh.titleView.setVisibility(claim.isPlaceholder() ? View.INVISIBLE : View.VISIBLE);
vh.allView.setVisibility(claim.isPlaceholder() ? View.VISIBLE : View.GONE);
vh.titleView.setText(Helper.isNullOrEmpty(claim.getTitle()) ? claim.getName() : claim.getTitle());
String thumbnailUrl = claim.getThumbnailUrl();
if (!Helper.isNullOrEmpty(thumbnailUrl) && context != null) {
Glide.with(context.getApplicationContext()).load(thumbnailUrl).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
}
vh.alphaContainer.setVisibility(claim.isPlaceholder() || Helper.isNullOrEmpty(thumbnailUrl) ? View.VISIBLE : View.GONE);
vh.thumbnailView.setVisibility(claim.isPlaceholder() || Helper.isNullOrEmpty(thumbnailUrl) ? View.GONE : View.VISIBLE);
vh.alphaView.setText(claim.isPlaceholder() ? null : claim.getName() != null ? claim.getName().substring(1, 2) : "");
int bgColor = Helper.generateRandomColorForValue(claim.getClaimId());
Helper.setIconViewBackgroundColor(vh.alphaContainer, bgColor, claim.isPlaceholder(), context);
vh.itemView.setSelected(isClaimSelected(claim));
vh.itemView.setOnClickListener(view -> {
if (claim.isPlaceholder()) {
selectedItem = null;
if (listener != null) {
listener.onChannelSelectionCleared();
}
} else if (!claim.equals(selectedItem)) {
selectedItem = claim;
if (listener != null) {
listener.onChannelItemSelected(claim);
}
}
notifyDataSetChanged();
});
}
}
@@ -0,0 +1,496 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.snackbar.Snackbar;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.listener.SelectionModeListener;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.LbryFile;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
import io.lbry.browser.utils.Lbryio;
import lombok.Getter;
import lombok.Setter;
public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.ViewHolder> {
private static final int VIEW_TYPE_STREAM = 1;
private static final int VIEW_TYPE_CHANNEL = 2;
private static final int VIEW_TYPE_FEATURED = 3; // featured search result
private Map<String, Claim> quickClaimIdMap;
private Map<String, Claim> quickClaimUrlMap;
private Map<String, Boolean> notFoundClaimIdMap;
private Map<String, Boolean> notFoundClaimUrlMap;
@Setter
private boolean hideFee;
@Setter
private boolean canEnterSelectionMode;
private Context context;
private List<Claim> items;
private List<Claim> selectedItems;
@Setter
private ClaimListItemListener listener;
@Getter
@Setter
private boolean inSelectionMode;
@Setter
private SelectionModeListener selectionModeListener;
private float scale;
public ClaimListAdapter(List<Claim> items, Context context) {
this.context = context;
this.items = new ArrayList<>(items);
this.selectedItems = new ArrayList<>();
quickClaimIdMap = new HashMap<>();
quickClaimUrlMap = new HashMap<>();
notFoundClaimIdMap = new HashMap<>();
notFoundClaimUrlMap = new HashMap<>();
if (context != null) {
scale = context.getResources().getDisplayMetrics().density;
}
}
public List<Claim> getSelectedItems() {
return this.selectedItems;
}
public int getSelectedCount() {
return selectedItems != null ? selectedItems.size() : 0;
}
public void clearSelectedItems() {
this.selectedItems.clear();
}
public boolean isClaimSelected(Claim claim) {
return selectedItems.contains(claim);
}
public Claim getFeaturedItem() {
for (Claim claim : items) {
if (claim.isFeatured()) {
return claim;
}
}
return null;
}
public void removeFeaturedItem() {
int featuredIndex = -1;
for (int i = 0; i < items.size(); i++) {
if (items.get(i).isFeatured()) {
featuredIndex = i;
break;
}
}
if (featuredIndex > -1) {
items.remove(featuredIndex);
}
}
public List<Claim> getItems() {
return new ArrayList<>(this.items);
}
public void updateSigningChannelForClaim(Claim resolvedClaim) {
for (Claim claim : items) {
if (claim.getClaimId().equalsIgnoreCase(resolvedClaim.getClaimId())) {
claim.setSigningChannel(resolvedClaim.getSigningChannel());
}
}
}
public void clearItems() {
clearSelectedItems();
this.items.clear();
quickClaimIdMap.clear();
quickClaimUrlMap.clear();
notFoundClaimIdMap.clear();
notFoundClaimUrlMap.clear();
notifyDataSetChanged();
}
public Claim getLastItem() {
return items.size() > 0 ? items.get(items.size() - 1) : null;
}
public void addFeaturedItem(Claim claim) {
items.add(0, claim);
notifyDataSetChanged();
}
public void addItems(List<Claim> claims) {
for (Claim claim : claims) {
if (!items.contains(claim)) {
items.add(claim);
}
}
notFoundClaimUrlMap.clear();
notFoundClaimIdMap.clear();
notifyDataSetChanged();
}
public void setItems(List<Claim> claims) {
items = new ArrayList<>(claims);
notifyDataSetChanged();
}
public void removeItems(List<Claim> claims) {
items.removeAll(claims);
notifyDataSetChanged();
}
public void removeItem(Claim claim) {
items.remove(claim);
selectedItems.remove(claim);
notifyDataSetChanged();
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected View feeContainer;
protected TextView feeView;
protected ImageView thumbnailView;
protected View noThumbnailView;
protected TextView alphaView;
protected TextView vanityUrlView;
protected TextView durationView;
protected TextView titleView;
protected TextView publisherView;
protected TextView publishTimeView;
protected TextView pendingTextView;
protected View repostInfoView;
protected TextView repostChannelView;
protected View selectedOverlayView;
protected TextView fileSizeView;
protected ProgressBar downloadProgressView;
protected TextView deviceView;
public ViewHolder(View v) {
super(v);
feeContainer = v.findViewById(R.id.claim_fee_container);
feeView = v.findViewById(R.id.claim_fee);
alphaView = v.findViewById(R.id.claim_thumbnail_alpha);
noThumbnailView = v.findViewById(R.id.claim_no_thumbnail);
thumbnailView = v.findViewById(R.id.claim_thumbnail);
vanityUrlView = v.findViewById(R.id.claim_vanity_url);
durationView = v.findViewById(R.id.claim_duration);
titleView = v.findViewById(R.id.claim_title);
publisherView = v.findViewById(R.id.claim_publisher);
publishTimeView = v.findViewById(R.id.claim_publish_time);
pendingTextView = v.findViewById(R.id.claim_pending_text);
repostInfoView = v.findViewById(R.id.claim_repost_info);
repostChannelView = v.findViewById(R.id.claim_repost_channel);
selectedOverlayView = v.findViewById(R.id.claim_selected_overlay);
fileSizeView = v.findViewById(R.id.claim_file_size);
downloadProgressView = v.findViewById(R.id.claim_download_progress);
deviceView = v.findViewById(R.id.claim_view_device);
}
}
@Override
public int getItemCount() {
return items != null ? items.size() : 0;
}
@Override
public int getItemViewType(int position) {
if (items.get(position).isFeatured()) {
return VIEW_TYPE_FEATURED;
}
Claim claim = items.get(position);
String valueType = items.get(position).getValueType();
Claim actualClaim = Claim.TYPE_REPOST.equalsIgnoreCase(valueType) ? claim.getRepostedClaim() : claim;
return Claim.TYPE_CHANNEL.equalsIgnoreCase(actualClaim.getValueType()) ? VIEW_TYPE_CHANNEL : VIEW_TYPE_STREAM;
}
public void updateFileForClaimByIdOrUrl(LbryFile file, String claimId, String url) {
updateFileForClaimByIdOrUrl(file, claimId, url, false);
}
public void updateFileForClaimByIdOrUrl(LbryFile file, String claimId, String url, boolean skipNotFound) {
if (!skipNotFound) {
if (notFoundClaimIdMap.containsKey(claimId) && notFoundClaimUrlMap.containsKey(url)) {
return;
}
}
if (quickClaimIdMap.containsKey(claimId)) {
quickClaimIdMap.get(claimId).setFile(file);
notifyDataSetChanged();
return;
}
if (quickClaimUrlMap.containsKey(claimId)) {
quickClaimUrlMap.get(claimId).setFile(file);
notifyDataSetChanged();
return;
}
boolean claimFound = false;
for (int i = 0; i < items.size(); i++) {
Claim claim = items.get(i);
if (claimId.equalsIgnoreCase(claim.getClaimId()) || url.equalsIgnoreCase(claim.getPermanentUrl())) {
quickClaimIdMap.put(claimId, claim);
quickClaimUrlMap.put(url, claim);
claim.setFile(file);
notifyDataSetChanged();
claimFound = true;
break;
}
}
if (!claimFound) {
notFoundClaimIdMap.put(claimId, true);
notFoundClaimUrlMap.put(url, true);
}
}
public void clearFileForClaimOrUrl(String outpoint, String url) {
clearFileForClaimOrUrl(outpoint, url, false);
notifyDataSetChanged();
}
public void clearFileForClaimOrUrl(String outpoint, String url, boolean remove) {
int claimIndex = -1;
for (int i = 0; i < items.size(); i++) {
Claim claim = items.get(i);
if (outpoint.equalsIgnoreCase(claim.getOutpoint()) || url.equalsIgnoreCase(claim.getPermanentUrl())) {
claimIndex = i;
claim.setFile(null);
break;
}
}
if (remove && claimIndex > -1) {
Claim removed = items.remove(claimIndex);
selectedItems.remove(removed);
}
notifyDataSetChanged();
}
@Override
public ClaimListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
int viewResourceId = -1;
switch (viewType) {
case VIEW_TYPE_FEATURED: viewResourceId = R.layout.list_item_featured_search_result; break;
case VIEW_TYPE_CHANNEL: viewResourceId = R.layout.list_item_channel; break;
case VIEW_TYPE_STREAM: default: viewResourceId = R.layout.list_item_stream; break;
}
View v = LayoutInflater.from(context).inflate(viewResourceId, parent, false);
return new ClaimListAdapter.ViewHolder(v);
}
public int getScaledValue(int value) {
return (int) (value * scale + 0.5f);
}
@Override
public void onBindViewHolder(ClaimListAdapter.ViewHolder vh, int position) {
int type = getItemViewType(position);
int paddingTop = position == 0 ? 16 : 8;
int paddingBottom = position == getItemCount() - 1 ? 16 : 8;
int paddingTopScaled = getScaledValue(paddingTop);
int paddingBottomScaled = getScaledValue(paddingBottom);
vh.itemView.setPadding(vh.itemView.getPaddingLeft(), paddingTopScaled, vh.itemView.getPaddingRight(), paddingBottomScaled);
Claim original = items.get(position);
boolean isRepost = Claim.TYPE_REPOST.equalsIgnoreCase(original.getValueType());
final Claim item = Claim.TYPE_REPOST.equalsIgnoreCase(original.getValueType()) ? original.getRepostedClaim() : original;
Claim.GenericMetadata metadata = item.getValue();
Claim signingChannel = item.getSigningChannel();
Claim.StreamMetadata streamMetadata = null;
if (metadata instanceof Claim.StreamMetadata) {
streamMetadata = (Claim.StreamMetadata) metadata;
}
String thumbnailUrl = item.getThumbnailUrl();
long publishTime = (streamMetadata != null && streamMetadata.getReleaseTime() > 0) ? streamMetadata.getReleaseTime() * 1000 : item.getTimestamp() * 1000;
int bgColor = Helper.generateRandomColorForValue(item.getClaimId());
if (bgColor == 0) {
bgColor = Helper.generateRandomColorForValue(item.getName());
}
boolean isPending = item.getConfirmations() == 0;
boolean isSelected = isClaimSelected(item);
vh.itemView.setSelected(isSelected);
vh.selectedOverlayView.setVisibility(isSelected ? View.VISIBLE : View.GONE);
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isPending) {
Snackbar.make(vh.itemView, R.string.item_pending_blockchain, Snackbar.LENGTH_LONG).show();
return;
}
if (inSelectionMode) {
toggleSelectedClaim(original);
} else {
if (listener != null) {
listener.onClaimClicked(item);
}
}
}
});
vh.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (!canEnterSelectionMode) {
return false;
}
if (isPending) {
Snackbar.make(vh.itemView, R.string.item_pending_blockchain, Snackbar.LENGTH_LONG).show();
return false;
}
if (!inSelectionMode) {
inSelectionMode = true;
if (selectionModeListener != null) {
selectionModeListener.onEnterSelectionMode();
}
}
toggleSelectedClaim(original);
return true;
}
});
vh.publisherView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null && signingChannel != null) {
listener.onClaimClicked(signingChannel);
}
}
});
vh.publishTimeView.setVisibility(!isPending ? View.VISIBLE : View.GONE);
vh.pendingTextView.setVisibility(isPending ? View.VISIBLE : View.GONE);
vh.repostInfoView.setVisibility(isRepost ? View.VISIBLE : View.GONE);
vh.repostChannelView.setText(isRepost ? original.getSigningChannel().getName() : null);
vh.repostChannelView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onClaimClicked(original.getSigningChannel());
}
}
});
vh.titleView.setText(Helper.isNullOrEmpty(item.getTitle()) ? item.getName() : item.getTitle());
if (type == VIEW_TYPE_FEATURED) {
LbryUri vanityUrl = new LbryUri();
vanityUrl.setClaimName(item.getName());
vh.vanityUrlView.setText(vanityUrl.toString());
}
vh.feeContainer.setVisibility(item.isUnresolved() || !Claim.TYPE_STREAM.equalsIgnoreCase(item.getValueType()) ? View.GONE : View.VISIBLE);
vh.noThumbnailView.setVisibility(Helper.isNullOrEmpty(thumbnailUrl) ? View.VISIBLE : View.GONE);
Helper.setIconViewBackgroundColor(vh.noThumbnailView, bgColor, false, context);
if (type == VIEW_TYPE_FEATURED && item.isUnresolved()) {
vh.durationView.setVisibility(View.GONE);
vh.titleView.setText("Nothing here. Publish something!");
vh.alphaView.setText(item.getName().substring(0, Math.min(5, item.getName().length() - 1)));
} else {
if (Claim.TYPE_STREAM.equalsIgnoreCase(item.getValueType())) {
long duration = item.getDuration();
if (!Helper.isNullOrEmpty(thumbnailUrl)) {
Glide.with(context.getApplicationContext()).
load(thumbnailUrl).
centerCrop().
placeholder(R.drawable.bg_thumbnail_placeholder).
into(vh.thumbnailView);
vh.thumbnailView.setVisibility(View.VISIBLE);
} else {
vh.thumbnailView.setVisibility(View.GONE);
}
BigDecimal cost = item.getActualCost(Lbryio.LBCUSDRate);
vh.feeContainer.setVisibility(cost.doubleValue() > 0 && !hideFee ? View.VISIBLE : View.GONE);
vh.feeView.setText(cost.doubleValue() > 0 ? Helper.shortCurrencyFormat(cost.doubleValue()) : "Paid");
vh.alphaView.setText(item.getName().substring(0, Math.min(5, item.getName().length() - 1)));
vh.publisherView.setText(signingChannel != null ? signingChannel.getName() : context.getString(R.string.anonymous));
vh.publishTimeView.setText(DateUtils.getRelativeTimeSpanString(
publishTime, System.currentTimeMillis(), 0, DateUtils.FORMAT_ABBREV_RELATIVE));
vh.durationView.setVisibility(duration > 0 ? View.VISIBLE : View.GONE);
vh.durationView.setText(Helper.formatDuration(duration));
LbryFile claimFile = item.getFile();
boolean isDownloading = false;
int progress = 0;
String fileSizeString = claimFile == null ? null : Helper.formatBytes(claimFile.getTotalBytes(), false);
if (claimFile != null &&
!Helper.isNullOrEmpty(claimFile.getDownloadPath()) &&
!claimFile.isCompleted() &&
claimFile.getWrittenBytes() < claimFile.getTotalBytes()) {
isDownloading = true;
progress = claimFile.getTotalBytes() > 0 ?
Double.valueOf(((double) claimFile.getWrittenBytes() / (double) claimFile.getTotalBytes()) * 100.0).intValue() : 0;
fileSizeString = String.format("%s / %s",
Helper.formatBytes(claimFile.getWrittenBytes(), false),
Helper.formatBytes(claimFile.getTotalBytes(), false));
}
Helper.setViewText(vh.fileSizeView, claimFile != null && !Helper.isNullOrEmpty(claimFile.getDownloadPath()) ? fileSizeString : null);
Helper.setViewVisibility(vh.downloadProgressView, isDownloading ? View.VISIBLE : View.INVISIBLE);
Helper.setViewProgress(vh.downloadProgressView, progress);
Helper.setViewText(vh.deviceView, item.getDevice());
} else if (Claim.TYPE_CHANNEL.equalsIgnoreCase(item.getValueType())) {
if (!Helper.isNullOrEmpty(thumbnailUrl)) {
Glide.with(context.getApplicationContext()).
load(thumbnailUrl).
centerCrop().
placeholder(R.drawable.bg_thumbnail_placeholder).
apply(RequestOptions.circleCropTransform()).
into(vh.thumbnailView);
}
vh.alphaView.setText(item.getName().substring(1, 2).toUpperCase());
vh.publisherView.setText(item.getName());
vh.publishTimeView.setText(DateUtils.getRelativeTimeSpanString(
publishTime, System.currentTimeMillis(), 0, DateUtils.FORMAT_ABBREV_RELATIVE));
}
}
}
private void toggleSelectedClaim(Claim claim) {
if (selectedItems.contains(claim)) {
selectedItems.remove(claim);
} else {
selectedItems.add(claim);
}
if (selectionModeListener != null) {
selectionModeListener.onItemSelectionToggled();
}
if (selectedItems.size() == 0) {
inSelectionMode = false;
if (selectionModeListener != null) {
selectionModeListener.onExitSelectionMode();
}
}
notifyDataSetChanged();
}
public interface ClaimListItemListener {
void onClaimClicked(Claim claim);
}
}
@@ -0,0 +1,117 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.EditorsChoiceItem;
import io.lbry.browser.utils.Helper;
import lombok.Setter;
public class EditorsChoiceItemAdapter extends RecyclerView.Adapter<EditorsChoiceItemAdapter.ViewHolder> {
private static final int VIEW_TYPE_HEADER = 1;
private static final int VIEW_TYPE_CONTENT = 2;
private Context context;
private List<EditorsChoiceItem> items;
@Setter
private EditorsChoiceItemListener listener;
public EditorsChoiceItemAdapter(List<EditorsChoiceItem> items, Context context) {
this.context = context;
this.items = new ArrayList<>(items);
}
public void addFeaturedItem(EditorsChoiceItem item) {
items.add(0, item);
notifyDataSetChanged();
}
public void addItems(List<EditorsChoiceItem> items) {
for (EditorsChoiceItem item : items) {
if (!this.items.contains(item)) {
this.items.add(item);
}
}
notifyDataSetChanged();
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected ImageView thumbnailView;
protected TextView descriptionView;
protected TextView headerView;
protected TextView titleView;
protected View cardView;
public ViewHolder(View v) {
super(v);
cardView = v.findViewById(R.id.editors_choice_content_card);
descriptionView = v.findViewById(R.id.editors_choice_content_description);
titleView = v.findViewById(R.id.editors_choice_content_title);
thumbnailView = v.findViewById(R.id.editors_choice_content_thumbnail);
headerView = v.findViewById(R.id.editors_choice_header_title);
}
}
@Override
public int getItemCount() {
return items != null ? items.size() : 0;
}
@Override
public int getItemViewType(int position) {
return items.get(position).isHeader() ? VIEW_TYPE_HEADER : VIEW_TYPE_CONTENT;
}
@Override
public EditorsChoiceItemAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_editors_choice, parent, false);
return new EditorsChoiceItemAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(EditorsChoiceItemAdapter.ViewHolder vh, int position) {
int type = getItemViewType(position);
EditorsChoiceItem item = items.get(position);
vh.headerView.setVisibility(type == VIEW_TYPE_HEADER ? View.VISIBLE : View.GONE);
vh.cardView.setVisibility(type == VIEW_TYPE_CONTENT ? View.VISIBLE : View.GONE);
vh.headerView.setText(item.getTitle());
vh.titleView.setText(item.getTitle());
vh.descriptionView.setText(item.getDescription());
if (!Helper.isNullOrEmpty(item.getThumbnailUrl())) {
Glide.with(context.getApplicationContext()).
load(item.getThumbnailUrl()).
centerCrop().
placeholder(R.drawable.bg_thumbnail_placeholder).
into(vh.thumbnailView);
}
vh.cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onEditorsChoiceItemClicked(item);
}
}
});
}
public interface EditorsChoiceItemListener {
void onEditorsChoiceItemClicked(EditorsChoiceItem item);
}
}
@@ -0,0 +1,119 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.GalleryItem;
import io.lbry.browser.utils.Helper;
import lombok.Setter;
public class GalleryGridAdapter extends RecyclerView.Adapter<GalleryGridAdapter.ViewHolder> {
private Context context;
private List<GalleryItem> items;
@Setter
private GalleryItemClickListener listener;
public GalleryGridAdapter(List<GalleryItem> items, Context context) {
this.items = new ArrayList<>(items);
this.context = context;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected ImageView thumbnailView;
protected TextView durationView;
public ViewHolder(View v) {
super(v);
thumbnailView = v.findViewById(R.id.gallery_item_thumbnail);
durationView = v.findViewById(R.id.gallery_item_duration);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public void addItem(GalleryItem item) {
if (!items.contains(item)) {
items.add(item);
notifyDataSetChanged();
}
}
public void addItems(List<GalleryItem> items) {
for (GalleryItem item : items) {
if (!this.items.contains(item)) {
this.items.add(item);
notifyDataSetChanged();
}
}
}
public void clearItems() {
items.clear();
notifyDataSetChanged();
}
@Override
public GalleryGridAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_gallery, root, false);
return new GalleryGridAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(GalleryGridAdapter.ViewHolder vh, int position) {
GalleryItem item = items.get(position);
String thumbnailUrl = item.getThumbnailPath();
Glide.with(context.getApplicationContext()).load(thumbnailUrl).centerCrop().into(vh.thumbnailView);
vh.durationView.setVisibility(item.getDuration() > 0 ? View.VISIBLE : View.INVISIBLE);
vh.durationView.setText(item.getDuration() > 0 ? Helper.formatDuration(Double.valueOf(item.getDuration() / 1000.0).longValue()) : null);
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onGalleryItemClicked(item);
}
}
});
}
public interface GalleryItemClickListener {
void onGalleryItemClicked(GalleryItem item);
}
public static class GalleryGridItemDecoration extends RecyclerView.ItemDecoration {
private int spanCount;
private int spacing;
public GalleryGridItemDecoration(int spanCount, int spacing) {
this.spanCount = spanCount;
this.spacing = spacing;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int position = parent.getChildAdapterPosition(view); // item position
int column = position % spanCount; // item column
outRect.left = column * spacing / spanCount; // column * ((1f / spanCount) * spacing)
outRect.right = spacing - (column + 1) * spacing / spanCount; // spacing - (column + 1) * ((1f / spanCount) * spacing)
if (position >= spanCount) {
outRect.top = spacing; // item top
}
}
}
}
@@ -0,0 +1,80 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.database.DataSetObserver;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.Claim;
public class InlineChannelSpinnerAdapter extends ArrayAdapter<Claim> {
private List<Claim> channels;
private int layoutResourceId;
private LayoutInflater inflater;
public InlineChannelSpinnerAdapter(Context context, int resource, List<Claim> channels) {
super(context, resource, 0, channels);
inflater = LayoutInflater.from(context);
layoutResourceId = resource;
this.channels = new ArrayList<>(channels);
}
public void addPlaceholder(boolean includeAnonymous) {
Claim placeholder = new Claim();
placeholder.setPlaceholder(true);
insert(placeholder, 0);
channels.add(0, placeholder);
if (includeAnonymous) {
Claim anonymous = new Claim();
anonymous.setPlaceholderAnonymous(true);
insert(anonymous, 1);
channels.add(1, anonymous);
}
}
public int getItemPosition(Claim item) {
for (int i = 0; i < channels.size(); i++) {
Claim channel = channels.get(i);
if (item.getClaimId().equalsIgnoreCase(channel.getClaimId())) {
return i;
}
}
return -1;
}
@Override
public View getDropDownView(int position, View view, ViewGroup parent) {
return createView(position, view, parent);
}
@Override
public View getView(int position, View view, ViewGroup parent) {
return createView(position, view, parent);
}
private View createView(int position, View convertView, ViewGroup parent){
View view = inflater.inflate(layoutResourceId, parent, false);
Context context = getContext();
Claim channel = getItem(position);
String name = channel.getName();
if (channel.isPlaceholder()) {
name = context.getString(R.string.create_a_channel);
} else if (channel.isPlaceholderAnonymous()) {
name = context.getString(R.string.anonymous);
}
TextView label = view.findViewById(R.id.channel_item_name);
label.setText(name);
return view;
}
}
@@ -0,0 +1,92 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.lbryinc.Invitee;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
import lombok.Setter;
public class InviteeListAdapter extends RecyclerView.Adapter<InviteeListAdapter.ViewHolder> {
private Context context;
private List<Invitee> items;
public InviteeListAdapter(List<Invitee> invitees, Context context) {
this.context = context;
this.items = new ArrayList<>(invitees);
}
public void clear() {
items.clear();
notifyDataSetChanged();
}
public List<Invitee> getItems() {
return new ArrayList<>(items);
}
public void addHeader() {
Invitee header = new Invitee();
header.setHeader(true);
items.add(0, header);
}
public void addInvitees(List<Invitee> Invitees) {
for (Invitee tx : Invitees) {
if (!items.contains(tx)) {
items.add(tx);
}
}
notifyDataSetChanged();
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
@Override
public InviteeListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_invitee, root, false);
return new InviteeListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(InviteeListAdapter.ViewHolder vh, int position) {
Invitee item = items.get(position);
vh.emailView.setText(item.isHeader() ? context.getString(R.string.email) : item.getEmail());
vh.emailView.setTypeface(null, item.isHeader() ? Typeface.BOLD : Typeface.NORMAL);
String rewardText = context.getString(
item.isInviteRewardClaimed() ? R.string.claimed :
(item.isInviteRewardClaimable() ? R.string.claimable : R.string.unclaimable));
vh.rewardView.setText(item.isHeader() ? context.getString(R.string.reward) : rewardText);
vh.rewardView.setTypeface(null, item.isHeader() ? Typeface.BOLD : Typeface.NORMAL);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected TextView emailView;
protected TextView rewardView;
public ViewHolder(View v) {
super(v);
emailView = v.findViewById(R.id.invitee_email);
rewardView = v.findViewById(R.id.invitee_reward);
}
}
}
@@ -0,0 +1,53 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import io.lbry.browser.R;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.Language;
import io.lbry.browser.utils.Predefined;
public class LanguageSpinnerAdapter extends ArrayAdapter<Language> {
private int layoutResourceId;
private LayoutInflater inflater;
public LanguageSpinnerAdapter(Context context, int resource) {
super(context, resource, 0, Predefined.PUBLISH_LANGUAGES);
inflater = LayoutInflater.from(context);
layoutResourceId = resource;
}
public int getItemPosition(String languageCode) {
for (int i = 0; i < Predefined.PUBLISH_LANGUAGES.size(); i++) {
Language lang = Predefined.PUBLISH_LANGUAGES.get(i);
if (lang.getCode().equalsIgnoreCase(languageCode)) {
return i;
}
}
return -1;
}
@Override
public View getDropDownView(int position, View view, @NonNull ViewGroup parent) {
return createView(position, view, parent);
}
@Override
public View getView(int position, View view, @NonNull ViewGroup parent) {
return createView(position, view, parent);
}
private View createView(int position, View convertView, ViewGroup parent) {
Language item = getItem(position);
View view = inflater.inflate(layoutResourceId, parent, false);
TextView label = view.findViewById(R.id.item_display_name);
label.setText(item != null ? item.getStringResourceId() : 0);
return view;
}
}
@@ -0,0 +1,52 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import io.lbry.browser.R;
import io.lbry.browser.model.Language;
import io.lbry.browser.model.License;
import io.lbry.browser.utils.Predefined;
public class LicenseSpinnerAdapter extends ArrayAdapter<License> {
private int layoutResourceId;
private LayoutInflater inflater;
public LicenseSpinnerAdapter(Context context, int resource) {
super(context, resource, 0, Predefined.LICENSES);
inflater = LayoutInflater.from(context);
layoutResourceId = resource;
}
public int getItemPosition(String name) {
for (int i = 0; i < Predefined.LICENSES.size(); i++) {
License lic = Predefined.LICENSES.get(i);
if (lic.getName().equalsIgnoreCase(name)) {
return i;
}
}
return -1;
}
@Override
public View getDropDownView(int position, View view, @NonNull ViewGroup parent) {
return createView(position, view, parent);
}
@Override
public View getView(int position, View view, @NonNull ViewGroup parent) {
return createView(position, view, parent);
}
private View createView(int position, View convertView, ViewGroup parent) {
License item = getItem(position);
View view = inflater.inflate(layoutResourceId, parent, false);
TextView label = view.findViewById(R.id.item_display_name);
label.setText(item != null ? item.getStringResourceId() : 0);
return view;
}
}
@@ -0,0 +1,117 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.NavMenuItem;
import io.lbry.browser.ui.controls.SolidIconView;
import io.lbry.browser.utils.Helper;
import lombok.Getter;
import lombok.Setter;
public class NavigationMenuAdapter extends RecyclerView.Adapter<NavigationMenuAdapter.ViewHolder> {
private static final int TYPE_GROUP = 1;
private static final int TYPE_ITEM = 2;
private Context context;
private List<NavMenuItem> menuItems;
private NavMenuItem currentItem;
@Setter
private NavigationMenuItemClickListener listener;
public NavigationMenuAdapter(List<NavMenuItem> menuItems, Context context) {
this.menuItems = new ArrayList<>(menuItems);
this.context = context;
}
public void setCurrentItem(int id) {
for (NavMenuItem item : menuItems) {
if (item.getId() == id) {
this.currentItem = item;
break;
}
}
notifyDataSetChanged();
}
public void setExtraLabelForItem(int id, String extraLabel) {
for (NavMenuItem item : menuItems) {
if (item.getId() == id) {
item.setExtraLabel(extraLabel);
break;
}
}
notifyDataSetChanged();
}
public void setCurrentItem(NavMenuItem currentItem) {
this.currentItem = currentItem;
notifyDataSetChanged();
}
public int getCurrentItemId() {
return currentItem != null ? currentItem.getId() : -1;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected SolidIconView iconView;
protected TextView titleView;
public ViewHolder(View v) {
super(v);
titleView = v.findViewById(R.id.nav_menu_title);
iconView = v.findViewById(R.id.nav_menu_item_icon);
}
}
@Override
public int getItemCount() {
return menuItems != null ? menuItems.size() : 0;
}
@Override
public int getItemViewType(int position) {
return menuItems.get(position).isGroup() ? TYPE_GROUP : TYPE_ITEM;
}
@Override
public NavigationMenuAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(context).inflate(viewType == TYPE_GROUP ?
R.layout.list_item_nav_menu_group : R.layout.list_item_nav_menu_item, parent, false);
return new NavigationMenuAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(ViewHolder vh, int position) {
int type = getItemViewType(position);
NavMenuItem item = menuItems.get(position);
String displayTitle = !Helper.isNullOrEmpty(item.getExtraLabel()) ? String.format("%s (%s)", item.getTitle(), item.getExtraLabel()) : item.getTitle();
vh.titleView.setText(displayTitle);
if (type == TYPE_ITEM && vh.iconView != null) {
vh.iconView.setText(item.getIcon());
}
vh.itemView.setSelected(item.equals(currentItem));
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onNavigationMenuItemClicked(item);
}
}
});
}
public interface NavigationMenuItemClickListener {
void onNavigationMenuItemClicked(NavMenuItem menuItem);
}
}
@@ -0,0 +1,220 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.lbryinc.Reward;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
import lombok.Getter;
import lombok.Setter;
public class RewardListAdapter extends RecyclerView.Adapter<RewardListAdapter.ViewHolder> {
public static final int DISPLAY_MODE_ALL = 1;
public static final int DISPLAY_MODE_UNCLAIMED = 2;
private Context context;
@Setter
private List<Reward> all;
private List<Reward> items;
@Setter
private RewardClickListener clickListener;
@Getter
private int displayMode;
public RewardListAdapter(List<Reward> all, Context context) {
this.all = new ArrayList<>(all);
this.items = new ArrayList<>(all);
this.context = context;
this.displayMode = DISPLAY_MODE_ALL;
addCustomReward();
}
public void setRewards(List<Reward> rewards) {
this.all = new ArrayList<>(rewards);
updateItemsForDisplayMode();
notifyDataSetChanged();
}
public void setDisplayMode(int displayMode) {
this.displayMode = displayMode;
updateItemsForDisplayMode();
notifyDataSetChanged();
}
private void updateItemsForDisplayMode() {
if (displayMode == DISPLAY_MODE_ALL) {
items = new ArrayList<>(all);
} else if (displayMode == DISPLAY_MODE_UNCLAIMED) {
items = new ArrayList<>();
for (Reward reward : all) {
if (!reward.isClaimed()) {
items.add(reward);
}
}
}
addCustomReward();
}
private void addCustomReward() {
Reward custom = new Reward();
custom.setCustom(true);
custom.setRewardTitle(context.getString(R.string.custom_reward_title));
custom.setRewardDescription(context.getString(R.string.custom_reward_description));
items.add(custom);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected View iconClaimed;
protected View loading;
protected View upTo;
protected TextView textTitle;
protected TextView textDescription;
protected TextView textLbcValue;
protected TextView textUsdValue;
protected TextView textLinkTransaction;
protected EditText inputCustomCode;
protected MaterialButton buttonClaimCustom;
public ViewHolder(View v) {
super(v);
iconClaimed = v.findViewById(R.id.reward_item_claimed_icon);
upTo = v.findViewById(R.id.reward_item_up_to);
loading = v.findViewById(R.id.reward_item_loading);
textTitle = v.findViewById(R.id.reward_item_title);
textDescription = v.findViewById(R.id.reward_item_description);
textLbcValue = v.findViewById(R.id.reward_item_lbc_value);
textLinkTransaction = v.findViewById(R.id.reward_item_tx_link);
textUsdValue = v.findViewById(R.id.reward_item_usd_value);
inputCustomCode = v.findViewById(R.id.reward_item_custom_code_input);
buttonClaimCustom = v.findViewById(R.id.reward_item_custom_claim_button);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public void addReward(Reward reward) {
if (!items.contains(reward)) {
items.add(reward);
}
notifyDataSetChanged();
}
public List<Reward> getRewards() {
return new ArrayList<>(items);
}
@Override
public RewardListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_reward, root, false);
return new RewardListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(RewardListAdapter.ViewHolder vh, int position) {
Reward reward = items.get(position);
String displayAmount = reward.getDisplayAmount();
double rewardAmount = 0;
if (!"?".equals(displayAmount)) {
rewardAmount = Double.valueOf(displayAmount);
}
boolean hasTransaction = !Helper.isNullOrEmpty(reward.getTransactionId()) && reward.getTransactionId().length() > 7;
vh.iconClaimed.setVisibility(reward.isClaimed() ? View.VISIBLE : View.INVISIBLE);
vh.inputCustomCode.setVisibility(reward.isCustom() ? View.VISIBLE : View.GONE);
vh.buttonClaimCustom.setVisibility(reward.isCustom() ? View.VISIBLE : View.GONE);
vh.textTitle.setText(reward.getRewardTitle());
vh.textDescription.setText(reward.getRewardDescription());
vh.upTo.setVisibility(reward.shouldDisplayRange() ? View.VISIBLE : View.GONE);
vh.textLbcValue.setText(reward.isCustom() ? "?" : Helper.LBC_CURRENCY_FORMAT.format(Helper.parseDouble(reward.getDisplayAmount(), 0)));
vh.textLinkTransaction.setVisibility(hasTransaction ? View.VISIBLE : View.GONE);
vh.textLinkTransaction.setText(hasTransaction ? reward.getTransactionId().substring(0, 7) : null);
vh.textLinkTransaction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (context != null) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("%s/%s", Helper.EXPLORER_TX_PREFIX, reward.getTransactionId())));
context.startActivity(intent);
}
}
});
vh.textUsdValue.setText(reward.isCustom() || Lbryio.LBCUSDRate == 0 ? null :
String.format("≈$%s", Helper.SIMPLE_CURRENCY_FORMAT.format(rewardAmount * Lbryio.LBCUSDRate)));
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (reward.isClaimed()) {
return;
}
if (vh.inputCustomCode != null && !vh.inputCustomCode.hasFocus()) {
vh.inputCustomCode.requestFocus();
}
if (clickListener != null) {
clickListener.onRewardClicked(reward, vh.loading);
}
}
});
vh.inputCustomCode.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
String value = charSequence.toString().trim();
vh.buttonClaimCustom.setEnabled(value.length() > 0);
}
@Override
public void afterTextChanged(Editable editable) {
}
});
vh.buttonClaimCustom.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String claimCode = Helper.getValue(vh.inputCustomCode.getText());
if (Helper.isNullOrEmpty(claimCode)) {
Snackbar.make(view, R.string.please_enter_claim_code, Snackbar.LENGTH_LONG).
setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
return;
}
if (clickListener != null) {
clickListener.onCustomClaimButtonClicked(claimCode, vh.inputCustomCode, vh.buttonClaimCustom, vh.loading);
}
}
});
}
public interface RewardClickListener {
void onRewardClicked(Reward reward, View loadingView);
void onCustomClaimButtonClicked(String code, EditText inputCustomCode, MaterialButton buttonClaim, View loadingView);
}
}
@@ -0,0 +1,127 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.Claim;
import io.lbry.browser.listener.ChannelItemSelectionListener;
import io.lbry.browser.utils.Helper;
import lombok.Setter;
public class SuggestedChannelGridAdapter extends RecyclerView.Adapter<SuggestedChannelGridAdapter.ViewHolder> {
private Context context;
private List<Claim> items;
private List<Claim> selectedItems;
@Setter
private ChannelItemSelectionListener listener;
public SuggestedChannelGridAdapter(List<Claim> items, Context context) {
this.items = new ArrayList<>(items);
this.selectedItems = new ArrayList<>();
this.context = context;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected View noThumbnailView;
protected ImageView thumbnailView;
protected TextView alphaView;
protected TextView titleView;
protected TextView tagView;
public ViewHolder(View v) {
super(v);
noThumbnailView = v.findViewById(R.id.suggested_channel_no_thumbnail);
alphaView = v.findViewById(R.id.suggested_channel_alpha_view);
thumbnailView = v.findViewById(R.id.suggested_channel_thumbnail);
titleView = v.findViewById(R.id.suggested_channel_title);
tagView = v.findViewById(R.id.suggested_channel_tag);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public int getSelectedCount() { return selectedItems.size(); }
public void clearItems() {
items.clear();
notifyDataSetChanged();
}
public List<Claim> getSelectedItems() {
return this.selectedItems;
}
public void clearSelectedItems() {
this.selectedItems.clear();
}
public boolean isClaimSelected(Claim claim) {
return selectedItems.contains(claim);
}
public void addClaims(List<Claim> claims) {
for (Claim claim : claims) {
if (!items.contains(claim)) {
items.add(claim);
}
}
notifyDataSetChanged();
}
@Override
public SuggestedChannelGridAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_suggested_channel, root, false);
return new SuggestedChannelGridAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(SuggestedChannelGridAdapter.ViewHolder vh, int position) {
Claim claim = items.get(position);
String thumbnailUrl = claim.getThumbnailUrl();
int bgColor = Helper.generateRandomColorForValue(claim.getClaimId());
Helper.setIconViewBackgroundColor(vh.noThumbnailView, bgColor, false, context);
vh.noThumbnailView.setVisibility(Helper.isNullOrEmpty(thumbnailUrl) ? View.INVISIBLE : View.VISIBLE);
vh.alphaView.setText(claim.getName().substring(1, 2));
if (!Helper.isNullOrEmpty(thumbnailUrl)) {
vh.thumbnailView.setVisibility(View.VISIBLE);
Glide.with(context.getApplicationContext()).load(thumbnailUrl).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
} else {
vh.thumbnailView.setVisibility(View.GONE);
}
vh.titleView.setText(Helper.isNullOrEmpty(claim.getTitle()) ? claim.getName() : claim.getTitle());
String firstTag = claim.getFirstTag();
vh.tagView.setVisibility(Helper.isNullOrEmpty(firstTag) ? View.INVISIBLE : View.VISIBLE);
vh.tagView.setBackgroundResource(R.drawable.bg_tag);
vh.tagView.setText(firstTag);
vh.itemView.setSelected(isClaimSelected(claim));
vh.itemView.setOnClickListener(view -> {
if (selectedItems.contains(claim)) {
selectedItems.remove(claim);
if (listener != null) {
listener.onChannelItemDeselected(claim);
}
} else {
selectedItems.add(claim);
if (listener != null) {
listener.onChannelItemSelected(claim);
}
}
notifyDataSetChanged();
});
}
}
@@ -0,0 +1,108 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.Tag;
import lombok.Getter;
import lombok.Setter;
public class TagListAdapter extends RecyclerView.Adapter<TagListAdapter.ViewHolder> {
public static final int CUSTOMIZE_MODE_NONE = 0;
public static final int CUSTOMIZE_MODE_ADD = 1;
public static final int CUSTOMIZE_MODE_REMOVE = 2;
private Context context;
private List<Tag> items;
@Setter
private TagClickListener clickListener;
@Getter
@Setter
private int customizeMode;
public TagListAdapter(List<Tag> tags, Context context) {
this.context = context;
this.items = new ArrayList<>(tags);
this.customizeMode = CUSTOMIZE_MODE_NONE;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected ImageView iconView;
protected TextView nameView;
public ViewHolder(View v) {
super(v);
iconView = v.findViewById(R.id.tag_action);
nameView = v.findViewById(R.id.tag_name);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public void addTag(Tag tag) {
if (!items.contains(tag)) {
items.add(tag);
}
notifyDataSetChanged();
}
public List<Tag> getTags() {
return new ArrayList<>(items);
}
public void setTags(List<Tag> tags) {
items = new ArrayList<>(tags);
notifyDataSetChanged();
}
public void addTags(List<Tag> tags) {
for (Tag tag : tags) {
if (!items.contains(tag)) {
items.add(tag);
}
}
notifyDataSetChanged();
}
public void removeTag(Tag tag) {
items.remove(tag);
notifyDataSetChanged();
}
@Override
public TagListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_tag, root, false);
return new TagListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(TagListAdapter.ViewHolder vh, int position) {
Tag tag = items.get(position);
vh.nameView.setText(tag.getName().toLowerCase());
vh.iconView.setVisibility(customizeMode == CUSTOMIZE_MODE_NONE ? View.GONE : View.VISIBLE);
vh.iconView.setImageResource(customizeMode == CUSTOMIZE_MODE_REMOVE ? R.drawable.ic_close : R.drawable.ic_add);
vh.itemView.setBackgroundResource(tag.isMature() ? R.drawable.bg_tag_mature : R.drawable.bg_tag);
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (clickListener != null) {
clickListener.onTagClicked(tag, customizeMode);
}
}
});
}
public interface TagClickListener {
void onTagClicked(Tag tag, int customizeMode);
}
}
@@ -0,0 +1,136 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.model.Transaction;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
import lombok.Setter;
public class TransactionListAdapter extends RecyclerView.Adapter<TransactionListAdapter.ViewHolder> {
private static final DecimalFormat TX_LIST_AMOUNT_FORMAT = new DecimalFormat("#,##0.0000");
private static final SimpleDateFormat TX_LIST_DATE_FORMAT = new SimpleDateFormat("MMM d");
private Context context;
private List<Transaction> items;
@Setter
private TransactionClickListener listener;
public TransactionListAdapter(List<Transaction> transactions, Context context) {
this.context = context;
this.items = new ArrayList<>(transactions);
}
public void clear() {
items.clear();
notifyDataSetChanged();
}
public List<Transaction> getItems() {
return new ArrayList<>(items);
}
public void addTransactions(List<Transaction> transactions) {
for (Transaction tx : transactions) {
if (!items.contains(tx)) {
items.add(tx);
}
}
notifyDataSetChanged();
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
@Override
public TransactionListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_transaction, root, false);
return new TransactionListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(TransactionListAdapter.ViewHolder vh, int position) {
Transaction item = items.get(position);
vh.descView.setText(item.getDescriptionStringId());
vh.amountView.setText(TX_LIST_AMOUNT_FORMAT.format(item.getValue().doubleValue()));
vh.claimView.setText(item.getClaim());
vh.feeView.setText(context.getString(R.string.tx_list_fee, TX_LIST_AMOUNT_FORMAT.format(item.getFee().doubleValue())));
vh.txidLinkView.setText(item.getTxid().substring(0, 7));
vh.dateView.setVisibility(item.getConfirmations() > 0 ? View.VISIBLE : View.GONE);
vh.dateView.setText(item.getConfirmations() > 0 ? TX_LIST_DATE_FORMAT.format(item.getTxDate()) : null);
vh.pendingView.setVisibility(item.getConfirmations() == 0 ? View.VISIBLE : View.GONE);
vh.infoFeeContainer.setVisibility(!Helper.isNullOrEmpty(item.getClaim()) || Math.abs(item.getFee().doubleValue()) > 0 ?
View.VISIBLE : View.GONE);
vh.claimView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LbryUri claimUrl = item.getClaimUrl();
if (claimUrl != null && listener != null) {
listener.onClaimUrlClicked(claimUrl);
}
}
});
vh.txidLinkView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (context != null) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("%s/%s", Helper.EXPLORER_TX_PREFIX, item.getTxid())));
context.startActivity(intent);
}
}
});
vh.itemView.setOnClickListener(view -> {
if (listener != null) {
listener.onTransactionClicked(item);
}
});
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected TextView descView;
protected TextView amountView;
protected TextView claimView;
protected TextView feeView;
protected TextView txidLinkView;
protected TextView dateView;
protected TextView pendingView;
protected View infoFeeContainer;
public ViewHolder(View v) {
super(v);
descView = v.findViewById(R.id.transaction_desc);
amountView = v.findViewById(R.id.transaction_amount);
claimView = v.findViewById(R.id.transaction_claim);
feeView = v.findViewById(R.id.transaction_fee);
txidLinkView = v.findViewById(R.id.transaction_id_link);
dateView = v.findViewById(R.id.transaction_date);
pendingView = v.findViewById(R.id.transaction_pending_text);
infoFeeContainer = v.findViewById(R.id.transaction_info_fee_container);
}
}
public interface TransactionClickListener {
void onTransactionClicked(Transaction transaction);
void onClaimUrlClicked(LbryUri uri);
}
}
@@ -0,0 +1,147 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.UrlSuggestion;
import io.lbry.browser.ui.controls.SolidIconView;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
import lombok.Setter;
public class UrlSuggestionListAdapter extends RecyclerView.Adapter<UrlSuggestionListAdapter.ViewHolder> {
private Context context;
private List<UrlSuggestion> items;
@Setter
private UrlSuggestionClickListener listener;
public UrlSuggestionListAdapter(Context context) {
this.context = context;
this.items = new ArrayList<>();
}
public void clear() {
items.clear();
notifyDataSetChanged();
}
public List<UrlSuggestion> getItems() {
return new ArrayList<>(items);
}
public List<String> getItemUrls() {
List<String> uris = new ArrayList<>();
for (int i = 0; i < items.size(); i++) {
LbryUri uri = items.get(i).getUri();
if (uri != null) {
uris.add(uri.toString());
}
}
return uris;
}
public void setClaimForUrl(LbryUri url, Claim claim) {
for (int i = 0; i < items.size(); i++) {
LbryUri thisUrl = items.get(i).getUri();
try {
if (thisUrl != null) {
LbryUri vanity = LbryUri.parse(thisUrl.toVanityString());
if (thisUrl.equals(url) || vanity.equals(url)) {
items.get(i).setClaim(claim);
}
}
} catch (LbryUriException ex) {
// pass
}
}
}
public void addUrlSuggestions(List<UrlSuggestion> urlSuggestions) {
for (UrlSuggestion urlSuggestion : urlSuggestions) {
if (!items.contains(urlSuggestion)) {
items.add(urlSuggestion);
}
}
notifyDataSetChanged();
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
@Override
public UrlSuggestionListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_url_suggestion, root, false);
return new UrlSuggestionListAdapter.ViewHolder(v);
}
@Override
public void onBindViewHolder(UrlSuggestionListAdapter.ViewHolder vh, int position) {
UrlSuggestion item = items.get(position);
String fullTitle, desc;
int iconStringId;
switch (item.getType()) {
case UrlSuggestion.TYPE_CHANNEL:
iconStringId = R.string.fa_at;
fullTitle = item.getTitle();
desc = item.getClaim() != null ? item.getClaim().getTitle() :
((item.isUseTextAsDescription() && !Helper.isNullOrEmpty(item.getText())) ? item.getText() : String.format(context.getString(R.string.view_channel_url_desc), item.getText()));
break;
case UrlSuggestion.TYPE_TAG:
iconStringId = R.string.fa_hashtag;
fullTitle = String.format(context.getString(R.string.tag_url_title), item.getText());
desc = String.format(context.getString(R.string.explore_tag_url_desc), item.getText());
break;
case UrlSuggestion.TYPE_SEARCH:
iconStringId = R.string.fa_search;
fullTitle = String.format(context.getString(R.string.search_url_title), item.getText());
desc = String.format(context.getString(R.string.search_url_desc), item.getText());
break;
case UrlSuggestion.TYPE_FILE:
default:
iconStringId = R.string.fa_file;
fullTitle = item.getTitle();
desc = item.getClaim() != null ? item.getClaim().getTitle() :
((item.isUseTextAsDescription() && !Helper.isNullOrEmpty(item.getText())) ? item.getText() : String.format(context.getString(R.string.view_file_url_desc), item.getText()));
break;
}
vh.iconView.setText(iconStringId);
vh.titleView.setText(fullTitle);
vh.descView.setText(desc);
vh.itemView.setOnClickListener(view -> {
if (listener != null) {
listener.onUrlSuggestionClicked(item);
}
});
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected SolidIconView iconView;
protected TextView titleView;
protected TextView descView;
public ViewHolder(View v) {
super(v);
iconView = v.findViewById(R.id.url_suggestion_icon);
titleView = v.findViewById(R.id.url_suggestion_title);
descView = v.findViewById(R.id.url_suggestion_description);
}
}
public interface UrlSuggestionClickListener {
void onUrlSuggestionClicked(UrlSuggestion urlSuggestion);
}
}
@@ -0,0 +1,71 @@
package io.lbry.browser.adapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import io.lbry.browser.listener.SignInListener;
import io.lbry.browser.listener.WalletSyncListener;
import io.lbry.browser.ui.verification.EmailVerificationFragment;
import io.lbry.browser.ui.verification.ManualVerificationFragment;
import io.lbry.browser.ui.verification.PhoneVerificationFragment;
import io.lbry.browser.ui.verification.WalletVerificationFragment;
import lombok.SneakyThrows;
/**
* 4 fragments
* - Email collect / verify (sign in)
* - Phone number collect / verify (rewards)
* - Wallet password
* - Manual verification page
*/
public class VerificationPagerAdapter extends FragmentStateAdapter {
public static final int PAGE_VERIFICATION_EMAIL = 0;
public static final int PAGE_VERIFICATION_PHONE = 1;
public static final int PAGE_VERIFICATION_WALLET = 2;
public static final int PAGE_VERIFICATION_MANUAL = 3;
private FragmentActivity activity;
public VerificationPagerAdapter(FragmentActivity activity) {
super(activity);
this.activity = activity;
}
@SneakyThrows
@Override
public Fragment createFragment(int position) {
switch (position) {
case 0:
default:
EmailVerificationFragment evFragment = EmailVerificationFragment.class.newInstance();
if (activity instanceof SignInListener) {
evFragment.setListener((SignInListener) activity);
}
return evFragment;
case 1:
PhoneVerificationFragment pvFragment = PhoneVerificationFragment.class.newInstance();
if (activity instanceof SignInListener) {
pvFragment.setListener((SignInListener) activity);
}
return pvFragment;
case 2:
WalletVerificationFragment wvFragment = WalletVerificationFragment.class.newInstance();
if (activity instanceof WalletSyncListener) {
wvFragment.setListener((WalletSyncListener) activity);
}
return wvFragment;
case 3:
ManualVerificationFragment mvFragment = ManualVerificationFragment.class.newInstance();
if (activity instanceof SignInListener) {
mvFragment.setListener((SignInListener) activity);
}
return mvFragment;
}
}
@Override
public int getItemCount() {
return 4;
}
}
@@ -0,0 +1,250 @@
package io.lbry.browser.data;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.opengl.Visibility;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.Tag;
import io.lbry.browser.model.UrlSuggestion;
import io.lbry.browser.model.ViewHistory;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final int DATABASE_VERSION = 2;
public static final String DATABASE_NAME = "LbryApp.db";
private static DatabaseHelper instance;
private static final String[] SQL_CREATE_TABLES = {
// local subscription store
"CREATE TABLE subscriptions (url TEXT PRIMARY KEY NOT NULL, channel_name TEXT NOT NULL)",
// url entry / suggestion history
"CREATE TABLE url_history (id INTEGER PRIMARY KEY NOT NULL, value TEXT NOT NULL, url TEXT, type INTEGER NOT NULL, timestamp TEXT NOT NULL)",
// tags (known and followed)
"CREATE TABLE tags (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL, is_followed INTEGER NOT NULL)",
// view history (stores only stream claims that have resolved)
"CREATE TABLE view_history (" +
" id INTEGER PRIMARY KEY NOT NULL" +
", url TEXT NOT NULL" +
", claim_id TEXT" +
", claim_name TEXT" +
", cost REAL " +
", currency TEXT " +
", title TEXT " +
", publisher_claim_id TEXT" +
", publisher_name TEXT" +
", publisher_title TEXT" +
", thumbnail_url TEXT" +
", release_time INTEGER " +
", device TEXT" +
", timestamp TEXT NOT NULL)"
};
private static final String[] SQL_CREATE_INDEXES = {
"CREATE UNIQUE INDEX idx_subscription_url ON subscriptions (url)",
"CREATE UNIQUE INDEX idx_url_history_value ON url_history (value)",
"CREATE UNIQUE INDEX idx_url_history_url ON url_history (url)",
"CREATE UNIQUE INDEX idx_tag_name ON tags (name)",
"CREATE UNIQUE INDEX idx_view_history_url_device ON view_history (url, device)",
"CREATE INDEX idx_view_history_device ON view_history (device)"
};
private static final String[] SQL_V1_V2_UPGRADE = {
"ALTER TABLE view_history ADD COLUMN currency TEXT"
};
private static final String SQL_INSERT_SUBSCRIPTION = "REPLACE INTO subscriptions (channel_name, url) VALUES (?, ?)";
private static final String SQL_DELETE_SUBSCRIPTION = "DELETE FROM subscriptions WHERE url = ?";
private static final String SQL_GET_SUBSCRIPTIONS = "SELECT channel_name, url FROM subscriptions";
private static final String SQL_INSERT_URL_HISTORY = "REPLACE INTO url_history (value, url, type, timestamp) VALUES (?, ?, ?, ?)";
private static final String SQL_CLEAR_URL_HISTORY = "DELETE FROM url_history";
private static final String SQL_CLEAR_URL_HISTORY_BEFORE_TIME = "DELETE FROM url_history WHERE timestamp < ?";
private static final String SQL_GET_RECENT_URL_HISTORY = "SELECT value, url, type FROM url_history ORDER BY timestamp DESC LIMIT 10";
private static final String SQL_INSERT_VIEW_HISTORY =
"REPLACE INTO view_history (url, claim_id, claim_name, cost, currency, title, publisher_claim_id, publisher_name, publisher_title, thumbnail_url, device, release_time, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String SQL_GET_VIEW_HISTORY =
"SELECT url, claim_id, claim_name, cost, currency, title, publisher_claim_id, publisher_name, publisher_title, thumbnail_url, device, release_time, timestamp " +
"FROM view_history WHERE '' = ? OR timestamp < ? ORDER BY timestamp DESC LIMIT %d";
private static final String SQL_CLEAR_VIEW_HISTORY = "DELETE FROM view_history";
private static final String SQL_CLEAR_VIEW_HISTORY_BY_DEVICE = "DELETE FROM view_history WHERE device = ?";
private static final String SQL_CLEAR_VIEW_HISTORY_BEFORE_TIME = "DELETE FROM view_history WHERE timestamp < ?";
private static final String SQL_CLEAR_VIEW_HISTORY_BY_DEVICE_BEFORE_TIME = "DELETE FROM view_history WHERE device = ? AND timestamp < ?";
private static final String SQL_INSERT_TAG = "REPLACE INTO tags (name, is_followed) VALUES (?, ?)";
private static final String SQL_GET_KNOWN_TAGS = "SELECT name, is_followed FROM tags";
private static final String SQL_UNFOLLOW_TAGS = "UPDATE tags SET is_followed = 0";
private static final String SQL_GET_FOLLOWED_TAGS = "SELECT name FROM tags WHERE is_followed = 1";
public DatabaseHelper(Context context) {
super(context, String.format("%s/%s", context.getFilesDir().getAbsolutePath(), DATABASE_NAME), null, DATABASE_VERSION);
instance = this;
}
public static DatabaseHelper getInstance() {
return instance;
}
public void onCreate(SQLiteDatabase db) {
for (String sql : SQL_CREATE_TABLES) {
db.execSQL(sql);
}
for (String sql : SQL_CREATE_INDEXES) {
db.execSQL(sql);
}
}
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (oldVersion < 2) {
for (String sql : SQL_V1_V2_UPGRADE) {
db.execSQL(sql);
}
}
}
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public static void createOrUpdateUrlHistoryItem(String text, String url, int type, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_URL_HISTORY, new Object[] {
text, url, type, new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).format(new Date())
});
}
public static void clearUrlHistory(SQLiteDatabase db) {
db.execSQL(SQL_CLEAR_URL_HISTORY);
}
public static void clearUrlHistoryBefore(Date date, SQLiteDatabase db) {
db.execSQL(SQL_CLEAR_URL_HISTORY_BEFORE_TIME, new Object[] { new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).format(new Date()) });
}
// History items are essentially url suggestions
public static List<UrlSuggestion> getRecentHistory(SQLiteDatabase db) {
List<UrlSuggestion> suggestions = new ArrayList<>();
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_RECENT_URL_HISTORY, null);
while (cursor.moveToNext()) {
UrlSuggestion suggestion = new UrlSuggestion();
suggestion.setText(cursor.getString(0));
suggestion.setUri(cursor.isNull(1) ? null : LbryUri.tryParse(cursor.getString(1)));
suggestion.setType(cursor.getInt(2));
suggestion.setTitleUrlOnly(true);
suggestions.add(suggestion);
}
} finally {
Helper.closeCursor(cursor);
}
return suggestions;
}
// View history items are stream claims
public static void createOrUpdateViewHistoryItem(ViewHistory viewHistory, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_VIEW_HISTORY, new Object[] {
viewHistory.getUri().toString(),
viewHistory.getClaimId(),
viewHistory.getClaimName(),
viewHistory.getCost() != null ? viewHistory.getCost().doubleValue() : 0,
viewHistory.getCurrency(),
viewHistory.getTitle(),
viewHistory.getPublisherClaimId(),
viewHistory.getPublisherName(),
viewHistory.getPublisherTitle(),
viewHistory.getThumbnailUrl(),
viewHistory.getDevice(),
viewHistory.getReleaseTime(),
new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).format(new Date())
});
}
public static List<ViewHistory> getViewHistory(String lastTimestamp, int pageLimit, SQLiteDatabase db) {
List<ViewHistory> history = new ArrayList<>();
Cursor cursor = null;
try {
String arg = lastTimestamp == null ? "" : lastTimestamp;
cursor = db.rawQuery(String.format(SQL_GET_VIEW_HISTORY, pageLimit), new String[] { arg, arg });
while (cursor.moveToNext()) {
ViewHistory item = new ViewHistory();
int cursorIndex = 0;
item.setUri(LbryUri.tryParse(cursor.getString(cursorIndex++)));
item.setClaimId(cursor.getString(cursorIndex++));
item.setClaimName(cursor.getString(cursorIndex++));
item.setCost(new BigDecimal(cursor.getDouble(cursorIndex++)));
item.setCurrency(cursor.getString(cursorIndex++));
item.setTitle(cursor.getString(cursorIndex++));
item.setPublisherClaimId(cursor.getString(cursorIndex++));
item.setPublisherName(cursor.getString(cursorIndex++));
item.setPublisherTitle(cursor.getString(cursorIndex++));
item.setThumbnailUrl(cursor.getString(cursorIndex++));
item.setDevice(cursor.getString(cursorIndex++));
item.setReleaseTime(cursor.getLong(cursorIndex++));
try {
item.setTimestamp(new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).parse(cursor.getString(cursorIndex)));
} catch (ParseException ex) {
// invalid timestamp (which shouldn't happen). Skip this item
continue;
}
history.add(item);
}
} finally {
Helper.closeCursor(cursor);
}
return history;
}
public static void createOrUpdateTag(Tag tag, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_TAG, new Object[] { tag.getLowercaseName(), tag.isFollowed() ? 1 : 0 });
}
public static void setAllTagsUnfollowed(SQLiteDatabase db) {
db.execSQL(SQL_UNFOLLOW_TAGS);
}
public static List<Tag> getTags(SQLiteDatabase db) {
List<Tag> tags = new ArrayList<>();
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_KNOWN_TAGS, null);
while (cursor.moveToNext()) {
Tag tag = new Tag();
tag.setName(cursor.getString(0));
tag.setFollowed(cursor.getInt(1) == 1);
tags.add(tag);
}
} finally {
Helper.closeCursor(cursor);
}
return tags;
}
public static void createOrUpdateSubscription(Subscription subscription, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_SUBSCRIPTION, new Object[] { subscription.getChannelName(), subscription.getUrl() });
}
public static void deleteSubscription(Subscription subscription, SQLiteDatabase db) {
db.execSQL(SQL_DELETE_SUBSCRIPTION, new Object[] { subscription.getUrl() });
}
public static List<Subscription> getSubscriptions(SQLiteDatabase db) {
List<Subscription> subscriptions = new ArrayList<>();
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_SUBSCRIPTIONS, null);
while (cursor.moveToNext()) {
Subscription subscription = new Subscription();
subscription.setChannelName(cursor.getString(0));
subscription.setUrl(cursor.getString(1));
subscriptions.add(subscription);
}
} finally {
Helper.closeCursor(cursor);
}
return subscriptions;
}
}
@@ -0,0 +1,112 @@
package io.lbry.browser.dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import io.lbry.browser.R;
import lombok.Setter;
public class ContentFromDialogFragment extends BottomSheetDialogFragment {
public static final String TAG = "ContentFromDialog";
public static final int ITEM_FROM_PAST_24_HOURS = 1;
public static final int ITEM_FROM_PAST_WEEK = 2;
public static final int ITEM_FROM_PAST_MONTH = 3;
public static final int ITEM_FROM_PAST_YEAR = 4;
public static final int ITEM_FROM_ALL_TIME = 5;
@Setter
private ContentFromListener contentFromListener;
private int currentFromItem;
public static ContentFromDialogFragment newInstance() {
return new ContentFromDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_content_from, container,false);
ContentFromItemClickListener clickListener = new ContentFromItemClickListener(this, contentFromListener);
view.findViewById(R.id.content_from_past_24_hours_item).setOnClickListener(clickListener);
view.findViewById(R.id.content_from_past_week_item).setOnClickListener(clickListener);
view.findViewById(R.id.content_from_past_month_item).setOnClickListener(clickListener);
view.findViewById(R.id.content_from_past_year_item).setOnClickListener(clickListener);
view.findViewById(R.id.content_from_all_time_item).setOnClickListener(clickListener);
checkSelectedFromItem(currentFromItem, view);
return view;
}
public static void checkSelectedFromItem(int fromItem, View parent) {
int checkViewId = -1;
switch (fromItem) {
case ITEM_FROM_PAST_24_HOURS: checkViewId = R.id.content_from_past_24_hours_item_selected; break;
case ITEM_FROM_PAST_WEEK: checkViewId = R.id.content_from_past_week_item_selected; break;
case ITEM_FROM_PAST_MONTH: checkViewId = R.id.content_from_past_month_item_selected; break;
case ITEM_FROM_PAST_YEAR: checkViewId = R.id.content_from_past_year_item_selected; break;
case ITEM_FROM_ALL_TIME: checkViewId = R.id.content_from_all_time_item_selected; break;
}
if (parent != null && checkViewId > -1) {
parent.findViewById(checkViewId).setVisibility(View.VISIBLE);
}
}
public void setCurrentFromItem(int fromItem) {
this.currentFromItem = fromItem;
}
private static class ContentFromItemClickListener implements View.OnClickListener {
private final int[] checkViewIds = {
R.id.content_from_past_24_hours_item,
R.id.content_from_past_week_item,
R.id.content_from_past_month_item,
R.id.content_from_past_year_item,
R.id.content_from_all_time_item
};
private BottomSheetDialogFragment dialog;
private ContentFromListener listener;
public ContentFromItemClickListener(BottomSheetDialogFragment dialog, ContentFromListener listener) {
this.dialog = dialog;
this.listener = listener;
}
public void onClick(View view) {
int currentFromItem = -1;
if (dialog != null) {
View dialogView = dialog.getView();
if (dialogView != null) {
for (int id : checkViewIds) {
dialogView.findViewById(id).setVisibility(View.GONE);
}
}
}
switch (view.getId()) {
case R.id.content_from_past_24_hours_item: currentFromItem = ITEM_FROM_PAST_24_HOURS; break;
case R.id.content_from_past_week_item: currentFromItem = ITEM_FROM_PAST_WEEK; break;
case R.id.content_from_past_month_item: currentFromItem = ITEM_FROM_PAST_MONTH; break;
case R.id.content_from_past_year_item: currentFromItem = ITEM_FROM_PAST_YEAR; break;
case R.id.content_from_all_time_item: currentFromItem = ITEM_FROM_ALL_TIME; break;
}
checkSelectedFromItem(currentFromItem, view);
if (listener != null) {
listener.onContentFromItemSelected(currentFromItem);
}
if (dialog != null) {
dialog.dismiss();
}
}
}
public interface ContentFromListener {
void onContentFromItemSelected(int contentFromItem);
}
}
@@ -0,0 +1,96 @@
package io.lbry.browser.dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import io.lbry.browser.R;
import lombok.Setter;
public class ContentScopeDialogFragment extends BottomSheetDialogFragment {
public static final String TAG = "ContentScopeDialog";
public static final int ITEM_EVERYONE = 1;
public static final int ITEM_TAGS = 2;
@Setter
private ContentScopeListener contentScopeListener;
private int currentScopeItem;
public static ContentScopeDialogFragment newInstance() {
return new ContentScopeDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_content_scope, container,false);
ContentScopeItemClickListener clickListener = new ContentScopeItemClickListener(this, contentScopeListener);
view.findViewById(R.id.content_scope_everyone_item).setOnClickListener(clickListener);
view.findViewById(R.id.content_scope_tags_item).setOnClickListener(clickListener);
checkSelectedScopeItem(currentScopeItem, view);
return view;
}
public static void checkSelectedScopeItem(int scope, View parent) {
int checkViewId = -1;
switch (scope) {
case ITEM_EVERYONE: checkViewId = R.id.content_scope_everyone_item_selected; break;
case ITEM_TAGS: checkViewId = R.id.content_scope_tags_item_selected; break;
}
if (parent != null && checkViewId > -1) {
parent.findViewById(checkViewId).setVisibility(View.VISIBLE);
}
}
public void setCurrentScopeItem(int scopeItem) {
this.currentScopeItem = scopeItem;
}
private static class ContentScopeItemClickListener implements View.OnClickListener {
private final int[] checkViewIds = {
R.id.content_scope_everyone_item_selected, R.id.content_scope_tags_item_selected
};
private BottomSheetDialogFragment dialog;
private ContentScopeListener listener;
public ContentScopeItemClickListener(BottomSheetDialogFragment dialog, ContentScopeListener listener) {
this.dialog = dialog;
this.listener = listener;
}
public void onClick(View view) {
int scopeItem = -1;
if (dialog != null) {
View dialogView = dialog.getView();
if (dialogView != null) {
for (int id : checkViewIds) {
dialogView.findViewById(id).setVisibility(View.GONE);
}
}
}
switch (view.getId()) {
case R.id.content_scope_everyone_item: scopeItem = ITEM_EVERYONE; break;
case R.id.content_scope_tags_item: scopeItem = ITEM_TAGS; break;
}
checkSelectedScopeItem(scopeItem, view);
if (listener != null) {
listener.onContentScopeItemSelected(scopeItem);
}
if (dialog != null) {
dialog.dismiss();
}
}
}
public interface ContentScopeListener {
void onContentScopeItemSelected(int scopeItem);
}
}
@@ -0,0 +1,100 @@
package io.lbry.browser.dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import io.lbry.browser.R;
import lombok.Setter;
public class ContentSortDialogFragment extends BottomSheetDialogFragment {
public static final String TAG = "ContentSortDialog";
public static final int ITEM_SORT_BY_TRENDING = 1;
public static final int ITEM_SORT_BY_NEW = 2;
public static final int ITEM_SORT_BY_TOP = 3;
@Setter
private SortByListener sortByListener;
private int currentSortByItem;
public static ContentSortDialogFragment newInstance() {
return new ContentSortDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_content_sort, container,false);
SortByItemClickListener clickListener = new SortByItemClickListener(this, sortByListener);
view.findViewById(R.id.sort_by_trending_item).setOnClickListener(clickListener);
view.findViewById(R.id.sort_by_new_item).setOnClickListener(clickListener);
view.findViewById(R.id.sort_by_top_item).setOnClickListener(clickListener);
checkSelectedSortByItem(currentSortByItem, view);
return view;
}
public static void checkSelectedSortByItem(int sortByItem, View parent) {
int checkViewId = -1;
switch (sortByItem) {
case ITEM_SORT_BY_TRENDING: checkViewId = R.id.sort_by_trending_item_selected; break;
case ITEM_SORT_BY_NEW: checkViewId = R.id.sort_by_new_item_selected; break;
case ITEM_SORT_BY_TOP: checkViewId = R.id.sort_by_top_item_selected; break;
}
if (parent != null && checkViewId > -1) {
parent.findViewById(checkViewId).setVisibility(View.VISIBLE);
}
}
public void setCurrentSortByItem(int sortByItem) {
this.currentSortByItem = sortByItem;
}
private static class SortByItemClickListener implements View.OnClickListener {
private final int[] checkViewIds = {
R.id.sort_by_trending_item_selected, R.id.sort_by_new_item_selected, R.id.sort_by_top_item_selected
};
private BottomSheetDialogFragment dialog;
private SortByListener listener;
public SortByItemClickListener(BottomSheetDialogFragment dialog, SortByListener listener) {
this.dialog = dialog;
this.listener = listener;
}
public void onClick(View view) {
int selectedSortByItem = -1;
if (dialog != null) {
View dialogView = dialog.getView();
if (dialogView != null) {
for (int id : checkViewIds) {
dialogView.findViewById(id).setVisibility(View.GONE);
}
}
}
switch (view.getId()) {
case R.id.sort_by_trending_item: selectedSortByItem = ITEM_SORT_BY_TRENDING; break;
case R.id.sort_by_new_item: selectedSortByItem = ITEM_SORT_BY_NEW; break;
case R.id.sort_by_top_item: selectedSortByItem = ITEM_SORT_BY_TOP; break;
}
checkSelectedSortByItem(selectedSortByItem, view);
if (listener != null) {
listener.onSortByItemSelected(selectedSortByItem);
}
if (dialog != null) {
dialog.dismiss();
}
}
}
public interface SortByListener {
void onSortByItemSelected(int sortBy);
}
}
@@ -0,0 +1,186 @@
package io.lbry.browser.dialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.flexbox.FlexboxLayoutManager;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.R;
import io.lbry.browser.adapter.TagListAdapter;
import io.lbry.browser.listener.TagListener;
import io.lbry.browser.model.Tag;
import io.lbry.browser.tasks.UpdateSuggestedTagsTask;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import lombok.Setter;
public class CustomizeTagsDialogFragment extends BottomSheetDialogFragment {
public static final String TAG = "CustomizeTagsDialog";
private static final int SUGGESTED_LIMIT = 8;
private String currentFilter;
private RecyclerView followedTagsList;
private RecyclerView suggestedTagsList;
private TagListAdapter followedTagsAdapter;
private TagListAdapter suggestedTagsAdapter;
private View noTagsView;
private View noResultsView;
@Setter
private TagListener listener;
private void checkNoTags() {
Helper.setViewVisibility(noTagsView, followedTagsAdapter == null || followedTagsAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
}
private void checkNoResults() {
Helper.setViewVisibility(noResultsView, suggestedTagsAdapter == null || suggestedTagsAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
}
public void addTag(Tag tag) {
if (followedTagsAdapter.getTags().contains(tag)) {
Snackbar.make(getView(), getString(R.string.tag_already_added, tag.getName()), Snackbar.LENGTH_LONG).show();
return;
}
tag.setFollowed(true);
followedTagsAdapter.addTag(tag);
if (suggestedTagsAdapter != null) {
suggestedTagsAdapter.removeTag(tag);
}
updateKnownTags(currentFilter, SUGGESTED_LIMIT, false);
if (listener != null) {
listener.onTagAdded(tag);
}
checkNoTags();
checkNoResults();
}
public void removeTag(Tag tag) {
tag.setFollowed(false);
followedTagsAdapter.removeTag(tag);
updateKnownTags(currentFilter, SUGGESTED_LIMIT, false);
if (listener != null) {
listener.onTagRemoved(tag);
}
checkNoTags();
checkNoResults();
}
public void setFilter(String filter) {
currentFilter = filter;
updateKnownTags(currentFilter, SUGGESTED_LIMIT, true);
}
public static CustomizeTagsDialogFragment newInstance() {
return new CustomizeTagsDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_customize_tags, container, false);
noResultsView = view.findViewById(R.id.customize_no_tag_results);
noTagsView = view.findViewById(R.id.customize_no_followed_tags);
followedTagsAdapter = new TagListAdapter(Lbry.followedTags, getContext());
followedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_REMOVE);
followedTagsAdapter.setClickListener(customizeTagClickListener);
suggestedTagsAdapter = new TagListAdapter(new ArrayList<>(), getContext());
suggestedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
suggestedTagsAdapter.setClickListener(customizeTagClickListener);
FlexboxLayoutManager flm1 = new FlexboxLayoutManager(getContext());
followedTagsList = view.findViewById(R.id.customize_tags_followed_list);
followedTagsList.setLayoutManager(flm1);
followedTagsList.setAdapter(followedTagsAdapter);
FlexboxLayoutManager flm2 = new FlexboxLayoutManager(getContext());
suggestedTagsList = view.findViewById(R.id.customize_tags_suggested_list);
suggestedTagsList.setLayoutManager(flm2);
suggestedTagsList.setAdapter(suggestedTagsAdapter);
TextInputEditText filterInput = view.findViewById(R.id.customize_tag_filter_input);
filterInput.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
String value = Helper.getValue(charSequence);
setFilter(value);
}
@Override
public void afterTextChanged(Editable editable) {
}
});
MaterialButton doneButton = view.findViewById(R.id.customize_done_button);
doneButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
checkNoTags();
return view;
}
private TagListAdapter.TagClickListener customizeTagClickListener = new TagListAdapter.TagClickListener() {
@Override
public void onTagClicked(Tag tag, int customizeMode) {
if (customizeMode == TagListAdapter.CUSTOMIZE_MODE_ADD) {
addTag(tag);
} else if (customizeMode == TagListAdapter.CUSTOMIZE_MODE_REMOVE) {
removeTag(tag);
}
}
};
public void onResume() {
super.onResume();
updateKnownTags(null, SUGGESTED_LIMIT, true);
}
private void updateKnownTags(String filter, int limit, boolean clearPrevious) {
UpdateSuggestedTagsTask task = new UpdateSuggestedTagsTask(
filter,
SUGGESTED_LIMIT,
followedTagsAdapter,
suggestedTagsAdapter,
clearPrevious,
false, new UpdateSuggestedTagsTask.KnownTagsHandler() {
@Override
public void onSuccess(List<Tag> tags) {
if (suggestedTagsAdapter == null) {
suggestedTagsAdapter = new TagListAdapter(tags, getContext());
suggestedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
suggestedTagsAdapter.setClickListener(customizeTagClickListener);
if (suggestedTagsList != null) {
suggestedTagsList.setAdapter(suggestedTagsAdapter);
}
} else {
suggestedTagsAdapter.setTags(tags);
}
checkNoResults();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
@@ -0,0 +1,107 @@
package io.lbry.browser.dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import io.lbry.browser.R;
import io.lbry.browser.adapter.SuggestedChannelGridAdapter;
import lombok.Getter;
import lombok.Setter;
public class DiscoverDialogFragment extends BottomSheetDialogFragment {
public static final String TAG = "DiscoverDialog";
@Getter
private SuggestedChannelGridAdapter adapter;
@Setter
private DiscoverDialogListener dialogActionsListener;
public static DiscoverDialogFragment newInstance() {
return new DiscoverDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_discover, container, false);
RecyclerView grid = view.findViewById(R.id.discover_channel_grid);
GridLayoutManager glm = new GridLayoutManager(getContext(), 3);
grid.setLayoutManager(glm);
grid.setAdapter(adapter);
grid.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
GridLayoutManager lm = (GridLayoutManager) recyclerView.getLayoutManager();
if (lm != null) {
int visibleItemCount = lm.getChildCount();
int totalItemCount = lm.getItemCount();
int pastVisibleItems = lm.findFirstVisibleItemPosition();
if (pastVisibleItems + visibleItemCount >= totalItemCount) {
if (dialogActionsListener != null) {
dialogActionsListener.onScrollEndReached();
}
}
}
}
});
MaterialButton doneButton = view.findViewById(R.id.discover_done_button);
doneButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
return view;
}
public void setAdapter(SuggestedChannelGridAdapter adapter) {
this.adapter = adapter;
if (getView() != null) {
((RecyclerView) getView().findViewById(R.id.discover_channel_grid)).setAdapter(adapter);
}
}
public void setLoading(boolean loading) {
if (getView() != null) {
getView().findViewById(R.id.discover_loading).setVisibility(loading ? View.VISIBLE : View.GONE);
}
}
@Override
public void onResume() {
super.onResume();
if (dialogActionsListener != null) {
dialogActionsListener.onResume();
}
}
@Override
public void onCancel(DialogInterface dialog) {
super.onDismiss(dialog);
if (dialogActionsListener != null) {
dialogActionsListener.onCancel();
}
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (dialogActionsListener != null) {
dialogActionsListener.onCancel();
}
}
public interface DiscoverDialogListener {
void onResume();
void onCancel();
void onScrollEndReached();
}
}
@@ -0,0 +1,291 @@
package io.lbry.browser.dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatSpinner;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.adapter.InlineChannelSpinnerAdapter;
import io.lbry.browser.listener.WalletBalanceListener;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.WalletBalance;
import io.lbry.browser.tasks.claim.ClaimListResultHandler;
import io.lbry.browser.tasks.claim.ClaimListTask;
import io.lbry.browser.tasks.claim.ClaimResultHandler;
import io.lbry.browser.tasks.claim.StreamRepostTask;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryUri;
import lombok.Setter;
public class RepostClaimDialogFragment extends BottomSheetDialogFragment implements WalletBalanceListener {
public static final String TAG = "RepostClaimDialog";
private MaterialButton buttonRepost;
private View linkCancel;
private TextInputEditText inputDeposit;
private View inlineBalanceContainer;
private TextView inlineBalanceValue;
private ProgressBar repostProgress;
private TextView textTitle;
private AppCompatSpinner channelSpinner;
private InlineChannelSpinnerAdapter channelSpinnerAdapter;
private TextView textNamePrefix;
private EditText inputName;
private TextView linkToggleAdvanced;
private View advancedContainer;
@Setter
private RepostClaimListener listener;
@Setter
private Claim claim;
public static RepostClaimDialogFragment newInstance() {
return new RepostClaimDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_repost_claim, container, false);
buttonRepost = view.findViewById(R.id.repost_button);
linkCancel = view.findViewById(R.id.repost_cancel_link);
inputDeposit = view.findViewById(R.id.repost_input_deposit);
inlineBalanceContainer = view.findViewById(R.id.repost_inline_balance_container);
inlineBalanceValue = view.findViewById(R.id.repost_inline_balance_value);
repostProgress = view.findViewById(R.id.repost_progress);
textTitle = view.findViewById(R.id.repost_title);
channelSpinner = view.findViewById(R.id.repost_channel_spinner);
textNamePrefix = view.findViewById(R.id.repost_name_prefix);
inputName = view.findViewById(R.id.repost_name_input);
linkToggleAdvanced = view.findViewById(R.id.repost_toggle_advanced);
advancedContainer = view.findViewById(R.id.repost_advanced_container);
textTitle.setText(getString(R.string.repost_title, claim.getTitle()));
inputName.setText(claim.getName());
inputDeposit.setText(R.string.min_deposit);
channelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
Object item = adapterView.getItemAtPosition(position);
if (item instanceof Claim) {
Claim claim = (Claim) item;
textNamePrefix.setText(String.format("%s%s/", LbryUri.PROTO_DEFAULT, claim.getName()));
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
inputDeposit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
inputDeposit.setHint(hasFocus ? getString(R.string.zero) : "");
inlineBalanceContainer.setVisibility(hasFocus ? View.VISIBLE : View.INVISIBLE);
}
});
linkCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
linkToggleAdvanced.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (advancedContainer.getVisibility() != View.VISIBLE) {
advancedContainer.setVisibility(View.VISIBLE);
linkToggleAdvanced.setText(R.string.hide_advanced);
} else {
advancedContainer.setVisibility(View.GONE);
linkToggleAdvanced.setText(R.string.show_advanced);
}
}
});
buttonRepost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
validateAndRepostClaim();
}
});
onWalletBalanceUpdated(Lbry.walletBalance);
return view;
}
public void onResume() {
super.onResume();
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).addWalletBalanceListener(this);
}
fetchChannels();
}
public void onPause() {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).removeWalletBalanceListener(this);
}
inputDeposit.clearFocus();
super.onPause();
}
private void fetchChannels() {
if (Lbry.ownChannels == null || Lbry.ownChannels.size() == 0) {
startLoading();
ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, repostProgress, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
Lbry.ownChannels = new ArrayList<>(claims);
loadChannels(claims);
finishLoading();
}
@Override
public void onError(Exception error) {
// could not fetch channels
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showError(error.getMessage());
}
dismiss();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
loadChannels(Lbry.ownChannels);
}
}
private void loadChannels(List<Claim> channels) {
if (channelSpinnerAdapter == null) {
Context context = getContext();
channelSpinnerAdapter = new InlineChannelSpinnerAdapter(context, R.layout.spinner_item_channel, channels);
channelSpinnerAdapter.notifyDataSetChanged();
} else {
channelSpinnerAdapter.clear();
channelSpinnerAdapter.addAll(channels);
channelSpinnerAdapter.notifyDataSetChanged();
}
if (channelSpinner != null) {
channelSpinner.setAdapter(channelSpinnerAdapter);
}
}
@Override
public void onWalletBalanceUpdated(WalletBalance walletBalance) {
if (walletBalance != null && inlineBalanceValue != null) {
inlineBalanceValue.setText(Helper.shortCurrencyFormat(walletBalance.getAvailable().doubleValue()));
}
}
private void validateAndRepostClaim() {
String name = Helper.getValue(inputName.getText());
if (Helper.isNullOrEmpty(name) || !LbryUri.isNameValid(name)) {
showError(getString(R.string.repost_name_invalid_characters));
return;
}
String depositString = Helper.getValue(inputDeposit.getText());
if (Helper.isNullOrEmpty(depositString)) {
showError(getString(R.string.invalid_amount));
return;
}
BigDecimal bid = new BigDecimal(depositString);
if (bid.doubleValue() > Lbry.walletBalance.getAvailable().doubleValue()) {
showError(getString(R.string.insufficient_balance));
return;
}
Claim channel = (Claim) channelSpinner.getSelectedItem();
StreamRepostTask task = new StreamRepostTask(name, bid, claim.getClaimId(), channel.getClaimId(), repostProgress, new ClaimResultHandler() {
@Override
public void beforeStart() {
startLoading();
}
@Override
public void onSuccess(Claim claimResult) {
if (listener != null) {
listener.onClaimReposted(claimResult);
}
finishLoading();
dismiss();
}
@Override
public void onError(Exception error) {
showError(error.getMessage());
finishLoading();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void showError(String message) {
Snackbar.make(getView(), message, Snackbar.LENGTH_LONG).
setBackgroundTint(Color.RED).
setTextColor(Color.WHITE).
show();
}
private void startLoading() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setCanceledOnTouchOutside(false);
}
linkCancel.setEnabled(false);
buttonRepost.setEnabled(false);
inputName.setEnabled(false);
channelSpinner.setEnabled(false);
linkToggleAdvanced.setVisibility(View.INVISIBLE);
}
private void finishLoading() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setCanceledOnTouchOutside(true);
}
linkCancel.setEnabled(true);
buttonRepost.setEnabled(true);
inputName.setEnabled(true);
channelSpinner.setEnabled(true);
linkToggleAdvanced.setVisibility(View.VISIBLE);
}
public interface RepostClaimListener {
void onClaimReposted(Claim claim);
}
}
@@ -0,0 +1,196 @@
package io.lbry.browser.dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import io.lbry.browser.MainActivity;
import io.lbry.browser.R;
import io.lbry.browser.listener.WalletBalanceListener;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.WalletBalance;
import io.lbry.browser.tasks.GenericTaskHandler;
import io.lbry.browser.tasks.wallet.SupportCreateTask;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import lombok.Setter;
public class SendTipDialogFragment extends BottomSheetDialogFragment implements WalletBalanceListener {
public static final String TAG = "SendTipDialog";
private MaterialButton sendButton;
private View cancelLink;
private TextInputEditText inputAmount;
private View inlineBalanceContainer;
private TextView inlineBalanceValue;
private ProgressBar sendProgress;
@Setter
private SendTipListener listener;
@Setter
private Claim claim;
public static SendTipDialogFragment newInstance() {
return new SendTipDialogFragment();
}
private void disableControls() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setCanceledOnTouchOutside(false);
}
sendButton.setEnabled(false);
cancelLink.setEnabled(false);
}
private void enableControls() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setCanceledOnTouchOutside(true);
}
sendButton.setEnabled(true);
cancelLink.setEnabled(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_send_tip, container, false);
inputAmount = view.findViewById(R.id.tip_input_amount);
inlineBalanceContainer = view.findViewById(R.id.tip_inline_balance_container);
inlineBalanceValue = view.findViewById(R.id.tip_inline_balance_value);
sendProgress = view.findViewById(R.id.tip_send_progress);
cancelLink = view.findViewById(R.id.tip_cancel_link);
sendButton = view.findViewById(R.id.tip_send);
inputAmount.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
inputAmount.setHint(hasFocus ? getString(R.string.zero) : "");
inlineBalanceContainer.setVisibility(hasFocus ? View.VISIBLE : View.INVISIBLE);
}
});
TextView infoText = view.findViewById(R.id.tip_info);
infoText.setMovementMethod(LinkMovementMethod.getInstance());
infoText.setText(HtmlCompat.fromHtml(
Claim.TYPE_CHANNEL.equalsIgnoreCase(claim.getValueType()) ?
getString(R.string.send_tip_info_channel, claim.getTitleOrName()) :
getString(R.string.send_tip_info_content, claim.getTitleOrName()),
HtmlCompat.FROM_HTML_MODE_LEGACY));
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String amountString = Helper.getValue(inputAmount.getText());
if (Helper.isNullOrEmpty(amountString)) {
showError(getString(R.string.invalid_amount));
return;
}
BigDecimal amount = new BigDecimal(amountString);
if (amount.doubleValue() > Lbry.walletBalance.getAvailable().doubleValue()) {
showError(getString(R.string.insufficient_balance));
return;
}
SupportCreateTask task = new SupportCreateTask(claim.getClaimId(), amount, true, sendProgress, new GenericTaskHandler() {
@Override
public void beforeStart() {
disableControls();
}
@Override
public void onSuccess() {
enableControls();
if (listener != null) {
listener.onTipSent(amount);
}
dismiss();
}
@Override
public void onError(Exception error) {
showError(error.getMessage());
enableControls();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
cancelLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
String channel = null;
if (Claim.TYPE_CHANNEL.equalsIgnoreCase(claim.getValueType())) {
channel = claim.getTitleOrName();
} else if (claim.getSigningChannel() != null) {
channel = claim.getPublisherTitle();
}
((TextView) view.findViewById(R.id.tip_send_title)).setText(
Helper.isNullOrEmpty(channel) ? getString(R.string.send_a_tip) : getString(R.string.send_a_tip_to, channel)
);
onWalletBalanceUpdated(Lbry.walletBalance);
return view;
}
public void onResume() {
super.onResume();
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).addWalletBalanceListener(this);
}
}
public void onPause() {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).removeWalletBalanceListener(this);
}
super.onPause();
}
@Override
public void onWalletBalanceUpdated(WalletBalance walletBalance) {
if (walletBalance != null && inlineBalanceValue != null) {
inlineBalanceValue.setText(Helper.shortCurrencyFormat(walletBalance.getAvailable().doubleValue()));
}
}
private void showError(String message) {
Snackbar.make(getView(), message, Snackbar.LENGTH_LONG).
setBackgroundTint(Color.RED).
setTextColor(Color.WHITE).
show();
}
public interface SendTipListener {
void onTipSent(BigDecimal amount);
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class ApiCallException extends Exception {
public ApiCallException() {
super();
}
public ApiCallException(String message) {
super(message);
}
public ApiCallException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class LbryRequestException extends Exception {
public LbryRequestException() {
super();
}
public LbryRequestException(String message) {
super(message);
}
public LbryRequestException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class LbryResponseException extends Exception {
public LbryResponseException() {
super();
}
public LbryResponseException(String message) {
super(message);
}
public LbryResponseException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class LbryUriException extends Exception {
public LbryUriException() {
super();
}
public LbryUriException(String message) {
super(message);
}
public LbryUriException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class LbryioRequestException extends Exception {
public LbryioRequestException() {
super();
}
public LbryioRequestException(String message) {
super(message);
}
public LbryioRequestException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,25 @@
package io.lbry.browser.exceptions;
import lombok.Getter;
public class LbryioResponseException extends Exception {
@Getter
private int statusCode;
public LbryioResponseException() {
super();
}
public LbryioResponseException(String message) {
super(message);
}
public LbryioResponseException(String message, Throwable cause) {
super(message, cause);
}
public LbryioResponseException(String message, int statusCode) {
super(message);
this.statusCode = statusCode;
}
public LbryioResponseException(String message, Throwable cause, int statusCode) {
super(message, cause);
this.statusCode = statusCode;
}
}
@@ -0,0 +1,13 @@
package io.lbry.browser.exceptions;
public class WalletException extends Exception {
public WalletException() {
super();
}
public WalletException(String message) {
super(message);
}
public WalletException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,8 @@
package io.lbry.browser.listener;
public interface CameraPermissionListener {
void onCameraPermissionGranted();
void onCameraPermissionRefused();
void onRecordAudioPermissionGranted();
void onRecordAudioPermissionRefused();
}
@@ -0,0 +1,9 @@
package io.lbry.browser.listener;
import io.lbry.browser.model.Claim;
public interface ChannelItemSelectionListener {
void onChannelItemSelected(Claim claim);
void onChannelItemDeselected(Claim claim);
void onChannelSelectionCleared();
}
@@ -0,0 +1,5 @@
package io.lbry.browser.listener;
public interface DownloadActionListener {
void onDownloadAction(String downloadAction, String uri, String outpoint, String fileInfoJson, double progress);
}
@@ -0,0 +1,9 @@
package io.lbry.browser.listener;
import java.util.List;
import io.lbry.browser.model.Claim;
public interface FetchChannelsListener {
void onChannelsFetched(List<Claim> channels);
}
@@ -0,0 +1,9 @@
package io.lbry.browser.listener;
import java.util.List;
import io.lbry.browser.model.Claim;
public interface FetchClaimsListener {
void onClaimsFetched(List<Claim> claims);
}
@@ -0,0 +1,6 @@
package io.lbry.browser.listener;
public interface FilePickerListener {
void onFilePicked(String filePath);
void onFilePickerCancelled();
}
@@ -0,0 +1,6 @@
package io.lbry.browser.listener;
public interface ScreenOrientationListener {
void onPortraitOrientationEntered();
void onLandscapeOrientationEntered();
}
@@ -0,0 +1,5 @@
package io.lbry.browser.listener;
public interface SdkStatusListener {
void onSdkReady();
}
@@ -0,0 +1,7 @@
package io.lbry.browser.listener;
public interface SelectionModeListener {
void onEnterSelectionMode();
void onExitSelectionMode();
void onItemSelectionToggled();
}
@@ -0,0 +1,10 @@
package io.lbry.browser.listener;
public interface SignInListener {
void onEmailAdded(String email);
void onEmailEdit();
void onEmailVerified();
void onPhoneAdded(String countryCode, String phoneNumber);
void onPhoneVerified();
void onManualVerifyContinue();
}
@@ -0,0 +1,6 @@
package io.lbry.browser.listener;
public interface StoragePermissionListener {
void onStoragePermissionGranted();
void onStoragePermissionRefused();
}
@@ -0,0 +1,8 @@
package io.lbry.browser.listener;
import io.lbry.browser.model.Tag;
public interface TagListener {
void onTagAdded(Tag tag);
void onTagRemoved(Tag tag);
}
@@ -0,0 +1,7 @@
package io.lbry.browser.listener;
import io.lbry.browser.model.WalletBalance;
public interface WalletBalanceListener {
void onWalletBalanceUpdated(WalletBalance walletBalance);
}
@@ -0,0 +1,8 @@
package io.lbry.browser.listener;
public interface WalletSyncListener {
void onWalletSyncProcessing();
void onWalletSyncWaitingForInput();
void onWalletSyncEnabled();
void onWalletSyncFailed(Exception error);
}
@@ -0,0 +1,490 @@
package io.lbry.browser.model;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
import io.lbry.browser.utils.Predefined;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Claim {
public static final String CLAIM_TYPE_CLAIM = "claim";
public static final String CLAIM_TYPE_UPDATE = "update";
public static final String CLAIM_TYPE_SUPPORT = "support";
public static final String TYPE_STREAM = "stream";
public static final String TYPE_CHANNEL = "channel";
public static final String TYPE_REPOST = "repost";
public static final String STREAM_TYPE_AUDIO = "audio";
public static final String STREAM_TYPE_IMAGE = "image";
public static final String STREAM_TYPE_VIDEO = "video";
public static final String STREAM_TYPE_SOFTWARE = "software";
public static final String ORDER_BY_EFFECTIVE_AMOUNT = "effective_amount";
public static final String ORDER_BY_RELEASE_TIME = "release_time";
public static final String ORDER_BY_TRENDING_GROUP = "trending_group";
public static final String ORDER_BY_TRENDING_MIXED = "trending_mixed";
public static final List<String> CLAIM_TYPES = Arrays.asList(TYPE_CHANNEL, TYPE_STREAM);
public static final List<String> STREAM_TYPES = Arrays.asList(
STREAM_TYPE_AUDIO, STREAM_TYPE_IMAGE, STREAM_TYPE_SOFTWARE, STREAM_TYPE_VIDEO
);
public static final String RELEASE_TIME_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
@EqualsAndHashCode.Include
private boolean placeholder;
private boolean placeholderAnonymous;
private boolean featured;
private boolean unresolved; // used for featured
private String address;
private String amount;
private String canonicalUrl;
@EqualsAndHashCode.Include
private String claimId;
private int claimSequence;
private String claimOp;
private long confirmations;
private boolean decodedClaim;
private long timestamp;
private long height;
private boolean isMine;
private String name;
private String normalizedName;
private int nout;
private String permanentUrl;
private String shortUrl;
private String txid;
private String type; // claim | update | support
private String valueType; // stream | channel | repost
private Claim repostedClaim;
private Claim signingChannel;
private String repostChannelUrl;
private boolean isChannelSignatureValid;
private GenericMetadata value;
private LbryFile file; // associated file if it exists
// device it was viewed on (for view history)
private String device;
public static Claim claimFromOutput(JSONObject item) {
// we only need name, permanent_url, txid and nout
Claim claim = new Claim();
claim.setClaimId(Helper.getJSONString("claim_id", null, item));
claim.setName(Helper.getJSONString("name", null, item));
claim.setPermanentUrl(Helper.getJSONString("permanent_url", null, item));
claim.setTxid(Helper.getJSONString("txid", null, item));
claim.setNout(Helper.getJSONInt("nout", -1, item));
return claim;
}
public String getOutpoint() {
return String.format("%s:%d", txid, nout);
}
public boolean isFree() {
if (!(value instanceof StreamMetadata)) {
return true;
}
Fee fee = ((StreamMetadata) value).getFee();
return fee == null || Helper.parseDouble(fee.getAmount(), 0) == 0;
}
public BigDecimal getActualCost(double usdRate) {
if (!(value instanceof StreamMetadata)) {
return new BigDecimal(0);
}
Fee fee = ((StreamMetadata) value).getFee();
if (fee != null) {
double amount = Helper.parseDouble(fee.getAmount(), 0);
if ("usd".equalsIgnoreCase(fee.getCurrency())) {
return new BigDecimal(String.valueOf(amount / usdRate));
}
return new BigDecimal(String.valueOf(amount)); // deweys
}
return new BigDecimal(0);
}
public String getMediaType() {
if (value instanceof StreamMetadata) {
StreamMetadata metadata = (StreamMetadata) value;
String mediaType = metadata.getSource() != null ? metadata.getSource().getMediaType() : null;
return mediaType;
}
return null;
}
public boolean isPlayable() {
if (value instanceof StreamMetadata) {
StreamMetadata metadata = (StreamMetadata) value;
String mediaType = metadata.getSource() != null ? metadata.getSource().getMediaType() : null;
if (mediaType != null) {
return mediaType.startsWith("video") || mediaType.startsWith("audio");
}
}
return false;
}
public boolean isViewable() {
if (value instanceof StreamMetadata) {
StreamMetadata metadata = (StreamMetadata) value;
String mediaType = metadata.getSource() != null ? metadata.getSource().getMediaType() : null;
if (mediaType != null) {
return mediaType.startsWith("image") || mediaType.startsWith("text");
}
}
return false;
}
public boolean isMature() {
List<String> tags = getTags();
if (tags != null && tags.size() > 0) {
for (String tag : tags) {
if (Predefined.MATURE_TAGS.contains(tag.toLowerCase())) {
return true;
}
}
}
return false;
}
public String getThumbnailUrl() {
if (value != null && value.getThumbnail() != null) {
return value.getThumbnail().getUrl();
}
return null;
}
public String getCoverUrl() {
if (TYPE_CHANNEL.equals(valueType) && value != null && value instanceof ChannelMetadata && ((ChannelMetadata) value).getCover() != null) {
return ((ChannelMetadata) value).getCover().getUrl();
}
return null;
}
public String getFirstCharacter() {
if (name != null) {
return name.startsWith("@") ? name.substring(1) : name;
}
return "";
}
public String getFirstTag() {
if (value != null && value.tags != null && value.tags.size() > 0) {
return value.tags.get(0);
}
return null;
}
public String getDescription() {
return (value != null) ? value.getDescription() : null;
}
public String getWebsiteUrl() {
return (value instanceof ChannelMetadata) ? ((ChannelMetadata) value).getWebsiteUrl() : null;
}
public String getEmail() {
return (value instanceof ChannelMetadata) ? ((ChannelMetadata) value).getEmail() : null;
}
public String getPublisherName() {
if (signingChannel != null) {
return signingChannel.getName();
}
return "Anonymous";
}
public String getPublisherTitle() {
if (signingChannel != null) {
return Helper.isNullOrEmpty(signingChannel.getTitle()) ? signingChannel.getName() : signingChannel.getTitle();
}
return "Anonymous";
}
public List<String> getTags() {
return (value != null && value.getTags() != null) ? new ArrayList<>(value.getTags()) : new ArrayList<>();
}
public List<Tag> getTagObjects() {
List<Tag> tags = new ArrayList<>();
if (value != null && value.getTags() != null) {
for (String value : value.getTags()) {
tags.add(new Tag(value));
}
}
return tags;
}
public String getTitle() {
return (value != null) ? value.getTitle() : null;
}
public String getTitleOrName() {
return (value != null) ? value.getTitle() : getName();
}
public long getDuration() {
if (value instanceof StreamMetadata) {
StreamMetadata metadata = (StreamMetadata) value;
if (STREAM_TYPE_VIDEO.equalsIgnoreCase(metadata.getStreamType()) && metadata.getVideo() != null) {
return metadata.getVideo().getDuration();
} else if (STREAM_TYPE_AUDIO.equalsIgnoreCase(metadata.getStreamType()) && metadata.getAudio() != null) {
return metadata.getAudio().getDuration();
}
}
return 0;
}
public static Claim fromViewHistory(ViewHistory viewHistory) {
// only for stream claims
Claim claim = new Claim();
claim.setClaimId(viewHistory.getClaimId());
claim.setName(viewHistory.getClaimName());
claim.setValueType(TYPE_STREAM);
claim.setPermanentUrl(viewHistory.getUri().toString());
claim.setDevice(viewHistory.getDevice());
claim.setConfirmations(1);
StreamMetadata value = new StreamMetadata();
value.setTitle(viewHistory.getTitle());
value.setReleaseTime(viewHistory.getReleaseTime());
if (!Helper.isNullOrEmpty(viewHistory.getThumbnailUrl())) {
Resource thumbnail = new Resource();
thumbnail.setUrl(viewHistory.getThumbnailUrl());
value.setThumbnail(thumbnail);
}
if (viewHistory.getCost() != null && viewHistory.getCost().doubleValue() > 0) {
Fee fee = new Fee();
fee.setAmount(String.valueOf(viewHistory.getCost().doubleValue()));
fee.setCurrency(viewHistory.getCurrency());
value.setFee(fee);
}
claim.setValue(value);
if (!Helper.isNullOrEmpty(viewHistory.getPublisherClaimId())) {
Claim signingChannel = new Claim();
signingChannel.setClaimId(viewHistory.getPublisherClaimId());
signingChannel.setName(viewHistory.getPublisherName());
if (!Helper.isNullOrEmpty(viewHistory.getPublisherTitle())) {
GenericMetadata channelValue = new GenericMetadata();
channelValue.setTitle(viewHistory.getPublisherTitle());
signingChannel.setValue(channelValue);
}
claim.setSigningChannel(signingChannel);
}
return claim;
}
public static Claim fromJSONObject(JSONObject claimObject) {
Claim claim = null;
String claimJson = claimObject.toString();
Type type = new TypeToken<Claim>(){}.getType();
Type streamMetadataType = new TypeToken<StreamMetadata>(){}.getType();
Type channelMetadataType = new TypeToken<ChannelMetadata>(){}.getType();
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
claim = gson.fromJson(claimJson, type);
try {
String valueType = claim.getValueType();
// Specific value type parsing
if (TYPE_REPOST.equalsIgnoreCase(valueType)) {
JSONObject repostedClaimObject = claimObject.getJSONObject("reposted_claim");
claim.setRepostedClaim(Claim.fromJSONObject(repostedClaimObject));
} else {
JSONObject value = claimObject.getJSONObject("value");
if (value != null) {
String valueJson = value.toString();
if (TYPE_STREAM.equalsIgnoreCase(valueType)) {
claim.setValue(gson.fromJson(valueJson, streamMetadataType));
} else if (TYPE_CHANNEL.equalsIgnoreCase(valueType)) {
claim.setValue(gson.fromJson(valueJson, channelMetadataType));
}
}
}
} catch (JSONException ex) {
// pass
}
return claim;
}
public static Claim fromSearchJSONObject(JSONObject searchResultObject) {
Claim claim = new Claim();
LbryUri claimUri = new LbryUri();
try {
claim.setClaimId(searchResultObject.getString("claimId"));
claim.setName(searchResultObject.getString("name"));
claim.setConfirmations(1);
if (claim.getName().startsWith("@")) {
claimUri.setChannelClaimId(claim.getClaimId());
claimUri.setChannelName(claim.getName());
claim.setValueType(TYPE_CHANNEL);
} else {
claimUri.setStreamClaimId(claim.getClaimId());
claimUri.setStreamName(claim.getName());
claim.setValueType(TYPE_STREAM);
}
int duration = searchResultObject.isNull("duration") ? 0 : searchResultObject.getInt("duration");
long feeAmount = searchResultObject.isNull("fee") ? 0 : searchResultObject.getLong("fee");
String releaseTimeString = !searchResultObject.isNull("release_time") ? searchResultObject.getString("release_time") : null;
long releaseTime = 0;
try {
releaseTime = Double.valueOf(new SimpleDateFormat(RELEASE_TIME_DATE_FORMAT).parse(releaseTimeString).getTime() / 1000.0).longValue();
} catch (ParseException ex) {
// pass
}
GenericMetadata metadata = (duration > 0 || releaseTime > 0 || feeAmount > 0) ? new StreamMetadata() : new GenericMetadata();
metadata.setTitle(searchResultObject.getString("title"));
if (metadata instanceof StreamMetadata) {
StreamInfo streamInfo = new StreamInfo();
if (duration > 0) {
// assume stream type video
((StreamMetadata) metadata).setStreamType(STREAM_TYPE_VIDEO);
streamInfo.setDuration(duration);
}
Fee fee = null;
if (feeAmount > 0) {
fee = new Fee();
fee.setAmount(String.valueOf(new BigDecimal(String.valueOf(feeAmount)).divide(new BigDecimal(100000000))));
fee.setCurrency("LBC");
}
((StreamMetadata) metadata).setFee(fee);
((StreamMetadata) metadata).setVideo(streamInfo);
((StreamMetadata) metadata).setReleaseTime(releaseTime);
}
claim.setValue(metadata);
if (!searchResultObject.isNull("thumbnail_url")) {
Resource thumbnail = new Resource();
thumbnail.setUrl(searchResultObject.getString("thumbnail_url"));
claim.getValue().setThumbnail(thumbnail);
}
if (!searchResultObject.isNull("channel_claim_id") && !searchResultObject.isNull("channel")) {
Claim signingChannel = new Claim();
signingChannel.setClaimId(searchResultObject.getString("channel_claim_id"));
signingChannel.setName(searchResultObject.getString("channel"));
LbryUri channelUri = new LbryUri();
channelUri.setChannelClaimId(signingChannel.getClaimId());
channelUri.setChannelName(signingChannel.getName());
signingChannel.setPermanentUrl(channelUri.toString());
claim.setSigningChannel(signingChannel);
}
} catch (JSONException ex) {
// pass
}
claim.setPermanentUrl(claimUri.toString());
return claim;
}
@Data
public static class Meta {
private long activationHeight;
private int claimsInChannel;
private int creationHeight;
private int creationTimestamp;
private String effectiveAmount;
private long expirationHeight;
private boolean isControlling;
private String supportAmount;
private int reposted;
private double trendingGlobal;
private double trendingGroup;
private double trendingLocal;
private double trendingMixed;
}
@Data
public static class GenericMetadata {
private String title;
private String description;
private Resource thumbnail;
private List<String> languages;
private List<String> tags;
private List<Location> locations;
}
@Data
@EqualsAndHashCode(callSuper = true)
public static class ChannelMetadata extends GenericMetadata {
private String publicKey;
private String publicKeyId;
private Resource cover;
private String email;
private String websiteUrl;
private List<String> featured;
}
@Data
@EqualsAndHashCode(callSuper = true)
public static class StreamMetadata extends GenericMetadata {
private String license;
private String licenseUrl;
private long releaseTime;
private String author;
private Fee fee;
private String streamType; // video | audio | image | software
private Source source;
private StreamInfo video;
private StreamInfo audio;
private StreamInfo image;
private StreamInfo software;
@Data
public static class Source {
private String sdHash;
private String mediaType;
private String hash;
private String name;
private long size;
}
}
// only support "url" for now
@Data
public static class Resource {
private String url;
}
@Data
public static class StreamInfo {
private long duration; // video / audio
private long height; // video / image
private long width; // video / image
private String os; // software
}
}
Loaded 100 of 1188 files, more files were not shown because too many files have changed in this diff. Show more