Compare commits

..
405 Commits
Author SHA1 Message Date
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
1218 changed files with 177157 additions and 31011 deletions

No files matched your search

+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
+6
View File
@@ -6,4 +6,10 @@ build.log
recipes/**/*.pyc
src/main/assets/index.android.bundle
src/main/assets/index.android.bundle.meta
*.log
.vagrant
lbry-android.keystore
p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
.gitsecret/keys/random_seed
+58
View File
@@ -0,0 +1,58 @@
stages:
- build
- deploy
- release
build apk:
stage: build
image: lbry/android-base:latest
before_script:
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
artifacts:
paths:
- bin/browser-*-release.apk
script:
- export PATH=/usr/bin:$PATH
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- cd app
- npm install
- cd ..
- wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- git secret reveal
- mv buildozer.spec.travis buildozer.spec
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk /dev/null
deploy build.lbry.io:
image: python:latest
stage: deploy
dependencies:
- build apk
before_script:
- pip install awscli
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
script:
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/push.apk
release apk:
image: python:latest
stage: release
only:
- tags
dependencies:
- build apk
before_script:
- pip install awscli githubrelease
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
script:
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/latest.apk
View File
Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
lbry-android.keystore:
p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json
+95 -39
View File
@@ -1,39 +1,95 @@
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
sudo: required
dist: xenial
language: python
python:
- '3.7'
install:
- deactivate
- export PATH=/usr/bin:$PATH
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- sudo dpkg --add-architecture i386
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential python3.7 python3.7-dev python3.7-venv python3-pip 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
- sudo pip install --upgrade cython==0.28.1 pip setuptools
- wget -q https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz
- tar -xf node-v8.11.1-linux-x64.tar.xz
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/node /usr/bin/node
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/npm /usr/bin/npm
- git clone https://github.com/lbryio/buildozer.git
- cd app
- npm config set registry="http://registry.npmjs.org/"
- npm install
- sudo npm install -g react-native-cli
- sudo ln -s $TRAVIS_BUILD_DIR/node-v8.11.1-linux-x64/bin/react-native /usr/bin/react-native
- cd ..
- cd buildozer
- sudo python setup.py install
- cd ..
- mv buildozer.spec.travis buildozer.spec
- mkdir -p cd ~/.buildozer/android/platform/
- wget -q 'https://dist.testnet.lbry.tech/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
- wget -q 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/platform-27_r01.zip' -P ~/.buildozer/android/platform/
- wget -q 'https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip' -P ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
- cp -f $TRAVIS_BUILD_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- 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/platform-27_r01.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
- mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-27
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.2-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
- mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.2
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
- echo $'\n84831b9409646a918e30573bab4c9c91346d8abd' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-preview-license
script:
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
- cp $TRAVIS_BUILD_DIR/bin/*.apk /dev/null
before_deploy:
- cd $TRAVIS_BUILD_DIR/bin
- export BUILD_VERSION=$(cat ../src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
- cp browser-$BUILD_VERSION-release.apk latest.apk
deploy:
- provider: releases
api_key:
secure: m+FYX7vHZoiLSHHiJ2d3y8Fm4qSRoIVjEei+5BV17awiow/U8UKvy/5J1n8qfBdq+dpst5z58pTHCKWPbJz84C3z/posJ5mwEcOAaD/kxSAMHbtlaPW90pRWHUu3aW86UM/ggqtljE9Qz8KS/9a0xNUDfcXLkLgxuxgwodMcacEulAAc9TIOCUeR3IFI+KN0ptTCVahCu2JN8DCHKomaR+yKZHdo/9v9XCAcvmImSDu9nUDLH3+A7xQeRpPJqSspk1dadgdXP76kU8t3OKsYuM7DS5AoKvMIc9lZot4UYYKAx7/zavbzeEmqnyskULgsmV8/UDI1AV9U7uFBdrR6dSjISA1k6EHnCgqzasF+lp0hz5iE/0yPxlE9Z1kLW9gZgxSJtjr6Kv2uqAjHYYmpkjtTwHPwBugRM7PWMTxHNcPwkIHpBSRkXjpyDjkWd/LY4X866Y1g2BdIhbGshjy/9Fb2vnYxNZW6drLHn+wWeHJ41Vfgtg1cn01yZGJqgIkcTkhzNL6Bi++y8EBJXDr4L870s336SpbqRuIrO/C16ZFB+XnOg4Ty50Fk5zkbySMHII58iWqSyDYWNvhqo9zU9jn1XQQeok12129Y4t9TUOcJRbxhQ+511lCmVcFIkWHsXDK2QSZ7TeMK5GQUA8OvcNe+WLCJaQ/YD7OZvwlPTvc=
file_glob: true
file: browser-*-release.apk
overwrite: true
skip_cleanup: true
on:
tags: true
- provider: s3
access_key_id:
secure: qEZZ73DWBn9+M2pS4VwsyX8YZjZOENIMP/eoU1A9Vbn155oZpbUaJ7k+4cAXqmBm0WBMKZDqpzCRSGehLAxHFH5rjkj9gLSgd8fY9cveABHkl50HeuxxNsQM+ytk9sCtP8bWOqf7rT/iCgM1soyF2pYmfHM3tU9l0fWK8oZ7pFRIg91hXxUvhvYY2u6B9D1NqSN9T3xtrwEkVjvmkmyKMLCtoIdyB7QdeQciFdGFhZC9DYJVRLxa3BlzZ1T8Qv4MCyIxPjxIugNvVR64VgGjdBdq0BEIyoRqbeIvtqQjlnne4DfJFeCmbDrSva1wDP1UyFoxsRhiWQ/jXXgIyN2CisI6QRD0J+a2LgmbmtkUzhRMuVQJmBrIauulOzcowwRV2J4TtUaAJK9iSHT9D3RLzpazCOnjvJZV9CK5w252Vs5eHnisCSCQk8Ozox96Sg6XW580NEXfkYoGzXLSGiy9zrZs813blUjssEY+jIQmJEby80C3guK7/G4lzthv57psqBWcYd0tFR+vTestS+EFlC02ToUngJhW7I7lPA2G2yrJ5319jFxUSniijb1n72TQthnbqTBahepvKvuG1iWZnCKxS5sWkutFoqEcpQyhXdf7QdR/VrOr8N5xrhK1B8dCYZM6h8eMZbBvOLH49+N6L9jiJz5x+Lk32wcssv1oOgI=
secret_access_key:
secure: lPygaaJdjFgWY4GcXUXC4Oc5op/TE85Md8lX2bzW19058lbcqYSdM0WySQCxoU/4rlM4Q0N8du0qQ3kZXDpP9XSqvFTVnTGTuB4yghUR1yXcpt6u3JOeOX+YAc3wyQ/pmod6VGO0n8pm8hBVsSFXufdBTjD2W+tNrDoa8RYnlWrt7BbICGltB7PcqYh1Qw6S1wDyZt8I4B5JHDhyJmX6FT5KfOb5cJyynpxlKUstUfy1rh81KuGkEcuEVOLg1s7HE1/IUkVIgezAuCrMHjc86qbNcHULJMFCVYntvvs07+tctrPxA/cfS24WkW7smyij+gdZAZWNNgkIDCuwqpex1v1nKn56mC8xXyUl4CnSCuubQtqUBzTmd4T5sF7trTtpVr9NInwy+4mUoCpz2UKZekTjZkqpzCAuC/cBVWE1/k3wsNat6dGyc9QnKXBqLVhuwYsCOteqLW50ToMMMW0ccDV6FXodwZmrunGd5wIX+UgZkf4l32vzKUxHtIupfYbsjylcPc3VO0OzMMKP/3sYLAN6QntVDFc30k1uqqpgJN4t0nV7vvjMI+b0Qr+o7GzUV2d+QulQXOySJgB2pH0kV1EoPAJ8KbqDOy8KgCJl0YIbOaz14+SiRQhotJ2hrLdtsvyVYXMX+d/CKHJSWa2MQq+jD7lMCwVaGg82PFN1gI4=
bucket: "build.lbry.io"
upload-dir: android
region: us-east-1
overwrite: true
skip_cleanup: true
on:
tags: true
- provider: s3
access_key_id:
secure: qEZZ73DWBn9+M2pS4VwsyX8YZjZOENIMP/eoU1A9Vbn155oZpbUaJ7k+4cAXqmBm0WBMKZDqpzCRSGehLAxHFH5rjkj9gLSgd8fY9cveABHkl50HeuxxNsQM+ytk9sCtP8bWOqf7rT/iCgM1soyF2pYmfHM3tU9l0fWK8oZ7pFRIg91hXxUvhvYY2u6B9D1NqSN9T3xtrwEkVjvmkmyKMLCtoIdyB7QdeQciFdGFhZC9DYJVRLxa3BlzZ1T8Qv4MCyIxPjxIugNvVR64VgGjdBdq0BEIyoRqbeIvtqQjlnne4DfJFeCmbDrSva1wDP1UyFoxsRhiWQ/jXXgIyN2CisI6QRD0J+a2LgmbmtkUzhRMuVQJmBrIauulOzcowwRV2J4TtUaAJK9iSHT9D3RLzpazCOnjvJZV9CK5w252Vs5eHnisCSCQk8Ozox96Sg6XW580NEXfkYoGzXLSGiy9zrZs813blUjssEY+jIQmJEby80C3guK7/G4lzthv57psqBWcYd0tFR+vTestS+EFlC02ToUngJhW7I7lPA2G2yrJ5319jFxUSniijb1n72TQthnbqTBahepvKvuG1iWZnCKxS5sWkutFoqEcpQyhXdf7QdR/VrOr8N5xrhK1B8dCYZM6h8eMZbBvOLH49+N6L9jiJz5x+Lk32wcssv1oOgI=
secret_access_key:
secure: lPygaaJdjFgWY4GcXUXC4Oc5op/TE85Md8lX2bzW19058lbcqYSdM0WySQCxoU/4rlM4Q0N8du0qQ3kZXDpP9XSqvFTVnTGTuB4yghUR1yXcpt6u3JOeOX+YAc3wyQ/pmod6VGO0n8pm8hBVsSFXufdBTjD2W+tNrDoa8RYnlWrt7BbICGltB7PcqYh1Qw6S1wDyZt8I4B5JHDhyJmX6FT5KfOb5cJyynpxlKUstUfy1rh81KuGkEcuEVOLg1s7HE1/IUkVIgezAuCrMHjc86qbNcHULJMFCVYntvvs07+tctrPxA/cfS24WkW7smyij+gdZAZWNNgkIDCuwqpex1v1nKn56mC8xXyUl4CnSCuubQtqUBzTmd4T5sF7trTtpVr9NInwy+4mUoCpz2UKZekTjZkqpzCAuC/cBVWE1/k3wsNat6dGyc9QnKXBqLVhuwYsCOteqLW50ToMMMW0ccDV6FXodwZmrunGd5wIX+UgZkf4l32vzKUxHtIupfYbsjylcPc3VO0OzMMKP/3sYLAN6QntVDFc30k1uqqpgJN4t0nV7vvjMI+b0Qr+o7GzUV2d+QulQXOySJgB2pH0kV1EoPAJ8KbqDOy8KgCJl0YIbOaz14+SiRQhotJ2hrLdtsvyVYXMX+d/CKHJSWa2MQq+jD7lMCwVaGg82PFN1gI4=
bucket: "build.lbry.io"
upload-dir: "android/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}"
region: us-east-1
overwrite: true
skip_cleanup: true
on:
all_branches: true
env:
global:
- secure: GS3Cp1QXiX8UPye3kdk2A2f3iFRr02sHKpY+RE+Zvx3Q7GDmhDuepHKzx6Hq5Os5fZN9Y/Bdds+XH+vLIRtT6XsWR7AONPhSifVY3XB5/2F+lDcZ538W8P8GZvXejpY4VecMUWHoWbuyt0s3PpaGXZJcHp8ir+CUJ0NUmU3I9w449pqj9/de2LHtG3qKH1lG0Xz58iOC0mmEeH451cQv3dDw851ihA4ak9vCTV1KKuMJUcv+2u6PxXGVX0mrJLEssjL6ze6G5iZUB4PM1vUpe3HqcVw8CSOa8O79BQxoB00qyA3WD+LpZDPpI0wh6gmBsR/2nCFyMJndJr3CjyB6lHdK7PgBoK0CJjszKawiZqg74O9DOjzTJTO2v9bnkfPrNxu4/3D/tbDg+whY8k5oV1sgDue9KAo/2aEEO0LGlKP4W3Qqt/lzRKsfpMVrMTdCNKJ8rG/wUFWw8ehOCmAsJaQ1saDOZDMNPLLuYpxFgmXFqWV5ThbUHgEJVj+G7qt6CMEussKvuZJoJZx24Pdk5Prr7ENzTyPmE5gk4b8WNfVNleOEC09xu5tFk2yOdzF1dawKsa1Mog6gImirTQ/INC/3BANdKoG9/cLJEIt9boJaFDXE1dpqoLVzoez9znHKOGSAU/1PaH3thjVnbUyO5z24PpPZ12zM3+3P8DbI454=
before_install:
- openssl aes-256-cbc -K $encrypted_b4c9b905b12e_key -iv $encrypted_b4c9b905b12e_iv
-in lbry-android.keystore.enc -out lbry-android.keystore -d
+117
View File
@@ -0,0 +1,117 @@
## Linux Build Instructions
This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04, but these instructions, or an analog of them, should work on most Linux or macOS environments.
### Install Prerequisites
#### Requirements
* JDK 1.8
* Android SDK
* Crystax Android NDK
* Buildozer
* Node.js
* npm
* yarn
#### apt Packages
Based on the quick-start instructions at http://buildozer.readthedocs.io/en/latest/installation.html
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install autoconf autogen build-essential curl libtool libffi-dev python python-pip python-openssl python3.7 python3.7-dev python3-pip 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
```
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.
#### Install Cython and Setuptools
```
sudo pip install --upgrade cython==0.28.1 setuptools
```
#### Install buildozer
A forked version of `buildozer` needs to be installed in order to copy the React Native UI source files into the corresponding directories.
```
git clone https://github.com/lbryio/buildozer.git
cd buildozer
sudo python2.7 setup.py install
```
#### Create buildozer.spec
Assuming `lbry-android` 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. The basic recommended settings are outlined below.
| Setting | Description |
|:------------------- |:-----------------------------|
| title | application title |
| package.name | package name (e.g. browser) |
| package.domain | package domain (e.g. io.lbry) |
| source.dir | the location of the application main.py |
| version | application version |
| requirements | the Python 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 (Should be at least 23 for Gradle build support) |
| android.sdk | Android SDK version (Should be at least 23 for Gradle build support) |
| android.ndk | Android NDK version (not required when using crystax Android NDK) |
| android.ndk_path | Android NDK path. This should be set to the crystax Android NDK path) |
| android.sdk_path | Android SDK path. This should be set to the path where the Android SDK is manually set up (if not set up in the `.buildozer` path). |
| 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 |
#### Setup Android SDK for buildozer
Download the Android SDK, platform and build tools archives.
* Android API 23 SDK - https://dl.google.com/android/android-sdk_r23-linux.tgz
* Android API 27 platform - https://dl.google.com/android/repository/platform-27_r01.zip
* Android build tools 26.0.1 - https://dl.google.com/android/repository/build-tools_r26.0.1-linux.
Create the `.buildozer` path (and the `android` sub-path) in your home folder if it doesn't already exist.
`mkdir ~/.buildozer`
`mkdir ~/.buildozer/android`
Extract the API 23 SDK to the `~/.buildozer/android` path and rename the extracted folder.
```
tar -xf android-sdk_r23-linux.tgz ~/.buildozer/android/platform/
mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
```
Extract the API 27 platform archive into the `android-sdk-23` folder and rename the extracted folder.
```
unzip platform-27_r01.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-27
```
Extract the build tools 26.0.1 build tools into the `android-sdk-23` folder and rename the extracted folder.
```
mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
unzip ~/.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
```
Finally, create the Android SDK license file. This prevents being prompted to accept the SDK license during the build process.
```
mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
```
#### Setup Crystax Android NDK for buildozer
* Download the Crystax Android NDK from https://us.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz and extract. Remember to update `android.ndk_path` in your `buildozer.spec` to the path of the extracted Crystax NDK archive.
* Copy `build-target-python.sh` from the `scripts` folder in the cloned `lbry-android` repository to the `crystax-ndk-10.3.2/build/tools/` folder.
* Delete the `android-9` folder in `crystax-ndk-10.3.2/platforms`, and create a symbolic link named `android-9` to the `android-21` folder.
#### Build and Deploy
Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface.
Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory.
To build and deploy, you can run `./deploy.sh`. This requires a connected device or running Android emulator.
#### Development
If you already installed `Android SDK` and `adb`
* Run `adb reverse tcp:8081 tcp:8081`
* Then go to the `lbry-android/app` folder and run `npm start`
Note: You need to have your device connected with USB debugging.
Once the bundler is ready, run the LBRY Browser app on your device and then shake the device violently until you see the React Native dev menu. You can enable "Live Reloading" and "Hot Reloading" from this menu, so any changes you make to the React Native code will be visible as you save. This will only reload React Native Javascript files. Native Java code needs to be redeployed by running the command `./deploy.sh`
+110
View File
@@ -0,0 +1,110 @@
### Introduction
If you would like to contribute to the Android app, but find the build documentation a little daunting, this guide lets you copy-paste your way to a successful APK build.
#### Estimated build time
25 - 40 minutes (depending on Internet connection speeds)
#### What do you need?
* A computer running Ubuntu 18.04
* Internet access to download modules and packages.
* At least 15GB of free disk space.
* Alternatively, Docker. You can skip steps 1 through 5 if you make use of the `lbry/android-base` Docker base image. Scroll down to Fast track if you would prefer to use Docker.
### Step 1 of 10
Install all the apt packages required by running the following commands. You can copy-paste directly to your terminal.
```
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get install -y curl ca-certificates software-properties-common gpg-agent wget
sudo add-apt-repository ppa:deadsnakes/ppa -y && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get -y update && apt-get -y install autoconf autogen automake libtool libffi-dev \
build-essential python3.7 python3.7-dev python3.7-venv python3-pip 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 \
python-pip openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 yarn gawk nodejs npm
```
### Step 2 of 10
Install a couple of packages using the Python package installer
```
sudo -H pip install --upgrade cython==0.28.1 setuptools
```
### Step 3 of 10
Install buildozer, a tool for creating the apk package using the python for android toolcahin.
```
git clone https://github.com/lbryio/buildozer.git
cd buildozer && python2.7 setup.py install && cd ..
```
### Step 4 of 10
The Android SDK needs to be setup for buildozer. This requires creating a few directories and downloading a number of files. Run the following commands to create the buildozer directory, download the required archives and extract them into their proper destination folders.
```
mkdir -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/platform-28_r06.zip' -P ~/.buildozer/android/platform/ && \
wget 'https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip' -P ~/.buildozer/android/platform/
tar -xvf ~/.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 ~/.buildozer/android/platform/platform-28_r06.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms && \
mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-9 ~/.buildozer/android/platform/android-sdk-23/platforms/android-28 && \
mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools && \
unzip ~/.buildozer/android/platform/build-tools_r26.0.2-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools && \
mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses && \
echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
```
### Step 5 of 10
Install the react-native-cli npm package.
```
sudo npm install -g react-native-cli
```
### Step 6 of 10
Install the Crystax NDK which is required for building Python 3.7 for the mobile app, and a number of native C / C++ modules and packages used by the app. Run the following commands to download and extract the NDK.
```
wget 'https://www.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/ && \
tar -xvf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/ && \
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9 && \
ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
```
### Step 7 of 10
Clone the lbryio/lbry-android git repository and create your buildozer.spec file. The provide buildozer.spec.sample contains defaults provided you followed steps 1 through 5 exactly as described. You can also customise the spec file if you want to.
```
git clone https://github.com/lbryio/lbry-android
cd lbry-android
cp buildozer.spec.sample buildozer.spec
```
### Step 8 of 10
Install the npm packages required for the app's React Native code.
```
cd app
npm install
cd ..
```
### Step 9 of 10
Copy a couple of required files from the repository for the build to be successful.
```
cp scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
cp scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
```
### Step 10 of 10
If you made it this far, you're finally ready to build the package! You just have to run a single command to generate the APK.
```
buildozer android debug
```
### Fast Track
Install Docker and start a container using the `lbry/android-base` image, which is about 1.72GB in size. Run the following commands for Ubuntu and then follow steps 6 through 10 in the container's bash prompt.
```
sudo apt-get install docker-ce
docker run -it lbry/android-base:latest /bin/bash
```
**Protip:** You can also make use of Docker to run your builds on macOS or Windows.
+20 -65
View File
@@ -1,75 +1,30 @@
[![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)
### Install Prerequisites
An Android browser and wallet for the [LBRY](https://lbry.com) network. This app bundles [lbrynet-daemon](https://github.com/lbryio/lbry) as a background service with a UI layer built with React Native. The APK is built using buildozer and the Gradle build tool.
#### Requirements
* JDK 1.8
* Android SDK
* Android NDK
* Buildozer
<img src="https://spee.ch/8/lbry-android.png" alt="LBRY Android Screenshot" width="384px" />
#### 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.
## Installation
The minimum supported Android version is 5.0 Lollipop. There are two ways to install:
**Additional package for building libgmp**
```
sudo apt-get install m4
```
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.
**Additional package for the pycrypto recipe**
## Usage
The app can be launched by opening **LBRY Browser** from the device's app drawer or via the shortcut on the home screen if that was created upon installation.
This had to be installed due to an error regarding the `<gnu/stubs.h>` include not found.
```
sudo apt-get install libc6-dev-i386
```
## Running from Source
The app is built from source via [Buildozer](https://github.com/kivy/buildozer). After cloning the repository, copy `buildozer.spec.sample` to `buildozer.spec` and modify this file as necessary for your environment. Please see [BUILD.md](BUILD.md) for detailed build instructions.
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
#### Install Cython
```
sudo pip install --upgrade cython==0.25.2
```
## License
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
#### Install buildozer
```
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python2.7 setup.py install
```
## 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.
#### 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.
| 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 |
#### Build and deploy the APK
Run `buildozer android debug` to build a debug APK, or `buildozer android release` to build a release APK.
To deploy and run the APK on a connected Android device, you can run `buildozer android debug deploy run`.
Run `buildozer android clean` to clean the package if you intend to rebuild.
## Contact
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)
Vendored
+100
View File
@@ -0,0 +1,100 @@
echoed=false
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
#config.disksize.size = "20GB"
config.vm.provider "virtualbox" do |v|
host = RbConfig::CONFIG['host_os']
# Give VM 1/4 system memory & access to all cpu cores on the host
if host =~ /darwin/
cpus = `sysctl -n hw.ncpu`.to_i
# sysctl returns Bytes and we need to convert to MB
mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4
elsif host =~ /linux/
cpus = `nproc`.to_i
# meminfo shows KB and we need to convert to MB
mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 4
else
cpus = `wmic cpu get NumberOfCores`.split("\n")[2].to_i
mem = `wmic OS get TotalVisibleMemorySize`.split("\n")[2].to_i / 1024 /4
end
mem = mem / 1024 / 4
mem = [mem, 2048].max # Minimum 2048
if echoed === false
echoed=true
puts("Memory", mem)
puts("CPUs", cpus)
end
#v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/home_vagrant_lbry-android", "1"]
#v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
v.customize ["modifyvm", :id, "--memory", mem]
v.customize ["modifyvm", :id, "--cpus", cpus]
end
config.vm.synced_folder "./", "/home/vagrant/lbry-android"
config.vm.provision "shell", inline: <<-SHELL
dpkg --add-architecture i386
apt-get update
apt-get install -y libssl-dev
apt-get install -y python3.6 python3.6-dev python3-pip autoconf libffi-dev pkg-config libtool 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 python-pip
pip install -f --upgrade setuptools pyopenssl
git clone https://github.com/lbryio/buildozer.git
cd buildozer
python2.7 setup.py install
cd ../
rm -rf ./buildozer
# Install additonal buildozer dependencies
sudo apt-get install cython
# Install node
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
export HOME=/home/vagrant
cp $HOME/lbry-android/buildozer.spec.vagrant $HOME/lbry-android/buildozer.spec
mkdir -p cd $HOME/.buildozer/android/platform/
wget -q 'https://us.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P $HOME/.buildozer/android/
wget -q 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P $HOME/.buildozer/android/platform/
wget -q 'https://dl.google.com/android/repository/platform-27_r01.zip' -P $HOME/.buildozer/android/platform/
wget -q 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P $HOME/.buildozer/android/platform/
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C $HOME/.buildozer/android/
rm $HOME/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
ln -s $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
cp -f $HOME/lbry-android/scripts/build-target-python.sh $HOME/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
rm -rf $HOME/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
tar -xf $HOME/.buildozer/android/platform/android-sdk_r23-linux.tgz -C $HOME/.buildozer/android/platform/
rm $HOME/.buildozer/android/platform/android-sdk_r23-linux.tgz
mv $HOME/.buildozer/android/platform/android-sdk-linux $HOME/.buildozer/android/platform/android-sdk-23
unzip -qq $HOME/.buildozer/android/platform/android-23_r02.zip -d $HOME/.buildozer/android/platform/android-sdk-23/platforms
rm $HOME/.buildozer/android/platform/platform-27_r01.zip
mv $HOME/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 $HOME/.buildozer/android/platform/android-sdk-23/platforms/android-27
mkdir -p $HOME/.buildozer/android/platform/android-sdk-23/build-tools
unzip -qq $HOME/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d $HOME/.buildozer/android/platform/android-sdk-23/build-tools
rm $HOME/.buildozer/android/platform/build-tools_r26.0.1-linux.zip
mv $HOME/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 $HOME/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1
mkdir -p $HOME/.buildozer/android/platform/android-sdk-23/licenses
rm -rf $HOME/.buildozer/android/platform/android-sdk-23/tools
# https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
wget -q https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
unzip -o -q ./tools_r25.2.5-linux.zip -d $HOME/.buildozer/android/platform/android-sdk-23/
rm sdk-tools-linux-3859397.zip
echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > $HOME/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
sudo chown -r vagrant $HOME
echo "Installing React Native via NPM..."
sudo npm install -g react-native-cli
SHELL
end
+9
View File
@@ -0,0 +1,9 @@
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
"@babel/plugin-proposal-nullish-coalescing-operator",
["module-resolver", {
root: ["./src"],
}],
]
}
+5640 -8030
View File
File diff suppressed because it is too large. Load diff
+35 -13
View File
@@ -3,23 +3,45 @@
"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"
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"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",
"base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0",
"lbry-redux": "lbryio/lbry-redux",
"lbryinc": "lbryio/lbryinc",
"lodash": ">=4.17.11",
"merge": ">=1.2.1",
"moment": "^2.22.1",
"react": "16.8.6",
"react-native": "0.59.3",
"@react-native-community/async-storage": "^1.2.2",
"react-native-country-picker-modal": "^0.6.2",
"react-native-exception-handler": "2.9.0",
"react-native-fast-image": "^5.0.3",
"react-native-gesture-handler": "^1.1.0",
"react-native-image-zoom-viewer": "^2.2.5",
"react-native-password-strength-meter": "^0.0.2",
"react-native-phone-input": "lbryio/react-native-phone-input",
"react-native-vector-icons": "^6.4.2",
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
"react-navigation": "^3.11.0",
"react-navigation-redux-helpers": "^3.0.2",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-logger": "3.0.6",
"redux-persist": "^4.8.0",
"redux-persist": "^4.10.2",
"redux-persist-filesystem-storage": "^1.3.2",
"redux-persist-transform-compress": "^4.2.0",
"redux-persist-transform-filter": "0.0.10",
"redux-thunk": "^2.2.0"
"redux-persist-transform-filter": "0.0.18",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.10.15"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"babel-preset-env": "^1.6.1",
"babel-preset-react-native": "5.0.2",
"babel-preset-stage-2": "^6.18.0",
"babel-plugin-module-resolver": "^3.1.1",
"flow-babel-webpack-plugin": "^1.1.1"
}
}
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+328 -63
View File
@@ -1,64 +1,169 @@
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 AboutPage from 'page/about';
import DiscoverPage from 'page/discover';
import DownloadsPage from 'page/downloads';
import DrawerContent from 'component/drawerContent';
import FilePage from 'page/file';
import FirstRunScreen from 'page/firstRun';
import RewardsPage from 'page/rewards';
import TrendingPage from 'page/trending';
import SearchPage from 'page/search';
import SettingsPage from 'page/settings';
import SplashScreen from 'page/splash';
import SubscriptionsPage from 'page/subscriptions';
import TransactionHistoryPage from 'page/transactionHistory';
import VerificationScreen from 'page/verification';
import WalletPage from 'page/wallet';
import {
addNavigationHelpers,
DrawerNavigator,
StackNavigator,
createDrawerNavigator,
createStackNavigator,
NavigationActions
} from 'react-navigation';
import {
createReduxContainer,
createReactNavigationReduxMiddleware,
createNavigationReducer
} from 'react-navigation-redux-helpers';
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';
import {
AppState,
BackHandler,
Linking,
NativeModules,
TextInput,
ToastAndroid
} from 'react-native';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { SETTINGS, doDismissToast, doToast, selectToast } from 'lbry-redux';
import {
doGetSync,
doUserCheckEmailVerified,
doUserEmailVerify,
doUserEmailVerifyFailure,
selectEmailToVerify,
selectEmailVerifyIsPending,
selectEmailVerifyErrorMessage,
selectUser
} from 'lbryinc';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { decode as atob } from 'base-64';
import { dispatchNavigateBack, dispatchNavigateToUri } from 'utils/helper';
import AsyncStorage from '@react-native-community/async-storage';
import Colors from 'styles/colors';
import Constants from 'constants';
import Icon from 'react-native-vector-icons/FontAwesome5';
import NavigationButton from 'component/navigationButton';
import discoverStyle from 'styles/discover';
import searchStyle from 'styles/search';
import SearchRightHeaderIcon from 'component/searchRightHeaderIcon';
const discoverStack = StackNavigator({
const menuNavigationButton = (navigation) => <NavigationButton
name="bars"
size={24}
style={discoverStyle.drawerMenuButton}
iconStyle={discoverStyle.drawerHamburger}
onPress={() => navigation.openDrawer() } />
const discoverStack = createStackNavigator({
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')} />
})
title: 'Explore',
header: null
}),
},
File: {
screen: FilePage,
navigationOptions: {
header: null,
drawerLockMode: 'locked-closed'
}
navigationOptions: ({ navigation }) => ({
header: null
})
},
Search: {
screen: SearchPage,
navigationOptions: ({ navigation }) => ({
headerTitle: <SearchInput style={searchStyle.searchInput} />,
headerRight: <Feather name="x" size={24} style={discoverStyle.rightHeaderIcon} onPress={() => navigation.dispatch(NavigationActions.back())} />
header: null
})
}
}, {
headerMode: 'screen',
transitionConfig: () => ({ screenInterpolator: () => null }),
});
const drawer = DrawerNavigator({
Discover: { screen: discoverStack },
Settings: {
screen: SettingsPage,
headerMode: 'screen'
discoverStack.navigationOptions = ({ navigation }) => {
let drawerLockMode = 'unlocked';
/*if (navigation.state.index > 0) {
drawerLockMode = 'locked-closed';
}*/
return {
drawerLockMode
};
};
const walletStack = createStackNavigator({
Wallet: {
screen: WalletPage,
navigationOptions: ({ navigation }) => ({
title: 'Wallet',
header: null
})
},
TransactionHistory: {
screen: TransactionHistoryPage,
navigationOptions: {
title: 'Transaction History',
header: null
}
}
}, {
drawerWidth: 300,
headerMode: 'none'
headerMode: 'screen',
transitionConfig: () => ({ screenInterpolator: () => null }),
});
export const AppNavigator = new StackNavigator({
const drawer = createDrawerNavigator({
DiscoverStack: { screen: discoverStack, navigationOptions: {
title: 'Explore', drawerIcon: ({ tintColor }) => <Icon name="home" size={20} style={{ color: tintColor }} />
}},
TrendingStack: { screen: TrendingPage, navigationOptions: {
title: 'Trending', drawerIcon: ({ tintColor }) => <Icon name="fire" size={20} style={{ color: tintColor }} />
}},
MySubscriptionsStack: { screen: SubscriptionsPage, navigationOptions: {
title: 'Subscriptions', drawerIcon: ({ tintColor }) => <Icon name="heart" solid={true} size={20} style={{ color: tintColor }} />
}},
WalletStack: { screen: walletStack, navigationOptions: {
title: 'Wallet', drawerIcon: ({ tintColor }) => <Icon name="wallet" size={20} style={{ color: tintColor }} />
}},
Rewards: { screen: RewardsPage, navigationOptions: {
drawerIcon: ({ tintColor }) => <Icon name="award" size={20} style={{ color: tintColor }} />
}},
MyLBRYStack: { screen: DownloadsPage, navigationOptions: {
title: 'Library', drawerIcon: ({ tintColor }) => <Icon name="download" size={20} style={{ color: tintColor }} />
}},
Settings: { screen: SettingsPage, navigationOptions: {
drawerLockMode: 'locked-closed',
drawerIcon: ({ tintColor }) => <Icon name="cog" size={20} style={{ color: tintColor }} />
}},
About: { screen: AboutPage, navigationOptions: {
drawerLockMode: 'locked-closed',
drawerIcon: ({ tintColor }) => <Icon name="info" size={20} style={{ color: tintColor }} />
}}
}, {
drawerWidth: 300,
headerMode: 'none',
contentComponent: DrawerContent,
contentOptions: {
activeTintColor: Colors.LbryGreen,
labelStyle: discoverStyle.menuText
}
});
const mainStackNavigator = new createStackNavigator({
FirstRun: {
screen: FirstRunScreen,
navigationOptions: {
drawerLockMode: 'locked-closed'
}
},
Splash: {
screen: SplashScreen,
navigationOptions: {
@@ -67,61 +172,221 @@ export const AppNavigator = new StackNavigator({
},
Main: {
screen: drawer
},
Verification: {
screen: VerificationScreen,
navigationOptions: {
drawerLockMode: 'locked-closed'
}
}
}, {
headerMode: 'none'
});
export const AppNavigator = mainStackNavigator;
export const navigatorReducer = createNavigationReducer(AppNavigator);
export const reactNavigationMiddleware = createReactNavigationReduxMiddleware(
state => state.nav,
);
const App = createReduxContainer(mainStackNavigator);
const appMapStateToProps = (state) => ({
state: state.nav,
});
const ReduxAppNavigator = connect(appMapStateToProps)(App);
class AppWithNavigationState extends React.Component {
static supportedDisplayTypes = ['toast'];
constructor() {
super();
this.emailVerifyCheckInterval = null;
this.state = {
emailVerifyDone: false,
verifyPending: false
};
}
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;
const { dispatch, nav, drawerStack } = this.props;
// There should be a better way to check this
if (nav.routes.length > 0) {
if (nav.routes[0].routeName === 'Main') {
const mainRoute = nav.routes[0];
if (mainRoute.index > 0 ||
mainRoute.routes[0].index > 0 /* Discover stack index */ ||
mainRoute.routes[4].index > 0 /* Wallet stack index */ ||
mainRoute.index >= 5 /* Settings and About screens */) {
dispatchNavigateBack(dispatch, nav, drawerStack);
return true;
}
}
}
return false;
}.bind(this));
}
componentDidMount() {
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
Linking.addEventListener('url', this._handleUrl);
}
checkEmailVerification = () => {
const { dispatch } = this.props;
AsyncStorage.getItem(Constants.KEY_EMAIL_VERIFY_PENDING).then(pending => {
this.setState({ verifyPending: ('true' === pending) });
if ('true' === pending) {
dispatch(doUserCheckEmailVerified());
}
});
}
componentWillUnmount() {
AppState.removeEventListener('change', this._handleAppStateChange);
BackHandler.removeEventListener('hardwareBackPress');
Linking.removeEventListener('url', this._handleUrl);
}
componentDidUpdate() {
const { dispatch, user } = this.props;
if (this.state.verifyPending && this.emailVerifyCheckInterval > 0 && user && user.has_verified_email) {
clearInterval(this.emailVerifyCheckInterval);
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'false');
this.setState({ verifyPending: false });
ToastAndroid.show('Your email address was successfully verified.', ToastAndroid.LONG);
// upon successful email verification, do wallet sync (if password has been set)
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
if (walletPassword && walletPassword.trim().length > 0) {
dispatch(doGetSync(walletPassword));
}
});
}
}
componentWillUpdate(nextProps) {
const { dispatch } = this.props;
const {
toast,
emailToVerify,
emailVerifyPending,
emailVerifyErrorMessage,
user
} = nextProps;
if (toast) {
const { message } = toast;
let currentDisplayType;
if (!currentDisplayType && message) {
// default to toast if no display type set and there is a message specified
currentDisplayType = 'toast';
}
if ('toast' === currentDisplayType) {
ToastAndroid.show(message, ToastAndroid.LONG);
}
dispatch(doDismissToast());
}
if (user &&
!emailVerifyPending &&
!this.state.emailVerifyDone &&
(emailToVerify || emailVerifyErrorMessage)) {
AsyncStorage.getItem(Constants.KEY_SHOULD_VERIFY_EMAIL).then(shouldVerify => {
if ('true' === shouldVerify) {
this.setState({ emailVerifyDone: true });
const message = emailVerifyErrorMessage ?
String(emailVerifyErrorMessage) : 'Your email address was successfully verified.';
if (!emailVerifyErrorMessage) {
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
}
AsyncStorage.removeItem(Constants.KEY_SHOULD_VERIFY_EMAIL);
dispatch(doToast({ message }));
}
});
}
}
_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();
const { backgroundPlayEnabled, dispatch } = this.props;
// Check if the app was suspended
if (AppState.currentState && AppState.currentState.match(/inactive|background/)) {
AsyncStorage.getItem('firstLaunchTime').then(start => {
if (start !== null && !isNaN(parseInt(start, 10))) {
// App suspended during first launch?
// If so, this needs to be included as a property when tracking
AsyncStorage.setItem('firstLaunchSuspended', 'true');
}
// Background media
if (backgroundPlayEnabled && NativeModules.BackgroundMedia && window.currentMediaInfo) {
const { title, channel, uri } = window.currentMediaInfo;
NativeModules.BackgroundMedia.showPlaybackNotification(title, channel, uri, false);
}
});
}
if (AppState.currentState && AppState.currentState.match(/active/)) {
if (backgroundPlayEnabled || NativeModules.BackgroundMedia) {
NativeModules.BackgroundMedia.hidePlaybackNotification();
}
}
}
render() {
_handleUrl = (evt) => {
const { dispatch, nav } = this.props;
return (
<AppNavigator
navigation={addNavigationHelpers({
dispatch,
state: nav,
addListener,
})}
/>
);
if (evt.url) {
if (evt.url.startsWith('lbry://?verify=')) {
this.setState({ emailVerifyDone: false });
let verification = {};
try {
verification = JSON.parse(atob(evt.url.substring(15)));
} catch (error) {
console.log(error);
}
if (verification.token && verification.recaptcha) {
AsyncStorage.setItem(Constants.KEY_SHOULD_VERIFY_EMAIL, 'true');
try {
dispatch(doUserEmailVerify(verification.token, verification.recaptcha));
} catch (error) {
const message = 'Invalid Verification Token';
dispatch(doUserEmailVerifyFailure(message));
dispatch(doToast({ message }));
}
} else {
dispatch(doToast({
message: 'Invalid Verification URI',
}));
}
} else {
dispatchNavigateToUri(dispatch, nav, evt.url);
}
}
}
render() {
return <ReduxAppNavigator />;
}
}
const mapStateToProps = state => ({
nav: state.nav,
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state)
nav: state.nav,
toast: selectToast(state),
drawerStack: selectDrawerStack(state),
emailToVerify: selectEmailToVerify(state),
emailVerifyPending: selectEmailVerifyIsPending(state),
emailVerifyErrorMessage: selectEmailVerifyErrorMessage(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
user: selectUser(state)
});
export default connect(mapStateToProps)(AppWithNavigationState);
export default connect(mapStateToProps)(AppWithNavigationState);
+7
View File
@@ -0,0 +1,7 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import Address from './view';
export default connect(null, {
doToast,
})(Address);
+28
View File
@@ -0,0 +1,28 @@
// @flow
import * as React from 'react';
import { Clipboard, Text, View } from 'react-native';
import Button from '../button';
import walletStyle from '../../styles/wallet';
type Props = {
address: string,
doToast: ({ message: string }) => void,
};
export default class Address extends React.PureComponent<Props> {
render() {
const { address, doToast, style } = this.props;
return (
<View style={[walletStyle.row, style]}>
<Text selectable={true} numberOfLines={1} style={walletStyle.address}>{address || ''}</Text>
<Button icon={'clipboard'} style={walletStyle.button} onPress={() => {
Clipboard.setString(address);
doToast({
message: 'Address copied',
});
}} />
</View>
);
}
}
+4
View File
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import Button from './view';
export default connect(null, null)(Button);
+58
View File
@@ -0,0 +1,58 @@
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
import buttonStyle from '../../styles/button';
import Colors from '../../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
export default class Button extends React.PureComponent {
render() {
const {
disabled,
style,
text,
icon,
iconColor,
solid,
theme,
onPress,
onLayout
} = this.props;
let styles = [buttonStyle.button, buttonStyle.row];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
if (disabled) {
styles.push(buttonStyle.disabled);
}
const textStyles = [buttonStyle.text];
if (icon && icon.trim().length > 0) {
textStyles.push(buttonStyle.textWithIcon);
}
if (theme === 'light') {
textStyles.push(buttonStyle.textDark);
} else {
// Dark background, default
textStyles.push(buttonStyle.textLight);
}
let renderIcon = (<Icon name={icon} size={18} color={iconColor ? iconColor : ('light' === theme ? Colors.DarkGrey : Colors.White)} />);
if (solid) {
renderIcon = (<Icon name={icon} size={18} color={iconColor ? iconColor : ('light' === theme ? Colors.DarkGrey : Colors.White)} solid />);
}
return (
<TouchableOpacity disabled={disabled} style={styles} onPress={onPress} onLayout={onLayout}>
{icon && renderIcon}
{text && (text.trim().length > 0) && <Text style={textStyles}>{text}</Text>}
</TouchableOpacity>
);
}
};
+4
View File
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import CategoryList from './view';
export default connect(null, null)(CategoryList);
+39
View File
@@ -0,0 +1,39 @@
import React from 'react';
import NavigationActions from 'react-navigation';
import { FlatList, Text, View } from 'react-native';
import { normalizeURI } from 'lbry-redux';
import FileItem from '/component/fileItem';
import discoverStyle from 'styles/discover';
class CategoryList extends React.PureComponent {
render() {
const { category, categoryMap, navigation } = this.props;
return (
<FlatList
style={discoverStyle.horizontalScrollContainer}
contentContainerStyle={discoverStyle.horizontalScrollPadding}
initialNumToRender={3}
maxToRenderPerBatch={3}
removeClippedSubviews={true}
renderItem={ ({item}) => (
<FileItem
style={discoverStyle.fileItem}
mediaStyle={discoverStyle.fileItemMedia}
key={item}
uri={normalizeURI(item)}
navigation={navigation}
showDetails={true}
compactView={false} />
)
}
horizontal={true}
showsHorizontalScrollIndicator={false}
data={categoryMap[category]}
keyExtractor={(item, index) => item}
/>
);
}
}
export default CategoryList;
@@ -0,0 +1,26 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import {
doClaimRewardType,
doClaimRewardClearError,
makeSelectClaimRewardError,
makeSelectIsRewardClaimPending,
rewards as REWARD_TYPES
} from 'lbryinc';
import CustomRewardCard from './view';
const select = state => ({
rewardIsPending: makeSelectIsRewardClaimPending()(state, {
reward_type: REWARD_TYPES.TYPE_REWARD_CODE,
}),
error: makeSelectClaimRewardError()(state, { reward_type: REWARD_TYPES.TYPE_REWARD_CODE }),
});
const perform = dispatch => ({
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, true)),
clearError: reward => dispatch(doClaimRewardClearError(reward)),
notify: data => dispatch(doToast(data)),
submitRewardCode: code => dispatch(doClaimRewardType(REWARD_TYPES.TYPE_REWARD_CODE, { params: { code } }))
});
export default connect(select, perform)(CustomRewardCard);
@@ -0,0 +1,88 @@
// @flow
import React from 'react';
import { ActivityIndicator, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
import Colors from '../../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Button from '../button';
import Link from '../link';
import rewardStyle from '../../styles/reward';
class CustomRewardCard extends React.PureComponent<Props> {
state = {
claimStarted: false,
rewardCode: ''
};
componentWillReceiveProps(nextProps) {
const { error, rewardIsPending } = nextProps;
const { clearError, notify } = this.props;
if (this.state.claimStarted && !rewardIsPending) {
if (error && error.trim().length > 0) {
notify({ message: error });
} else {
notify({ message: 'Reward successfully claimed!' });
this.setState({ rewardCode: '' });
}
this.setState({ claimStarted: false });
}
}
onClaimPress = () => {
const { canClaim, notify, showVerification, submitRewardCode } = this.props;
const { rewardCode } = this.state;
Keyboard.dismiss();
if (!canClaim) {
if (showVerification) {
showVerification();
}
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' });
return;
}
if (!rewardCode || rewardCode.trim().length === 0) {
notify({ message: 'Please enter a reward code to claim.' });
return;
}
this.setState({ claimStarted: true }, () => {
submitRewardCode(rewardCode);
});
}
render() {
const { canClaim, rewardIsPending } = this.props;
return (
<View style={[rewardStyle.rewardCard, rewardStyle.row]} >
<View style={rewardStyle.leftCol}>
{rewardIsPending && <ActivityIndicator size="small" color={Colors.LbryGreen} />}
</View>
<View style={rewardStyle.midCol}>
<Text style={rewardStyle.rewardTitle}>Custom Code</Text>
<Text style={rewardStyle.rewardDescription}>Are you a supermodel or rockstar that received a custom reward code? Claim it here.</Text>
<View>
<TextInput style={rewardStyle.customCodeInput}
placeholder={"0123abc"}
onChangeText={text => this.setState({ rewardCode: text })}
value={this.state.rewardCode} />
<Button style={rewardStyle.redeemButton}
text={"Redeem"}
disabled={(!this.state.rewardCode || this.state.rewardCode.trim().length === 0 || rewardIsPending)}
onPress={() => {
if (!rewardIsPending) { this.onClaimPress(); }
}} />
</View>
</View>
<View style={rewardStyle.rightCol}>
<Text style={rewardStyle.rewardAmount}>?</Text>
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
</View>
</View>
);
}
};
export default CustomRewardCard;
+16
View File
@@ -0,0 +1,16 @@
import { connect } from 'react-redux';
import { makeSelectDateForUri } from 'lbry-redux';
import DateTime from './view';
const select = (state, props) => ({
date: props.date || makeSelectDateForUri(props.uri)(state),
});
const perform = dispatch => ({
fetchBlock: height => dispatch(doFetchBlock(height)),
});
export default connect(
select,
perform
)(DateTime);
+55
View File
@@ -0,0 +1,55 @@
// @flow
import React from 'react';
import moment from 'moment';
import { View, Text } from 'react-native';
type Props = {
date?: number,
timeAgo?: boolean,
formatOptions: {},
show?: string,
};
class DateTime extends React.PureComponent<Props> {
static SHOW_DATE = 'date';
static SHOW_TIME = 'time';
static SHOW_BOTH = 'both';
static defaultProps = {
formatOptions: {
month: 'long',
day: 'numeric',
year: 'numeric',
},
};
render() {
const { date, formatOptions, timeAgo, style, textStyle } = this.props;
const show = this.props.show || DateTime.SHOW_BOTH;
const locale = 'en-US'; // default to en-US until we get a working i18n module for RN
if (timeAgo) {
return date ? <View style={style}><Text style={textStyle}>{moment(date).from(moment())}</Text></View> : null;
}
// TODO: formatOptions not working as expected in RN
// date.toLocaleDateString([locale, 'en-US'], formatOptions)}
return (
<View style={style}>
<Text style={textStyle}>
{date &&
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_DATE) &&
moment(date).format('MMMM D, YYYY')}
{show === DateTime.SHOW_BOTH && ' '}
{date &&
(show === DateTime.SHOW_BOTH || show === DateTime.SHOW_TIME) &&
date.toLocaleTimeString()}
{!date && '...'}
</Text>
</View>
);
}
}
export default DateTime;
+4
View File
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import DrawerContent from './view';
export default connect()(DrawerContent);
+38
View File
@@ -0,0 +1,38 @@
import React from 'react';
import { DrawerItems, SafeAreaView } from 'react-navigation';
import { ScrollView } from 'react-native';
import Constants from 'constants';
import discoverStyle from 'styles/discover';
class DrawerContent extends React.PureComponent {
render() {
const props = this.props;
const { navigation, onItemPress } = props;
return (
<ScrollView>
<SafeAreaView style={discoverStyle.drawerContentContainer} forceInset={{ top: 'always', horizontal: 'never' }}>
<DrawerItems
{...props}
onItemPress={(route) => {
const { routeName } = route.route;
if (Constants.FULL_ROUTE_NAME_DISCOVER === routeName) {
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_DISCOVER });
return;
}
if (Constants.FULL_ROUTE_NAME_WALLET === routeName) {
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_WALLET });
return;
}
onItemPress(route);
}}
/>
</SafeAreaView>
</ScrollView>
);
}
}
export default DrawerContent;
@@ -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,11 +1,12 @@
import { connect } from 'react-redux';
import {
doPurchaseUri,
makeSelectFileInfoForUri,
makeSelectDownloadingForUri,
makeSelectLoadingForUri,
makeSelectCostInfoForUri
} from 'lbry-redux';
import { doPurchaseUri, doStartDownload } from '../../redux/actions/file';
import { doFetchCostInfoForUri, makeSelectCostInfoForUri } from 'lbryinc';
import { doStartDownload } from 'redux/actions/file';
import FileDownloadButton from './view';
const select = (state, props) => ({
@@ -16,8 +17,9 @@ const select = (state, props) => ({
});
const perform = dispatch => ({
purchaseUri: uri => dispatch(doPurchaseUri(uri)),
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint))
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)),
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
});
export default connect(select, perform)(FileDownloadButton);
+44 -21
View File
@@ -1,13 +1,21 @@
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import fileDownloadButtonStyle from '../../styles/fileDownloadButton';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from '../button';
import fileDownloadButtonStyle from 'styles/fileDownloadButton';
class FileDownloadButton extends React.PureComponent {
componentDidMount() {
const { costInfo, fetchCostInfo, uri } = this.props;
if (costInfo === undefined) {
fetchCostInfo(uri);
}
}
componentWillReceiveProps(nextProps) {
//this.checkAvailability(nextProps.uri);
this.restartDownload(nextProps);
//this.restartDownload(nextProps);
}
restartDownload(props) {
const { downloading, fileInfo, uri, restartDownload } = props;
@@ -21,7 +29,7 @@ class FileDownloadButton extends React.PureComponent {
restartDownload(uri, fileInfo.outpoint);
}
}
render() {
const {
fileInfo,
@@ -29,46 +37,61 @@ class FileDownloadButton extends React.PureComponent {
uri,
purchaseUri,
costInfo,
isPlayable,
isViewable,
onPlay,
onView,
loading,
doPause,
style,
openFile,
onButtonLayout,
} = this.props;
const openFile = () => {
//openInShell(fileInfo.download_path);
//doPause();
};
if (loading || downloading) {
if ((fileInfo && !fileInfo.stopped) || 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) {
} else if (!fileInfo && !downloading) {
if (!costInfo) {
return (
<View style={[style, fileDownloadButtonStyle.container]}>
<Text>Fetching cost info...</Text>
<Text style={fileDownloadButtonStyle.text}>Fetching cost info...</Text>
</View>
);
}
return (
<TouchableOpacity style={[style, fileDownloadButtonStyle.container]} onPress={() => {
purchaseUri(uri);
}}>
<Text style={fileDownloadButtonStyle.text}>Download</Text>
</TouchableOpacity>
<Button icon={isPlayable ? 'play' : null}
text={(isPlayable ? 'Play' : (isViewable ? 'View' : 'Download'))}
onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]} onPress={() => {
if (NativeModules.Firebase) {
NativeModules.Firebase.track('purchase_uri', { uri: uri });
}
purchaseUri(uri, costInfo, !isPlayable);
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.checkDownloads();
}
if (isPlayable && onPlay) {
this.props.onPlay();
}
if (isViewable && onView) {
this.props.onView();
}
}} />
);
} else if (fileInfo && fileInfo.download_path) {
return (
<TouchableOpacity style={[style, fileDownloadButtonStyle.container]} onPress={() => openFile()}>
<Text style={fileDownloadButtonStyle.text}>Open</Text>
<TouchableOpacity onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]} onPress={openFile}>
<Text style={fileDownloadButtonStyle.text}>{isViewable ? 'View' : 'Open'}</Text>
</TouchableOpacity>
);
}
+9 -3
View File
@@ -4,10 +4,13 @@ import {
makeSelectClaimForUri,
makeSelectMetadataForUri,
makeSelectFileInfoForUri,
makeSelectThumbnailForUri,
makeSelectTitleForUri,
makeSelectIsUriResolving,
selectRewardContentClaimIds
makeSelectClaimIsNsfw
} from 'lbry-redux';
import { selectShowNsfw } from '../../redux/selectors/settings';
import { selectRewardContentClaimIds } from 'lbryinc';
import { selectShowNsfw } from 'redux/selectors/settings';
import FileItem from './view';
const select = (state, props) => ({
@@ -16,7 +19,10 @@ const select = (state, props) => ({
metadata: makeSelectMetadataForUri(props.uri)(state),
rewardedContentClaimIds: selectRewardContentClaimIds(state, props),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
obscureNsfw: !selectShowNsfw(state)
obscureNsfw: !selectShowNsfw(state),
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state),
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
});
const perform = dispatch => ({
+56 -28
View File
@@ -1,11 +1,16 @@
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';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import { navigateToUri } from 'utils/helper';
import Colors from 'styles/colors';
import DateTime from 'component/dateTime';
import FileItemMedia from 'component/fileItemMedia';
import FilePrice from 'component/filePrice';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
import NsfwOverlay from 'component/nsfwOverlay';
import discoverStyle from 'styles/discover';
class FileItem extends React.PureComponent {
constructor(props) {
@@ -22,52 +27,75 @@ class FileItem extends React.PureComponent {
resolve(props) {
const { isResolvingUri, resolveUri, claim, uri } = props;
if (!isResolvingUri && claim === undefined && uri) {
resolveUri(uri);
}
}
navigateToFileUri = () => {
const { navigation, uri } = this.props;
const normalizedUri = normalizeURI(uri);
if (NativeModules.Firebase) {
NativeModules.Firebase.track('explore_click', { uri: normalizedUri });
}
navigateToUri(navigation, normalizedUri);
}
render() {
const {
claim,
title,
thumbnail,
fileInfo,
metadata,
isResolvingUri,
rewardedContentClaimIds,
style,
navigation
mediaStyle,
navigation,
showDetails,
compactView,
titleBeforeThumbnail
} = 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.';
}
const channelClaimId = claim && claim.value && claim.value.publisherSignature && claim.value.publisherSignature.certificateId;
const fullChannelUri = channelClaimId ? `${channelName}#${channelClaimId}` : channelName;
const height = claim ? claim.height : null;
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 style={discoverStyle.container} onPress={this.navigateToFileUri}>
{!compactView && titleBeforeThumbnail && <Text numberOfLines={1} style={[discoverStyle.fileItemName, discoverStyle.rewardTitle]}>{title}</Text>}
<FileItemMedia title={title}
thumbnail={thumbnail}
blurRadius={obscureNsfw ? 15 : 0}
resizeMode="cover"
isResolvingUri={isResolvingUri}
style={mediaStyle} />
{(!compactView && fileInfo && fileInfo.completed && fileInfo.download_path) &&
<Icon style={discoverStyle.downloadedIcon} solid={true} color={Colors.NextLbryGreen} name={"folder"} size={16} />}
{(!compactView && (!fileInfo || !fileInfo.completed || !fileInfo.download_path)) &&
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />}
{!compactView && <View style={isRewardContent ? discoverStyle.rewardTitleContainer : null}>
<Text numberOfLines={1} style={[discoverStyle.fileItemName, discoverStyle.rewardTitle]}>{title}</Text>
{isRewardContent && <Icon style={discoverStyle.rewardIcon} name="award" size={14} />}
</View>}
{(!compactView && showDetails) &&
<View style={discoverStyle.detailsRow}>
{channelName &&
<Link style={discoverStyle.channelName} text={channelName} onPress={() => {
navigateToUri(navigation, normalizeURI(fullChannelUri));
}} />}
<DateTime style={discoverStyle.dateTime} textStyle={discoverStyle.dateTimeText} timeAgo uri={uri} />
</View>}
</TouchableOpacity>
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate('Settings')} />}
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
</View>
);
}
+62 -13
View File
@@ -1,6 +1,8 @@
import React from 'react';
import { Text, Image, View } from 'react-native';
import fileItemMediaStyle from '../../styles/fileItemMedia';
import { ActivityIndicator, Image, Text, View } from 'react-native';
import Colors from 'styles/colors';
import FastImage from 'react-native-fast-image'
import fileItemMediaStyle from 'styles/fileItemMedia';
class FileItemMedia extends React.PureComponent {
static AUTO_THUMB_STYLES = [
@@ -17,6 +19,10 @@ class FileItemMedia extends React.PureComponent {
fileItemMediaStyle.autothumbOrange,
];
state: {
imageLoadFailed: false
};
componentWillMount() {
this.setState({
autoThumbStyle:
@@ -26,31 +32,74 @@ class FileItemMedia extends React.PureComponent {
});
}
getFastImageResizeMode(resizeMode) {
switch (resizeMode) {
case "contain":
return FastImage.resizeMode.contain;
case "stretch":
return FastImage.resizeMode.stretch;
case "center":
return FastImage.resizeMode.center;
default:
return FastImage.resizeMode.cover;
}
}
isThumbnailValid = (thumbnail) => {
if (!thumbnail || ((typeof thumbnail) !== 'string')) {
return false;
}
if (thumbnail.substring(0, 7) != 'http://' && thumbnail.substring(0, 8) != 'https://') {
return false;
}
return true;
}
render() {
let style = this.props.style;
const { title, thumbnail, blurRadius, resizeMode } = this.props;
const { blurRadius, isResolvingUri, thumbnail, title, resizeMode } = this.props;
const atStyle = this.state.autoThumbStyle;
if (thumbnail && ((typeof thumbnail) === 'string')) {
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
if (style == null) {
style = fileItemMediaStyle.thumbnail;
}
if (blurRadius > 0) {
// No blur radius support in FastImage yet
return (
<Image
source={{uri: thumbnail}}
blurRadius={blurRadius}
resizeMode={resizeMode ? resizeMode : "cover"}
style={style}
/>);
}
return (
<Image source={{uri: thumbnail}}
blurRadius={blurRadius}
resizeMode={resizeMode ? resizeMode : "cover"}
style={style} />
<FastImage
source={{uri: thumbnail}}
onError={() => this.setState({ imageLoadFailed: true })}
resizeMode={this.getFastImageResizeMode(resizeMode)}
style={style}
/>
);
}
return (
<View style={[style ? style : fileItemMediaStyle.autothumb, atStyle]}>
<Text style={fileItemMediaStyle.autothumbText}>{title &&
{isResolvingUri && (
<View style={fileItemMediaStyle.resolving}>
<ActivityIndicator color={Colors.White} size={"large"} />
<Text style={fileItemMediaStyle.text}>Resolving...</Text>
</View>
)}
{!isResolvingUri && <Text style={fileItemMediaStyle.autothumbText}>{title &&
title
.replace(/\s+/g, '')
.substring(0, Math.min(title.replace(' ', '').length, 5))
.toUpperCase()}</Text>
.toUpperCase()}</Text>}
</View>
);
}
+11
View File
@@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import FileList from './view';
import { selectClaimsById } from 'lbry-redux';
const select = state => ({
claimsById: selectClaimsById(state),
});
const perform = dispatch => ({});
export default connect(select, perform)(FileList);
+196
View File
@@ -0,0 +1,196 @@
// @flow
import * as React from 'react';
import { buildURI } from 'lbry-redux';
import { FlatList } from 'react-native';
import FileItem from 'component/fileItem';
import fileListStyle from 'styles/fileList';
// In the future, all Flow types need to be specified in a common source (lbry-redux, perhaps?)
type FileInfo = {
name: string,
channelName: ?string,
pending?: boolean,
channel_claim_id: string,
value?: {
publisherSignature: {
certificateId: string,
},
},
metadata: {
publisherSignature: {
certificateId: string,
},
},
};
type Props = {
hideFilter: boolean,
sortByHeight?: boolean,
claimsById: Array<{}>,
fileInfos: Array<FileInfo>,
checkPending?: boolean,
};
type State = {
sortBy: string,
};
class FileList extends React.PureComponent<Props, State> {
static defaultProps = {
hideFilter: false,
};
constructor(props: Props) {
super(props);
this.state = {
sortBy: 'dateNew',
};
(this: any).handleSortChanged = this.handleSortChanged.bind(this);
this.sortFunctions = {
dateNew: fileInfos =>
this.props.sortByHeight
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
if (fileInfo1.pending) {
return -1;
}
const height1 = this.props.claimsById[fileInfo1.claim_id]
? this.props.claimsById[fileInfo1.claim_id].height
: 0;
const height2 = this.props.claimsById[fileInfo2.claim_id]
? this.props.claimsById[fileInfo2.claim_id].height
: 0;
if (height1 > height2) {
return -1;
} else if (height1 < height2) {
return 1;
}
return 0;
})
: [...fileInfos].reverse(),
dateOld: fileInfos =>
this.props.sortByHeight
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const height1 = this.props.claimsById[fileInfo1.claim_id]
? this.props.claimsById[fileInfo1.claim_id].height
: 999999;
const height2 = this.props.claimsById[fileInfo2.claim_id]
? this.props.claimsById[fileInfo2.claim_id].height
: 999999;
if (height1 < height2) {
return -1;
} else if (height1 > height2) {
return 1;
}
return 0;
})
: fileInfos,
title: fileInfos =>
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
const getFileTitle = fileInfo => {
const { value, metadata, name, claim_name: claimName } = fileInfo;
if (metadata) {
// downloaded claim
return metadata.title || claimName;
} else if (value) {
// published claim
const { title } = value.stream.metadata;
return title || name;
}
// Invalid claim
return '';
};
const title1 = getFileTitle(fileInfo1).toLowerCase();
const title2 = getFileTitle(fileInfo2).toLowerCase();
if (title1 < title2) {
return -1;
} else if (title1 > title2) {
return 1;
}
return 0;
}),
filename: fileInfos =>
fileInfos.slice().sort(({ file_name: fileName1 }, { file_name: fileName2 }) => {
const fileName1Lower = fileName1.toLowerCase();
const fileName2Lower = fileName2.toLowerCase();
if (fileName1Lower < fileName2Lower) {
return -1;
} else if (fileName2Lower > fileName1Lower) {
return 1;
}
return 0;
}),
};
}
getChannelSignature = (fileInfo: FileInfo) => {
if (fileInfo.pending) {
return undefined;
}
if (fileInfo.value) {
return fileInfo.value.publisherSignature.certificateId;
}
return fileInfo.channel_claim_id;
};
handleSortChanged(event: SyntheticInputEvent<*>) {
this.setState({
sortBy: event.target.value,
});
}
sortFunctions: {};
render() {
const {
contentContainerStyle,
fileInfos,
hideFilter,
checkPending,
navigation,
onEndReached,
style
} = this.props;
const { sortBy } = this.state;
const items = [];
if (!fileInfos) {
return null;
}
this.sortFunctions[sortBy](fileInfos).forEach(fileInfo => {
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
const uriParams = {};
// This is unfortunate
// https://github.com/lbryio/lbry/issues/1159
const name = claimName || claimNameDownloaded;
uriParams.contentName = name;
uriParams.claimId = claimId;
const uri = buildURI(uriParams);
items.push(uri);
});
return (
<FlatList
style={style}
contentContainerStyle={contentContainerStyle}
data={items}
onEndReached={onEndReached}
keyExtractor={(item, index) => item}
renderItem={({item}) => (
<FileItem style={fileListStyle.fileItem}
uri={item}
navigation={navigation}
showDetails={true}
compactView={false} />
)} />
);
}
}
export default FileList;
@@ -5,20 +5,25 @@ import {
makeSelectMetadataForUri,
makeSelectFileInfoForUri,
makeSelectIsUriResolving,
makeSelectTitleForUri,
makeSelectThumbnailForUri,
} from 'lbry-redux';
import { selectShowNsfw } from '../../redux/selectors/settings';
import SearchResultItem from './view';
import { selectShowNsfw } from 'redux/selectors/settings';
import FileListItem from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
isDownloaded: !!makeSelectFileInfoForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
obscureNsfw: !selectShowNsfw(state)
obscureNsfw: !selectShowNsfw(state),
title: makeSelectTitleForUri(props.uri)(state),
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
});
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri))
});
export default connect(select, perform)(SearchResultItem);
export default connect(select, perform)(FileListItem);
+134
View File
@@ -0,0 +1,134 @@
import React from 'react';
import { normalizeURI, parseURI } from 'lbry-redux';
import {
ActivityIndicator,
Platform,
Text,
TouchableOpacity,
View
} from 'react-native';
import { navigateToUri, formatBytes } from 'utils/helper';
import Colors from 'styles/colors';
import DateTime from 'component/dateTime';
import FileItemMedia from 'component/fileItemMedia';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
import NsfwOverlay from 'component/nsfwOverlay';
import ProgressBar from 'component/progressBar';
import fileListStyle from 'styles/fileList';
class FileListItem extends React.PureComponent {
getStorageForFileInfo = (fileInfo) => {
if (!fileInfo.completed) {
const written = formatBytes(fileInfo.written_bytes);
const total = formatBytes(fileInfo.total_bytes);
return `(${written} / ${total})`;
}
return formatBytes(fileInfo.written_bytes);
}
formatTitle = (title) => {
if (!title) {
return title;
}
return (title.length > 80) ? title.substring(0, 77).trim() + '...' : title;
}
getDownloadProgress = (fileInfo) => {
return Math.ceil((fileInfo.written_bytes / fileInfo.total_bytes) * 100);
}
componentDidMount() {
const { claim, resolveUri, uri } = this.props;
if (!claim) {
resolveUri(uri);
}
}
render() {
const {
claim,
fileInfo,
metadata,
featuredResult,
isResolvingUri,
isDownloaded,
style,
onPress,
navigation,
thumbnail,
title
} = this.props;
const uri = normalizeURI(this.props.uri);
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
const isResolving = !fileInfo && isResolvingUri;
let name, channel, height, channelClaimId, fullChannelUri;
if (claim) {
name = claim.name;
channel = claim.channel_name;
height = claim.height;
channelClaimId = claim.value && claim.value.publisherSignature && claim.value.publisherSignature.certificateId;
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
}
if (featuredResult && !isResolvingUri && !claim && !title && !name) {
return null;
}
return (
<View style={style}>
<TouchableOpacity style={style} onPress={onPress}>
<FileItemMedia style={fileListStyle.thumbnail}
blurRadius={obscureNsfw ? 15 : 0}
resizeMode="cover"
title={(title || name)}
thumbnail={thumbnail} />
{(fileInfo && fileInfo.completed && fileInfo.download_path) &&
<Icon style={fileListStyle.downloadedIcon} solid={true} color={Colors.NextLbryGreen} name={"folder"} size={16} />}
<View style={fileListStyle.detailsContainer}>
{featuredResult && <Text style={fileListStyle.featuredUri} numberOfLines={1}>{uri}</Text>}
{!title && !name && !channel && isResolving && (
<View>
{(!title && !name) && <Text style={fileListStyle.uri}>{uri}</Text>}
{(!title && !name) && <View style={fileListStyle.row}>
<ActivityIndicator size={"small"} color={featuredResult ? Colors.White : Colors.LbryGreen} />
</View>}
</View>)}
{(title || name) && <Text style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}>{this.formatTitle(title) || this.formatTitle(name)}</Text>}
{channel &&
<Link style={fileListStyle.publisher} text={channel} onPress={() => {
navigateToUri(navigation, normalizeURI(fullChannelUri));
}} />}
<View style={fileListStyle.info}>
{(fileInfo && !isNaN(fileInfo.written_bytes) && fileInfo.written_bytes > 0) &&
<Text style={fileListStyle.infoText}>{this.getStorageForFileInfo(fileInfo)}</Text>}
<DateTime style={fileListStyle.publishInfo} textStyle={fileListStyle.infoText} timeAgo uri={uri} />
</View>
{(fileInfo && fileInfo.download_path) &&
<View style={fileListStyle.downloadInfo}>
{!fileInfo.completed &&
<ProgressBar
borderRadius={3}
color={Colors.NextLbryGreen}
height={3}
style={fileListStyle.progress}
progress={this.getDownloadProgress(fileInfo)} />}
</View>
}
</View>
</TouchableOpacity>
{obscureNsfw && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
</View>
);
}
}
export default FileListItem;
+2 -6
View File
@@ -1,10 +1,6 @@
import { connect } from 'react-redux';
import {
doFetchCostInfoForUri,
makeSelectCostInfoForUri,
makeSelectFetchingCostInfoForUri,
makeSelectClaimForUri
} from 'lbry-redux';
import { makeSelectClaimForUri } from 'lbry-redux';
import { doFetchCostInfoForUri, makeSelectCostInfoForUri, makeSelectFetchingCostInfoForUri } from 'lbryinc';
import FilePrice from './view';
const select = (state, props) => ({
+1 -1
View File
@@ -108,7 +108,7 @@ class FilePrice extends React.PureComponent {
<CreditAmount
style={textStyle}
label={false}
amount={costInfo.cost}
amount={parseFloat(costInfo.cost)}
isEstimate={isEstimate}
showFree
showFullPrice={showFullPrice}>???</CreditAmount>
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import FileRewardsDriver from './view';
export default connect()(FileRewardsDriver);
@@ -0,0 +1,20 @@
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import filePageStyle from 'styles/filePage';
class FileRewardsDriver extends React.PureComponent<Props> {
render() {
const { navigation } = this.props;
return (
<TouchableOpacity style={filePageStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
<Icon name="award" size={16} style={filePageStyle.rewardIcon} />
<Text style={filePageStyle.rewardDriverText}>Earn some credits to access this content.</Text>
</TouchableOpacity>
);
}
}
export default FileRewardsDriver;
@@ -0,0 +1,14 @@
import { connect } from 'react-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { selectBalance } from 'lbry-redux';
import { selectUnclaimedRewardValue } from 'lbryinc';
import Constants from 'constants';
import FloatingWalletBalance from './view';
const select = state => ({
balance: selectBalance(state),
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
rewardsNotInterested: makeSelectClientSetting(Constants.SETTING_REWARDS_NOT_INTERESTED)(state),
});
export default connect(select, null)(FloatingWalletBalance);
@@ -0,0 +1,38 @@
// @flow
import React from 'react';
import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native';
import { formatCredits } from 'lbry-redux'
import Address from 'component/address';
import Button from 'component/button';
import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import floatingButtonStyle from 'styles/floatingButton';
type Props = {
balance: number,
};
class FloatingWalletBalance extends React.PureComponent<Props> {
render() {
const { balance, navigation, rewardsNotInterested, unclaimedRewardAmount } = this.props;
return (
<View style={[floatingButtonStyle.view, floatingButtonStyle.bottomRight]}>
{(!rewardsNotInterested && unclaimedRewardAmount > 0) &&
<TouchableOpacity style={floatingButtonStyle.pendingContainer}
onPress={() => navigation && navigation.navigate({ routeName: 'Rewards' })} >
<Icon name="award" size={18} style={floatingButtonStyle.rewardIcon} />
<Text style={floatingButtonStyle.text}>{unclaimedRewardAmount}</Text>
</TouchableOpacity>}
<TouchableOpacity style={floatingButtonStyle.container}
onPress={() => navigation && navigation.navigate({ routeName: 'WalletStack' })}>
{isNaN(balance) && <ActivityIndicator size="small" color={Colors.White} />}
{(!isNaN(balance) || balance === 0) && (
<Text style={floatingButtonStyle.text}>{(formatCredits(parseFloat(balance), 2) + ' LBC')}</Text>)}
</TouchableOpacity>
</View>
);
}
}
export default FloatingWalletBalance;
+9
View File
@@ -0,0 +1,9 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import Link from './view';
const perform = dispatch => ({
notify: (data) => dispatch(doToast(data))
});
export default connect(null, perform)(Link);
+68
View File
@@ -0,0 +1,68 @@
import React from 'react';
import { Linking, Text, TouchableOpacity } from 'react-native';
export default class Link extends React.PureComponent {
constructor(props) {
super(props)
this.state = {
tappedStyle: false,
}
this.addTappedStyle = this.addTappedStyle.bind(this)
}
handlePress = () => {
const { error, href, navigation, notify } = this.props;
if (navigation && href.startsWith('#')) {
navigation.navigate(href.substring(1));
} else {
if (this.props.effectOnTap) this.addTappedStyle();
Linking.openURL(href)
.then(() => setTimeout(() => { this.setState({ tappedStyle: false }); }, 2000))
.catch(err => {
notify({ message: error, isError: true })
this.setState({tappedStyle: false})
}
);
}
}
addTappedStyle() {
this.setState({ tappedStyle: true });
setTimeout(() => { this.setState({ tappedStyle: false }); }, 2000);
}
render() {
const {
ellipsizeMode,
numberOfLines,
onPress,
style,
text
} = this.props;
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
if (this.props.effectOnTap && this.state.tappedStyle) {
styles.push(this.props.effectOnTap);
}
return (
<Text
style={styles}
numberOfLines={numberOfLines}
ellipsizeMode={ellipsizeMode}
onPress={onPress ? onPress : this.handlePress}>
{text}
</Text>
);
}
};
+13 -2
View File
@@ -1,7 +1,18 @@
import { connect } from 'react-redux';
import { SETTINGS, savePosition } from 'lbry-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doSetPlayerVisible } from 'redux/actions/drawer';
import { selectIsPlayerVisible } from 'redux/selectors/drawer';
import MediaPlayer from './view';
const select = state => ({});
const perform = dispatch => ({});
const select = state => ({
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
isPlayerVisible: selectIsPlayerVisible(state),
});
const perform = dispatch => ({
savePosition: (claimId, outpoint, position) => dispatch(savePosition(claimId, outpoint, position)),
setPlayerVisible: () => dispatch(doSetPlayerVisible(true)),
});
export default connect(select, perform)(MediaPlayer);
+281 -83
View File
@@ -1,92 +1,134 @@
import React from 'react';
import { Lbry } from 'lbry-redux';
import { PanResponder, Text, View, ScrollView, TouchableOpacity } from 'react-native';
import {
AppState,
ActivityIndicator,
DeviceEventEmitter,
NativeModules,
PanResponder,
Text,
View,
ScrollView,
TouchableOpacity
} from 'react-native';
import Colors from 'styles/colors';
import FastImage from 'react-native-fast-image'
import Video from 'react-native-video';
import Icon from 'react-native-vector-icons/FontAwesome';
import FileItemMedia from '../fileItemMedia';
import mediaPlayerStyle from '../../styles/mediaPlayer';
import Icon from 'react-native-vector-icons/FontAwesome5';
import FileItemMedia from 'component/fileItemMedia';
import mediaPlayerStyle from 'styles/mediaPlayer';
const positionSaveInterval = 10
class MediaPlayer extends React.PureComponent {
static ControlsTimeout = 3000;
seekResponder = null;
seekerWidth = 0;
trackingOffset = 0;
tracking = null;
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
};
constructor(props) {
super(props);
this.state = {
buffering: false,
backgroundPlayEnabled: false,
autoPaused: false,
rate: 1,
volume: 1,
muted: false,
resizeMode: 'contain',
duration: 0.0,
currentTime: 0.0,
paused: !props.autoPlay,
fullscreenMode: false,
areControlsVisible: true,
controlsTimeout: -1,
seekerOffset: 0,
seekerPosition: 0,
firstPlay: true,
seekTimeout: -1
};
}
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
});
const { position } = this.props;
if (!isNaN(parseFloat(position)) && position > 0) {
this.video.seek(position);
this.setState({ currentTime: position }, () => this.setSeekerPosition(this.calculateSeekerPosition()));
}
if (this.props.onMediaLoaded) {
this.props.onMediaLoaded();
this.props.onMediaLoaded();
}
}
onProgress = (data) => {
this.setState({ currentTime: data.currentTime });
const { savePosition, claim } = this.props;
this.setState({ buffering: false, currentTime: data.currentTime });
if (data.currentTime > 0 && Math.floor(data.currentTime) % positionSaveInterval === 0) {
const { claim_id: claimId, txid, nout } = claim;
savePosition(claimId, `${txid}:${nout}`, data.currentTime);
}
if (!this.state.seeking) {
this.setSeekerPosition(this.calculateSeekerPosition());
}
if (this.state.firstPlay) {
if (this.props.onPlaybackStarted) {
this.props.onPlaybackStarted();
}
this.setState({ firstPlay: false });
this.hidePlayerControls();
}
}
clearControlsTimeout = () => {
if (this.state.controlsTimeout > -1) {
clearTimeout(this.state.controlsTimeout)
}
}
showPlayerControls = () => {
this.clearControlsTimeout();
if (!this.state.areControlsVisible) {
@@ -94,7 +136,12 @@ class MediaPlayer extends React.PureComponent {
}
this.hidePlayerControls();
}
manualHidePlayerControls = () => {
this.clearControlsTimeout();
this.setState({ areControlsVisible: false });
}
hidePlayerControls() {
const player = this;
let timeout = setTimeout(() => {
@@ -102,28 +149,50 @@ class MediaPlayer extends React.PureComponent {
}, MediaPlayer.ControlsTimeout);
player.setState({ controlsTimeout: timeout });
}
togglePlayerControls = () => {
const { setPlayerVisible, isPlayerVisible } = this.props;
if (!isPlayerVisible) {
setPlayerVisible();
}
if (this.state.areControlsVisible) {
this.manualHidePlayerControls();
} else {
this.showPlayerControls();
}
}
togglePlay = () => {
this.showPlayerControls();
this.setState({ paused: !this.state.paused });
this.setState({ paused: !this.state.paused }, this.handlePausedState);
}
handlePausedState = () => {
if (!this.state.paused) {
// onProgress will automatically clear this, so it's fine
this.setState({ buffering: true });
}
}
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 });
if (this.props.onPlaybackFinished) {
this.props.onPlaybackFinished();
}
this.video.seek(0);
}
setSeekerPosition(position = 0) {
position = this.checkSeekerPosition(position);
this.setState({ seekerPosition: position });
@@ -131,17 +200,17 @@ class MediaPlayer extends React.PureComponent {
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;
@@ -149,56 +218,87 @@ class MediaPlayer extends React.PureComponent {
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();
if (this.state.seekTimeout > 0) {
clearTimeout(this.state.seekTimeout);
}
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.setState({ paused: true }, this.handlePausedState);
this.onEnd();
} else {
this.seekTo(time);
this.setState({ seeking: false });
this.setState({ seekTimeout: setTimeout(() => { this.setState({ seeking: false }); }, 100) });
}
this.hidePlayerControls();
}
});
}
getTrackingOffset() {
return this.state.fullscreenMode ? this.trackingOffset : 0;
}
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();
}
componentWillReceiveProps(nextProps) {
const { isPlayerVisible } = nextProps;
if (!isPlayerVisible && !this.state.backgroundPlayEnabled) {
// force pause if the player is not visible and background play is not enabled
this.setState({ paused: true });
}
}
componentDidMount() {
const { assignPlayer, backgroundPlayEnabled } = this.props;
if (assignPlayer) {
assignPlayer(this);
}
this.setState({ backgroundPlayEnabled: !!backgroundPlayEnabled });
this.setSeekerPosition(this.calculateSeekerPosition());
AppState.addEventListener('change', this.handleAppStateChange);
DeviceEventEmitter.addListener('onBackgroundPlayPressed', this.play);
DeviceEventEmitter.addListener('onBackgroundPausePressed', this.pause);
}
componentWillUnmount() {
AppState.removeEventListener('change', this.handleAppStateChange);
DeviceEventEmitter.removeListener('onBackgroundPlayPressed', this.play);
DeviceEventEmitter.removeListener('onBackgroundPausePressed', this.pause);
this.clearControlsTimeout();
this.setState({ paused: true, fullscreenMode: false });
const { onFullscreenToggled } = this.props;
@@ -206,65 +306,163 @@ class MediaPlayer extends React.PureComponent {
onFullscreenToggled(false);
}
}
handleAppStateChange = () => {
if (AppState.currentState && AppState.currentState.match(/inactive|background/)) {
if (!this.state.backgroundPlayEnabled && !this.state.paused) {
this.setState({ paused: true, autoPaused: true });
}
}
if (AppState.currentState && AppState.currentState.match(/active/)) {
if (!this.state.backgroundPlayEnabled && this.state.autoPaused) {
this.setState({ paused: false, autoPaused: false });
}
}
}
onBuffer = () => {
if (!this.state.paused) {
this.setState({ buffering: true }, () => this.manualHidePlayerControls());
}
}
play = () => {
this.setState({ paused: false }, this.updateBackgroundMediaNotification);
}
pause = () => {
this.setState({ paused: true }, this.updateBackgroundMediaNotification);
}
updateBackgroundMediaNotification = () => {
this.handlePausedState();
const { backgroundPlayEnabled } = this.props;
if (backgroundPlayEnabled) {
if (NativeModules.BackgroundMedia && window.currentMediaInfo) {
const { title, channel, uri } = window.currentMediaInfo;
NativeModules.BackgroundMedia.showPlaybackNotification(title, channel, uri, this.state.paused);
}
}
}
renderPlayerControls() {
const { onBackButtonPressed } = this.props;
if (this.state.areControlsVisible) {
return (
<View style={mediaPlayerStyle.playerControlsContainer}>
<TouchableOpacity style={mediaPlayerStyle.backButton} onPress={onBackButtonPressed}>
<Icon name={"arrow-left"} size={18} style={mediaPlayerStyle.backButtonIcon} />
</TouchableOpacity>
<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" />}
{this.state.paused && <Icon name="play" size={40} color="#ffffff" />}
{!this.state.paused && <Icon name="pause" size={40} 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;
}
onSeekerTouchAreaPressed = (evt) => {
if (evt && evt.nativeEvent) {
const newSeekerPosition = evt.nativeEvent.locationX;
if (!isNaN(newSeekerPosition)) {
const time = this.state.duration * (newSeekerPosition / this.seekerWidth);
this.setSeekerPosition(newSeekerPosition);
this.seekTo(time);
}
}
}
onTrackingLayout = (evt) => {
this.trackingOffset = evt.nativeEvent.layout.x;
this.seekerWidth = evt.nativeEvent.layout.width;
this.setSeekerPosition(this.calculateSeekerPosition());
}
render() {
const { fileInfo, title, thumbnail, style, fullScreenStyle } = this.props;
const flexCompleted = this.getCurrentTimePercentage() * 100;
const flexRemaining = (1 - this.getCurrentTimePercentage()) * 100;
const { onLayout, source, style, thumbnail } = this.props;
const completedWidth = this.getCurrentTimePercentage() * this.seekerWidth;
const remainingWidth = this.seekerWidth - completedWidth;
let styles = [this.state.fullscreenMode ? mediaPlayerStyle.fullscreenContainer : mediaPlayerStyle.container];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
const trackingStyle = [mediaPlayerStyle.trackingControls, this.state.fullscreenMode ?
mediaPlayerStyle.fullscreenTrackingControls : mediaPlayerStyle.containedTrackingControls];
return (
<View style={[style, mediaPlayerStyle.container]}>
<Video source={{ uri: 'file:///' + fileInfo.download_path }}
ref={(ref: Video) => { this.video = ref }}
<View style={styles} onLayout={onLayout}>
<Video source={{ uri: source }}
bufferConfig={{ minBufferMs: 15000, maxBufferMs: 60000, bufferForPlaybackMs: 5000, bufferForPlaybackAfterRebufferMs: 5000 }}
ref={(ref: Video) => { this.video = ref; }}
resizeMode={this.state.resizeMode}
playInBackground={true}
playInBackground={this.state.backgroundPlayEnabled}
style={mediaPlayerStyle.player}
rate={this.state.rate}
volume={this.state.volume}
paused={this.state.paused}
onLoad={this.onLoad}
onBuffer={this.onBuffer}
onProgress={this.onProgress}
onEnd={this.onEnd}
onError={this.onError}
minLoadRetryCount={999}
/>
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.showPlayerControls}>
{this.state.firstPlay && thumbnail && thumbnail.trim().length > 0 &&
<FastImage
source={{uri: thumbnail}}
resizeMode={FastImage.resizeMode.cover}
style={mediaPlayerStyle.playerThumbnail}
/>}
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.togglePlayerControls}>
{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 }]} />
{(!this.state.fullscreenMode || (this.state.fullscreenMode && this.state.areControlsVisible)) &&
<View style={trackingStyle} onLayout={this.onTrackingLayout}>
<View style={mediaPlayerStyle.progress}>
<View style={[mediaPlayerStyle.innerProgressCompleted, { width: completedWidth }]} />
<View style={[mediaPlayerStyle.innerProgressRemaining, { width: remainingWidth }]} />
</View>
</View>
</View>}
{this.state.buffering &&
<View style={mediaPlayerStyle.loadingContainer}>
<ActivityIndicator color={Colors.LbryGreen} size="large" />
</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 style={{ left: this.getTrackingOffset(), width: this.seekerWidth }}>
<View style={[mediaPlayerStyle.seekerHandle,
(this.state.fullscreenMode ? mediaPlayerStyle.seekerHandleFs : mediaPlayerStyle.seekerHandleContained),
{ left: this.state.seekerPosition }]} { ...this.seekResponder.panHandlers }>
<View style={this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle} />
</View>
<TouchableOpacity
style={[mediaPlayerStyle.seekerTouchArea,
(this.state.fullscreenMode ? mediaPlayerStyle.seekerTouchAreaFs : mediaPlayerStyle.seekerTouchAreaContained)]}
onPress={this.onSeekerTouchAreaPressed} />
</View>}
</View>
);
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import NavigationButton from './view';
export default connect()(NavigationButton);
@@ -0,0 +1,18 @@
import React from 'react';
import Icon from 'react-native-vector-icons/FontAwesome5';
import { TouchableOpacity } from 'react-native';
class NavigationButton extends React.PureComponent {
render() {
const { iconStyle, name, onPress, size, style } = this.props;
return (
<TouchableOpacity onPress={onPress} style={style}>
<Icon name={name} size={size} style={iconStyle} />
</TouchableOpacity>
);
}
};
export default NavigationButton;
+6
View File
@@ -0,0 +1,6 @@
import { connect } from 'react-redux';
import PageHeader from './view';
const perform = dispatch => ({});
export default connect(null, perform)(PageHeader);
+52
View File
@@ -0,0 +1,52 @@
// Based on https://github.com/react-navigation/react-navigation/blob/master/src/views/Header/Header.js
import React from 'react';
import {
Animated,
Platform,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome5';
import NavigationButton from 'component/navigationButton';
import pageHeaderStyle from 'styles/pageHeader';
const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;
const AnimatedText = Animated.Text;
class PageHeader extends React.PureComponent {
render() {
const { title, onBackPressed } = this.props;
const containerStyles = [
pageHeaderStyle.container,
{ height: APPBAR_HEIGHT }
];
return (
<View style={containerStyles}>
<View style={pageHeaderStyle.flexOne}>
<View style={pageHeaderStyle.header}>
<View style={pageHeaderStyle.title}>
<AnimatedText
numberOfLines={1}
style={pageHeaderStyle.titleText}
accessibilityTraits="header">
{title}
</AnimatedText>
</View>
<NavigationButton
name="arrow-left"
style={pageHeaderStyle.left}
size={24}
iconStyle={pageHeaderStyle.backIcon}
onPress={onBackPressed}
/>
</View>
</View>
</View>
);
}
}
export default PageHeader;
+4
View File
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import ProgressBar from './view';
export default connect()(ProgressBar);
+54
View File
@@ -0,0 +1,54 @@
// @flow
import React from 'react';
import PropTypes from 'prop-types';
import { View } from 'react-native';
const defaultHeight = 5;
const defaultBorderRadius = 5;
const minProgress = 0;
const maxProgress = 100;
class ProgressBar extends React.PureComponent {
static propTypes = {
borderRadius: PropTypes.number,
color: PropTypes.string.isRequired,
height: PropTypes.number,
progress: function(props, propName, componentName) {
const value = parseInt(props[propName], 10);
if (isNaN(value) || props[propName] < minProgress || props[propName] > maxProgress) {
return new Error('progress should be between 0 and 100');
}
},
style: PropTypes.any
};
render() {
const { borderRadius, color, height, progress, style } = this.props;
const currentProgress = Math.ceil(progress);
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
styles.push({
borderRadius: borderRadius || defaultBorderRadius,
flexDirection: 'row',
height: height || defaultHeight,
overflow: 'hidden'
});
return (
<View style={styles}>
<View style={{ backgroundColor: color, borderRadius: borderRadius || defaultBorderRadius, flex: currentProgress }} />
<View style={{ backgroundColor: color, opacity: 0.2, flex: (100 - currentProgress) }} />
</View>
);
}
}
export default ProgressBar;
+25
View File
@@ -0,0 +1,25 @@
import { connect } from 'react-redux';
import {
makeSelectClaimForUri,
doSearch,
makeSelectRecommendedContentForUri,
makeSelectTitleForUri,
selectIsSearching,
} from 'lbry-redux';
import RelatedContent from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state),
isSearching: selectIsSearching(state),
});
const perform = dispatch => ({
search: query => dispatch(doSearch(query, 20, undefined, true)),
});
export default connect(
select,
perform
)(RelatedContent);
+65
View File
@@ -0,0 +1,65 @@
import React from 'react';
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
import { navigateToUri } from 'utils/helper';
import Colors from 'styles/colors';
import FileListItem from 'component/fileListItem';
import fileListStyle from 'styles/fileList';
import relatedContentStyle from 'styles/relatedContent';
export default class RelatedContent extends React.PureComponent<Props> {
constructor() {
super();
this.didSearch = undefined;
}
componentDidMount() {
this.getRecommendedContent();
}
componentDidUpdate(prevProps: Props) {
const { claim, uri } = this.props;
if (uri !== prevProps.uri) {
this.didSearch = false;
}
if (claim && !this.didSearch) {
this.getRecommendedContent();
}
}
getRecommendedContent() {
const { search, title } = this.props;
if (title) {
search(title);
this.didSearch = true;
}
}
didSearch: ?boolean;
render() {
const { recommendedContent, isSearching, navigation } = this.props;
if (!isSearching && (!recommendedContent || recommendedContent.length === 0)) {
return null;
}
return (
<View style={relatedContentStyle.container}>
<Text style={relatedContentStyle.title}>Related Content</Text>
{recommendedContent && recommendedContent.map(recommendedUri => (
<FileListItem
style={fileListStyle.item}
key={recommendedUri}
uri={recommendedUri}
navigation={navigation}
onPress={() => navigateToUri(navigation, recommendedUri, { autoplay: true })} />
))}
{isSearching && <ActivityIndicator size="small" color={Colors.LbryGreen} style={relatedContentStyle.loading} />}
</View>
);
}
}
+29
View File
@@ -0,0 +1,29 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import {
doClaimRewardType,
doClaimRewardClearError,
makeSelectClaimRewardError,
makeSelectIsRewardClaimPending,
} from 'lbryinc';
import RewardCard from './view';
const makeSelect = () => {
const selectIsPending = makeSelectIsRewardClaimPending();
const selectError = makeSelectClaimRewardError();
const select = (state, props) => ({
errorMessage: selectError(state, props),
isPending: selectIsPending(state, props),
});
return select;
};
const perform = dispatch => ({
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, true)),
clearError: reward => dispatch(doClaimRewardClearError(reward)),
notify: data => dispatch(doToast(data))
});
export default connect(makeSelect, perform)(RewardCard);
+103
View File
@@ -0,0 +1,103 @@
// @flow
import React from 'react';
import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native';
import Colors from '../../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from '../link';
import rewardStyle from '../../styles/reward';
type Props = {
canClaim: bool,
onClaimPress: object,
reward: {
id: string,
reward_title: string,
reward_amount: number,
transaction_id: string,
created_at: string,
reward_description: string,
reward_type: string,
},
};
class RewardCard extends React.PureComponent<Props> {
state = {
claimStarted: false
};
componentWillReceiveProps(nextProps) {
const { errorMessage, isPending } = nextProps;
const { clearError, notify, reward } = this.props;
if (this.state.claimStarted && !isPending) {
if (errorMessage && errorMessage.trim().length > 0) {
notify({ message: errorMessage });
clearError(reward);
} else {
notify({ message: 'Reward successfully claimed!' });
}
this.setState({ claimStarted: false });
}
}
onClaimPress = () => {
const {
canClaim,
claimReward,
notify,
reward,
showVerification
} = this.props;
if (!canClaim) {
if (showVerification) {
showVerification();
}
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' });
return;
}
this.setState({ claimStarted: true }, () => {
claimReward(reward);
});
}
render() {
const { canClaim, isPending, onClaimPress, reward } = this.props;
const claimed = !!reward.transaction_id;
return (
<TouchableOpacity style={[rewardStyle.rewardCard, rewardStyle.row]} onPress={() => {
if (!isPending && !claimed) {
this.onClaimPress();
}
}}>
<View style={rewardStyle.leftCol}>
{!isPending && <TouchableOpacity onPress={() => {
if (!claimed) {
this.onClaimPress();
}
}}>
{claimed && <Icon name={claimed ? "check-circle" : "circle"}
style={claimed ? rewardStyle.claimed : (canClaim ? rewardStyle.unclaimed : rewardStyle.disabled)}
size={20} />}
</TouchableOpacity>}
{isPending && <ActivityIndicator size="small" color={Colors.LbryGreen} />}
</View>
<View style={rewardStyle.midCol}>
<Text style={rewardStyle.rewardTitle}>{reward.reward_title}</Text>
<Text style={rewardStyle.rewardDescription}>{reward.reward_description}</Text>
{claimed && <Link style={rewardStyle.link}
href={`https://explorer.lbry.com/tx/${reward.transaction_id}`}
text={reward.transaction_id.substring(0, 7)}
error={'The transaction URL could not be opened'} />}
</View>
<View style={rewardStyle.rightCol}>
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
</View>
</TouchableOpacity>
);
}
};
export default RewardCard;
@@ -0,0 +1,19 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { doRewardList, selectUnclaimedRewardValue, selectFetchingRewards, selectUser } from 'lbryinc';
import RewardEnrolment from './view';
const select = state => ({
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
fetching: selectFetchingRewards(state),
user: selectUser(state)
});
const perform = dispatch => ({
fetchRewards: () => dispatch(doRewardList()),
notify: data => dispatch(doToast(data)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
});
export default connect(select, perform)(RewardEnrolment);
+53
View File
@@ -0,0 +1,53 @@
import React from 'react';
import { NativeModules, Text, TouchableOpacity, View } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import Button from 'component/button';
import Constants from 'constants';
import Link from 'component/link';
import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import rewardStyle from 'styles/reward';
class RewardEnrolment extends React.Component {
componentDidMount() {
this.props.fetchRewards();
}
onNotInterestedPressed = () => {
const { navigation, setClientSetting } = this.props;
setClientSetting(Constants.SETTING_REWARDS_NOT_INTERESTED, true);
navigation.navigate({ routeName: 'DiscoverStack' });
}
onEnrollPressed = () => {
const { navigation } = this.props;
navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: false }});
}
render() {
const { fetching, navigation, unclaimedRewardAmount, user } = this.props;
return (
<View style={rewardStyle.enrollContainer} onPress>
<View style={rewardStyle.summaryRow}>
<Icon name="award" size={36} color={Colors.White} />
<Text style={rewardStyle.summaryText}>
{unclaimedRewardAmount} unclaimed credits
</Text>
</View>
<View style={rewardStyle.onboarding}>
<Text style={rewardStyle.enrollDescText}>LBRY credits allow you to purchase content, publish content, and influence the network. You can start earning credits by watching videos on LBRY.</Text>
</View>
<View style={rewardStyle.buttonRow}>
<Link style={rewardStyle.notInterestedLink} text={"Not interested"} onPress={this.onNotInterestedPressed} />
<Button style={rewardStyle.enrollButton} theme={"light"} text={"Enroll"} onPress={this.onEnrollPressed} />
</View>
</View>
);
}
}
export default RewardEnrolment;
+17
View File
@@ -0,0 +1,17 @@
import { connect } from 'react-redux';
import { doToast } from 'lbry-redux';
import { doRewardList, selectUnclaimedRewardValue, selectFetchingRewards, selectUser } from 'lbryinc';
import RewardSummary from './view';
const select = state => ({
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
fetching: selectFetchingRewards(state),
user: selectUser(state)
});
const perform = dispatch => ({
fetchRewards: () => dispatch(doRewardList()),
notify: data => dispatch(doToast(data))
});
export default connect(select, perform)(RewardSummary);
+82
View File
@@ -0,0 +1,82 @@
import React from 'react';
import { NativeModules, Text, TouchableOpacity, View } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import Button from 'component/button';
import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import rewardStyle from 'styles/reward';
class RewardSummary extends React.Component {
static itemKey = 'rewardSummaryDismissed';
state = {
actionsLeft: 0,
dismissed: false
};
componentDidMount() {
this.props.fetchRewards();
AsyncStorage.getItem(RewardSummary.itemKey).then(isDismissed => {
if ('true' === isDismissed) {
this.setState({ dismissed: true });
}
const { user } = this.props;
let actionsLeft = 0;
if (!user || !user.has_verified_email) {
actionsLeft++;
}
if (!user || !user.is_identity_verified) {
actionsLeft++;
}
this.setState({ actionsLeft });
});
}
onDismissPressed = () => {
AsyncStorage.setItem(RewardSummary.itemKey, 'true');
this.setState({ dismissed: true });
this.props.notify({
message: 'You can always claim your rewards from the Rewards page.',
});
}
handleSummaryPressed = () => {
const { showVerification } = this.props;
if (showVerification) {
showVerification();
}
}
render() {
const { fetching, navigation, unclaimedRewardAmount, user } = this.props;
if (!user) {
return null;
}
if (this.state.dismissed ||
(user && user.is_reward_approved) ||
this.state.actionsLeft === 0 ||
unclaimedRewardAmount === 0) {
return null;
}
return (
<TouchableOpacity style={rewardStyle.summaryContainer} onPress={this.handleSummaryPressed}>
<View style={rewardStyle.summaryRow}>
<Icon name="award" size={36} color={Colors.White} />
<Text style={rewardStyle.summaryText}>
{unclaimedRewardAmount} unclaimed credits
</Text>
</View>
<Button style={rewardStyle.dismissButton} theme={"light"} text={"Dismiss"} onPress={this.onDismissPressed} />
</TouchableOpacity>
);
}
}
export default RewardSummary;
+7 -1
View File
@@ -1,9 +1,15 @@
import { connect } from 'react-redux';
import { NativeModules } from 'react-native';
import { doSearch, doUpdateSearchQuery } from 'lbry-redux';
import SearchInput from './view';
const perform = dispatch => ({
search: search => dispatch(doSearch(search)),
search: search => {
if (NativeModules.Firebase) {
NativeModules.Firebase.track('search', { query: search });
}
return dispatch(doSearch(search));
},
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query, false))
});
@@ -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;
@@ -0,0 +1,10 @@
import { connect } from 'react-redux';
import SearchRightHeaderIcon from './view';
import { ACTIONS } from 'lbry-redux';
const perform = dispatch => ({
clearQuery: () => dispatch({
type: ACTIONS.HISTORY_NAVIGATE
})
});
export default connect(null, perform)(SearchRightHeaderIcon);
@@ -0,0 +1,20 @@
import React from 'react';
import { NavigationActions } from 'react-navigation';
import Feather from "react-native-vector-icons/Feather";
class SearchRightHeaderIcon extends React.PureComponent {
clearAndGoBack() {
const { navigation } = this.props;
this.props.clearQuery();
navigation.dispatch(NavigationActions.back())
}
render() {
const { style } = this.props;
return <Feather name="x" size={24} style={style} onPress={() => this.clearAndGoBack()} />;
}
}
export default SearchRightHeaderIcon;
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import StorageStatsCard from './view';
export default connect()(StorageStatsCard);
+132
View File
@@ -0,0 +1,132 @@
import React from 'react';
import { normalizeURI, parseURI } from 'lbry-redux';
import {
ActivityIndicator,
Platform,
Switch,
Text,
TouchableOpacity,
View
} from 'react-native';
import { formatBytes } from '../../utils/helper';
import Colors from '../../styles/colors';
import storageStatsStyle from '../../styles/storageStats';
class StorageStatsCard extends React.PureComponent {
state = {
totalBytes: 0,
totalAudioBytes: 0,
totalAudioPercent: 0,
totalImageBytes: 0,
totalImagePercent: 0,
totalVideoBytes: 0,
totalVideoPercent: 0,
totalOtherBytes: 0,
totalOtherPercent: 0,
showStats: false
};
componentDidMount() {
// calculate total bytes
const { fileInfos } = this.props;
let totalBytes = 0, totalAudioBytes = 0, totalImageBytes = 0, totalVideoBytes = 0;
let totalAudioPercent = 0, totalImagePercent = 0, totalVideoPercent = 0;
fileInfos.forEach(fileInfo => {
if (fileInfo.completed) {
const bytes = fileInfo.written_bytes;
const type = fileInfo.mime_type;
totalBytes += bytes;
if (type) {
if (type.startsWith('audio/')) totalAudioBytes += bytes;
if (type.startsWith('image/')) totalImageBytes += bytes;
if (type.startsWith('video/')) totalVideoBytes += bytes;
}
}
});
totalAudioPercent = ((totalAudioBytes / totalBytes) * 100).toFixed(2);
totalImagePercent = ((totalImageBytes / totalBytes) * 100).toFixed(2);
totalVideoPercent = ((totalVideoBytes / totalBytes) * 100).toFixed(2);
this.setState({
totalBytes,
totalAudioBytes,
totalAudioPercent,
totalImageBytes,
totalImagePercent,
totalVideoBytes,
totalVideoPercent,
totalOtherBytes: totalBytes - (totalAudioBytes + totalImageBytes + totalVideoBytes),
totalOtherPercent: (100 - (parseFloat(totalAudioPercent) +
parseFloat(totalImagePercent) +
parseFloat(totalVideoPercent))).toFixed(2)
});
}
render() {
if (this.state.totalBytes == 0) {
return null;
}
return (
<View style={storageStatsStyle.card}>
<View style={[storageStatsStyle.row, storageStatsStyle.totalSizeContainer]}>
<View style={storageStatsStyle.summary}>
<Text style={storageStatsStyle.totalSize}>{formatBytes(this.state.totalBytes, 2)}</Text>
<Text style={storageStatsStyle.annotation}>used</Text>
</View>
<View style={[storageStatsStyle.row, storageStatsStyle.toggleStatsContainer]}>
<Text style={storageStatsStyle.statsText}>Stats</Text>
<Switch
style={storageStatsStyle.statsToggle}
value={this.state.showStats}
onValueChange={(value) => this.setState({ showStats: value })} />
</View>
</View>
{this.state.showStats &&
<View>
<View style={storageStatsStyle.distributionBar}>
<View style={[storageStatsStyle.audioDistribution, { flex: parseFloat(this.state.totalAudioPercent) }]} />
<View style={[storageStatsStyle.imageDistribution, { flex: parseFloat(this.state.totalImagePercent) }]} />
<View style={[storageStatsStyle.videoDistribution, { flex: parseFloat(this.state.totalVideoPercent) }]} />
<View style={[storageStatsStyle.otherDistribution, { flex: parseFloat(this.state.totalOtherPercent) }]} />
</View>
<View style={storageStatsStyle.legend}>
{this.state.totalAudioBytes > 0 &&
<View style={[storageStatsStyle.row, storageStatsStyle.legendItem]}>
<View style={[storageStatsStyle.legendBox, storageStatsStyle.audioDistribution]} />
<Text style={storageStatsStyle.legendText}>Audio</Text>
<Text style={storageStatsStyle.legendSize}>{formatBytes(this.state.totalAudioBytes, 2)}</Text>
</View>
}
{this.state.totalImageBytes > 0 &&
<View style={[storageStatsStyle.row, storageStatsStyle.legendItem]}>
<View style={[storageStatsStyle.legendBox, storageStatsStyle.imageDistribution]} />
<Text style={storageStatsStyle.legendText}>Images</Text>
<Text style={storageStatsStyle.legendSize}>{formatBytes(this.state.totalImageBytes, 2)}</Text>
</View>
}
{this.state.totalVideoBytes > 0 &&
<View style={[storageStatsStyle.row, storageStatsStyle.legendItem]}>
<View style={[storageStatsStyle.legendBox, storageStatsStyle.videoDistribution]} />
<Text style={storageStatsStyle.legendText}>Videos</Text>
<Text style={storageStatsStyle.legendSize}>{formatBytes(this.state.totalVideoBytes, 2)}</Text>
</View>
}
{this.state.totalOtherBytes > 0 &&
<View style={[storageStatsStyle.row, storageStatsStyle.legendItem]}>
<View style={[storageStatsStyle.legendBox, storageStatsStyle.otherDistribution]} />
<Text style={storageStatsStyle.legendText}>Other</Text>
<Text style={storageStatsStyle.legendSize}>{formatBytes(this.state.totalOtherBytes, 2)}</Text>
</View>
}
</View>
</View>}
</View>
)
}
}
export default StorageStatsCard;
@@ -0,0 +1,23 @@
import { connect } from 'react-redux';
import {
doChannelSubscribe,
doChannelUnsubscribe,
selectSubscriptions,
makeSelectIsSubscribed,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import SubscribeButton from './view';
const select = (state, props) => ({
subscriptions: selectSubscriptions(state),
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
});
export default connect(
select,
{
doChannelSubscribe,
doChannelUnsubscribe,
doToast,
}
)(SubscribeButton);
+49
View File
@@ -0,0 +1,49 @@
import React from 'react';
import { normalizeURI, parseURI } from 'lbry-redux';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from '../button';
import Colors from '../../styles/colors';
class SubscribeButton extends React.PureComponent {
render() {
const {
uri,
isSubscribed,
doChannelSubscribe,
doChannelUnsubscribe,
style
} = this.props;
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
const iconColor = isSubscribed ? null : Colors.Red;
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
const subscriptionLabel = isSubscribed ? null : __('Subscribe');
const { claimName } = parseURI(uri);
return (
<Button
style={styles}
theme={"light"}
icon={isSubscribed ? "heart-broken" : "heart"}
iconColor={iconColor}
solid={isSubscribed ? false : true}
text={subscriptionLabel}
onPress={() => {
subscriptionHandler({
channelName: claimName,
uri: normalizeURI(uri),
});
}} />
);
}
}
export default SubscribeButton;
@@ -0,0 +1,25 @@
import { connect } from 'react-redux';
import {
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
selectEnabledChannelNotifications,
selectSubscriptions,
makeSelectIsSubscribed,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import SubscribeNotificationButton from './view';
const select = (state, props) => ({
enabledChannelNotifications: selectEnabledChannelNotifications(state),
subscriptions: selectSubscriptions(state),
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
});
export default connect(
select,
{
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
doToast,
}
)(SubscribeNotificationButton);
@@ -0,0 +1,55 @@
import React from 'react';
import { parseURI } from 'lbry-redux';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from 'component/button';
import Colors from 'styles/colors';
class SubscribeNotificationButton extends React.PureComponent {
render() {
const {
uri,
name,
doChannelSubscriptionEnableNotifications,
doChannelSubscriptionDisableNotifications,
doToast,
enabledChannelNotifications,
isSubscribed,
style
} = this.props;
if (!isSubscribed) {
return null;
}
let styles = [];
if (style) {
if (style.length) {
styles = styles.concat(style);
} else {
styles.push(style);
}
}
const shouldNotify = enabledChannelNotifications.indexOf(name) > -1;
const { claimName } = parseURI(uri);
return (
<Button
style={styles}
theme={"light"}
icon={shouldNotify ? "bell-slash" : "bell"}
solid={true}
onPress={() => {
if (shouldNotify) {
doChannelSubscriptionDisableNotifications(name);
doToast({ message: 'You will not receive notifications for new content.' });
} else {
doChannelSubscriptionEnableNotifications(name);
doToast({ message: 'You will receive all notifications for new content.' });
}
}} />
);
}
}
export default SubscribeNotificationButton;
@@ -0,0 +1,25 @@
import { connect } from 'react-redux';
import {
makeSelectFetchingChannelClaims,
makeSelectClaimsInChannelForPage,
doFetchClaimsByChannel,
doResolveUris,
} from 'lbry-redux';
import { selectShowNsfw } from 'redux/selectors/settings';
import SuggestedSubscriptionItem from './view';
const select = (state, props) => ({
claims: makeSelectClaimsInChannelForPage(props.categoryLink)(state),
fetching: makeSelectFetchingChannelClaims(props.categoryLink)(state),
obscureNsfw: !selectShowNsfw(state),
});
const perform = dispatch => ({
fetchChannel: channel => dispatch(doFetchClaimsByChannel(channel)),
resolveUris: uris => dispatch(doResolveUris(uris, true)),
});
export default connect(
select,
perform
)(SuggestedSubscriptionItem);
@@ -0,0 +1,74 @@
import React from 'react';
import { buildURI, normalizeURI } from 'lbry-redux';
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
import Colors from 'styles/colors';
import discoverStyle from 'styles/discover';
import FileItem from 'component/fileItem';
import subscriptionsStyle from 'styles/subscriptions';
class SuggestedSubscriptionItem extends React.PureComponent {
componentDidMount() {
const { fetching, categoryLink, fetchChannel, resolveUris, claims } = this.props;
if (!fetching && categoryLink && (!claims || claims.length)) {
fetchChannel(categoryLink);
}
}
uriForClaim = (claim) => {
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = claim;
const uriParams = {};
// This is unfortunate
// https://github.com/lbryio/lbry/issues/1159
const name = claimName || claimNameDownloaded;
uriParams.contentName = name;
uriParams.claimId = claimId;
const uri = buildURI(uriParams);
return uri;
}
render() {
const { categoryLink, fetching, obscureNsfw, claims, navigation } = this.props;
if (!claims || !claims.length) {
return (
<View style={subscriptionsStyle.busyContainer}>
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
</View>
);
}
if (claims && claims.length > 0) {
return (
<View style={subscriptionsStyle.suggestedContainer}>
<FileItem
style={subscriptionsStyle.compactMainFileItem}
mediaStyle={subscriptionsStyle.fileItemMedia}
uri={this.uriForClaim(claims[0])}
navigation={navigation} />
{(claims.length > 1) &&
<FlatList style={subscriptionsStyle.compactItems}
horizontal={true}
renderItem={ ({item}) => (
<FileItem
style={subscriptionsStyle.compactFileItem}
mediaStyle={subscriptionsStyle.compactFileItemMedia}
key={item}
uri={normalizeURI(item)}
navigation={navigation}
compactView={true} />
)
}
data={claims.slice(1, 4).map(claim => this.uriForClaim(claim))}
keyExtractor={(item, index) => item}
/>}
</View>
);
}
return null;
}
}
export default SuggestedSubscriptionItem;
@@ -0,0 +1,13 @@
import { connect } from 'react-redux';
import { selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
import SuggestedSubscriptions from './view';
const select = state => ({
suggested: selectSuggestedChannels(state),
loading: selectIsFetchingSuggested(state),
});
export default connect(
select,
null
)(SuggestedSubscriptions);
@@ -0,0 +1,55 @@
import React from 'react';
import { ActivityIndicator, SectionList, Text, View } from 'react-native';
import { normalizeURI } from 'lbry-redux';
import { navigateToUri } from 'utils/helper';
import SubscribeButton from 'component/subscribeButton';
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
import Colors from 'styles/colors';
import discoverStyle from 'styles/discover';
import subscriptionsStyle from 'styles/subscriptions';
import Link from 'component/link';
class SuggestedSubscriptions extends React.PureComponent {
render() {
const { suggested, loading, navigation } = this.props;
if (loading) {
return (
<View>
<ActivityIndicator size="large" color={Colors.LbryGreen} />
</View>
);
}
return suggested ? (
<SectionList style={subscriptionsStyle.scrollContainer}
renderItem={ ({item, index, section}) => (
<SuggestedSubscriptionItem
key={item}
categoryLink={normalizeURI(item)}
navigation={navigation} />
)
}
renderSectionHeader={
({section: {title}}) => {
const titleParts = title.split(';');
const channelName = titleParts[0];
const channelUri = normalizeURI(titleParts[1]);
return (
<View style={subscriptionsStyle.titleRow}>
<Link style={subscriptionsStyle.channelTitle} text={channelName} onPress={() => {
navigateToUri(navigation, normalizeURI(channelUri));
}} />
<SubscribeButton style={subscriptionsStyle.subscribeButton} uri={channelUri} name={channelName} />
</View>
)
}
}
sections={suggested.map(({ uri, label }) => ({ title: (label + ';' + uri), data: [uri] }))}
keyExtractor={(item, index) => item}
/>
) : null;
}
}
export default SuggestedSubscriptions;
@@ -0,0 +1,11 @@
import { connect } from 'react-redux';
//import { selectClaimedRewardsByTransactionId } from 'redux/selectors/rewards';
import { selectAllMyClaimsByOutpoint } from 'lbry-redux';
import TransactionList from './view';
const select = state => ({
//rewards: selectClaimedRewardsByTransactionId(state),
myClaims: selectAllMyClaimsByOutpoint(state),
});
export default connect(select, null)(TransactionList);
@@ -0,0 +1,56 @@
// @flow
import React from 'react';
import { Text, View, Linking } from 'react-native';
import { buildURI, formatCredits } from 'lbry-redux';
import { navigateToUri } from '../../../utils/helper';
import Link from '../../link';
import moment from 'moment';
import transactionListStyle from '../../../styles/transactionList';
class TransactionListItem extends React.PureComponent {
capitalize(string: string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
render() {
const { transaction, navigation } = this.props;
const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction;
return (
<View style={transactionListStyle.listItem}>
<View style={[transactionListStyle.row, transactionListStyle.topRow]}>
<View style={transactionListStyle.col}>
<Text style={transactionListStyle.text}>{this.capitalize(type)}</Text>
{name && claimId && (
<Link
style={transactionListStyle.link}
onPress={() => navigateToUri(navigation, buildURI({ claimName: name, claimId }))}
text={name} />
)}
</View>
<View style={transactionListStyle.col}>
<Text style={[transactionListStyle.amount, transactionListStyle.text]}>{formatCredits(amount, 8)}</Text>
{ fee !== 0 && (<Text style={[transactionListStyle.amount, transactionListStyle.text]}>fee {formatCredits(fee, 8)}</Text>) }
</View>
</View>
<View style={transactionListStyle.row}>
<View style={transactionListStyle.col}>
<Link style={transactionListStyle.smallLink}
text={txid.substring(0, 8)}
href={`https://explorer.lbry.com/tx/${txid}`}
error={'The transaction URL could not be opened'} />
</View>
<View style={transactionListStyle.col}>
{date ? (
<Text style={transactionListStyle.smallText}>{moment(date).format('MMM D')}</Text>
) : (
<Text style={transactionListStyle.smallText}>Pending</Text>
)}
</View>
</View>
</View>
);
}
}
export default TransactionListItem;
+70
View File
@@ -0,0 +1,70 @@
// @flow
import React from 'react';
import { Text, View } from 'react-native';
import TransactionListItem from './internal/transaction-list-item';
import transactionListStyle from '../../styles/transactionList';
export type Transaction = {
amount: number,
claim_id: string,
claim_name: string,
fee: number,
nout: number,
txid: string,
type: string,
date: Date,
};
class TransactionList extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
filter: 'all',
};
(this: any).handleFilterChanged = this.handleFilterChanged.bind(this);
(this: any).filterTransaction = this.filterTransaction.bind(this);
}
handleFilterChanged(event: React.SyntheticInputEvent<*>) {
this.setState({
filter: event.target.value,
});
}
filterTransaction(transaction: Transaction) {
const { filter } = this.state;
return filter === 'all' || filter === transaction.type;
}
render() {
const { emptyMessage, rewards, transactions, navigation } = this.props;
const { filter } = this.state;
const transactionList = transactions.filter(this.filterTransaction);
return (
<View>
{!transactionList.length && (
<Text style={transactionListStyle.noTransactions}>{emptyMessage || 'No transactions to list.'}</Text>
)}
{!!transactionList.length && (
<View>
{transactionList.map(t => (
<TransactionListItem
key={`${t.txid}:${t.nout}`}
transaction={t}
navigation={navigation}
reward={rewards && rewards[t.txid]}
/>
))}
</View>
)}
</View>
);
}
}
export default TransactionList;
@@ -0,0 +1,20 @@
import { connect } from 'react-redux';
import {
doFetchTransactions,
selectRecentTransactions,
selectHasTransactions,
selectIsFetchingTransactions,
} from 'lbry-redux';
import TransactionListRecent from './view';
const select = state => ({
fetchingTransactions: selectIsFetchingTransactions(state),
transactions: selectRecentTransactions(state),
hasTransactions: selectHasTransactions(state),
});
const perform = dispatch => ({
fetchTransactions: () => dispatch(doFetchTransactions()),
});
export default connect(select, perform)(TransactionListRecent);
@@ -0,0 +1,50 @@
// @flow
import React from 'react';
//import BusyIndicator from 'component/common/busy-indicator';
import { Text, View } from 'react-native';
import Button from '../button';
import Link from '../link';
import TransactionList from '../transactionList';
import type { Transaction } from '../transactionList/view';
import walletStyle from '../../styles/wallet';
type Props = {
fetchTransactions: () => void,
fetchingTransactions: boolean,
hasTransactions: boolean,
transactions: Array<Transaction>,
};
class TransactionListRecent extends React.PureComponent<Props> {
componentDidMount() {
this.props.fetchTransactions();
}
render() {
const { fetchingTransactions, hasTransactions, transactions, navigation } = this.props;
return (
<View style={walletStyle.transactionsCard}>
<View style={[walletStyle.row, walletStyle.transactionsHeader]}>
<Text style={walletStyle.transactionsTitle}>Recent Transactions</Text>
<Link style={walletStyle.link}
navigation={navigation}
text={'View All'}
href={'#TransactionHistory'} />
</View>
{fetchingTransactions && (
<Text style={walletStyle.infoText}>Fetching transactions...</Text>
)}
{!fetchingTransactions && (
<TransactionList
navigation={navigation}
transactions={transactions}
emptyMessage={"Looks like you don't have any recent transactions."}
/>
)}
</View>
);
}
}
export default TransactionListRecent;
+26
View File
@@ -0,0 +1,26 @@
import { connect } from 'react-redux';
import {
doUpdateSearchQuery,
selectSearchState as selectSearch,
selectSearchValue,
selectSearchSuggestions
} from 'lbry-redux';
import { selectCurrentRoute } from 'redux/selectors/drawer';
import UriBar from './view';
const select = state => {
const { ...searchState } = selectSearch(state);
return {
...searchState,
query: selectSearchValue(state),
currentRoute: selectCurrentRoute(state),
suggestions: selectSearchSuggestions(state)
};
};
const perform = dispatch => ({
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
});
export default connect(select, perform)(UriBar);
@@ -0,0 +1,45 @@
// @flow
import React from 'react';
import { SEARCH_TYPES, normalizeURI } from 'lbry-redux';
import { Text, TouchableOpacity, View } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome5';
import uriBarStyle from '../../../styles/uriBar';
class UriBarItem extends React.PureComponent {
render() {
const { item, onPress } = this.props;
const { shorthand, type, value } = item;
let icon;
switch (type) {
case SEARCH_TYPES.CHANNEL:
icon = <Icon name="at" size={18} />
break;
case SEARCH_TYPES.SEARCH:
icon = <Icon name="search" size={18} />
break;
case SEARCH_TYPES.FILE:
default:
icon = <Icon name="file" size={18} />
break;
}
return (
<TouchableOpacity style={uriBarStyle.item} onPress={onPress}>
{icon}
<View style={uriBarStyle.itemContent}>
<Text style={uriBarStyle.itemText} numberOfLines={1}>{shorthand || value} - {type === SEARCH_TYPES.SEARCH ? 'Search' : value}</Text>
<Text style={uriBarStyle.itemDesc} numberOfLines={1}>
{type === SEARCH_TYPES.SEARCH && `Search for '${value}'`}
{type === SEARCH_TYPES.CHANNEL && `View the @${shorthand} channel`}
{type === SEARCH_TYPES.FILE && `View content at ${value}`}
</Text>
</View>
</TouchableOpacity>
)
}
}
export default UriBarItem;
+197
View File
@@ -0,0 +1,197 @@
// @flow
import React from 'react';
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
import { FlatList, Keyboard, TextInput, View } from 'react-native';
import { navigateToUri } from 'utils/helper';
import Constants from 'constants';
import UriBarItem from './internal/uri-bar-item';
import NavigationButton from 'component/navigationButton';
import discoverStyle from 'styles/discover';
import uriBarStyle from 'styles/uriBar';
class UriBar extends React.PureComponent {
static INPUT_TIMEOUT = 2500; // 2.5 seconds
textInput = null;
keyboardDidHideListener = null;
componentDidMount () {
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
this.setSelection();
}
componentWillUnmount() {
if (this.keyboardDidHideListener) {
this.keyboardDidHideListener.remove();
}
}
componentWillReceiveProps(nextProps) {
const { currentRoute, query } = nextProps;
const { currentRoute: prevRoute } = this.props;
if (Constants.DRAWER_ROUTE_SEARCH === currentRoute && currentRoute !== prevRoute) {
this.setState({ currentValue: query, inputText: query });
}
}
constructor(props) {
super(props);
this.state = {
changeTextTimeout: null,
currentValue: null,
inputText: null,
focused: false,
// TODO: Add a setting to enable / disable direct search?
directSearch: true
};
}
handleChangeText = text => {
const newValue = text ? text : '';
clearTimeout(this.state.changeTextTimeout);
const { updateSearchQuery, onSearchSubmitted, navigation } = this.props;
let timeout = setTimeout(() => {
if (text.trim().length === 0) {
// don't do anything if the text is empty
return;
}
updateSearchQuery(text);
if (!text.startsWith('lbry://')) {
// not a URI input, so this is a search, perform a direct search
if (onSearchSubmitted) {
onSearchSubmitted(text);
} else {
navigation.navigate({ routeName: 'Search', key: 'searchPage', params: { searchQuery: text }});
}
}
}, UriBar.INPUT_TIMEOUT);
this.setState({ inputText: newValue, currentValue: newValue, changeTextTimeout: timeout });
}
handleItemPress = (item) => {
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
const { type, value } = item;
Keyboard.dismiss();
if (SEARCH_TYPES.SEARCH === type) {
this.setState({ currentValue: value });
updateSearchQuery(value);
if (onSearchSubmitted) {
onSearchSubmitted(value);
return;
}
navigation.navigate({ routeName: 'Search', key: 'searchPage', params: { searchQuery: value }});
} else {
const uri = normalizeURI(value);
navigateToUri(navigation, uri);
}
}
_keyboardDidHide = () => {
if (this.textInput) {
this.textInput.blur();
}
this.setState({ focused: false });
}
setSelection() {
if (this.textInput) {
this.textInput.setNativeProps({ selection: { start: 0, end: 0 }});
}
}
handleSubmitEditing = () => {
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
if (this.state.inputText) {
let inputText = this.state.inputText;
if (inputText.startsWith('lbry://') && isURIValid(inputText)) {
// if it's a URI (lbry://...), open the file page
const uri = normalizeURI(inputText);
navigateToUri(navigation, uri);
} else {
updateSearchQuery(inputText);
// Not a URI, default to a search request
if (onSearchSubmitted) {
// Only the search page sets the onSearchSubmitted prop, so call this prop if set
onSearchSubmitted(inputText);
return;
}
// Open the search page with the query populated
navigation.navigate({ routeName: 'Search', key: 'searchPage', params: { searchQuery: inputText }});
}
}
}
onSearchPageBlurred() {
this.setState({ currenValueSet: false });
}
render() {
const { navigation, suggestions, query, value } = this.props;
if (this.state.currentValue === null) {
this.setState({ currentValue: value });
}
let style = [uriBarStyle.overlay];
// TODO: Add optional setting to enable URI / search bar suggestions
/*if (this.state.focused) { style.push(uriBarStyle.inFocus); }*/
return (
<View style={style}>
<View style={uriBarStyle.uriContainer}>
<NavigationButton
name="bars"
size={24}
style={uriBarStyle.drawerMenuButton}
iconStyle={discoverStyle.drawerHamburger}
onPress={() => navigation.openDrawer() } />
<TextInput ref={(ref) => { this.textInput = ref }}
style={uriBarStyle.uriText}
onLayout={() => { this.setSelection(); }}
selectTextOnFocus={true}
placeholder={'Search movies, music, and more'}
underlineColorAndroid={'transparent'}
numberOfLines={1}
clearButtonMode={'while-editing'}
value={this.state.currentValue}
returnKeyType={'go'}
inlineImageLeft={'baseline_search_black_24'}
inlineImagePadding={16}
onFocus={() => this.setState({ focused: true })}
onBlur={() => {
this.setState({ focused: false });
this.setSelection();
}}
onChangeText={this.handleChangeText}
onSubmitEditing={this.handleSubmitEditing}/>
{(this.state.focused && !this.state.directSearch) && (
<View style={uriBarStyle.suggestions}>
<FlatList style={uriBarStyle.suggestionList}
data={suggestions}
keyboardShouldPersistTaps={'handled'}
keyExtractor={(item, value) => item.value}
renderItem={({item}) => (
<UriBarItem
item={item}
navigation={navigation}
onPress={() => this.handleItemPress(item)}
/>)} />
</View>)}
</View>
</View>
);
}
}
export default UriBar;
+20
View File
@@ -0,0 +1,20 @@
import { connect } from 'react-redux';
import {
doCheckAddressIsMine,
doGetNewAddress,
selectReceiveAddress,
selectGettingNewAddress,
} from 'lbry-redux';
import WalletAddress from './view';
const select = state => ({
receiveAddress: selectReceiveAddress(state),
gettingNewAddress: selectGettingNewAddress(state),
});
const perform = dispatch => ({
checkAddressIsMine: address => dispatch(doCheckAddressIsMine(address)),
getNewAddress: () => dispatch(doGetNewAddress()),
});
export default connect(select, perform)(WalletAddress);
+47
View File
@@ -0,0 +1,47 @@
// @flow
import React from 'react';
import { Text, View } from 'react-native';
import Address from '../address';
import Button from '../button';
import walletStyle from '../../styles/wallet';
type Props = {
checkAddressIsMine: string => void,
receiveAddress: string,
getNewAddress: () => void,
gettingNewAddress: boolean,
};
class WalletAddress extends React.PureComponent<Props> {
componentWillMount() {
const { checkAddressIsMine, receiveAddress, getNewAddress } = this.props;
if (!receiveAddress) {
getNewAddress();
} else {
checkAddressIsMine(receiveAddress);
}
}
render() {
const { receiveAddress, getNewAddress, gettingNewAddress } = this.props;
return (
<View style={walletStyle.card}>
<Text style={walletStyle.title}>Receive Credits</Text>
<Text style={[walletStyle.text, walletStyle.bottomMarginMedium]}>Use this wallet address to receive credits sent by another user (or yourself).</Text>
<Address address={receiveAddress} style={walletStyle.bottomMarginSmall} />
<Button style={[walletStyle.button, walletStyle.bottomMarginLarge]}
icon={'sync'}
text={'Get new address'}
onPress={getNewAddress}
disabled={gettingNewAddress}
/>
<Text style={walletStyle.smallText}>
You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.
</Text>
</View>
);
}
}
export default WalletAddress;
+9
View File
@@ -0,0 +1,9 @@
import { connect } from 'react-redux';
import { selectBalance } from 'lbry-redux';
import WalletBalance from './view';
const select = state => ({
balance: selectBalance(state),
});
export default connect(select, null)(WalletBalance);
+29
View File
@@ -0,0 +1,29 @@
// @flow
import React from 'react';
import { Image, Text, View } from 'react-native';
import { Lbry, formatCredits } from 'lbry-redux'
import Address from 'component/address';
import Button from 'component/button';
import walletStyle from 'styles/wallet';
type Props = {
balance: number,
};
class WalletBalance extends React.PureComponent<Props> {
render() {
const { balance } = this.props;
return (
<View style={walletStyle.balanceCard}>
<Image style={walletStyle.balanceBackground} resizeMode={'cover'} source={require('../../assets/stripe.png')} />
<Text style={walletStyle.balanceTitle}>Balance</Text>
<Text style={walletStyle.balanceCaption}>You currently have</Text>
<Text style={walletStyle.balance}>
{(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')}
</Text>
</View>
);
}
}
export default WalletBalance;
@@ -0,0 +1,4 @@
import { connect } from 'react-redux';
import WalletRewardsDriver from './view';
export default connect()(WalletRewardsDriver);
@@ -0,0 +1,17 @@
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
import walletStyle from 'styles/wallet';
class WalletRewardsDriver extends React.PureComponent<Props> {
render() {
const { navigation } = this.props;
return (
<TouchableOpacity style={walletStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
<Text style={walletStyle.rewardDriverText}>Earn credits while using the LBRY app. Tap to get started.</Text>
</TouchableOpacity>
);
}
}
export default WalletRewardsDriver;
+22
View File
@@ -0,0 +1,22 @@
import { connect } from 'react-redux';
import {
doToast,
doSendDraftTransaction,
selectDraftTransaction,
selectDraftTransactionError,
selectBalance
} from 'lbry-redux';
import WalletSend from './view';
const select = state => ({
balance: selectBalance(state),
draftTransaction: selectDraftTransaction(state),
transactionError: selectDraftTransactionError(state),
});
const perform = dispatch => ({
sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
notify: (data) => dispatch(doToast(data))
});
export default connect(select, perform)(WalletSend);
+126
View File
@@ -0,0 +1,126 @@
// @flow
import React from 'react';
import { regexAddress } from 'lbry-redux';
import { Alert, TextInput, Text, View } from 'react-native';
import Button from '../button';
import walletStyle from '../../styles/wallet';
type DraftTransaction = {
address: string,
amount: ?number, // So we can use a placeholder in the input
};
type Props = {
sendToAddress: (string, number) => void,
balance: number,
};
class WalletSend extends React.PureComponent<Props> {
amountInput = null;
state = {
amount: null,
address: null,
addressChanged: false,
addressValid: false
};
componentWillUpdate(nextProps) {
const { draftTransaction, transactionError } = nextProps;
if (transactionError && transactionError.trim().length > 0) {
this.setState({ address: draftTransaction.address, amount: draftTransaction.amount });
}
}
handleSend = () => {
const { balance, sendToAddress, notify } = this.props;
const { address, amount } = this.state;
if (address && !regexAddress.test(address)) {
notify({
message: 'The recipient address is not a valid LBRY address.',
});
return;
}
if (amount > balance) {
notify({
message: 'Insufficient credits',
});
return;
}
if (amount && address) {
// Show confirmation before send
Alert.alert(
'Send LBC',
`Are you sure you want to send ${amount} LBC to ${address}?`,
[
{ text: 'No' },
{ text: 'Yes', onPress: () => {
sendToAddress(address, parseFloat(amount));
this.setState({ address: null, amount: null });
}}
]);
}
}
handleAddressInputBlur = () => {
if (this.state.addressChanged && !this.state.addressValid) {
const { notify } = this.props;
notify({
message: 'The recipient address is not a valid LBRY address.',
});
}
}
handleAddressInputSubmit = () => {
if (this.amountInput) {
this.amountInput.focus();
}
}
render() {
const { balance } = this.props;
const canSend = this.state.address &&
this.state.amount > 0 &&
this.state.address.trim().length > 0;
return (
<View style={walletStyle.card}>
<Text style={walletStyle.title}>Send Credits</Text>
<Text style={walletStyle.text}>Recipient address</Text>
<View style={[walletStyle.row, walletStyle.bottomMarginMedium]}>
<TextInput onChangeText={value => this.setState({
address: value,
addressChanged: true,
addressValid: (value.trim().length == 0 || regexAddress.test(value))
})}
onBlur={this.handleAddressInputBlur}
onSubmitEditing={this.handleAddressInputSubmit}
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
value={this.state.address}
returnKeyType={'next'}
style={[walletStyle.input, walletStyle.addressInput, walletStyle.bottomMarginMedium]} />
</View>
<Text style={walletStyle.text}>Amount</Text>
<View style={walletStyle.row}>
<View style={walletStyle.amountRow}>
<TextInput ref={ref => this.amountInput = ref}
onChangeText={value => this.setState({amount: value})}
keyboardType={'numeric'}
placeholder={'0'}
value={this.state.amount}
style={[walletStyle.input, walletStyle.amountInput]} />
<Text style={[walletStyle.text, walletStyle.currency]}>LBC</Text>
</View>
<Button text={'Send'}
style={[walletStyle.button, walletStyle.sendButton]}
disabled={!canSend}
onPress={this.handleSend} />
</View>
</View>
);
}
}
export default WalletSend;
@@ -0,0 +1,10 @@
import { connect } from 'react-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import Constants from 'constants';
import WalletSyncDriver from './view';
const select = state => ({
deviceWalletSynced: makeSelectClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED)(state),
});
export default connect(select, null)(WalletSyncDriver);
@@ -0,0 +1,33 @@
import React from 'react';
import { Text, View } from 'react-native';
import Button from 'component/button';
import Link from 'component/link';
import walletStyle from 'styles/wallet';
class WalletSyncDriver extends React.PureComponent<Props> {
onEnableSyncPressed = () => {
const { navigation } = this.props;
navigation.navigate({ routeName: 'Verification', key: 'verification', params: { syncFlow: true } });
}
render() {
const { deviceWalletSynced } = this.props;
return (
<View style={walletStyle.syncDriverCard}>
<View style={walletStyle.syncDriverRow}>
<Text style={walletStyle.syncDriverTitle}>Wallet sync is {deviceWalletSynced ? 'on' : 'off'}.</Text>
{!deviceWalletSynced &&
<Link text="Sync FAQ" href="https://lbry.com/faq/how-to-backup-wallet#sync" style={walletStyle.syncDriverText} />}
</View>
{!deviceWalletSynced &&
<View style={walletStyle.actionRow}>
<Button style={walletStyle.enrollButton} theme={"light"} text={"Enable"} onPress={this.onEnableSyncPressed} />
<Link text="Manual backup" href="https://lbry.com/faq/how-to-backup-wallet#android" style={walletStyle.syncDriverText} />
</View>}
</View>
);
}
}
export default WalletSyncDriver;
Loaded 100 of 1218 files, more files were not shown because too many files have changed in this diff. Show more