Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53bfba0320 | ||
|
|
847c3e85fa | ||
|
|
c96b4afcc7 | ||
|
|
4c741b9ac9 | ||
|
|
6b184c49ad | ||
|
|
6991b99ea9 | ||
|
|
0cc2b4e368 | ||
|
|
c51f834636 | ||
|
|
9a567ff5d0 | ||
|
|
bb420542ef | ||
|
|
14ec13a2e6 | ||
|
|
bf2b038632 | ||
|
|
b2fa6bb3a9 | ||
|
|
53166d9bba | ||
|
|
1560e44d36 | ||
|
|
1dbc8847b1 | ||
|
|
8bbfd1007d | ||
|
|
851e117381 | ||
|
|
2e31a7fbdb | ||
|
|
f3316160fb | ||
|
|
48b92ed2a6 | ||
|
|
4d075095ad | ||
|
|
9c1985bab3 | ||
|
|
e11e1a0d5b | ||
|
|
f202797954 | ||
|
|
f1ee7586f9 | ||
|
|
6cc74488a3 | ||
|
|
dbf9760780 | ||
|
|
6de1e41628 | ||
|
|
9977aac9f6 | ||
|
|
eb4995da86 | ||
|
|
dffff47a9f | ||
|
|
96cc982e01 | ||
|
|
116ab4fcfb | ||
|
|
c9c0249d4f | ||
|
|
85833f91e3 | ||
|
|
b76498852e | ||
|
|
e75b0e51d9 | ||
|
|
6b746bc0b3 | ||
|
|
dd31a59524 | ||
|
|
ca75b44d3b | ||
|
|
d9a9a310a8 | ||
|
|
8ece8cc14d | ||
|
|
425a83faec | ||
|
|
f034b313b3 | ||
|
|
b600cbdc34 | ||
|
|
ad3fce5b17 | ||
|
|
25604657b6 | ||
|
|
996ff027e5 | ||
|
|
71c595df15 | ||
|
|
70d00b7d62 | ||
|
|
e8828d8658 | ||
|
|
e08f6ee73c | ||
|
|
f12460e83a | ||
|
|
baef12a26d | ||
|
|
79400dd2b1 | ||
|
|
4409849143 | ||
|
|
3d77756da0 | ||
|
|
d45dac4587 | ||
|
|
38292bcbcc | ||
|
|
8b8cf9cd7a | ||
|
|
7c969cbe93 | ||
|
|
3283cc447e | ||
|
|
810ba74e75 | ||
|
|
5e1a20c5de | ||
|
|
975c59a114 | ||
|
|
51fcf04b0b | ||
|
|
d921347d73 | ||
|
|
5e25b542fb |
No files matched your search
@@ -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
|
||||
+11
-6
@@ -1,15 +1,17 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
language: python
|
||||
python:
|
||||
- '2.7'
|
||||
- '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 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.25.2 pip setuptools
|
||||
- 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
|
||||
@@ -26,11 +28,14 @@ install:
|
||||
- cd ..
|
||||
- mv buildozer.spec.travis buildozer.spec
|
||||
- mkdir -p cd ~/.buildozer/android/platform/
|
||||
- wget -q 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P ~/.buildozer/android/platform/
|
||||
- wget -q 'https://us.crystax.net/download/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.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/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
|
||||
|
||||
@@ -7,23 +7,24 @@ This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04,
|
||||
#### Requirements
|
||||
* JDK 1.8
|
||||
* Android SDK
|
||||
* Android NDK
|
||||
* Crystax Android NDK
|
||||
* Buildozer
|
||||
* Node.js
|
||||
* npm
|
||||
* yarn
|
||||
|
||||
#### Apt Packages
|
||||
Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html
|
||||
#### 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 libtool python python-pip python-openssl 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 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
|
||||
#### Install Cython and Setuptools
|
||||
```
|
||||
sudo pip install --upgrade cython==0.25.2 setuptools
|
||||
sudo pip install --upgrade cython==0.28.1 setuptools
|
||||
```
|
||||
|
||||
#### Install buildozer
|
||||
@@ -43,8 +44,8 @@ Assuming `lbry-android` as the current working folder:
|
||||
| Setting | Description |
|
||||
|:------------------- |:-----------------------------|
|
||||
| title | application title |
|
||||
| package.name | package name (eg. browser) |
|
||||
| package.domain | package domain (eg. io.lbry) |
|
||||
| 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 |
|
||||
@@ -52,12 +53,52 @@ Assuming `lbry-android` as the current working folder:
|
||||
| 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 (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 |
|
||||
| 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.
|
||||
|
||||
@@ -69,7 +110,7 @@ To build and deploy, you can run `./deploy.sh`. This requires a connected device
|
||||
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`
|
||||
* Then go to the `lbry-android/app` folder and run `npm start`
|
||||
|
||||
Note: You need to have your device connected with USB debugging.
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ An Android browser and wallet for the [LBRY](https://lbry.io) network. This app
|
||||
## Installation
|
||||
The minimum supported Android version is 5.0 Lollipop. There are two ways to install:
|
||||
|
||||
1. Via the Google Play Store. While in alpha, it will not show in the Play Store unless you sign up [here](https://lbry.io/android-alpha).
|
||||
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.
|
||||
|
||||
## Usage
|
||||
The app can be launched by opening **LBRY Browser** from the device's app drawer or via the shortcut on the homescreen if that was created upon install.
|
||||
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.
|
||||
|
||||
## 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.
|
||||
|
||||
Vendored
+7
-4
@@ -43,7 +43,7 @@ Vagrant.configure("2") do |config|
|
||||
dpkg --add-architecture i386
|
||||
apt-get update
|
||||
apt-get install -y libssl-dev
|
||||
apt-get install -y 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
|
||||
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
|
||||
@@ -63,12 +63,15 @@ Vagrant.configure("2") do |config|
|
||||
cp $HOME/lbry-android/buildozer.spec.vagrant $HOME/lbry-android/buildozer.spec
|
||||
|
||||
mkdir -p cd $HOME/.buildozer/android/platform/
|
||||
wget -q 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P $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/
|
||||
unzip -qq $HOME/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d $HOME/.buildozer/android/platform/
|
||||
rm $HOME/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip
|
||||
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
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"presets": ["react-native"],
|
||||
"plugins": [
|
||||
["module-resolver", {
|
||||
root: ["./src"],
|
||||
}],
|
||||
]
|
||||
}
|
||||
Generated
+128
-6
@@ -644,6 +644,56 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@expo/vector-icons": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-8.1.0.tgz",
|
||||
"integrity": "sha512-/aKa+bgp3LIcTKJWPLRYTYCL0wf/Fr4dwl4XYmNGFG092pK3McuBoDk3b8tWyZnXBnEiqnMLd6Qwr+LEX6Jc0Q==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.4",
|
||||
"react-native-vector-icons": "6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"prop-types": {
|
||||
"version": "15.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
|
||||
"integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.3.1",
|
||||
"object-assign": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"react-native-vector-icons": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.0.0.tgz",
|
||||
"integrity": "sha512-uF3oWb3TV42uXi2apVOZHw9oy9Nr5SXDVwOo1umQWo/yYCrDzXyVfq14DzezgEbJ9jfc/yghBelj0agkXmOKlg==",
|
||||
"requires": {
|
||||
"lodash": "^4.0.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"yargs": "^8.0.2"
|
||||
}
|
||||
},
|
||||
"yargs": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
|
||||
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
|
||||
"requires": {
|
||||
"camelcase": "^4.1.0",
|
||||
"cliui": "^3.2.0",
|
||||
"decamelize": "^1.1.1",
|
||||
"get-caller-file": "^1.0.1",
|
||||
"os-locale": "^2.0.0",
|
||||
"read-pkg-up": "^2.0.0",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^1.0.1",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^2.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^3.2.1",
|
||||
"yargs-parser": "^7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"absolute-path": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz",
|
||||
@@ -1312,6 +1362,19 @@
|
||||
"babel-runtime": "^6.22.0"
|
||||
}
|
||||
},
|
||||
"babel-plugin-module-resolver": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.1.1.tgz",
|
||||
"integrity": "sha512-1Q77Al4ydp6nYApJ7sQ2fmgz30WuQgJZegIYuyOdbdpxenB/bSezQ3hDPsumIXGlUS4vUIv+EwFjzzXZNWtARw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-babel-config": "^1.1.0",
|
||||
"glob": "^7.1.2",
|
||||
"pkg-up": "^2.0.0",
|
||||
"reselect": "^3.0.1",
|
||||
"resolve": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"babel-plugin-react-transform": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-react-transform/-/babel-plugin-react-transform-3.0.0.tgz",
|
||||
@@ -2099,6 +2162,11 @@
|
||||
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.28.tgz",
|
||||
"integrity": "sha512-OJT3rzgtsYca/5WmmEuFJDPMwROVh5SSjoEX9wIrpfbbWJ4KqRzShs8Cj6jWHaatBYAeWngBA+kmmrcHSklT1g=="
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
|
||||
"integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw=="
|
||||
},
|
||||
"bplist-creator": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.7.tgz",
|
||||
@@ -2822,6 +2890,16 @@
|
||||
"unpipe": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"find-babel-config": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.1.0.tgz",
|
||||
"integrity": "sha1-rMAQQ6Z0n+w0Qpvmtk9ULrtdY1U=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"json5": "^0.5.1",
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
|
||||
@@ -3982,19 +4060,44 @@
|
||||
}
|
||||
},
|
||||
"lbry-redux": {
|
||||
"version": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
|
||||
"from": "github:lbryio/lbry-redux",
|
||||
"version": "github:lbryio/lbry-redux#18fec9f1f0f5ad366ebe12279e5dd0d67a37b2d5",
|
||||
"from": "github:lbryio/lbry-redux#mobile-channel-pagination",
|
||||
"requires": {
|
||||
"proxy-polyfill": "0.1.6",
|
||||
"reselect": "^3.0.0"
|
||||
"reselect": "^3.0.0",
|
||||
"uuid": "^3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"lbryinc": {
|
||||
"version": "github:lbryio/lbryinc#f2fff2a331578aef84eb77c108f976967afc50e0",
|
||||
"from": "github:lbryio/lbryinc",
|
||||
"version": "github:lbryio/lbryinc#4d24cef00106294d3e848b6c2b261e01382fce17",
|
||||
"from": "github:lbryio/lbryinc#subscriptions",
|
||||
"requires": {
|
||||
"lbry-redux": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
|
||||
"bluebird": "^3.5.1",
|
||||
"lbry-redux": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
|
||||
"reselect": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lbry-redux": {
|
||||
"version": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
|
||||
"from": "github:lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404",
|
||||
"requires": {
|
||||
"proxy-polyfill": "0.1.6",
|
||||
"reselect": "^3.0.0",
|
||||
"uuid": "^3.3.2"
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"lcid": {
|
||||
@@ -4960,6 +5063,15 @@
|
||||
"find-up": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"pkg-up": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
|
||||
"integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"plist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz",
|
||||
@@ -5272,6 +5384,11 @@
|
||||
"react-native-drawer-layout": "1.3.2"
|
||||
}
|
||||
},
|
||||
"react-native-exception-handler": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.9.0.tgz",
|
||||
"integrity": "sha512-XRHhGH5aM4lSenX4zZBa07JaszJGXeF8cv1KY314Q4qJWOihKWLpkdvwqwsBieZ2iy8DPhdAVioQzw8JLD/Okw=="
|
||||
},
|
||||
"react-native-fast-image": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/react-native-fast-image/-/react-native-fast-image-5.0.3.tgz",
|
||||
@@ -7003,6 +7120,11 @@
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
||||
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
|
||||
},
|
||||
"y18n": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||
|
||||
+5
-2
@@ -7,12 +7,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"base-64": "^0.1.0",
|
||||
"lbry-redux": "lbryio/lbry-redux",
|
||||
"lbryinc": "lbryio/lbryinc",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"lbry-redux": "lbryio/lbry-redux#mobile-channel-pagination",
|
||||
"lbryinc": "lbryio/lbryinc#subscriptions",
|
||||
"moment": "^2.22.1",
|
||||
"react": "16.2.0",
|
||||
"react-native": "0.55.3",
|
||||
"react-native-country-picker-modal": "^0.6.2",
|
||||
"react-native-exception-handler": "2.9.0",
|
||||
"react-native-fast-image": "^5.0.3",
|
||||
"react-native-fetch-blob": "^0.10.8",
|
||||
"react-native-image-zoom-viewer": "^2.2.5",
|
||||
@@ -33,6 +35,7 @@
|
||||
"devDependencies": {
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-stage-2": "^6.18.0",
|
||||
"babel-plugin-module-resolver": "^3.1.1",
|
||||
"flow-babel-webpack-plugin": "^1.1.1"
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ 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 WalletPage from '../page/wallet';
|
||||
import SearchInput from '../component/searchInput';
|
||||
@@ -33,7 +34,7 @@ import {
|
||||
ToastAndroid
|
||||
} from 'react-native';
|
||||
import { doDeleteCompleteBlobs } from '../redux/actions/file';
|
||||
import { SETTINGS, doHideNotification, doNotify, selectNotification } from 'lbry-redux';
|
||||
import { SETTINGS, doDismissToast, doToast, selectToast } from 'lbry-redux';
|
||||
import {
|
||||
doUserEmailVerify,
|
||||
doUserEmailVerifyFailure,
|
||||
@@ -66,6 +67,7 @@ const discoverStack = createStackNavigator({
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Discover',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
},
|
||||
File: {
|
||||
@@ -78,7 +80,8 @@ const discoverStack = createStackNavigator({
|
||||
Search: {
|
||||
screen: SearchPage,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
drawerLockMode: 'locked-closed'
|
||||
drawerLockMode: 'locked-closed',
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
}
|
||||
}, {
|
||||
@@ -91,6 +94,7 @@ const trendingStack = createStackNavigator({
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Trending',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -101,6 +105,18 @@ const myLbryStack = createStackNavigator({
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'My LBRY',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const mySubscriptionsStack = createStackNavigator({
|
||||
Subscriptions: {
|
||||
screen: SubscriptionsPage,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'My Subscriptions',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -111,6 +127,7 @@ const rewardsStack = createStackNavigator({
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Rewards',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -121,13 +138,15 @@ const walletStack = createStackNavigator({
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
title: 'Wallet',
|
||||
headerLeft: menuNavigationButton(navigation),
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
})
|
||||
},
|
||||
TransactionHistory: {
|
||||
screen: TransactionHistoryPage,
|
||||
navigationOptions: {
|
||||
title: 'Transaction History',
|
||||
drawerLockMode: 'locked-closed'
|
||||
drawerLockMode: 'locked-closed',
|
||||
headerTitleStyle: discoverStyle.titleText
|
||||
}
|
||||
}
|
||||
}, {
|
||||
@@ -141,6 +160,9 @@ const drawer = createDrawerNavigator({
|
||||
TrendingStack: { screen: trendingStack, navigationOptions: {
|
||||
title: 'Trending', drawerIcon: ({ tintColor }) => <Icon name="fire" size={20} style={{ color: tintColor }} />
|
||||
}},
|
||||
MySubscriptionsStack: { screen: mySubscriptionsStack, navigationOptions: {
|
||||
title: 'My Subscriptions', drawerIcon: ({ tintColor }) => <Icon name="rss-square" size={20} style={{ color: tintColor }} />
|
||||
}},
|
||||
MyLBRYStack: { screen: myLbryStack, navigationOptions: {
|
||||
title: 'My LBRY', drawerIcon: ({ tintColor }) => <Icon name="folder" size={20} style={{ color: tintColor }} />
|
||||
}},
|
||||
@@ -162,7 +184,8 @@ const drawer = createDrawerNavigator({
|
||||
drawerWidth: 300,
|
||||
headerMode: 'none',
|
||||
contentOptions: {
|
||||
activeTintColor: Colors.LbryGreen
|
||||
activeTintColor: Colors.LbryGreen,
|
||||
labelStyle: discoverStyle.menuText
|
||||
}
|
||||
});
|
||||
|
||||
@@ -240,28 +263,16 @@ class AppWithNavigationState extends React.Component {
|
||||
componentWillUpdate(nextProps) {
|
||||
const { dispatch } = this.props;
|
||||
const {
|
||||
notification,
|
||||
toast,
|
||||
emailToVerify,
|
||||
emailVerifyPending,
|
||||
emailVerifyErrorMessage,
|
||||
user
|
||||
} = nextProps;
|
||||
|
||||
if (notification) {
|
||||
const { displayType, message } = notification;
|
||||
if (toast) {
|
||||
const { message } = toast;
|
||||
let currentDisplayType;
|
||||
if (displayType && displayType.length) {
|
||||
for (let i = 0; i < displayType.length; i++) {
|
||||
const type = displayType[i];
|
||||
if (AppWithNavigationState.supportedDisplayTypes.indexOf(type) > -1) {
|
||||
currentDisplayType = type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (AppWithNavigationState.supportedDisplayTypes.indexOf(displayType) > -1) {
|
||||
currentDisplayType = displayType;
|
||||
}
|
||||
|
||||
if (!currentDisplayType && message) {
|
||||
// default to toast if no display type set and there is a message specified
|
||||
currentDisplayType = 'toast';
|
||||
@@ -271,7 +282,7 @@ class AppWithNavigationState extends React.Component {
|
||||
ToastAndroid.show(message, ToastAndroid.LONG);
|
||||
}
|
||||
|
||||
dispatch(doHideNotification());
|
||||
dispatch(doDismissToast());
|
||||
}
|
||||
|
||||
if (user &&
|
||||
@@ -287,7 +298,7 @@ class AppWithNavigationState extends React.Component {
|
||||
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
|
||||
}
|
||||
AsyncStorage.removeItem(Constants.KEY_SHOULD_VERIFY_EMAIL);
|
||||
dispatch(doNotify({ message, displayType: ['toast'] }));
|
||||
dispatch(doToast({ message }));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -340,12 +351,11 @@ class AppWithNavigationState extends React.Component {
|
||||
} catch (error) {
|
||||
const message = 'Invalid Verification Token';
|
||||
dispatch(doUserEmailVerifyFailure(message));
|
||||
dispatch(doNotify({ message, displayType: ['toast'] }));
|
||||
dispatch(doToast({ message }));
|
||||
}
|
||||
} else {
|
||||
dispatch(doNotify({
|
||||
dispatch(doToast({
|
||||
message: 'Invalid Verification URI',
|
||||
displayType: ['toast'],
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
@@ -363,7 +373,7 @@ const mapStateToProps = state => ({
|
||||
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
|
||||
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
|
||||
nav: state.nav,
|
||||
notification: selectNotification(state),
|
||||
toast: selectToast(state),
|
||||
emailToVerify: selectEmailToVerify(state),
|
||||
emailVerifyPending: selectEmailVerifyIsPending(state),
|
||||
emailVerifyErrorMessage: selectEmailVerifyErrorMessage(state),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import Address from './view';
|
||||
|
||||
export default connect(null, {
|
||||
doNotify,
|
||||
doToast,
|
||||
})(Address);
|
||||
@@ -6,21 +6,20 @@ import walletStyle from '../../styles/wallet';
|
||||
|
||||
type Props = {
|
||||
address: string,
|
||||
doNotify: ({ message: string, displayType: Array<string> }) => void,
|
||||
doToast: ({ message: string }) => void,
|
||||
};
|
||||
|
||||
export default class Address extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { address, doNotify, style } = this.props;
|
||||
|
||||
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);
|
||||
doNotify({
|
||||
doToast({
|
||||
message: 'Address copied',
|
||||
displayType: ['toast'],
|
||||
});
|
||||
}} />
|
||||
</View>
|
||||
|
||||
@@ -11,6 +11,8 @@ export default class Button extends React.PureComponent {
|
||||
style,
|
||||
text,
|
||||
icon,
|
||||
iconColor,
|
||||
solid,
|
||||
theme,
|
||||
onPress,
|
||||
onLayout
|
||||
@@ -41,9 +43,14 @@ export default class Button extends React.PureComponent {
|
||||
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 && <Icon name={icon} size={18} color={'light' === theme ? Colors.DarkGrey : Colors.White} />}
|
||||
{icon && renderIcon}
|
||||
{text && (text.trim().length > 0) && <Text style={textStyles}>{text}</Text>}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
@@ -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,83 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, 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, submitRewardCode } = this.props;
|
||||
const { rewardCode } = this.state;
|
||||
|
||||
if (!canClaim) {
|
||||
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;
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
selectEmailNewIsPending,
|
||||
selectEmailToVerify
|
||||
} from 'lbryinc';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import EmailRewardSubcard from './view';
|
||||
|
||||
const select = state => ({
|
||||
@@ -16,7 +16,7 @@ const select = state => ({
|
||||
|
||||
const perform = dispatch => ({
|
||||
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
||||
notify: data => dispatch(doNotify(data))
|
||||
notify: data => dispatch(doToast(data))
|
||||
});
|
||||
|
||||
export default connect(select, perform)(EmailRewardSubcard);
|
||||
export default connect(select, perform)(EmailRewardSubcard);
|
||||
@@ -38,12 +38,11 @@ class EmailRewardSubcard extends React.PureComponent {
|
||||
|
||||
if (this.state.verifyStarted && !emailNewPending) {
|
||||
if (emailNewErrorMessage) {
|
||||
notify({ message: String(emailNewErrorMessage), displayType: ['toast']});
|
||||
notify({ message: String(emailNewErrorMessage), isError: true });
|
||||
this.setState({ verifyStarted: false });
|
||||
} else {
|
||||
notify({
|
||||
message: 'Please follow the instructions in the email sent to your address to continue.',
|
||||
displayType: ['toast']
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -65,7 +64,6 @@ class EmailRewardSubcard extends React.PureComponent {
|
||||
if (!email || email.trim().length === 0 || email.indexOf('@') === -1) {
|
||||
return notify({
|
||||
message: 'Please provide a valid email address to continue.',
|
||||
displayType: ['toast'],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class FileDownloadButton extends React.PureComponent {
|
||||
onStartDownloadFailed
|
||||
} = this.props;
|
||||
|
||||
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...';
|
||||
|
||||
@@ -166,7 +166,7 @@ class FileList extends React.PureComponent<Props, State> {
|
||||
|
||||
items.push(uri);
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<FlatList
|
||||
style={style}
|
||||
@@ -176,7 +176,7 @@ class FileList extends React.PureComponent<Props, State> {
|
||||
<FileItem style={discoverStyle.fileItem}
|
||||
uri={item}
|
||||
navigation={navigation} />
|
||||
)} />
|
||||
)} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class FloatingWalletBalance extends React.PureComponent<Props> {
|
||||
onPress={() => navigation && navigation.navigate({ routeName: 'WalletStack' })}>
|
||||
{isNaN(balance) && <ActivityIndicator size="small" color={Colors.White} />}
|
||||
<Text style={floatingButtonStyle.text}>
|
||||
{(balance || balance === 0) && (formatCredits(balance, 2) + ' LBC')}
|
||||
{(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import Link from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
notify: (data) => dispatch(doNotify(data))
|
||||
notify: (data) => dispatch(doToast(data))
|
||||
});
|
||||
|
||||
export default connect(null, perform)(Link);
|
||||
@@ -21,7 +21,7 @@ export default class Link extends React.PureComponent {
|
||||
Linking.openURL(href)
|
||||
.then(() => setTimeout(() => { this.setState({ tappedStyle: false }); }, 2000))
|
||||
.catch(err => {
|
||||
notify({ message: error, displayType: ['toast']})
|
||||
notify({ message: error, isError: true })
|
||||
this.setState({tappedStyle: false})
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import {
|
||||
doUserPhoneNew,
|
||||
doUserPhoneVerify,
|
||||
@@ -22,7 +22,7 @@ const select = state => ({
|
||||
const perform = dispatch => ({
|
||||
addUserPhone: (phone, country_code) => dispatch(doUserPhoneNew(phone, country_code)),
|
||||
verifyPhone: (verificationCode) => dispatch(doUserPhoneVerify(verificationCode)),
|
||||
notify: data => dispatch(doNotify(data)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(PhoneNumberRewardSubcard);
|
||||
export default connect(select, perform)(PhoneNumberRewardSubcard);
|
||||
@@ -40,21 +40,21 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
DeviceEventEmitter.addListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
|
||||
//DeviceEventEmitter.addListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
|
||||
DeviceEventEmitter.addListener('onVerificationCodeReceived', this.receiveVerificationCode);
|
||||
|
||||
const { phone } = this.props;
|
||||
if (phone && String(phone).trim().length() > 0) {
|
||||
if (phone && String(phone).trim().length > 0) {
|
||||
this.setState({ newPhoneAdded: true });
|
||||
}
|
||||
|
||||
if (NativeModules.UtilityModule) {
|
||||
/*if (NativeModules.UtilityModule) {
|
||||
NativeModules.UtilityModule.canReceiveSms().then(canReceiveSms => this.setState({ canReceiveSms }));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
DeviceEventEmitter.removeListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
|
||||
//DeviceEventEmitter.removeListener('onReceiveSmsPermissionGranted', this.receiveSmsPermissionGranted);
|
||||
DeviceEventEmitter.removeListener('onVerificationCodeReceived', this.receiveVerificationCode);
|
||||
}
|
||||
|
||||
@@ -70,17 +70,17 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
|
||||
|
||||
if (!phoneNewIsPending && (phoneNewIsPending !== prevProps.phoneNewIsPending)) {
|
||||
if (phoneNewErrorMessage) {
|
||||
notify({ message: String(phoneNewErrorMessage), displayType: ['toast'] });
|
||||
notify({ message: String(phoneNewErrorMessage) });
|
||||
} else {
|
||||
this.setState({ newPhoneAdded: true });
|
||||
}
|
||||
}
|
||||
if (!phoneVerifyIsPending && (phoneVerifyIsPending !== prevProps.phoneVerifyIsPending)) {
|
||||
if (phoneVerifyErrorMessage) {
|
||||
notify({ message: String(phoneVerifyErrorMessage), displayType: ['toast'] });
|
||||
notify({ message: String(phoneVerifyErrorMessage) });
|
||||
this.setState({ codeVerifyStarted: false });
|
||||
} else {
|
||||
notify({ message: 'Your phone number was successfully verified.', displayType: ['toast'] });
|
||||
notify({ message: 'Your phone number was successfully verified.' });
|
||||
this.setState({ codeVerifySuccessful: true });
|
||||
if (onPhoneVerifySuccessful) {
|
||||
onPhoneVerifySuccessful();
|
||||
@@ -89,10 +89,6 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
receiveSmsPermissionGranted = () => {
|
||||
this.setState({ canReceiveSms: true });
|
||||
}
|
||||
|
||||
receiveVerificationCode = (evt) => {
|
||||
if (!this.state.newPhoneAdded || this.state.codeVerifySuccessful) {
|
||||
return;
|
||||
@@ -103,24 +99,12 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
|
||||
verifyPhone(evt.code);
|
||||
}
|
||||
|
||||
onAllowAccessPressed = () => {
|
||||
if (!NativeModules.UtilityModule) {
|
||||
return notify({
|
||||
message: 'The required permission could not be obtained due to a missing module.',
|
||||
displayType: ['toast']
|
||||
});
|
||||
}
|
||||
|
||||
NativeModules.UtilityModule.requestReceiveSmsPermission();
|
||||
}
|
||||
|
||||
onSendTextPressed = () => {
|
||||
const { addUserPhone, notify } = this.props;
|
||||
|
||||
if (!this.phoneInput.isValidNumber()) {
|
||||
return notify({
|
||||
message: 'Please provide a valid telephone number.',
|
||||
displayType: ['toast']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -171,17 +155,6 @@ class PhoneNumberRewardSubcard extends React.PureComponent {
|
||||
return (
|
||||
<View style={rewardStyle.subcard}>
|
||||
<Text style={rewardStyle.subtitle}>Pending action: Verify Phone Number</Text>
|
||||
{!this.state.canReceiveSms &&
|
||||
<View style={rewardStyle.smsPermissionContainer}>
|
||||
<Text style={[rewardStyle.bottomMarginMedium, rewardStyle.subcardText]}>
|
||||
You can grant access to the receive SMS permission in order to verify phone number. Alternatively, you can enter the verification code manually.
|
||||
</Text>
|
||||
<Button
|
||||
style={rewardStyle.actionButton}
|
||||
text={"Allow access"}
|
||||
onPress={this.onAllowAccessPressed}
|
||||
/>
|
||||
</View>}
|
||||
<View style={rewardStyle.phoneVerificationContainer}>
|
||||
{!this.state.newPhoneAdded &&
|
||||
<View>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import {
|
||||
doClaimRewardType,
|
||||
doClaimRewardClearError,
|
||||
@@ -23,7 +23,7 @@ const makeSelect = () => {
|
||||
const perform = dispatch => ({
|
||||
claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, true)),
|
||||
clearError: reward => dispatch(doClaimRewardClearError(reward)),
|
||||
notify: data => dispatch(doNotify(data))
|
||||
notify: data => dispatch(doToast(data))
|
||||
});
|
||||
|
||||
export default connect(makeSelect, perform)(RewardCard);
|
||||
@@ -30,10 +30,10 @@ class RewardCard extends React.PureComponent<Props> {
|
||||
const { clearError, notify, reward } = this.props;
|
||||
if (this.state.claimStarted && !isPending) {
|
||||
if (errorMessage && errorMessage.trim().length > 0) {
|
||||
notify({ message: errorMessage, displayType: ['toast'] });
|
||||
notify({ message: errorMessage });
|
||||
clearError(reward);
|
||||
} else {
|
||||
notify({ message: 'Reward successfully claimed!', displayType: ['toast'] });
|
||||
notify({ message: 'Reward successfully claimed!' });
|
||||
}
|
||||
this.setState({ claimStarted: false });
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class RewardCard extends React.PureComponent<Props> {
|
||||
} = this.props;
|
||||
|
||||
if (!canClaim) {
|
||||
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.', displayType: ['toast'] });
|
||||
notify({ message: 'Unfortunately, you are not eligible to claim this reward at this time.' });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,11 @@ class RewardCard extends React.PureComponent<Props> {
|
||||
const claimed = !!reward.transaction_id;
|
||||
|
||||
return (
|
||||
<View style={[rewardStyle.rewardCard, rewardStyle.row]}>
|
||||
<TouchableOpacity style={[rewardStyle.rewardCard, rewardStyle.row]} onPress={() => {
|
||||
if (!isPending && !claimed) {
|
||||
this.onClaimPress();
|
||||
}
|
||||
}}>
|
||||
<View style={rewardStyle.leftCol}>
|
||||
{!isPending && <TouchableOpacity onPress={() => {
|
||||
if (!claimed) {
|
||||
@@ -87,7 +91,7 @@ class RewardCard extends React.PureComponent<Props> {
|
||||
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
|
||||
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import { doRewardList, selectUnclaimedRewardValue, selectFetchingRewards, selectUser } from 'lbryinc';
|
||||
import RewardSummary from './view';
|
||||
|
||||
@@ -10,6 +11,7 @@ const select = state => ({
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchRewards: () => dispatch(doRewardList()),
|
||||
notify: data => dispatch(doToast(data))
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardSummary);
|
||||
@@ -1,32 +1,53 @@
|
||||
import React from 'react';
|
||||
import { NativeModules, Text, TouchableOpacity } from 'react-native';
|
||||
import { AsyncStorage, NativeModules, Text, TouchableOpacity } from 'react-native';
|
||||
import Button from '../../component/button';
|
||||
import rewardStyle from '../../styles/reward';
|
||||
|
||||
class RewardSummary extends React.Component {
|
||||
static itemKey = 'rewardSummaryDismissed';
|
||||
|
||||
state = {
|
||||
actionsLeft: 0
|
||||
actionsLeft: 0,
|
||||
dismissed: false
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.fetchRewards();
|
||||
|
||||
const { user } = this.props;
|
||||
let actionsLeft = 0;
|
||||
if (!user || !user.has_verified_email) {
|
||||
actionsLeft++;
|
||||
}
|
||||
AsyncStorage.getItem(RewardSummary.itemKey).then(isDismissed => {
|
||||
if ('true' === isDismissed) {
|
||||
this.setState({ dismissed: true });
|
||||
}
|
||||
|
||||
if (!user || !user.is_identity_verified) {
|
||||
actionsLeft++;
|
||||
}
|
||||
const { user } = this.props;
|
||||
let actionsLeft = 0;
|
||||
if (!user || !user.has_verified_email) {
|
||||
actionsLeft++;
|
||||
}
|
||||
|
||||
this.setState({ 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.',
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { fetching, navigation, unclaimedRewardAmount, user } = this.props;
|
||||
|
||||
if ((user && user.is_reward_approved) || this.state.actionsLeft === 0 || unclaimedRewardAmount === 0) {
|
||||
if (this.state.dismissed ||
|
||||
(user && user.is_reward_approved) ||
|
||||
this.state.actionsLeft === 0 ||
|
||||
unclaimedRewardAmount === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -37,6 +58,7 @@ class RewardSummary extends React.Component {
|
||||
<Text style={rewardStyle.summaryText}>
|
||||
You have {unclaimedRewardAmount} LBC in unclaimed rewards. You have {this.state.actionsLeft} action{this.state.actionsLeft === 1 ? '' : 's'} left to claim your first reward. Tap here to continue.
|
||||
</Text>
|
||||
<Button style={rewardStyle.dismissButton} theme={"light"} text={"Dismiss"} onPress={this.onDismissPressed} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import { 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 ? __('Unsubscribe') : __('Subscribe');
|
||||
const { claimName } = parseURI(uri);
|
||||
|
||||
return (
|
||||
<Button
|
||||
style={styles}
|
||||
theme={"light"}
|
||||
icon={"heart"}
|
||||
iconColor={iconColor}
|
||||
solid={isSubscribed ? false : true}
|
||||
text={subscriptionLabel}
|
||||
onPress={() => {
|
||||
subscriptionHandler({
|
||||
channelName: claimName,
|
||||
uri,
|
||||
});
|
||||
}} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SubscribeButton;
|
||||
@@ -19,7 +19,7 @@ class WalletBalance extends React.PureComponent<Props> {
|
||||
<Text style={walletStyle.balanceTitle}>Balance</Text>
|
||||
<Text style={walletStyle.balanceCaption}>You currently have</Text>
|
||||
<Text style={walletStyle.balance}>
|
||||
{(balance || balance === 0) && (formatCredits(balance, 2) + ' LBC')}
|
||||
{(balance || balance === 0) && (formatCredits(parseFloat(balance), 2) + ' LBC')}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doNotify,
|
||||
doToast,
|
||||
doSendDraftTransaction,
|
||||
selectDraftTransaction,
|
||||
selectDraftTransactionError,
|
||||
@@ -8,15 +8,15 @@ import {
|
||||
} from 'lbry-redux';
|
||||
import WalletSend from './view';
|
||||
|
||||
const perform = dispatch => ({
|
||||
sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)),
|
||||
notify: (data) => dispatch(doNotify(data))
|
||||
});
|
||||
|
||||
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);
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { regexAddress } from 'lbry-redux';
|
||||
import { TextInput, Text, View } from 'react-native';
|
||||
import { Alert, TextInput, Text, View } from 'react-native';
|
||||
import Button from '../button';
|
||||
import walletStyle from '../../styles/wallet';
|
||||
|
||||
@@ -38,7 +38,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
if (address && !regexAddress.test(address)) {
|
||||
notify({
|
||||
message: 'The recipient address is not a valid LBRY address.',
|
||||
displayType: ['toast']
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -46,14 +45,22 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
if (amount > balance) {
|
||||
notify({
|
||||
message: 'Insufficient credits',
|
||||
displayType: ['toast']
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (amount && address) {
|
||||
sendToAddress(address, parseFloat(amount));
|
||||
this.setState({ address: null, amount: null });
|
||||
// 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 });
|
||||
}}
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +69,6 @@ class WalletSend extends React.PureComponent<Props> {
|
||||
const { notify } = this.props;
|
||||
notify({
|
||||
message: 'The recipient address is not a valid LBRY address.',
|
||||
displayType: ['toast']
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ const Constants = {
|
||||
|
||||
ACTION_DELETE_COMPLETED_BLOBS: "DELETE_COMPLETED_BLOBS",
|
||||
ACTION_FIRST_RUN_PAGE_CHANGED: "FIRST_RUN_PAGE_CHANGED",
|
||||
|
||||
PAGE_REWARDS: 'rewards',
|
||||
PAGE_SETTINGS: 'settings',
|
||||
PAGE_TRENDING: 'trending',
|
||||
PAGE_WALLET: 'wallet'
|
||||
};
|
||||
|
||||
export default Constants;
|
||||
+13
-1
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import { setJSExceptionHandler } from 'react-native-exception-handler';
|
||||
import { Provider, connect } from 'react-redux';
|
||||
import {
|
||||
AppRegistry,
|
||||
@@ -10,6 +11,7 @@ import {
|
||||
} from 'react-native';
|
||||
import {
|
||||
Lbry,
|
||||
blacklistReducer,
|
||||
claimsReducer,
|
||||
costInfoReducer,
|
||||
fileInfoReducer,
|
||||
@@ -17,7 +19,7 @@ import {
|
||||
searchReducer,
|
||||
walletReducer
|
||||
} from 'lbry-redux';
|
||||
import { authReducer, rewardsReducer, userReducer } from 'lbryinc';
|
||||
import { authReducer, rewardsReducer, subscriptionsReducer, userReducer } from 'lbryinc';
|
||||
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
|
||||
import { createLogger } from 'redux-logger';
|
||||
import { AppNavigator } from './component/AppNavigator';
|
||||
@@ -30,6 +32,14 @@ import moment from 'moment';
|
||||
import settingsReducer from './redux/reducers/settings';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
const globalExceptionHandler = (error, isFatal) => {
|
||||
if (error && NativeModules.Mixpanel) {
|
||||
NativeModules.Mixpanel.logException(isFatal, error.message ? error.message : "No message", error);
|
||||
}
|
||||
};
|
||||
setJSExceptionHandler(globalExceptionHandler, true);
|
||||
|
||||
|
||||
function isFunction(object) {
|
||||
return typeof object === 'function';
|
||||
}
|
||||
@@ -68,6 +78,7 @@ const navigatorReducer = (state = initialNavState, action) => {
|
||||
|
||||
const reducers = combineReducers({
|
||||
auth: authReducer,
|
||||
blacklist: blacklistReducer,
|
||||
claims: claimsReducer,
|
||||
costInfo: costInfoReducer,
|
||||
fileInfo: fileInfoReducer,
|
||||
@@ -76,6 +87,7 @@ const reducers = combineReducers({
|
||||
rewards: rewardsReducer,
|
||||
settings: settingsReducer,
|
||||
search: searchReducer,
|
||||
subscriptions: subscriptionsReducer,
|
||||
user: userReducer,
|
||||
wallet: walletReducer
|
||||
});
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import { doFetchAccessToken, selectAccessToken, selectUserEmail } from 'lbryinc';
|
||||
import AboutPage from './view';
|
||||
|
||||
const perform = dispatch => ({});
|
||||
const select = state => ({
|
||||
accessToken: selectAccessToken(state),
|
||||
userEmail: selectUserEmail(state),
|
||||
});
|
||||
|
||||
export default connect(null, perform)(AboutPage);
|
||||
const perform = dispatch => ({
|
||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(AboutPage);
|
||||
@@ -28,10 +28,12 @@ class AboutPage extends React.PureComponent {
|
||||
lbryId: info.installation_id,
|
||||
});
|
||||
});
|
||||
|
||||
if (!this.props.accessToken) this.props.fetchAccessToken();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { navigation } = this.props;
|
||||
const { accessToken, navigation, notify, userEmail } = this.props;
|
||||
const loading = 'Loading...';
|
||||
const ver = this.state.versionInfo ? this.state.versionInfo : null;
|
||||
|
||||
@@ -49,6 +51,7 @@ class AboutPage extends React.PureComponent {
|
||||
</Text>
|
||||
<View style={aboutStyle.links}>
|
||||
<Link style={aboutStyle.link} href="https://lbry.io/faq/what-is-lbry" text="What is LBRY?" />
|
||||
<Link style={aboutStyle.link} href="https://lbry.io/faq/android-basics" text="Android App Basics" />
|
||||
<Link style={aboutStyle.link} href="https://lbry.io/faq" text="Frequently Asked Questions" />
|
||||
</View>
|
||||
<Text style={aboutStyle.socialTitle}>Get Social</Text>
|
||||
@@ -61,8 +64,23 @@ class AboutPage extends React.PureComponent {
|
||||
<Link style={aboutStyle.link} href="https://www.instagram.com/LBRYio/" text="Instagram" />
|
||||
<Link style={aboutStyle.link} href="https://twitter.com/LBRYio" text="Twitter" />
|
||||
<Link style={aboutStyle.link} href="https://reddit.com/r/lbry" text="Reddit" />
|
||||
<Link style={aboutStyle.link} href="https://t.me/lbryofficial" text="Telegram" />
|
||||
</View>
|
||||
<Text style={aboutStyle.releaseInfoTitle}>Release information</Text>
|
||||
<Text style={aboutStyle.releaseInfoTitle}>App info</Text>
|
||||
{userEmail && userEmail.trim().length > 0 &&
|
||||
<View style={aboutStyle.verticalRow}>
|
||||
<View style={aboutStyle.innerRow}>
|
||||
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Connected Email</Text></View>
|
||||
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{userEmail}</Text></View>
|
||||
</View>
|
||||
<View>
|
||||
<Link
|
||||
style={aboutStyle.listLink}
|
||||
href={`http://lbry.io/list/edit/${accessToken}`}
|
||||
text="Update mailing preferences" />
|
||||
</View>
|
||||
</View>}
|
||||
|
||||
<View style={aboutStyle.row}>
|
||||
<View style={aboutStyle.col}><Text style={aboutStyle.text}>App version</Text></View>
|
||||
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{this.state.appVersion}</Text></View>
|
||||
@@ -73,11 +91,6 @@ class AboutPage extends React.PureComponent {
|
||||
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.lbrynet_version : loading }</Text></View>
|
||||
</View>
|
||||
|
||||
<View style={aboutStyle.row}>
|
||||
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Wallet (lbryum)</Text></View>
|
||||
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.lbryum_version : loading }</Text></View>
|
||||
</View>
|
||||
|
||||
<View style={aboutStyle.row}>
|
||||
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Platform</Text></View>
|
||||
<View style={aboutStyle.col}><Text selectable={true} style={aboutStyle.valueText}>{ver ? ver.platform : loading }</Text></View>
|
||||
@@ -89,6 +102,21 @@ class AboutPage extends React.PureComponent {
|
||||
<Text selectable={true} style={aboutStyle.lineValueText}>{this.state.lbryId ? this.state.lbryId : loading}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={aboutStyle.row}>
|
||||
<View style={aboutStyle.col}><Text style={aboutStyle.text}>Logs</Text></View>
|
||||
<View style={aboutStyle.col}>
|
||||
<Link style={aboutStyle.listLink} text="Send log" onPress={() => {
|
||||
if (NativeModules.UtilityModule) {
|
||||
NativeModules.UtilityModule.shareLogFile((error) => {
|
||||
if (error) {
|
||||
notify(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}} />
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -3,15 +3,17 @@ import {
|
||||
doFetchClaimsByChannel,
|
||||
doFetchClaimCountByChannel,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimsInChannelForPage,
|
||||
makeSelectClaimsInChannelForCurrentPageState,
|
||||
makeSelectFetchingChannelClaims,
|
||||
makeSelectTotalPagesForChannel
|
||||
} from 'lbry-redux';
|
||||
import ChannelPage from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimsInChannel: makeSelectClaimsInChannelForPage(props.uri, props.page || 1)(state),
|
||||
claimsInChannel: makeSelectClaimsInChannelForCurrentPageState(props.uri)(state),
|
||||
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
|
||||
totalPages: makeSelectTotalPagesForChannel(props.uri, 10)(state), // Update to use a default PAGE_SIZE constant
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
||||
@@ -1,24 +1,47 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, Text, View } from 'react-native';
|
||||
import Colors from '../../styles/colors';
|
||||
import FileList from '../../component/fileList';
|
||||
import PageHeader from '../../component/pageHeader';
|
||||
import UriBar from '../../component/uriBar';
|
||||
import channelPageStyle from '../../styles/channelPage';
|
||||
import Colors from 'styles/colors';
|
||||
import Button from 'component/button';
|
||||
import FileList from 'component/fileList';
|
||||
import PageHeader from 'component/pageHeader';
|
||||
import UriBar from 'component/uriBar';
|
||||
import channelPageStyle from 'styles/channelPage';
|
||||
|
||||
class ChannelPage extends React.PureComponent {
|
||||
state = {
|
||||
page: 1
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { uri, page, claimsInChannel, fetchClaims, fetchClaimCount } = this.props;
|
||||
|
||||
if (!claimsInChannel || !claimsInChannel.length) {
|
||||
fetchClaims(uri, page || 1);
|
||||
fetchClaims(uri, page || this.state.page);
|
||||
fetchClaimCount(uri);
|
||||
}
|
||||
}
|
||||
|
||||
handlePreviousPage = () => {
|
||||
const { uri, fetchClaims } = this.props;
|
||||
if (this.state.page > 1) {
|
||||
this.setState({ page: this.state.page - 1 }, () => {
|
||||
fetchClaims(uri, this.state.page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleNextPage = () => {
|
||||
const { uri, fetchClaims, totalPages } = this.props;
|
||||
if (this.state.page < totalPages) {
|
||||
this.setState({ page: this.state.page + 1 }, () => {
|
||||
fetchClaims(uri, this.state.page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { fetching, claimsInChannel, claim, navigation, uri } = this.props;
|
||||
const { fetching, claimsInChannel, claim, navigation, totalPages, uri } = this.props;
|
||||
const { name, permanent_url: permanentUrl } = claim;
|
||||
|
||||
let contentList;
|
||||
@@ -44,11 +67,25 @@ class ChannelPage extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View style={channelPageStyle.container}>
|
||||
<PageHeader title={name} onBackPressed={() => navigation.goBack(navigation.state.key)} />
|
||||
{contentList}
|
||||
{(totalPages > 1) &&
|
||||
<View style={channelPageStyle.pageButtons}>
|
||||
<View>
|
||||
{(this.state.page > 1) && <Button
|
||||
style={channelPageStyle.button}
|
||||
text={"Previous"}
|
||||
disabled={!!fetching}
|
||||
onPress={this.handlePreviousPage} />}
|
||||
</View>
|
||||
{(this.state.page < totalPages) && <Button
|
||||
style={[channelPageStyle.button, channelPageStyle.nextButton]}
|
||||
text={"Next"}
|
||||
disabled={!!fetching}
|
||||
onPress={this.handleNextPage} />}
|
||||
</View>}
|
||||
<UriBar value={uri} navigation={navigation} />
|
||||
</View>
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
View,
|
||||
ScrollView
|
||||
} from 'react-native';
|
||||
import { navigateToUri } from '../../utils/helper';
|
||||
import { navigateToUri, uriFromFileInfo } from '../../utils/helper';
|
||||
import Colors from '../../styles/colors';
|
||||
import PageHeader from '../../component/pageHeader';
|
||||
import FileListItem from '../../component/fileListItem';
|
||||
@@ -28,14 +28,6 @@ class DownloadsPage extends React.PureComponent {
|
||||
this.props.fileList();
|
||||
}
|
||||
|
||||
uriFromFileInfo(fileInfo) {
|
||||
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
|
||||
const uriParams = {};
|
||||
uriParams.contentName = claimName || claimNameDownloaded;
|
||||
uriParams.claimId = claimId;
|
||||
return buildURI(uriParams);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { fetching, fileInfos, navigation } = this.props;
|
||||
const hasDownloads = fileInfos && Object.values(fileInfos).length > 0;
|
||||
@@ -59,9 +51,9 @@ class DownloadsPage extends React.PureComponent {
|
||||
renderItem={ ({item}) => (
|
||||
<FileListItem
|
||||
style={fileListStyle.item}
|
||||
uri={this.uriFromFileInfo(item)}
|
||||
uri={uriFromFileInfo(item)}
|
||||
navigation={navigation}
|
||||
onPress={() => navigateToUri(navigation, this.uriFromFileInfo(item), { autoplay: true })} />
|
||||
onPress={() => navigateToUri(navigation, uriFromFileInfo(item), { autoplay: true })} />
|
||||
)
|
||||
}
|
||||
data={fileInfos.sort((a, b) => {
|
||||
@@ -71,7 +63,7 @@ class DownloadsPage extends React.PureComponent {
|
||||
if (a.metadata.title === b.metadata.title) return 0;
|
||||
return (a.metadata.title < b.metadata.title) ? -1 : 1;
|
||||
})}
|
||||
keyExtractor={(item, index) => item.outpoint}
|
||||
keyExtractor={(item, index) => item.download_path}
|
||||
/>
|
||||
</View>}
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doFetchFileInfo,
|
||||
doResolveUri,
|
||||
doFetchCostInfoForUri,
|
||||
doResolveUri,
|
||||
doSendTip,
|
||||
doToast,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectContentTypeForUri,
|
||||
makeSelectMetadataForUri,
|
||||
selectBalance,
|
||||
selectBlackListedOutpoints,
|
||||
} from 'lbry-redux';
|
||||
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||
@@ -18,6 +22,7 @@ import FilePage from './view';
|
||||
const select = (state, props) => {
|
||||
const selectProps = { uri: props.navigation.state.params.uri };
|
||||
return {
|
||||
balance: selectBalance(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
claim: makeSelectClaimForUri(selectProps.uri)(state),
|
||||
isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state),
|
||||
@@ -28,17 +33,20 @@ const select = (state, props) => {
|
||||
//tab: makeSelectCurrentParam('tab')(state),
|
||||
fileInfo: makeSelectFileInfoForUri(selectProps.uri)(state),
|
||||
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
||||
channelUri: makeSelectChannelForClaimUri(selectProps.uri, true)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
||||
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||
},
|
||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
sendTip: (amount, claimId, uri, successCallback, errorCallback) => dispatch(doSendTip(amount, claimId, uri, successCallback, errorCallback)),
|
||||
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FilePage);
|
||||
+235
-138
@@ -27,6 +27,7 @@ import FloatingWalletBalance from '../../component/floatingWalletBalance';
|
||||
import Link from '../../component/link';
|
||||
import MediaPlayer from '../../component/mediaPlayer';
|
||||
import RelatedContent from '../../component/relatedContent';
|
||||
import SubscribeButton from '../../component/subscribeButton';
|
||||
import UriBar from '../../component/uriBar';
|
||||
import Video from 'react-native-video';
|
||||
import filePageStyle from '../../styles/filePage';
|
||||
@@ -37,6 +38,8 @@ class FilePage extends React.PureComponent {
|
||||
title: ''
|
||||
};
|
||||
|
||||
tipAmountInput = null;
|
||||
|
||||
playerBackground = null;
|
||||
|
||||
startTime = null;
|
||||
@@ -55,9 +58,12 @@ class FilePage extends React.PureComponent {
|
||||
pageSuspended: false,
|
||||
showImageViewer: false,
|
||||
showWebView: false,
|
||||
showTipView: false,
|
||||
playerBgHeight: 0,
|
||||
playerHeight: 0,
|
||||
uri: null
|
||||
tipAmount: null,
|
||||
uri: null,
|
||||
stopDownloadConfirmed: false
|
||||
};
|
||||
}
|
||||
|
||||
@@ -155,7 +161,12 @@ class FilePage extends React.PureComponent {
|
||||
{ text: 'No' },
|
||||
{ text: 'Yes', onPress: () => {
|
||||
deleteFile(fileInfo.outpoint, true);
|
||||
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
|
||||
this.setState({
|
||||
downloadPressed: false,
|
||||
fileViewLogged: false,
|
||||
mediaLoaded: false,
|
||||
stopDownloadConfirmed: false
|
||||
});
|
||||
}}
|
||||
],
|
||||
{ cancelable: true }
|
||||
@@ -163,7 +174,7 @@ class FilePage extends React.PureComponent {
|
||||
}
|
||||
|
||||
onStopDownloadPressed = () => {
|
||||
const { deleteFile, stopDownload, fileInfo, navigation } = this.props;
|
||||
const { fileInfo, navigation, notify, stopDownload } = this.props;
|
||||
|
||||
Alert.alert(
|
||||
'Stop download',
|
||||
@@ -172,8 +183,19 @@ class FilePage extends React.PureComponent {
|
||||
{ text: 'No' },
|
||||
{ text: 'Yes', onPress: () => {
|
||||
stopDownload(navigation.state.params.uri, fileInfo);
|
||||
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
|
||||
} }
|
||||
this.setState({
|
||||
downloadPressed: false,
|
||||
fileViewLogged: false,
|
||||
mediaLoaded: false,
|
||||
stopDownloadConfirmed: true
|
||||
});
|
||||
|
||||
// there can be a bit of lag between the user pressing Yes and the UI being updated
|
||||
// after the file_set_status and file_delete operations, so let the user know
|
||||
notify({
|
||||
message: 'The download will stop momentarily. You do not need to wait to discover something else.',
|
||||
});
|
||||
}}
|
||||
],
|
||||
{ cancelable: true }
|
||||
);
|
||||
@@ -293,9 +315,25 @@ class FilePage extends React.PureComponent {
|
||||
this.setState({ fileViewLogged: true });
|
||||
}
|
||||
|
||||
handleSendTip = () => {
|
||||
const { claim, balance, navigation, notify, sendTip } = this.props;
|
||||
const { uri } = navigation.state.params;
|
||||
const { tipAmount } = this.state;
|
||||
|
||||
if (tipAmount > balance) {
|
||||
notify({
|
||||
message: 'Insufficient credits',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
sendTip(tipAmount, claim.claim_id, uri, () => { this.setState({ tipAmount: 0, showTipView: false }) });
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
claim,
|
||||
channelUri,
|
||||
fileInfo,
|
||||
metadata,
|
||||
contentType,
|
||||
@@ -329,144 +367,203 @@ class FilePage extends React.PureComponent {
|
||||
<ChannelPage uri={uri} navigation={navigation} />
|
||||
);
|
||||
} else if (claim) {
|
||||
const completed = fileInfo && fileInfo.completed;
|
||||
const title = metadata.title;
|
||||
const isRewardContent = rewardedContentClaimIds.includes(claim.claim_id);
|
||||
const description = metadata.description ? metadata.description : null;
|
||||
const mediaType = Lbry.getMediaType(contentType);
|
||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||
const { height, channel_name: channelName, value } = claim;
|
||||
const showActions = !this.state.fullscreenMode && !this.state.showImageViewer && !this.state.showWebView &&
|
||||
(completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes));
|
||||
const channelClaimId =
|
||||
value && value.publisherSignature && value.publisherSignature.certificateId;
|
||||
let isClaimBlackListed = false;
|
||||
|
||||
const playerStyle = [filePageStyle.player,
|
||||
this.state.isLandscape ? filePageStyle.containedPlayerLandscape :
|
||||
(this.state.fullscreenMode ? filePageStyle.fullscreenPlayer : filePageStyle.containedPlayer)];
|
||||
const playerBgStyle = [filePageStyle.playerBackground, this.state.fullscreenMode ?
|
||||
filePageStyle.fullscreenPlayerBackground : filePageStyle.containedPlayerBackground];
|
||||
// at least 2MB (or the full download) before media can be loaded
|
||||
const canLoadMedia = fileInfo &&
|
||||
(fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes == fileInfo.total_bytes); // 2MB = 1024*1024*2
|
||||
const canOpen = (mediaType === 'image' || mediaType === 'text') && completed;
|
||||
const isWebViewable = mediaType === 'text';
|
||||
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||
|
||||
const openFile = () => {
|
||||
if (mediaType === 'image') {
|
||||
// use image viewer
|
||||
this.setState({
|
||||
imageUrls: [{
|
||||
url: localFileUri
|
||||
}],
|
||||
showImageViewer: true
|
||||
});
|
||||
}
|
||||
if (isWebViewable) {
|
||||
// show webview
|
||||
this.setState({
|
||||
showWebView: true
|
||||
});
|
||||
if (blackListedOutpoints) {
|
||||
for (let i = 0; i < blackListedOutpoints.length; i += 1) {
|
||||
const outpoint = blackListedOutpoints[i];
|
||||
if (outpoint.txid === claim.txid && outpoint.nout === claim.nout) {
|
||||
isClaimBlackListed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
innerContent = (
|
||||
<View style={filePageStyle.pageContainer}>
|
||||
{this.state.showWebView && isWebViewable && <WebView source={{ uri: localFileUri }}
|
||||
style={filePageStyle.viewer} />}
|
||||
|
||||
{this.state.showImageViewer && <ImageViewer style={StyleSheet.flatten(filePageStyle.viewer)}
|
||||
imageUrls={this.state.imageUrls}
|
||||
renderIndicator={() => null} />}
|
||||
|
||||
{!this.state.showWebView && (
|
||||
<View style={this.state.fullscreenMode ? filePageStyle.innerPageContainerFsMode : filePageStyle.innerPageContainer}
|
||||
onLayout={this.checkOrientation}>
|
||||
<View style={filePageStyle.mediaContainer}>
|
||||
{((canOpen || (!fileInfo || (isPlayable && !canLoadMedia))) || (!canOpen && fileInfo)) &&
|
||||
<FileItemMedia style={filePageStyle.thumbnail} title={title} thumbnail={metadata.thumbnail} />}
|
||||
{((!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded) &&
|
||||
<ActivityIndicator size="large" color={Colors.LbryGreen} style={filePageStyle.loading} />}
|
||||
{((isPlayable && !completed && !canLoadMedia) || !completed || canOpen) && (!this.state.downloadPressed) &&
|
||||
<FileDownloadButton uri={uri}
|
||||
style={filePageStyle.downloadButton}
|
||||
openFile={openFile}
|
||||
isPlayable={isPlayable}
|
||||
onPlay={() => {
|
||||
this.startTime = Date.now();
|
||||
this.setState({ downloadPressed: true, autoPlayMedia: true });
|
||||
}}
|
||||
onButtonLayout={() => this.setState({ downloadButtonShown: true })}
|
||||
onStartDownloadFailed={() => {
|
||||
this.startTime = null;
|
||||
setTimeout(() => {
|
||||
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
|
||||
}, 500);
|
||||
}} />}
|
||||
{!fileInfo && <FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />}
|
||||
</View>
|
||||
{canLoadMedia && fileInfo && <View style={playerBgStyle}
|
||||
ref={(ref) => { this.playerBackground = ref; }}
|
||||
onLayout={(evt) => {
|
||||
if (!this.state.playerBgHeight) {
|
||||
this.setState({ playerBgHeight: evt.nativeEvent.layout.height });
|
||||
}
|
||||
}} />}
|
||||
{canLoadMedia && fileInfo && <MediaPlayer
|
||||
fileInfo={fileInfo}
|
||||
assignPlayer={(ref) => { this.player = ref; }}
|
||||
uri={uri}
|
||||
style={playerStyle}
|
||||
autoPlay={autoplay || this.state.autoPlayMedia}
|
||||
onFullscreenToggled={this.handleFullscreenToggle}
|
||||
onLayout={(evt) => {
|
||||
if (!this.state.playerHeight) {
|
||||
this.setState({ playerHeight: evt.nativeEvent.layout.height });
|
||||
}
|
||||
}}
|
||||
onMediaLoaded={() => this.onMediaLoaded(channelName, title, uri)}
|
||||
onPlaybackStarted={this.onPlaybackStarted}
|
||||
/>}
|
||||
|
||||
{ showActions &&
|
||||
<View style={filePageStyle.actions}>
|
||||
{completed && <Button style={filePageStyle.actionButton}
|
||||
theme={"light"}
|
||||
icon={"trash"}
|
||||
text={"Delete"}
|
||||
onPress={this.onDeletePressed} />}
|
||||
{!completed && fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes &&
|
||||
<Button style={filePageStyle.actionButton}
|
||||
theme={"light"}
|
||||
text={"Stop Download"}
|
||||
onPress={this.onStopDownloadPressed} />
|
||||
}
|
||||
</View>}
|
||||
<ScrollView
|
||||
style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}
|
||||
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}>
|
||||
<Text style={filePageStyle.title} selectable={true}>{title}</Text>
|
||||
{channelName && <Link style={filePageStyle.channelName}
|
||||
selectable={true}
|
||||
text={channelName}
|
||||
onPress={() => {
|
||||
const channelUri = normalizeURI(channelName);
|
||||
navigateToUri(navigation, channelUri);
|
||||
}} />}
|
||||
|
||||
{description && description.length > 0 && <View style={filePageStyle.divider} />}
|
||||
|
||||
{description && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>}
|
||||
|
||||
<RelatedContent navigation={navigation} uri={uri} />
|
||||
</ScrollView>
|
||||
if (isClaimBlackListed) {
|
||||
innerContent = (
|
||||
<View style={filePageStyle.pageContainer}>
|
||||
<View style={filePageStyle.dmcaContainer}>
|
||||
<Text style={filePageStyle.dmcaText}>
|
||||
In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications.
|
||||
</Text>
|
||||
<Link style={filePageStyle.dmcaLink} href="https://lbry.io/faq/dmca" text="Read More" />
|
||||
</View>
|
||||
)}
|
||||
{!this.state.fullscreenMode && <FloatingWalletBalance navigation={navigation} />}
|
||||
{!this.state.fullscreenMode && <UriBar value={uri} navigation={navigation} />}
|
||||
</View>
|
||||
);
|
||||
<UriBar value={uri} navigation={navigation} />
|
||||
</View>
|
||||
);
|
||||
} else {
|
||||
const completed = fileInfo && fileInfo.completed;
|
||||
const title = metadata.title;
|
||||
const isRewardContent = rewardedContentClaimIds.includes(claim.claim_id);
|
||||
const description = metadata.description ? metadata.description : null;
|
||||
const mediaType = Lbry.getMediaType(contentType);
|
||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||
const { height, channel_name: channelName, value } = claim;
|
||||
const showActions = !this.state.fullscreenMode && !this.state.showImageViewer && !this.state.showWebView;
|
||||
const showFileActions = (completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes));
|
||||
const channelClaimId =
|
||||
value && value.publisherSignature && value.publisherSignature.certificateId;
|
||||
const canSendTip = this.state.tipAmount > 0;
|
||||
|
||||
const playerStyle = [filePageStyle.player,
|
||||
this.state.isLandscape ? filePageStyle.containedPlayerLandscape :
|
||||
(this.state.fullscreenMode ? filePageStyle.fullscreenPlayer : filePageStyle.containedPlayer)];
|
||||
const playerBgStyle = [filePageStyle.playerBackground, this.state.fullscreenMode ?
|
||||
filePageStyle.fullscreenPlayerBackground : filePageStyle.containedPlayerBackground];
|
||||
// at least 2MB (or the full download) before media can be loaded
|
||||
const canLoadMedia = fileInfo &&
|
||||
(fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes == fileInfo.total_bytes); // 2MB = 1024*1024*2
|
||||
const canOpen = (mediaType === 'image' || mediaType === 'text') && completed;
|
||||
const isWebViewable = mediaType === 'text';
|
||||
const localFileUri = this.localUriForFileInfo(fileInfo);
|
||||
|
||||
const openFile = () => {
|
||||
if (mediaType === 'image') {
|
||||
// use image viewer
|
||||
this.setState({
|
||||
imageUrls: [{
|
||||
url: localFileUri
|
||||
}],
|
||||
showImageViewer: true
|
||||
});
|
||||
}
|
||||
if (isWebViewable) {
|
||||
// show webview
|
||||
this.setState({
|
||||
showWebView: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
innerContent = (
|
||||
<View style={filePageStyle.pageContainer}>
|
||||
{this.state.showWebView && isWebViewable && <WebView source={{ uri: localFileUri }}
|
||||
style={filePageStyle.viewer} />}
|
||||
|
||||
{this.state.showImageViewer && <ImageViewer style={StyleSheet.flatten(filePageStyle.viewer)}
|
||||
imageUrls={this.state.imageUrls}
|
||||
renderIndicator={() => null} />}
|
||||
|
||||
{!this.state.showWebView && (
|
||||
<View style={this.state.fullscreenMode ? filePageStyle.innerPageContainerFsMode : filePageStyle.innerPageContainer}
|
||||
onLayout={this.checkOrientation}>
|
||||
<View style={filePageStyle.mediaContainer}>
|
||||
{((canOpen || (!fileInfo || (isPlayable && !canLoadMedia))) || (!canOpen && fileInfo)) &&
|
||||
<FileItemMedia style={filePageStyle.thumbnail} title={title} thumbnail={metadata.thumbnail} />}
|
||||
{((!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded) &&
|
||||
<ActivityIndicator size="large" color={Colors.LbryGreen} style={filePageStyle.loading} />}
|
||||
{((isPlayable && !completed && !canLoadMedia) || !completed || canOpen) && (!this.state.downloadPressed) &&
|
||||
<FileDownloadButton uri={uri}
|
||||
style={filePageStyle.downloadButton}
|
||||
openFile={openFile}
|
||||
isPlayable={isPlayable}
|
||||
onPlay={() => {
|
||||
this.startTime = Date.now();
|
||||
this.setState({ downloadPressed: true, autoPlayMedia: true, stopDownloadConfirmed: false });
|
||||
}}
|
||||
onButtonLayout={() => this.setState({ downloadButtonShown: true })}
|
||||
onStartDownloadFailed={() => {
|
||||
this.startTime = null;
|
||||
setTimeout(() => {
|
||||
this.setState({ downloadPressed: false, fileViewLogged: false, mediaLoaded: false });
|
||||
}, 500);
|
||||
}} />}
|
||||
{!fileInfo && <FilePrice uri={uri} style={filePageStyle.filePriceContainer} textStyle={filePageStyle.filePriceText} />}
|
||||
</View>
|
||||
{canLoadMedia && fileInfo && <View style={playerBgStyle}
|
||||
ref={(ref) => { this.playerBackground = ref; }}
|
||||
onLayout={(evt) => {
|
||||
if (!this.state.playerBgHeight) {
|
||||
this.setState({ playerBgHeight: evt.nativeEvent.layout.height });
|
||||
}
|
||||
}} />}
|
||||
{canLoadMedia && fileInfo && <MediaPlayer
|
||||
fileInfo={fileInfo}
|
||||
assignPlayer={(ref) => { this.player = ref; }}
|
||||
uri={uri}
|
||||
style={playerStyle}
|
||||
autoPlay={autoplay || this.state.autoPlayMedia}
|
||||
onFullscreenToggled={this.handleFullscreenToggle}
|
||||
onLayout={(evt) => {
|
||||
if (!this.state.playerHeight) {
|
||||
this.setState({ playerHeight: evt.nativeEvent.layout.height });
|
||||
}
|
||||
}}
|
||||
onMediaLoaded={() => this.onMediaLoaded(channelName, title, uri)}
|
||||
onPlaybackStarted={this.onPlaybackStarted}
|
||||
/>}
|
||||
|
||||
{showActions &&
|
||||
<View style={filePageStyle.actions}>
|
||||
<View style={filePageStyle.socialActions}>
|
||||
{channelName && <SubscribeButton
|
||||
style={[filePageStyle.actionButton, filePageStyle.subscribeButton]}
|
||||
uri={channelUri} name={channelName} />}
|
||||
{<Button style={filePageStyle.actionButton}
|
||||
theme={"light"}
|
||||
icon={"gift"}
|
||||
text={"Send a tip"}
|
||||
onPress={() => this.setState({ showTipView: true })} />}
|
||||
</View>
|
||||
{showFileActions &&
|
||||
<View style={filePageStyle.fileActions}>
|
||||
{completed && <Button style={filePageStyle.actionButton}
|
||||
theme={"light"}
|
||||
icon={"trash"}
|
||||
text={"Delete"}
|
||||
onPress={this.onDeletePressed} />}
|
||||
{!completed && fileInfo && !fileInfo.stopped &&
|
||||
fileInfo.written_bytes < fileInfo.total_bytes &&
|
||||
!this.state.stopDownloadConfirmed &&
|
||||
<Button style={filePageStyle.actionButton}
|
||||
theme={"light"}
|
||||
text={"Stop Download"}
|
||||
onPress={this.onStopDownloadPressed} />
|
||||
}
|
||||
</View>}
|
||||
</View>}
|
||||
<ScrollView
|
||||
style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}
|
||||
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}>
|
||||
<Text style={filePageStyle.title} selectable={true}>{title}</Text>
|
||||
{channelName && <Link style={filePageStyle.channelName}
|
||||
selectable={true}
|
||||
text={channelName}
|
||||
onPress={() => {
|
||||
const channelUri = normalizeURI(channelName);
|
||||
navigateToUri(navigation, channelUri);
|
||||
}} />}
|
||||
|
||||
{description && description.length > 0 && <View style={filePageStyle.divider} />}
|
||||
|
||||
{description && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>}
|
||||
|
||||
<RelatedContent navigation={navigation} uri={uri} />
|
||||
</ScrollView>
|
||||
{this.state.showTipView && <View style={filePageStyle.tipCard}>
|
||||
<View style={filePageStyle.row}>
|
||||
<View style={filePageStyle.amountRow}>
|
||||
<TextInput ref={ref => this.tipAmountInput = ref}
|
||||
onChangeText={value => this.setState({tipAmount: value})}
|
||||
keyboardType={'numeric'}
|
||||
value={this.state.tipAmount}
|
||||
style={[filePageStyle.input, filePageStyle.tipAmountInput]} />
|
||||
<Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text>
|
||||
</View>
|
||||
<Link style={[filePageStyle.link, filePageStyle.cancelTipLink]} text={'Cancel'} onPress={() => this.setState({ showTipView: false })} />
|
||||
<Button text={'Send tip'}
|
||||
style={[filePageStyle.button, filePageStyle.sendButton]}
|
||||
disabled={!canSendTip}
|
||||
onPress={this.handleSendTip} />
|
||||
</View>
|
||||
</View>}
|
||||
</View>
|
||||
)}
|
||||
{!this.state.fullscreenMode && <FloatingWalletBalance navigation={navigation} />}
|
||||
{!this.state.fullscreenMode && <UriBar value={uri} navigation={navigation} />}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return innerContent;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import {
|
||||
doGenerateAuthToken,
|
||||
doUserEmailNew,
|
||||
@@ -22,7 +22,7 @@ const select = (state) => ({
|
||||
const perform = dispatch => ({
|
||||
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
||||
generateAuthToken: installationId => dispatch(doGenerateAuthToken(installationId)),
|
||||
notify: data => dispatch(doNotify(data))
|
||||
notify: data => dispatch(doToast(data))
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FirstRun);
|
||||
export default connect(select, perform)(FirstRun);
|
||||
@@ -13,7 +13,7 @@ import Constants from '../../../constants';
|
||||
import firstRunStyle from '../../../styles/firstRun';
|
||||
|
||||
class EmailCollectPage extends React.PureComponent {
|
||||
static MAX_STATUS_TRIES = 15;
|
||||
static MAX_STATUS_TRIES = 30;
|
||||
|
||||
state = {
|
||||
email: null,
|
||||
@@ -57,7 +57,7 @@ class EmailCollectPage extends React.PureComponent {
|
||||
setTimeout(() => {
|
||||
this.startAuthenticating();
|
||||
this.setState({ statusTries: this.state.statusTries + 1 });
|
||||
}, 1000); // Retry every second for a maximum of MAX_STATUS_TRIES tries (15 seconds)
|
||||
}, 1000); // Retry every second for a maximum of MAX_STATUS_TRIES tries (30 seconds)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
if (this.state.emailSubmitted && !emailNewPending) {
|
||||
this.setState({ emailSubmitted: false });
|
||||
if (emailNewErrorMessage) {
|
||||
notify ({ message: String(emailNewErrorMessage), displayType: ['toast']});
|
||||
notify ({ message: String(emailNewErrorMessage), isError: true });
|
||||
} else {
|
||||
// Request successful. Navigate to discover.
|
||||
this.closeFinalPage();
|
||||
@@ -115,7 +115,6 @@ class FirstRunScreen extends React.PureComponent {
|
||||
if (email.indexOf('@') === -1) {
|
||||
return notify({
|
||||
message: 'Please provide a valid email address to continue.',
|
||||
displayType: ['toast'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -152,6 +151,13 @@ class FirstRunScreen extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onEmailViewLayout = () => {
|
||||
this.setState({ showBottomContainer: true });
|
||||
AsyncStorage.getItem('firstRunEmail').then(email => {
|
||||
this.setState({ showSkip: !email || email.trim().length === 0 });
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
authenticating,
|
||||
@@ -171,7 +177,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
authToken={authToken}
|
||||
generateAuthToken={generateAuthToken}
|
||||
onEmailChanged={this.onEmailChanged}
|
||||
onEmailViewLayout={() => this.setState({ showBottomContainer: true, showSkip: true })} />);
|
||||
onEmailViewLayout={this.onEmailViewLayout} />);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
selectClaimedRewards,
|
||||
selectUser,
|
||||
} from 'lbryinc';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
import { doToast } from 'lbry-redux';
|
||||
import RewardsPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
@@ -22,7 +22,7 @@ const select = state => ({
|
||||
|
||||
const perform = dispatch => ({
|
||||
fetchRewards: () => dispatch(doRewardList()),
|
||||
notify: data => dispatch(doNotify(data)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardsPage);
|
||||
export default connect(select, perform)(RewardsPage);
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from 'react-native';
|
||||
import Colors from '../../styles/colors';
|
||||
import Link from '../../component/link';
|
||||
import CustomRewardCard from '../../component/customRewardCard';
|
||||
import PhoneNumberRewardSubcard from '../../component/phoneNumberRewardSubcard';
|
||||
import EmailRewardSubcard from '../../component/emailRewardSubcard';
|
||||
import PageHeader from '../../component/pageHeader';
|
||||
@@ -122,6 +123,7 @@ class RewardsPage extends React.PureComponent {
|
||||
canClaim={!isNotEligible}
|
||||
reward={reward}
|
||||
reward_type={reward.reward_type} />)}
|
||||
<CustomRewardCard canClaim={!isNotEligible} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -129,9 +131,10 @@ class RewardsPage extends React.PureComponent {
|
||||
renderClaimedRewards() {
|
||||
const { claimed } = this.props;
|
||||
if (claimed && claimed.length) {
|
||||
const reversed = claimed.reverse();
|
||||
return (
|
||||
<View>
|
||||
{claimed.map(reward => <RewardCard key={reward.reward_type} reward={reward} />)}
|
||||
{reversed.map(reward => <RewardCard key={reward.transaction_id} reward={reward} />)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -142,7 +145,10 @@ class RewardsPage extends React.PureComponent {
|
||||
|
||||
return (
|
||||
<View style={rewardStyle.container}>
|
||||
<ScrollView style={rewardStyle.scrollContainer} contentContainerStyle={rewardStyle.scrollContentContainer}>
|
||||
<ScrollView
|
||||
keyboardShouldPersistTaps={'handled'}
|
||||
style={rewardStyle.scrollContainer}
|
||||
contentContainerStyle={rewardStyle.scrollContentContainer}>
|
||||
{this.renderVerification()}
|
||||
{this.renderUnclaimedRewards()}
|
||||
{this.renderClaimedRewards()}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doBalanceSubscribe, doNotify } from 'lbry-redux';
|
||||
import { doBalanceSubscribe, doBlackListedOutpointsSubscribe, doToast } from 'lbry-redux';
|
||||
import {
|
||||
doAuthenticate,
|
||||
doCheckSubscriptionsInit,
|
||||
doFetchRewardedContent,
|
||||
doUserEmailToVerify,
|
||||
doUserEmailVerify,
|
||||
@@ -20,9 +21,11 @@ const select = state => ({
|
||||
const perform = dispatch => ({
|
||||
authenticate: (appVersion, os) => dispatch(doAuthenticate(appVersion, os)),
|
||||
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
||||
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
|
||||
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
|
||||
deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()),
|
||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||
notify: data => dispatch(doNotify(data)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
||||
verifyUserEmail: (token, recaptcha) => dispatch(doUserEmailVerify(token, recaptcha)),
|
||||
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
||||
|
||||
@@ -102,12 +102,11 @@ class SplashScreen extends React.PureComponent {
|
||||
} catch (error) {
|
||||
const message = 'Invalid Verification Token';
|
||||
verifyUserEmailFailure(message);
|
||||
notify({ message, displayType: ['toast'] });
|
||||
notify({ message });
|
||||
}
|
||||
} else {
|
||||
notify({
|
||||
message: 'Invalid Verification URI',
|
||||
displayType: ['toast'],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -144,11 +143,15 @@ class SplashScreen extends React.PureComponent {
|
||||
const {
|
||||
authenticate,
|
||||
balanceSubscribe,
|
||||
blacklistedOutpointsSubscribe,
|
||||
checkSubscriptionsInit,
|
||||
navigation,
|
||||
notify
|
||||
} = this.props;
|
||||
|
||||
balanceSubscribe();
|
||||
blacklistedOutpointsSubscribe();
|
||||
checkSubscriptionsInit();
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ shouldAuthenticate: true });
|
||||
authenticate(appVersion, Platform.OS);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doFetchMySubscriptions,
|
||||
doSetViewMode,
|
||||
doFetchRecommendedSubscriptions,
|
||||
doCompleteFirstRun,
|
||||
doShowSuggestedSubs,
|
||||
selectSubscriptionClaims,
|
||||
selectSubscriptions,
|
||||
selectSubscriptionsBeingFetched,
|
||||
selectIsFetchingSubscriptions,
|
||||
selectUnreadSubscriptions,
|
||||
selectViewMode,
|
||||
selectFirstRunCompleted,
|
||||
selectShowSuggestedSubs
|
||||
} from 'lbryinc';
|
||||
import SubscriptionsPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
loading:
|
||||
selectIsFetchingSubscriptions(state) ||
|
||||
Boolean(Object.keys(selectSubscriptionsBeingFetched(state)).length),
|
||||
subscribedChannels: selectSubscriptions(state),
|
||||
allSubscriptions: selectSubscriptionClaims(state),
|
||||
unreadSubscriptions: selectUnreadSubscriptions(state),
|
||||
viewMode: selectViewMode(state),
|
||||
firstRunCompleted: selectFirstRunCompleted(state),
|
||||
showSuggestedSubs: selectShowSuggestedSubs(state),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
{
|
||||
doFetchMySubscriptions,
|
||||
doSetViewMode,
|
||||
doFetchRecommendedSubscriptions,
|
||||
doCompleteFirstRun,
|
||||
doShowSuggestedSubs,
|
||||
}
|
||||
)(SubscriptionsPage);
|
||||
@@ -0,0 +1,91 @@
|
||||
import React from 'react';
|
||||
import NavigationActions from 'react-navigation';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
AsyncStorage,
|
||||
FlatList,
|
||||
NativeModules,
|
||||
SectionList,
|
||||
Text,
|
||||
View
|
||||
} from 'react-native';
|
||||
import { buildURI } from 'lbry-redux';
|
||||
import { uriFromFileInfo } from 'utils/helper';
|
||||
import moment from 'moment';
|
||||
import Colors from 'styles/colors';
|
||||
import discoverStyle from 'styles/discover';
|
||||
import subscriptionsStyle from 'styles/subscriptions';
|
||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||
import FileItem from 'component/fileItem';
|
||||
import UriBar from 'component/uriBar';
|
||||
|
||||
class SubscriptionsPage extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const {
|
||||
doFetchMySubscriptions,
|
||||
doFetchRecommendedSubscriptions
|
||||
} = this.props;
|
||||
doFetchMySubscriptions();
|
||||
//doFetchRecommendedSubscriptions();
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
subscribedChannels,
|
||||
allSubscriptions,
|
||||
loading,
|
||||
viewMode,
|
||||
doSetViewMode,
|
||||
loadingSuggested,
|
||||
firstRunCompleted,
|
||||
doCompleteFirstRun,
|
||||
doShowSuggestedSubs,
|
||||
showSuggestedSubs,
|
||||
unreadSubscriptions,
|
||||
navigation
|
||||
} = this.props;
|
||||
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
|
||||
const hasSubscriptions = numberOfSubscriptions > 0;
|
||||
|
||||
return (
|
||||
<View style={subscriptionsStyle.container}>
|
||||
|
||||
{hasSubscriptions && !loading &&
|
||||
<FlatList
|
||||
style={subscriptionsStyle.scrollContainer}
|
||||
contentContainerStyle={subscriptionsStyle.scrollPadding}
|
||||
renderItem={ ({item}) => (
|
||||
<FileItem
|
||||
style={subscriptionsStyle.fileItem}
|
||||
mediaStyle={discoverStyle.fileItemMedia}
|
||||
key={item}
|
||||
uri={uriFromFileInfo(item)}
|
||||
navigation={navigation} />
|
||||
)
|
||||
}
|
||||
data={allSubscriptions.sort((a, b) => {
|
||||
return b.height - a.height;
|
||||
})}
|
||||
keyExtractor={(item, index) => uriFromFileInfo(item)} />}
|
||||
|
||||
{hasSubscriptions && loading &&
|
||||
<View style={subscriptionsStyle.busyContainer}>
|
||||
<ActivityIndicator size="large" color={Colors.LbryGreen} style={subscriptionsStyle.loading} />
|
||||
</View>
|
||||
}
|
||||
|
||||
{!hasSubscriptions &&
|
||||
<View style={subscriptionsStyle.busyContainer}>
|
||||
<Text style={subscriptionsStyle.infoText}>
|
||||
You are not subscribed to any channels. Feel free to discover new channels that you can subscribe to.
|
||||
</Text>
|
||||
</View>}
|
||||
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
<UriBar navigation={navigation} />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default SubscriptionsPage;
|
||||
@@ -1,12 +1,13 @@
|
||||
import React from 'react';
|
||||
import { ScrollView, Text, View } from 'react-native';
|
||||
import TransactionListRecent from '../../component/transactionListRecent';
|
||||
import WalletAddress from '../../component/walletAddress';
|
||||
import WalletBalance from '../../component/walletBalance';
|
||||
import WalletSend from '../../component/walletSend';
|
||||
import Button from '../../component/button';
|
||||
import Constants from '../../constants';
|
||||
import walletStyle from '../../styles/wallet';
|
||||
import TransactionListRecent from 'component/transactionListRecent';
|
||||
import WalletAddress from 'component/walletAddress';
|
||||
import WalletBalance from 'component/walletBalance';
|
||||
import WalletSend from 'component/walletSend';
|
||||
import Button from 'component/button';
|
||||
import Link from 'component/link'
|
||||
import Constants from 'constants';
|
||||
import walletStyle from 'styles/wallet';
|
||||
|
||||
class WalletPage extends React.PureComponent {
|
||||
render() {
|
||||
@@ -27,7 +28,13 @@ class WalletPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView>
|
||||
<ScrollView keyboardShouldPersistTaps={'handled'}>
|
||||
<View style={walletStyle.warningCard}>
|
||||
<Text style={walletStyle.warningText}>
|
||||
Please backup your wallet file using the instructions at <Link style={walletStyle.warningText} text="https://lbry.io/faq/how-to-backup-wallet#android" href="https://lbry.io/faq/how-to-backup-wallet#android" />.
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<WalletBalance />
|
||||
<WalletAddress />
|
||||
<WalletSend />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
ACTIONS,
|
||||
Lbry,
|
||||
doNotify,
|
||||
doToast,
|
||||
formatCredits,
|
||||
selectBalance,
|
||||
makeSelectCostInfoForUri,
|
||||
@@ -25,11 +25,17 @@ const deleteBlobsForSdHash = (sdHash) => {
|
||||
|
||||
export function doUpdateLoadStatus(uri, outpoint) {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
|
||||
Lbry.file_list({
|
||||
outpoint,
|
||||
full_status: true,
|
||||
}).then(([fileInfo]) => {
|
||||
if (!fileInfo || fileInfo.written_bytes === 0) {
|
||||
// if the outpoint isn't in the state, then it was probably canceled, so stop checking the load status
|
||||
const { downloadingByOutpoint = {} } = state.fileInfo;
|
||||
if (!downloadingByOutpoint[outpoint]) return;
|
||||
|
||||
// download hasn't started yet
|
||||
setTimeout(() => {
|
||||
dispatch(doUpdateLoadStatus(uri, outpoint));
|
||||
@@ -133,16 +139,16 @@ export function doStopDownloadingFile(uri, fileInfo) {
|
||||
Lbry.file_set_status(params).then(() => {
|
||||
dispatch({
|
||||
type: ACTIONS.DOWNLOADING_CANCELED,
|
||||
data: {}
|
||||
data: { uri, outpoint: fileInfo.outpoint }
|
||||
});
|
||||
|
||||
// Should also delete the file after the user stops downloading
|
||||
dispatch(doDeleteFile(fileInfo.outpoint, uri));
|
||||
|
||||
if (NativeModules.LbryDownloadManager) {
|
||||
NativeModules.LbryDownloadManager.stopDownload(uri, fileInfo.file_name);
|
||||
}
|
||||
});
|
||||
|
||||
if (NativeModules.LbryDownloadManager) {
|
||||
NativeModules.LbryDownloadManager.stopDownload(uri, fileInfo.file_name);
|
||||
}
|
||||
|
||||
// Should also delete the file after the user stops downloading
|
||||
dispatch(doDeleteFile(fileInfo.outpoint, uri));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -184,9 +190,8 @@ export function doLoadVideo(uri, failureCallback) {
|
||||
data: { uri },
|
||||
});
|
||||
|
||||
dispatch(doNotify({
|
||||
dispatch(doToast({
|
||||
message: `File timeout for uri ${uri}`,
|
||||
displayType: ['toast']
|
||||
}));
|
||||
|
||||
if (failureCallback) {
|
||||
@@ -203,9 +208,8 @@ export function doLoadVideo(uri, failureCallback) {
|
||||
data: { uri },
|
||||
});
|
||||
|
||||
dispatch(doNotify({
|
||||
dispatch(doToast({
|
||||
message: `Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.`,
|
||||
displayType: ['toast']
|
||||
}));
|
||||
|
||||
if (failureCallback) {
|
||||
@@ -264,9 +268,8 @@ export function doPurchaseUri(uri, specificCostInfo, failureCallback) {
|
||||
|
||||
if (cost > balance) {
|
||||
dispatch(doSetPlayingUri(null));
|
||||
dispatch(doNotify({
|
||||
dispatch(doToast({
|
||||
message: 'Insufficient credits',
|
||||
displayType: ['toast']
|
||||
}));
|
||||
if (failureCallback) {
|
||||
failureCallback();
|
||||
|
||||
+26
-8
@@ -16,17 +16,29 @@ const aboutStyle = StyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between'
|
||||
},
|
||||
innerRow: {
|
||||
marginBottom: 4,
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between'
|
||||
},
|
||||
verticalRow: {
|
||||
marginBottom: 1,
|
||||
backgroundColor: '#f9f9f9',
|
||||
padding: 16,
|
||||
flex: 1
|
||||
},
|
||||
title: {
|
||||
color: Colors.LbryGreen,
|
||||
fontSize: 24,
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
marginTop: 16,
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
marginBottom: 8
|
||||
},
|
||||
paragraph: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
lineHeight: 24,
|
||||
marginLeft: 12,
|
||||
@@ -40,38 +52,44 @@ const aboutStyle = StyleSheet.create({
|
||||
},
|
||||
link: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
marginBottom: 24
|
||||
},
|
||||
listLink: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 15,
|
||||
alignSelf: 'flex-end'
|
||||
},
|
||||
col: {
|
||||
alignSelf: 'stretch'
|
||||
},
|
||||
socialTitle: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
marginBottom: 8,
|
||||
fontSize: 20
|
||||
},
|
||||
releaseInfoTitle: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
marginBottom: 12,
|
||||
fontSize: 20
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 15
|
||||
},
|
||||
valueText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
textAlign: 'right',
|
||||
fontSize: 15
|
||||
},
|
||||
lineValueText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 15
|
||||
}
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ const buttonStyle = StyleSheet.create({
|
||||
color: Colors.DarkGrey
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
textWithIcon: {
|
||||
|
||||
@@ -12,11 +12,11 @@ const channelPageStyle = StyleSheet.create({
|
||||
fileList: {
|
||||
paddingTop: 30,
|
||||
flex: 1,
|
||||
marginBottom: 60
|
||||
marginBottom: 16
|
||||
},
|
||||
title: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 30,
|
||||
margin: 16
|
||||
},
|
||||
@@ -27,10 +27,25 @@ const channelPageStyle = StyleSheet.create({
|
||||
flexDirection: 'row'
|
||||
},
|
||||
infoText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
marginLeft: 10
|
||||
},
|
||||
pageButtons: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16,
|
||||
marginBottom: 76
|
||||
},
|
||||
button: {
|
||||
backgroundColor: Colors.LbryGreen,
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16
|
||||
},
|
||||
nextButton: {
|
||||
alignSelf: 'flex-end'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const Colors = {
|
||||
ChannelGrey: '#9b9b9b',
|
||||
DarkGrey: '#555555',
|
||||
DescriptionGrey: '#999999',
|
||||
LbryGreen: '#40b89a',
|
||||
LbryGreen: '#2f9176',
|
||||
BrighterLbryGreen: '#40b887',
|
||||
LightGrey: '#cccccc',
|
||||
LighterGrey: '#e5e5e5',
|
||||
|
||||
@@ -33,13 +33,13 @@ const discoverStyle = StyleSheet.create({
|
||||
flexDirection: 'row'
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
marginLeft: 10
|
||||
},
|
||||
categoryName: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 20,
|
||||
marginLeft: 24,
|
||||
marginTop: 16,
|
||||
@@ -53,15 +53,17 @@ const discoverStyle = StyleSheet.create({
|
||||
},
|
||||
fileItemMedia: {
|
||||
width: mediaWidth,
|
||||
height: mediaHeight
|
||||
height: mediaHeight,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
},
|
||||
fileItemName: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
marginTop: 8,
|
||||
fontSize: 18
|
||||
},
|
||||
channelName: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 16,
|
||||
marginTop: 4,
|
||||
color: Colors.LbryGreen
|
||||
@@ -77,7 +79,7 @@ const discoverStyle = StyleSheet.create({
|
||||
borderRadius: 4
|
||||
},
|
||||
filePriceText: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 12,
|
||||
textAlign: 'center',
|
||||
color: '#0c604b'
|
||||
@@ -110,7 +112,7 @@ const discoverStyle = StyleSheet.create({
|
||||
color: Colors.White,
|
||||
fontSize: 14,
|
||||
textAlign: 'center',
|
||||
fontFamily: 'Metropolis-Regular'
|
||||
fontFamily: 'Inter-UI-Regular'
|
||||
},
|
||||
rewardTitleContainer: {
|
||||
alignItems: 'center',
|
||||
@@ -118,13 +120,20 @@ const discoverStyle = StyleSheet.create({
|
||||
justifyContent: 'space-between'
|
||||
},
|
||||
rewardIcon: {
|
||||
color: Colors.LbryGreen,
|
||||
color: Colors.Red,
|
||||
flex: 0.1,
|
||||
textAlign: 'right',
|
||||
marginTop: 6
|
||||
},
|
||||
rewardTitle: {
|
||||
flex: 0.9
|
||||
},
|
||||
menuText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16
|
||||
},
|
||||
titleText: {
|
||||
fontFamily: 'Inter-UI-Regular'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const downloadsStyle = StyleSheet.create({
|
||||
},
|
||||
noDownloadsText: {
|
||||
textAlign: 'center',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
position: 'absolute'
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ const fileDownloadButtonStyle = StyleSheet.create({
|
||||
backgroundColor: '#40c0a9',
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-Medium',
|
||||
fontFamily: 'Inter-UI-Medium',
|
||||
color: '#ffffff',
|
||||
fontSize: 14,
|
||||
textAlign: 'center'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { StyleSheet, Dimensions } from 'react-native';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import Colors from './colors';
|
||||
|
||||
const fileItemMediaStyle = StyleSheet.create({
|
||||
autothumb: {
|
||||
@@ -9,9 +10,9 @@ const fileItemMediaStyle = StyleSheet.create({
|
||||
alignItems: 'center'
|
||||
},
|
||||
autothumbText: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
textAlign: 'center',
|
||||
color: '#ffffff',
|
||||
color: Colors.White,
|
||||
fontSize: 40
|
||||
},
|
||||
autothumbPurple: {
|
||||
@@ -54,7 +55,7 @@ const fileItemMediaStyle = StyleSheet.create({
|
||||
},
|
||||
text: {
|
||||
color: '#ffffff',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
marginTop: 8
|
||||
},
|
||||
|
||||
@@ -24,19 +24,20 @@ const fileListStyle = StyleSheet.create({
|
||||
width: thumbnailWidth,
|
||||
height: thumbnailHeight,
|
||||
marginRight: (screenWidthPixels <= 720) ? 10 : 12,
|
||||
justifyContent: 'center'
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: (screenWidthPixels <= 720) ? 12 : 16
|
||||
},
|
||||
uri: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
|
||||
marginBottom: 8
|
||||
},
|
||||
publisher: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
|
||||
marginTop: (screenWidthPixels <= 720) ? 1 : 3,
|
||||
color: Colors.LbryGreen
|
||||
@@ -48,7 +49,7 @@ const fileListStyle = StyleSheet.create({
|
||||
marginTop: (screenWidthPixels <= 720) ? 4 : 8
|
||||
},
|
||||
downloadStorage: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: (screenWidthPixels <= 720) ? 12 : 14,
|
||||
color: Colors.ChannelGrey
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ const filePageStyle = StyleSheet.create({
|
||||
height: containedMediaHeightWithControls
|
||||
},
|
||||
emptyClaimText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
textAlign: 'center',
|
||||
fontSize: 20,
|
||||
marginLeft: 16,
|
||||
@@ -52,7 +52,7 @@ const filePageStyle = StyleSheet.create({
|
||||
flex: 1
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 24,
|
||||
marginTop: 12,
|
||||
marginLeft: 20,
|
||||
@@ -60,7 +60,7 @@ const filePageStyle = StyleSheet.create({
|
||||
marginBottom: 12
|
||||
},
|
||||
channelName: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
@@ -69,7 +69,7 @@ const filePageStyle = StyleSheet.create({
|
||||
},
|
||||
description: {
|
||||
color: Colors.DescriptionGrey,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
lineHeight: 20,
|
||||
marginLeft: 20,
|
||||
@@ -136,12 +136,14 @@ const filePageStyle = StyleSheet.create({
|
||||
borderRadius: 4
|
||||
},
|
||||
filePriceText: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 12,
|
||||
textAlign: 'center',
|
||||
color: '#0c604b'
|
||||
},
|
||||
actions: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16,
|
||||
paddingTop: 16,
|
||||
@@ -149,11 +151,21 @@ const filePageStyle = StyleSheet.create({
|
||||
marginTop: -14,
|
||||
width: '100%',
|
||||
},
|
||||
fileActions: {
|
||||
alignSelf: 'flex-end'
|
||||
},
|
||||
socialActions: {
|
||||
alignSelf: 'flex-start',
|
||||
flexDirection: 'row'
|
||||
},
|
||||
actionButton: {
|
||||
alignSelf: 'flex-start',
|
||||
backgroundColor: Colors.White,
|
||||
paddingLeft: 24,
|
||||
paddingRight: 24
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16
|
||||
},
|
||||
subscribeButton: {
|
||||
marginRight: 8
|
||||
},
|
||||
loading: {
|
||||
position: 'absolute',
|
||||
@@ -165,8 +177,27 @@ const filePageStyle = StyleSheet.create({
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row'
|
||||
},
|
||||
dmcaContainer: {
|
||||
flex: 1,
|
||||
alignItems: 'flex-start',
|
||||
justifyContent: 'center',
|
||||
paddingLeft: 24,
|
||||
paddingRight: 24
|
||||
},
|
||||
dmcaText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
lineHeight: 24
|
||||
},
|
||||
dmcaLink: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
lineHeight: 24,
|
||||
marginTop: 24
|
||||
},
|
||||
infoText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
marginLeft: 10
|
||||
@@ -181,10 +212,57 @@ const filePageStyle = StyleSheet.create({
|
||||
zIndex: 100
|
||||
},
|
||||
link: {
|
||||
color: Colors.LbryGreen
|
||||
color: Colors.Grey
|
||||
},
|
||||
linkTapped: {
|
||||
color: "rgba(64, 184, 154, .2)"
|
||||
},
|
||||
tipCard: {
|
||||
backgroundColor: Colors.White,
|
||||
position: 'absolute',
|
||||
top: containedMediaHeightWithControls - 16,
|
||||
width: '100%',
|
||||
paddingTop: 8,
|
||||
paddingBottom: 8,
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16
|
||||
},
|
||||
row: {
|
||||
flexDirection: 'row',
|
||||
flex: 1,
|
||||
justifyContent: 'space-between'
|
||||
},
|
||||
amountRow: {
|
||||
flexDirection: 'row',
|
||||
flex: 0.75
|
||||
},
|
||||
button: {
|
||||
backgroundColor: Colors.LbryGreen,
|
||||
alignSelf: 'flex-end',
|
||||
marginBottom: 6
|
||||
},
|
||||
cancelTipLink: {
|
||||
alignSelf: 'flex-end',
|
||||
marginBottom: 14
|
||||
},
|
||||
input: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
tipAmountInput: {
|
||||
alignSelf: 'flex-start',
|
||||
width: 80,
|
||||
fontSize: 16,
|
||||
letterSpacing: 1
|
||||
},
|
||||
currency: {
|
||||
alignSelf: 'flex-start',
|
||||
marginTop: 17
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
lineHeight: 24
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ const firstRunStyle = StyleSheet.create({
|
||||
backgroundColor: Colors.LbryGreen
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-SemiBold',
|
||||
fontFamily: 'Inter-UI-SemiBold',
|
||||
fontSize: 40,
|
||||
marginLeft: 32,
|
||||
marginRight: 32,
|
||||
@@ -20,7 +20,7 @@ const firstRunStyle = StyleSheet.create({
|
||||
color: Colors.White
|
||||
},
|
||||
paragraph: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
lineHeight: 24,
|
||||
marginLeft: 32,
|
||||
@@ -29,7 +29,7 @@ const firstRunStyle = StyleSheet.create({
|
||||
color: Colors.White
|
||||
},
|
||||
infoParagraph: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
lineHeight: 20,
|
||||
marginLeft: 32,
|
||||
@@ -38,7 +38,7 @@ const firstRunStyle = StyleSheet.create({
|
||||
color: Colors.White
|
||||
},
|
||||
emailInput: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 24,
|
||||
lineHeight: 24,
|
||||
marginLeft: 32,
|
||||
@@ -58,18 +58,19 @@ const firstRunStyle = StyleSheet.create({
|
||||
actionButton: {
|
||||
backgroundColor: Colors.White,
|
||||
alignSelf: 'center',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12,
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16
|
||||
},
|
||||
button: {
|
||||
alignSelf: 'flex-end',
|
||||
marginLeft: 32,
|
||||
marginRight: 32
|
||||
padding: 20,
|
||||
paddingLeft: 32,
|
||||
paddingRight: 32
|
||||
},
|
||||
buttonText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 24,
|
||||
color: Colors.White
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ const floatingButtonStyle = StyleSheet.create({
|
||||
},
|
||||
text: {
|
||||
color: Colors.White,
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 18,
|
||||
},
|
||||
bottomRight: {
|
||||
|
||||
@@ -71,7 +71,7 @@ const mediaPlayerStyle = StyleSheet.create({
|
||||
bottom: 14,
|
||||
},
|
||||
elapsedDuration: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
position: 'absolute',
|
||||
left: 8,
|
||||
bottom: 24,
|
||||
@@ -79,7 +79,7 @@ const mediaPlayerStyle = StyleSheet.create({
|
||||
color: '#ffffff'
|
||||
},
|
||||
totalDuration: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
position: 'absolute',
|
||||
right: 40,
|
||||
bottom: 24,
|
||||
@@ -93,7 +93,7 @@ const mediaPlayerStyle = StyleSheet.create({
|
||||
left: 15,
|
||||
height: 12,
|
||||
width: 12,
|
||||
backgroundColor: '#40c0a9'
|
||||
backgroundColor: Colors.LbryGreen
|
||||
},
|
||||
seekerHandle: {
|
||||
backgroundColor: 'transparent',
|
||||
@@ -128,7 +128,7 @@ const mediaPlayerStyle = StyleSheet.create({
|
||||
left: 15,
|
||||
height: 24,
|
||||
width: 24,
|
||||
backgroundColor: '#40c0a9'
|
||||
backgroundColor: Colors.LbryGreen
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ const pageHeaderStyle = StyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
},
|
||||
titleText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: Platform.OS === 'ios' ? 17 : 20,
|
||||
fontWeight: Platform.OS === 'ios' ? '700' : '500',
|
||||
color: 'rgba(0, 0, 0, .9)',
|
||||
|
||||
@@ -12,7 +12,7 @@ const relatedContentStyle = StyleSheet.create({
|
||||
borderTopWidth: 1
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
},
|
||||
itemList: {
|
||||
|
||||
+39
-17
@@ -48,36 +48,36 @@ const rewardStyle = StyleSheet.create({
|
||||
paddingBottom: 16
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
lineHeight: 24
|
||||
},
|
||||
infoText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
marginLeft: 12
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 22,
|
||||
marginBottom: 6,
|
||||
color: Colors.LbryGreen
|
||||
},
|
||||
subtitle: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 18,
|
||||
marginBottom: 6,
|
||||
color: Colors.LbryGreen
|
||||
},
|
||||
subcardText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 15,
|
||||
lineHeight: 20,
|
||||
marginLeft: 2,
|
||||
marginRight: 2
|
||||
},
|
||||
subcardTextInput: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
marginTop: 2,
|
||||
marginBottom: 2
|
||||
@@ -99,7 +99,7 @@ const rewardStyle = StyleSheet.create({
|
||||
},
|
||||
link: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
},
|
||||
textLink: {
|
||||
@@ -118,21 +118,21 @@ const rewardStyle = StyleSheet.create({
|
||||
alignItems: 'center'
|
||||
},
|
||||
rewardAmount: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 26,
|
||||
textAlign: 'center'
|
||||
},
|
||||
rewardCurrency: {
|
||||
fontFamily: 'Metropolis-Regular'
|
||||
fontFamily: 'Inter-UI-Regular'
|
||||
},
|
||||
rewardTitle: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
color: Colors.LbryGreen,
|
||||
marginBottom: 4,
|
||||
},
|
||||
rewardDescription: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
lineHeight: 18,
|
||||
marginBottom: 4
|
||||
@@ -155,13 +155,17 @@ const rewardStyle = StyleSheet.create({
|
||||
},
|
||||
summaryContainer: {
|
||||
backgroundColor: Colors.LbryGreen,
|
||||
padding: 12
|
||||
padding: 12,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center'
|
||||
},
|
||||
summaryText: {
|
||||
color: Colors.White,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
lineHeight: 22
|
||||
lineHeight: 20,
|
||||
flex: 0.7
|
||||
},
|
||||
phoneVerificationContainer: {
|
||||
paddingLeft: 4,
|
||||
@@ -171,18 +175,18 @@ const rewardStyle = StyleSheet.create({
|
||||
marginLeft: 8
|
||||
},
|
||||
phoneInputText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
letterSpacing: 1.3
|
||||
},
|
||||
verifyingText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
marginLeft: 12,
|
||||
alignSelf: 'flex-start'
|
||||
},
|
||||
verificationCodeInput: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 24,
|
||||
letterSpacing: 12
|
||||
},
|
||||
@@ -191,6 +195,24 @@ const rewardStyle = StyleSheet.create({
|
||||
},
|
||||
smsPermissionContainer: {
|
||||
marginBottom: 32
|
||||
},
|
||||
dismissButton: {
|
||||
alignSelf: 'center',
|
||||
backgroundColor: Colors.White,
|
||||
paddingLeft: 4,
|
||||
paddingRight: 4,
|
||||
flex: 0.2
|
||||
},
|
||||
customCodeInput: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
letterSpacing: 1.3,
|
||||
marginTop: -8,
|
||||
marginBottom: 4
|
||||
},
|
||||
redeemButton: {
|
||||
alignSelf: 'flex-end',
|
||||
backgroundColor: Colors.LbryGreen
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ const searchStyle = StyleSheet.create({
|
||||
searchInput: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16
|
||||
},
|
||||
noResultsText: {
|
||||
textAlign: 'center',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
position: 'absolute'
|
||||
},
|
||||
|
||||
@@ -25,13 +25,13 @@ const settingsStyle = StyleSheet.create({
|
||||
},
|
||||
label: {
|
||||
fontSize: 14,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
lineHeight: 18
|
||||
},
|
||||
description: {
|
||||
color: '#aaaaaa',
|
||||
fontSize: 12,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
lineHeight: 18
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ const splashStyle = StyleSheet.create({
|
||||
backgroundColor: Colors.LbryGreen
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 64,
|
||||
textAlign: 'center',
|
||||
marginBottom: 48,
|
||||
@@ -23,7 +23,7 @@ const splashStyle = StyleSheet.create({
|
||||
width: '50%'
|
||||
},
|
||||
details: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
marginLeft: 16,
|
||||
marginRight: 16,
|
||||
@@ -31,7 +31,7 @@ const splashStyle = StyleSheet.create({
|
||||
textAlign: 'center'
|
||||
},
|
||||
message: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 18,
|
||||
color: Colors.White,
|
||||
marginLeft: 16,
|
||||
|
||||
@@ -16,16 +16,16 @@ const storageStatsStyle = StyleSheet.create({
|
||||
padding: 16
|
||||
},
|
||||
totalSize: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 36
|
||||
},
|
||||
annotation: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
marginTop: -4
|
||||
},
|
||||
statsText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
distributionBar: {
|
||||
@@ -57,12 +57,12 @@ const storageStatsStyle = StyleSheet.create({
|
||||
height: 16,
|
||||
},
|
||||
legendText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
flex: 0.3
|
||||
},
|
||||
legendSize: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
flex: 0.6,
|
||||
textAlign: 'right'
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { StyleSheet } from 'react-native';
|
||||
|
||||
const subscriptionsStyle = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
busyContainer: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
padding: 16
|
||||
},
|
||||
scrollContainer: {
|
||||
flex: 1,
|
||||
marginBottom: 60
|
||||
},
|
||||
scrollPadding: {
|
||||
paddingTop: 24
|
||||
},
|
||||
infoText: {
|
||||
textAlign: 'center',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
},
|
||||
fileItem: {
|
||||
marginLeft: 24,
|
||||
marginRight: 24,
|
||||
marginBottom: 24
|
||||
}
|
||||
});
|
||||
|
||||
export default subscriptionsStyle;
|
||||
@@ -21,29 +21,29 @@ const transactionListStyle = StyleSheet.create({
|
||||
alignSelf: 'stretch'
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
link: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
amount: {
|
||||
textAlign: 'right'
|
||||
},
|
||||
smallText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12,
|
||||
color: '#aaaaaa'
|
||||
},
|
||||
smallLink: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12
|
||||
},
|
||||
noTransactions: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
textAlign: 'center',
|
||||
padding: 16,
|
||||
color: '#aaaaaa'
|
||||
|
||||
@@ -22,7 +22,7 @@ const uriBarStyle = StyleSheet.create({
|
||||
borderColor: Colors.LightGrey,
|
||||
padding: 8,
|
||||
borderRadius: 4,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
width: '100%'
|
||||
},
|
||||
@@ -47,7 +47,7 @@ const uriBarStyle = StyleSheet.create({
|
||||
padding: 12
|
||||
},
|
||||
itemText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
marginLeft: 12,
|
||||
marginRight: 12
|
||||
|
||||
+19
-12
@@ -11,7 +11,7 @@ const walletStyle = StyleSheet.create({
|
||||
flexDirection: 'row'
|
||||
},
|
||||
address: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
borderWidth: 1,
|
||||
borderStyle: 'dashed',
|
||||
borderColor: '#cccccc',
|
||||
@@ -33,17 +33,24 @@ const walletStyle = StyleSheet.create({
|
||||
marginRight: 16,
|
||||
padding: 16
|
||||
},
|
||||
warningCard: {
|
||||
backgroundColor: Colors.Orange,
|
||||
padding: 16,
|
||||
marginLeft: 16,
|
||||
marginTop: 16,
|
||||
marginRight: 16
|
||||
},
|
||||
transactionsCard: {
|
||||
backgroundColor: '#ffffff',
|
||||
margin: 16
|
||||
},
|
||||
title: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 20,
|
||||
marginBottom: 24
|
||||
},
|
||||
transactionsTitle: {
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 20
|
||||
},
|
||||
transactionsHeader: {
|
||||
@@ -55,16 +62,16 @@ const walletStyle = StyleSheet.create({
|
||||
borderBottomColor: '#eeeeee'
|
||||
},
|
||||
text: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
link: {
|
||||
color: Colors.LbryGreen,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
smallText: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12
|
||||
},
|
||||
balanceCard: {
|
||||
@@ -80,14 +87,14 @@ const walletStyle = StyleSheet.create({
|
||||
},
|
||||
balanceTitle: {
|
||||
color: '#ffffff',
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 18,
|
||||
marginLeft: 16,
|
||||
marginTop: 16
|
||||
},
|
||||
balanceCaption: {
|
||||
color: '#caedB9',
|
||||
fontFamily: 'Metropolis-Medium',
|
||||
fontFamily: 'Inter-UI-Medium',
|
||||
fontSize: 14,
|
||||
marginLeft: 16,
|
||||
marginTop: 8,
|
||||
@@ -95,20 +102,20 @@ const walletStyle = StyleSheet.create({
|
||||
},
|
||||
balance: {
|
||||
color: '#ffffff',
|
||||
fontFamily: 'Metropolis-Bold',
|
||||
fontFamily: 'Inter-UI-Bold',
|
||||
fontSize: 36,
|
||||
marginLeft: 16,
|
||||
marginBottom: 16
|
||||
},
|
||||
infoText: {
|
||||
color: '#aaaaaa',
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
padding: 16,
|
||||
textAlign: 'center'
|
||||
},
|
||||
input: {
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14
|
||||
},
|
||||
amountInput: {
|
||||
@@ -129,7 +136,7 @@ const walletStyle = StyleSheet.create({
|
||||
},
|
||||
warningText: {
|
||||
color: Colors.White,
|
||||
fontFamily: 'Metropolis-Regular',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
lineHeight: 24
|
||||
},
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
import { NavigationActions, StackActions } from 'react-navigation';
|
||||
import { buildURI } from 'lbry-redux';
|
||||
import Constants from '../constants';
|
||||
|
||||
function getRouteForSpecialUri(uri) {
|
||||
let targetRoute;
|
||||
const page = uri.substring(8).trim(); // 'lbry://?'.length == 8
|
||||
|
||||
switch (page) {
|
||||
case Constants.PAGE_REWARDS: targetRoute = 'Rewards'; break;
|
||||
case Constants.PAGE_SETTINGS: targetRoute = 'Settings'; break;
|
||||
case Constants.PAGE_TRENDING: targetRoute = 'TrendingStack'; break;
|
||||
case Constants.PAGE_WALLET: targetRoute = 'WalletStack'; break;
|
||||
default: targetRoute = 'DiscoverStack'; break;
|
||||
}
|
||||
|
||||
return targetRoute;
|
||||
}
|
||||
|
||||
export function dispatchNavigateToUri(dispatch, nav, uri) {
|
||||
if (uri.startsWith('lbry://?')) {
|
||||
dispatch(NavigationActions.navigate({ routeName: getRouteForSpecialUri(uri) }));
|
||||
return;
|
||||
}
|
||||
|
||||
const params = { uri };
|
||||
if (nav && nav.routes && nav.routes.length > 0 && 'Main' === nav.routes[0].routeName) {
|
||||
const mainRoute = nav.routes[0];
|
||||
@@ -48,6 +70,11 @@ export function navigateToUri(navigation, uri, additionalParams) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (uri.startsWith('lbry://?')) {
|
||||
navigation.navigate({ routeName: getRouteForSpecialUri(uri) });
|
||||
return;
|
||||
}
|
||||
|
||||
const params = Object.assign({ uri }, additionalParams);
|
||||
if ('File' === navigation.state.routeName) {
|
||||
const stackAction = StackActions.replace({ routeName: 'File', newKey: uri, params });
|
||||
@@ -57,3 +84,11 @@ export function navigateToUri(navigation, uri, additionalParams) {
|
||||
|
||||
navigation.navigate({ routeName: 'File', key: uri, params });
|
||||
}
|
||||
|
||||
export function uriFromFileInfo(fileInfo) {
|
||||
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
|
||||
const uriParams = {};
|
||||
uriParams.contentName = claimName || claimNameDownloaded;
|
||||
uriParams.claimId = claimId;
|
||||
return buildURI(uriParams);
|
||||
}
|
||||
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
|
||||
|
||||
# (list) Application requirements
|
||||
# comma seperated e.g. requirements = sqlite3,kivy
|
||||
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
|
||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.1#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
|
||||
|
||||
# (str) Custom source folders for requirements
|
||||
# Sets custom source for any requirements with recipes
|
||||
@@ -86,7 +86,7 @@ fullscreen = 0
|
||||
#android.presplash_color = #FFFFFF
|
||||
|
||||
# (list) Permissions
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
|
||||
|
||||
# (int) Android API to use
|
||||
android.api = 27
|
||||
@@ -98,16 +98,16 @@ android.minapi = 21
|
||||
android.sdk = 23
|
||||
|
||||
# (str) Android NDK version to use
|
||||
android.ndk = 13b
|
||||
#android.ndk = 13b
|
||||
|
||||
# (bool) Use --private data storage (True) or --dir public storage (False)
|
||||
#android.private_storage = True
|
||||
|
||||
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
|
||||
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
|
||||
|
||||
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.sdk_path = ~/Dev/SDKs/android
|
||||
#android.sdk_path = ~/.buildozer/android
|
||||
|
||||
# (str) ANT directory (if empty, it will be automatically downloaded.)
|
||||
#android.ant_path =
|
||||
|
||||
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
|
||||
|
||||
# (list) Application requirements
|
||||
# comma seperated e.g. requirements = sqlite3,kivy
|
||||
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
|
||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.1#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
|
||||
|
||||
# (str) Custom source folders for requirements
|
||||
# Sets custom source for any requirements with recipes
|
||||
@@ -86,7 +86,7 @@ fullscreen = 0
|
||||
#android.presplash_color = #FFFFFF
|
||||
|
||||
# (list) Permissions
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
|
||||
|
||||
# (int) Android API to use
|
||||
android.api = 27
|
||||
@@ -98,16 +98,16 @@ android.minapi = 21
|
||||
android.sdk = 23
|
||||
|
||||
# (str) Android NDK version to use
|
||||
android.ndk = 13b
|
||||
#android.ndk = 13b
|
||||
|
||||
# (bool) Use --private data storage (True) or --dir public storage (False)
|
||||
#android.private_storage = True
|
||||
|
||||
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
|
||||
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
|
||||
|
||||
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.sdk_path = ~/Dev/SDKs/android
|
||||
#android.sdk_path = ~/.buildozer/android
|
||||
|
||||
# (str) ANT directory (if empty, it will be automatically downloaded.)
|
||||
#android.ant_path =
|
||||
|
||||
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
|
||||
|
||||
# (list) Application requirements
|
||||
# comma seperated e.g. requirements = sqlite3,kivy
|
||||
requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.21.2#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite
|
||||
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, miniupnpc==1.9, gmpy, appdirs==1.4.3, argparse==1.2.1, docopt, base58==1.0.0, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2, pyyaml, qrcode==5.2.2, requests, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, txJSON-RPC, zope.interface==4.3.3, protobuf==3.6.1, keyring==10.4.0, txupnp, git+https://github.com/lbryio/lbryschema.git#egg=lbryschema, git+https://github.com/lbryio/lbry.git@v0.30.1#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git#egg=aioupnp, asn1crypto, treq==17.8.0, funcsigs, mock, pbr, pyopenssl, twisted, idna, Automat, hyperlink, PyHamcrest, netifaces, cryptography, aiohttp==3.4.4, multidict==4.5.2, idna_ssl==1.1.0, typing_extensions==3.6.5, yarl, chardet==3.0.4, async_timeout==3.0.1, aiorpcX==0.9.0, git+https://github.com/lbryio/torba#egg=torba, coincurve
|
||||
|
||||
# (str) Custom source folders for requirements
|
||||
# Sets custom source for any requirements with recipes
|
||||
@@ -86,7 +86,7 @@ fullscreen = 0
|
||||
#android.presplash_color = #FFFFFF
|
||||
|
||||
# (list) Permissions
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,RECEIVE_SMS,WRITE_EXTERNAL_STORAGE
|
||||
android.permissions = ACCESS_NETWORK_STATE,BLUETOOTH,INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
|
||||
|
||||
# (int) Android API to use
|
||||
android.api = 27
|
||||
@@ -98,16 +98,16 @@ android.minapi = 21
|
||||
android.sdk = 23
|
||||
|
||||
# (str) Android NDK version to use
|
||||
android.ndk = 13b
|
||||
#android.ndk = 13b
|
||||
|
||||
# (bool) Use --private data storage (True) or --dir public storage (False)
|
||||
#android.private_storage = True
|
||||
|
||||
# (str) Android NDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.ndk_path = ~/Dev/SDKs/android-ndk-r13b
|
||||
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
|
||||
|
||||
# (str) Android SDK directory (if empty, it will be automatically downloaded.)
|
||||
#android.sdk_path = ~/Dev/SDKs/android
|
||||
#android.sdk_path = ~/.buildozer/android
|
||||
|
||||
# (str) ANT directory (if empty, it will be automatically downloaded.)
|
||||
#android.ant_path =
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
|
||||
python-for-android is a packager for Python apps on Android. You can
|
||||
create your own Python distribution including the modules and
|
||||
dependencies you want, and bundle it in an APK along with your own
|
||||
dependencies you want and bundle it in an APK along with your own
|
||||
code.
|
||||
|
||||
Features include:
|
||||
@@ -13,7 +13,7 @@ Features include:
|
||||
- Automatic support for most pure Python modules, and built in support
|
||||
for many others, including popular dependencies such as numpy and
|
||||
sqlalchemy.
|
||||
- Multiple architecture targets, for APKs optimised on any given device.
|
||||
- Multiple architecture targets, for APKs optimized on any given device.
|
||||
|
||||
For documentation and support, see:
|
||||
|
||||
@@ -21,8 +21,8 @@ For documentation and support, see:
|
||||
- Mailing list: https://groups.google.com/forum/#!forum/kivy-users or
|
||||
https://groups.google.com/forum/#!forum/python-android.
|
||||
|
||||
In 2015 these tools were rewritten to provide a new, easier to use and
|
||||
extend interface. If you are looking for the old toolchain with
|
||||
In 2015, these tools were rewritten to provide a newer, easier to use and
|
||||
extended interface. If you are looking for the old toolchain with
|
||||
distribute.sh and build.py, it is still available at
|
||||
https://github.com/kivy/python-for-android/tree/old_toolchain, and
|
||||
issues and PRs relating to this branch are still accepted. However,
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ python-for-android
|
||||
|
||||
python-for-android is a packager for Python apps on Android. You can
|
||||
create your own Python distribution including the modules and
|
||||
dependencies you want, and bundle it in an APK along with your own code.
|
||||
dependencies you want and bundle it in an APK along with your own code.
|
||||
|
||||
Features include:
|
||||
|
||||
@@ -13,7 +13,7 @@ Features include:
|
||||
- Automatic support for most pure Python modules, and built in support
|
||||
for many others, including popular dependencies such as numpy and
|
||||
sqlalchemy.
|
||||
- Multiple architecture targets, for APKs optimised on any given
|
||||
- Multiple architecture targets, for APKs optimized on any given
|
||||
device.
|
||||
|
||||
For documentation and support, see:
|
||||
@@ -22,7 +22,7 @@ For documentation and support, see:
|
||||
- Mailing list: https://groups.google.com/forum/#!forum/kivy-users or
|
||||
https://groups.google.com/forum/#!forum/python-android.
|
||||
|
||||
In 2015 these tools were rewritten to provide a new, easier to use and
|
||||
In 2015, these tools were rewritten to provide a new, easier to use and
|
||||
extend interface. If you are looking for the old toolchain with
|
||||
distribute.sh and build.py, it is still available at
|
||||
https://github.com/kivy/python-for-android/tree/old\_toolchain, and
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from os.path import (join, dirname, isdir, splitext, basename, realpath)
|
||||
from os import listdir, mkdir
|
||||
from os.path import (join, dirname, isdir, splitext, basename)
|
||||
from os import listdir
|
||||
import sh
|
||||
import glob
|
||||
import json
|
||||
import importlib
|
||||
|
||||
from pythonforandroid.logger import (warning, shprint, info, logger,
|
||||
debug, error)
|
||||
debug)
|
||||
from pythonforandroid.util import (current_directory, ensure_dir,
|
||||
temp_directory, which)
|
||||
from pythonforandroid.recipe import Recipe
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
@@ -308,9 +308,9 @@ JNIEXPORT void JNICALL Java_org_kivy_android_PythonService_nativeStart(
|
||||
setenv("PYTHONHOME", python_home, 1);
|
||||
setenv("PYTHONPATH", python_path, 1);
|
||||
setenv("PYTHON_SERVICE_ARGUMENT", arg, 1);
|
||||
|
||||
|
||||
char ca_path[128];
|
||||
snprintf(ca_path, 128, "%s/lib/python2.7/site-packages/certifi/cacert.pem", python_home);
|
||||
snprintf(ca_path, 128, "%s/crystax_python/site-packages/certifi/cacert.pem", python_home);
|
||||
setenv("SSL_CERT_FILE", ca_path, 1);
|
||||
|
||||
char *argv[] = {"."};
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@ public class PythonUtil {
|
||||
"python2.7",
|
||||
"python3.5m",
|
||||
"python3.6m",
|
||||
"python3.7m",
|
||||
"main"
|
||||
};
|
||||
}
|
||||
@@ -36,7 +37,7 @@ public class PythonUtil {
|
||||
// If this is the last possible libpython
|
||||
// load, and it has failed, give a more
|
||||
// general error
|
||||
if (lib.startsWith("python3.6") && !foundPython) {
|
||||
if (lib.startsWith("python3.7") && !foundPython) {
|
||||
throw new java.lang.RuntimeException("Could not load any libpythonXXX.so");
|
||||
}
|
||||
continue;
|
||||
@@ -49,7 +50,7 @@ public class PythonUtil {
|
||||
} catch(UnsatisfiedLinkError e) {
|
||||
Log.v(TAG, "Failed to load _io.so or unicodedata.so...but that's okay.");
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// System.loadLibrary("ctypes");
|
||||
System.load(filesDirPath + "/lib/python2.7/lib-dynload/_ctypes.so");
|
||||
|
||||
@@ -140,6 +140,16 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
{% endif %}
|
||||
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="io.lbry.browser.fileprovider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/filepaths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -72,6 +72,13 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
compileSdkVersion = {{ android_api }}
|
||||
buildToolsVersion = '{{ build_tools_version }}'
|
||||
minSdkVersion = {{ args.min_sdk_version }}
|
||||
targetSdkVersion = {{ android_api }}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
afterEvaluate {project ->
|
||||
if (project.hasProperty("android")) {
|
||||
@@ -84,6 +91,7 @@ subprojects {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':react-native-exception-handler')
|
||||
compile project(':react-native-fast-image')
|
||||
compile project(':react-native-fetch-blob')
|
||||
compile project(':react-native-video')
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
rootProject.name = 'browser'
|
||||
include ':react-native-exception-handler'
|
||||
project(':react-native-exception-handler').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-exception-handler/android')
|
||||
include ':react-native-fast-image'
|
||||
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, './react/node_modules/react-native-fast-image/android')
|
||||
include ':react-native-fetch-blob'
|
||||
|
||||
@@ -396,6 +396,7 @@ class Context(object):
|
||||
'platforms',
|
||||
'android-{}'.format(self.android_min_api),
|
||||
platform_dir)
|
||||
|
||||
if not exists(self.ndk_platform):
|
||||
warning('ndk_platform doesn\'t exist: {}'.format(
|
||||
self.ndk_platform))
|
||||
@@ -529,7 +530,7 @@ class Context(object):
|
||||
if self.python_recipe.from_crystax:
|
||||
return self.get_python_install_dir()
|
||||
return join(self.get_python_install_dir(),
|
||||
'lib', 'python2.7', 'site-packages')
|
||||
'lib', 'python3.7', 'site-packages')
|
||||
|
||||
def get_libs_dir(self, arch):
|
||||
'''The libs dir for a given arch.'''
|
||||
@@ -634,7 +635,7 @@ def run_pymodules_install(ctx, modules):
|
||||
|
||||
venv = sh.Command(ctx.virtualenv)
|
||||
with current_directory(join(ctx.build_dir)):
|
||||
shprint(venv, '--python=python2.7', 'venv')
|
||||
shprint(venv, '--python=python3.7', 'venv')
|
||||
|
||||
info('Creating a requirements.txt file for the Python modules')
|
||||
with open('requirements.txt', 'w') as fileh:
|
||||
|
||||
@@ -41,7 +41,7 @@ class Distribution(object):
|
||||
return str(self)
|
||||
|
||||
@classmethod
|
||||
def get_distribution(cls, ctx, name=None, recipes=[],
|
||||
def get_distribution(cls, ctx, name=None, recipes=[],
|
||||
force_build=False,
|
||||
extra_dist_dirs=[],
|
||||
require_perfect_match=False):
|
||||
@@ -70,10 +70,6 @@ class Distribution(object):
|
||||
correct set of recipes.
|
||||
'''
|
||||
|
||||
# AND: This whole function is a bit hacky, it needs checking
|
||||
# properly to make sure it follows logically correct
|
||||
# possibilities
|
||||
|
||||
existing_dists = Distribution.get_distributions(ctx)
|
||||
|
||||
needs_build = True # whether the dist needs building, will be returned
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
@@ -16,7 +15,7 @@ if not six.PY3:
|
||||
stderr = codecs.getwriter('utf8')(stderr)
|
||||
|
||||
if six.PY2:
|
||||
unistr = unicode
|
||||
unistr = unicode # noqa F821
|
||||
else:
|
||||
unistr = str
|
||||
|
||||
@@ -43,6 +42,7 @@ class LevelDifferentiatingFormatter(logging.Formatter):
|
||||
Err_Style.RESET_ALL) + record.msg
|
||||
return super(LevelDifferentiatingFormatter, self).format(record)
|
||||
|
||||
|
||||
logger = logging.getLogger('p4a')
|
||||
if not hasattr(logger, 'touched'): # Necessary as importlib reloads
|
||||
# this, which would add a second
|
||||
@@ -72,6 +72,7 @@ class colorama_shim(object):
|
||||
def enable(self, enable):
|
||||
self._enabled = enable
|
||||
|
||||
|
||||
Out_Style = colorama_shim(Colo_Style)
|
||||
Out_Fore = colorama_shim(Colo_Fore)
|
||||
Err_Style = colorama_shim(Colo_Style)
|
||||
@@ -173,6 +174,8 @@ def shprint(command, *args, **kwargs):
|
||||
msg_width = columns - len(msg_hdr) - 1
|
||||
output = command(*args, **kwargs)
|
||||
for line in output:
|
||||
if isinstance(line, bytes):
|
||||
line = line.decode('utf-8', errors='replace')
|
||||
if logger.level > logging.DEBUG:
|
||||
msg = line.replace(
|
||||
'\n', ' ').replace(
|
||||
|
||||
@@ -18,6 +18,7 @@ def is_platform(platform):
|
||||
return uname()[0] == platform
|
||||
return is_x
|
||||
|
||||
|
||||
is_linux = is_platform('Linux')
|
||||
is_darwin = is_platform('Darwin')
|
||||
|
||||
@@ -30,31 +31,31 @@ def is_arch(xarch):
|
||||
|
||||
def is_api_gt(apiver):
|
||||
def is_x(recipe, **kwargs):
|
||||
return recipe.ctx.android_min_api > apiver
|
||||
return recipe.ctx.android_api > apiver
|
||||
return is_x
|
||||
|
||||
|
||||
def is_api_gte(apiver):
|
||||
def is_x(recipe, **kwargs):
|
||||
return recipe.ctx.android_min_api >= apiver
|
||||
return recipe.ctx.android_api >= apiver
|
||||
return is_x
|
||||
|
||||
|
||||
def is_api_lt(apiver):
|
||||
def is_x(recipe, **kwargs):
|
||||
return recipe.ctx.android_min_api < apiver
|
||||
return recipe.ctx.android_api < apiver
|
||||
return is_x
|
||||
|
||||
|
||||
def is_api_lte(apiver):
|
||||
def is_x(recipe, **kwargs):
|
||||
return recipe.ctx.android_min_api <= apiver
|
||||
return recipe.ctx.android_api <= apiver
|
||||
return is_x
|
||||
|
||||
|
||||
def is_api(apiver):
|
||||
def is_x(recipe, **kwargs):
|
||||
return recipe.ctx.android_min_api == apiver
|
||||
return recipe.ctx.android_api == apiver
|
||||
return is_x
|
||||
|
||||
|
||||
|
||||
+82
-111
@@ -1,11 +1,11 @@
|
||||
from os.path import join, dirname, isdir, exists, isfile, split, realpath, basename
|
||||
from os.path import basename, dirname, exists, isdir, isfile, join, realpath
|
||||
import importlib
|
||||
import zipfile
|
||||
import glob
|
||||
from shutil import rmtree
|
||||
from six import PY2, with_metaclass
|
||||
|
||||
import hashlib
|
||||
from re import match
|
||||
|
||||
import sh
|
||||
import shutil
|
||||
@@ -20,7 +20,6 @@ from pythonforandroid.logger import (logger, info, warning, error, debug, shprin
|
||||
from pythonforandroid.util import (urlretrieve, current_directory, ensure_dir)
|
||||
|
||||
# this import is necessary to keep imp.load_source from complaining :)
|
||||
import pythonforandroid.recipes
|
||||
|
||||
|
||||
if PY2:
|
||||
@@ -149,7 +148,7 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
|
||||
urlretrieve(url, target, report_hook)
|
||||
return target
|
||||
elif parsed_url.scheme in ('git', 'git+ssh', 'git+http', 'git+https'):
|
||||
elif parsed_url.scheme in ('git', 'git+file', 'git+ssh', 'git+http', 'git+https'):
|
||||
if isdir(target):
|
||||
with current_directory(target):
|
||||
shprint(sh.git, 'fetch', '--tags')
|
||||
@@ -168,43 +167,6 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
shprint(sh.git, 'submodule', 'update', '--recursive')
|
||||
return target
|
||||
|
||||
def extract_source(self, source, cwd):
|
||||
"""
|
||||
(internal) Extract the `source` into the directory `cwd`.
|
||||
"""
|
||||
if not source:
|
||||
return
|
||||
if isfile(source):
|
||||
info("Extract {} into {}".format(source, cwd))
|
||||
|
||||
if source.endswith(".tgz") or source.endswith(".tar.gz"):
|
||||
shprint(sh.tar, "-C", cwd, "-xvzf", source)
|
||||
|
||||
elif source.endswith(".tbz2") or source.endswith(".tar.bz2"):
|
||||
shprint(sh.tar, "-C", cwd, "-xvjf", source)
|
||||
|
||||
elif source.endswith(".zip"):
|
||||
zf = zipfile.ZipFile(source)
|
||||
zf.extractall(path=cwd)
|
||||
zf.close()
|
||||
|
||||
else:
|
||||
warning(
|
||||
"Error: cannot extract, unrecognized extension for {}"
|
||||
.format(source))
|
||||
raise Exception()
|
||||
|
||||
elif isdir(source):
|
||||
info("Copying {} into {}".format(source, cwd))
|
||||
|
||||
shprint(sh.cp, '-a', source, cwd)
|
||||
|
||||
else:
|
||||
warning(
|
||||
"Error: cannot extract or copy, unrecognized path {}"
|
||||
.format(source))
|
||||
raise Exception()
|
||||
|
||||
# def get_archive_rootdir(self, filename):
|
||||
# if filename.endswith(".tgz") or filename.endswith(".tar.gz") or \
|
||||
# filename.endswith(".tbz2") or filename.endswith(".tar.bz2"):
|
||||
@@ -225,19 +187,19 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
build directory.
|
||||
"""
|
||||
info("Applying patch {}".format(filename))
|
||||
filename = join(self.recipe_dir, filename)
|
||||
filename = join(self.get_recipe_dir(), filename)
|
||||
shprint(sh.patch, "-t", "-d", self.get_build_dir(arch), "-p1",
|
||||
"-i", filename, _tail=10)
|
||||
|
||||
def copy_file(self, filename, dest):
|
||||
info("Copy {} to {}".format(filename, dest))
|
||||
filename = join(self.recipe_dir, filename)
|
||||
filename = join(self.get_recipe_dir(), filename)
|
||||
dest = join(self.build_dir, dest)
|
||||
shutil.copy(filename, dest)
|
||||
|
||||
def append_file(self, filename, dest):
|
||||
info("Append {} to {}".format(filename, dest))
|
||||
filename = join(self.recipe_dir, filename)
|
||||
filename = join(self.get_recipe_dir(), filename)
|
||||
dest = join(self.build_dir, dest)
|
||||
with open(filename, "rb") as fd:
|
||||
data = fd.read()
|
||||
@@ -329,7 +291,14 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
return join(self.get_build_container_dir(arch), self.name)
|
||||
|
||||
def get_recipe_dir(self):
|
||||
# AND: Redundant, an equivalent property is already set by get_recipe
|
||||
"""
|
||||
Returns the local recipe directory or defaults to the core recipe
|
||||
directory.
|
||||
"""
|
||||
if self.ctx.local_recipes is not None:
|
||||
local_recipe_dir = join(self.ctx.local_recipes, self.name)
|
||||
if exists(local_recipe_dir):
|
||||
return local_recipe_dir
|
||||
return join(self.ctx.root_dir, 'recipes', self.name)
|
||||
|
||||
# Public Recipe API to be subclassed if needed
|
||||
@@ -349,6 +318,16 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
return
|
||||
|
||||
url = self.versioned_url
|
||||
ma = match(u'^(.+)#md5=([0-9a-f]{32})$', url)
|
||||
if ma: # fragmented URL?
|
||||
if self.md5sum:
|
||||
raise ValueError(
|
||||
('Received md5sum from both the {} recipe '
|
||||
'and its url').format(self.name))
|
||||
url = ma.group(1)
|
||||
expected_md5 = ma.group(2)
|
||||
else:
|
||||
expected_md5 = self.md5sum
|
||||
|
||||
shprint(sh.mkdir, '-p', join(self.ctx.packages_path, self.name))
|
||||
|
||||
@@ -356,44 +335,41 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
filename = shprint(sh.basename, url).stdout[:-1].decode('utf-8')
|
||||
|
||||
do_download = True
|
||||
|
||||
marker_filename = '.mark-{}'.format(filename)
|
||||
if exists(filename) and isfile(filename):
|
||||
if not exists(marker_filename):
|
||||
shprint(sh.rm, filename)
|
||||
elif self.md5sum:
|
||||
elif expected_md5:
|
||||
current_md5 = md5sum(filename)
|
||||
if current_md5 == self.md5sum:
|
||||
debug('Checked md5sum: downloaded expected content!')
|
||||
do_download = False
|
||||
else:
|
||||
info('Downloaded unexpected content...')
|
||||
if current_md5 != expected_md5:
|
||||
debug('* Generated md5sum: {}'.format(current_md5))
|
||||
debug('* Expected md5sum: {}'.format(self.md5sum))
|
||||
|
||||
debug('* Expected md5sum: {}'.format(expected_md5))
|
||||
raise ValueError(
|
||||
('Generated md5sum does not match expected md5sum '
|
||||
'for {} recipe').format(self.name))
|
||||
do_download = False
|
||||
else:
|
||||
do_download = False
|
||||
info('{} download already cached, skipping'
|
||||
.format(self.name))
|
||||
|
||||
# If we got this far, we will download
|
||||
if do_download:
|
||||
debug('Downloading {} from {}'.format(self.name, url))
|
||||
|
||||
shprint(sh.rm, '-f', marker_filename)
|
||||
self.download_file(url, filename)
|
||||
self.download_file(self.versioned_url, filename)
|
||||
shprint(sh.touch, marker_filename)
|
||||
|
||||
if exists(filename) and isfile(filename) and self.md5sum:
|
||||
if exists(filename) and isfile(filename) and expected_md5:
|
||||
current_md5 = md5sum(filename)
|
||||
if self.md5sum is not None:
|
||||
if current_md5 == self.md5sum:
|
||||
debug('Checked md5sum: downloaded expected content!')
|
||||
else:
|
||||
info('Downloaded unexpected content...')
|
||||
if expected_md5 is not None:
|
||||
if current_md5 != expected_md5:
|
||||
debug('* Generated md5sum: {}'.format(current_md5))
|
||||
debug('* Expected md5sum: {}'.format(self.md5sum))
|
||||
exit(1)
|
||||
debug('* Expected md5sum: {}'.format(expected_md5))
|
||||
raise ValueError(
|
||||
('Generated md5sum does not match expected md5sum '
|
||||
'for {} recipe').format(self.name))
|
||||
else:
|
||||
info('{} download already cached, skipping'.format(self.name))
|
||||
|
||||
def unpack(self, arch):
|
||||
info_main('Unpacking {} for {}'.format(self.name, arch))
|
||||
@@ -404,8 +380,6 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
if user_dir is not None:
|
||||
info('P4A_{}_DIR exists, symlinking instead'.format(
|
||||
self.name.lower()))
|
||||
# AND: Currently there's something wrong if I use ln, fix this
|
||||
warning('Using cp -a instead of symlink...fix this!')
|
||||
if exists(self.get_build_dir(arch)):
|
||||
return
|
||||
shprint(sh.rm, '-rf', build_dir)
|
||||
@@ -421,11 +395,13 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
|
||||
filename = shprint(
|
||||
sh.basename, self.versioned_url).stdout[:-1].decode('utf-8')
|
||||
ma = match(u'^(.+)#md5=([0-9a-f]{32})$', filename)
|
||||
if ma: # fragmented URL?
|
||||
filename = ma.group(1)
|
||||
|
||||
with current_directory(build_dir):
|
||||
directory_name = self.get_build_dir(arch)
|
||||
|
||||
# AND: Could use tito's get_archive_rootdir here
|
||||
if not exists(directory_name) or not isdir(directory_name):
|
||||
extraction_filename = join(
|
||||
self.ctx.packages_path, self.name, filename)
|
||||
@@ -638,7 +614,6 @@ class Recipe(with_metaclass(RecipeMeta)):
|
||||
if len(logger.handlers) > 1:
|
||||
logger.removeHandler(logger.handlers[1])
|
||||
recipe = mod.recipe
|
||||
recipe.recipe_dir = dirname(recipe_file)
|
||||
recipe.ctx = ctx
|
||||
cls.recipes[name] = recipe
|
||||
return recipe
|
||||
@@ -755,6 +730,10 @@ class PythonRecipe(Recipe):
|
||||
return join(
|
||||
Recipe.get_recipe('hostpython2', self.ctx).get_build_dir(),
|
||||
'hostpython')
|
||||
elif 'hostpython3crystax' in self.ctx.recipe_build_order:
|
||||
return join(
|
||||
Recipe.get_recipe('hostpython3crystax', self.ctx).get_build_dir(),
|
||||
'hostpython')
|
||||
else:
|
||||
python_recipe = self.ctx.python_recipe
|
||||
return 'python{}'.format(python_recipe.version)
|
||||
@@ -779,6 +758,34 @@ class PythonRecipe(Recipe):
|
||||
env['PYTHONNOUSERSITE'] = '1'
|
||||
|
||||
if not self.call_hostpython_via_targetpython:
|
||||
# sets python headers/linkages...depending on python's recipe
|
||||
python_version = self.ctx.python_recipe.version
|
||||
python_short_version = '.'.join(python_version.split('.')[:2])
|
||||
if 'python2' in self.ctx.recipe_build_order:
|
||||
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
|
||||
env['CFLAGS'] += ' -I' + env[
|
||||
'PYTHON_ROOT'] + '/include/python2.7'
|
||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
||||
' -lpython2.7'
|
||||
elif self.ctx.python_recipe.from_crystax:
|
||||
ndk_dir_python = join(self.ctx.ndk_dir, 'sources',
|
||||
'python', python_version)
|
||||
env['CFLAGS'] += ' -I{} '.format(
|
||||
join(ndk_dir_python, 'include',
|
||||
'python'))
|
||||
env['LDFLAGS'] += ' -L{}'.format(
|
||||
join(ndk_dir_python, 'libs', arch.arch))
|
||||
env['LDFLAGS'] += ' -lpython{}m'.format(python_short_version)
|
||||
elif 'python3' in self.ctx.recipe_build_order:
|
||||
# This headers are unused cause python3 recipe was removed
|
||||
# TODO: should be reviewed when python3 recipe added
|
||||
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
|
||||
env['CFLAGS'] += ' -I' + env[
|
||||
'PYTHON_ROOT'] + '/include/python{}m'.format(
|
||||
python_short_version)
|
||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
||||
' -lpython{}m'.format(
|
||||
python_short_version)
|
||||
hppath = []
|
||||
hppath.append(join(dirname(self.hostpython_location), 'Lib'))
|
||||
hppath.append(join(hppath[0], 'site-packages'))
|
||||
@@ -819,28 +826,12 @@ class PythonRecipe(Recipe):
|
||||
with current_directory(self.get_build_dir(arch.arch)):
|
||||
hostpython = sh.Command(self.hostpython_location)
|
||||
|
||||
|
||||
if self.ctx.python_recipe.from_crystax:
|
||||
# hppath = join(dirname(self.hostpython_location), 'Lib',
|
||||
# 'site-packages')
|
||||
hpenv = env.copy()
|
||||
# if 'PYTHONPATH' in hpenv:
|
||||
# hpenv['PYTHONPATH'] = ':'.join([hppath] +
|
||||
# hpenv['PYTHONPATH'].split(':'))
|
||||
# else:
|
||||
# hpenv['PYTHONPATH'] = hppath
|
||||
# hpenv['PYTHONHOME'] = self.ctx.get_python_install_dir()
|
||||
# shprint(hostpython, 'setup.py', 'build',
|
||||
# _env=hpenv, *self.setup_extra_args)
|
||||
shprint(hostpython, 'setup.py', 'install', '-O2',
|
||||
'--root={}'.format(self.ctx.get_python_install_dir()),
|
||||
'--install-lib=.',
|
||||
# AND: will need to unhardcode the 3.5 when adding 2.7 (and other crystax supported versions)
|
||||
_env=hpenv, *self.setup_extra_args)
|
||||
# site_packages_dir = self.ctx.get_site_packages_dir()
|
||||
# built_files = glob.glob(join('build', 'lib*', '*'))
|
||||
# for filen in built_files:
|
||||
# shprint(sh.cp, '-r', filen, join(site_packages_dir, split(filen)[-1]))
|
||||
elif self.call_hostpython_via_targetpython:
|
||||
shprint(hostpython, 'setup.py', 'install', '-O2', _env=env,
|
||||
*self.setup_extra_args)
|
||||
@@ -857,7 +848,6 @@ class PythonRecipe(Recipe):
|
||||
'--root={}'.format(self.ctx.get_python_install_dir()),
|
||||
'--install-lib=lib/python2.7/site-packages',
|
||||
_env=hpenv, *self.setup_extra_args)
|
||||
# AND: Hardcoded python2.7 needs fixing
|
||||
|
||||
# If asked, also install in the hostpython build dir
|
||||
if self.install_in_hostpython:
|
||||
@@ -917,6 +907,7 @@ class CompiledComponentsPythonRecipe(PythonRecipe):
|
||||
shprint(hostpython, 'setup.py', self.build_cmd, '-v', _env=env,
|
||||
*self.setup_extra_args)
|
||||
|
||||
|
||||
class CppCompiledComponentsPythonRecipe(CompiledComponentsPythonRecipe):
|
||||
""" Extensions that require the cxx-stl """
|
||||
call_hostpython_via_targetpython = False
|
||||
@@ -926,39 +917,34 @@ class CppCompiledComponentsPythonRecipe(CompiledComponentsPythonRecipe):
|
||||
keys = dict(
|
||||
ctx=self.ctx,
|
||||
arch=arch,
|
||||
arch_noeabi=arch.arch.replace('eabi', ''),
|
||||
pyroot=self.ctx.get_python_install_dir()
|
||||
arch_noeabi=arch.arch.replace('eabi', '')
|
||||
)
|
||||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
|
||||
env['CFLAGS'] += " -I{pyroot}/include/python2.7 " \
|
||||
" -I{ctx.ndk_dir}/platforms/android-{ctx.android_min_api}/arch-{arch_noeabi}/usr/include" \
|
||||
env['CFLAGS'] += " -I{ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}/usr/include" \
|
||||
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/include" \
|
||||
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/include".format(**keys)
|
||||
env['CXXFLAGS'] = env['CFLAGS'] + ' -frtti -fexceptions'
|
||||
env['LDFLAGS'] += " -L{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}" \
|
||||
" -lpython2.7" \
|
||||
" -lgnustl_shared".format(**keys)
|
||||
|
||||
|
||||
return env
|
||||
|
||||
def build_compiled_components(self,arch):
|
||||
def build_compiled_components(self, arch):
|
||||
super(CppCompiledComponentsPythonRecipe, self).build_compiled_components(arch)
|
||||
|
||||
# Copy libgnustl_shared.so
|
||||
with current_directory(self.get_build_dir(arch.arch)):
|
||||
sh.cp(
|
||||
"{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/libgnustl_shared.so".format(ctx=self.ctx,arch=arch),
|
||||
"{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/libgnustl_shared.so".format(ctx=self.ctx, arch=arch),
|
||||
self.ctx.get_libs_dir(arch.arch)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
class CythonRecipe(PythonRecipe):
|
||||
pre_build_ext = False
|
||||
cythonize = True
|
||||
cython_args = []
|
||||
call_hostpython_via_targetpython = False
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CythonRecipe, self).__init__(*args, **kwargs)
|
||||
@@ -1082,21 +1068,6 @@ class CythonRecipe(PythonRecipe):
|
||||
env['LIBLINK_PATH'] = liblink_path
|
||||
ensure_dir(liblink_path)
|
||||
|
||||
if self.ctx.python_recipe.from_crystax:
|
||||
env['CFLAGS'] = '-I{} '.format(
|
||||
join(self.ctx.ndk_dir, 'sources', 'python',
|
||||
self.ctx.python_recipe.version, 'include',
|
||||
'python')) + env['CFLAGS']
|
||||
|
||||
# Temporarily hardcode the -lpython3.x as this does not
|
||||
# get applied automatically in some environments. This
|
||||
# will need generalising, along with the other hardcoded
|
||||
# py3.5 references, to support other python3 or crystax
|
||||
# python versions.
|
||||
python3_version = self.ctx.python_recipe.version
|
||||
python3_version = '.'.join(python3_version.split('.')[:2])
|
||||
env['LDFLAGS'] = env['LDFLAGS'] + ' -lpython{}m'.format(python3_version)
|
||||
|
||||
return env
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class CryptographyRecipe(CompiledComponentsPythonRecipe):
|
||||
name = 'cryptography'
|
||||
version = '1.4'
|
||||
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
|
||||
depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'pyasn1', 'six', 'setuptools', 'enum34', 'ipaddress', 'cffi']
|
||||
depends = [('python2', 'python3crystax'), 'openssl', 'idna', 'pyasn1', 'six', 'setuptools', 'ipaddress', 'cffi']
|
||||
call_hostpython_via_targetpython = False
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
|
||||
Generated
-3
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
@@ -1,3 +1,83 @@
|
||||
from pythonforandroid.recipe import CythonRecipe, IncludedFilesBehaviour
|
||||
from pythonforandroid.util import current_directory
|
||||
from pythonforandroid.patching import will_build
|
||||
from pythonforandroid import logger
|
||||
|
||||
from os.path import join
|
||||
|
||||
|
||||
class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
|
||||
# name = 'android'
|
||||
version = None
|
||||
url = None
|
||||
|
||||
src_filename = 'src'
|
||||
|
||||
depends = [('pygame', 'sdl2', 'genericndkbuild'), ('python2', 'python3crystax')]
|
||||
|
||||
config_env = {}
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = super(AndroidRecipe, self).get_recipe_env(arch)
|
||||
env.update(self.config_env)
|
||||
return env
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
super(AndroidRecipe, self).prebuild_arch(arch)
|
||||
|
||||
tpxi = 'DEF {} = {}\n'
|
||||
th = '#define {} {}\n'
|
||||
tpy = '{} = {}\n'
|
||||
|
||||
bootstrap = bootstrap_name = self.ctx.bootstrap.name
|
||||
is_sdl2 = bootstrap_name in ('sdl2', 'sdl2python3', 'sdl2_gradle')
|
||||
is_pygame = bootstrap_name in ('pygame',)
|
||||
is_webview = bootstrap_name in ('webview',)
|
||||
is_lbry = bootstrap_name in ('lbry',)
|
||||
|
||||
if is_sdl2 or is_webview or is_lbry:
|
||||
if is_sdl2:
|
||||
bootstrap = 'sdl2'
|
||||
java_ns = 'org.kivy.android'
|
||||
jni_ns = 'org/kivy/android'
|
||||
elif is_pygame:
|
||||
java_ns = 'org.renpy.android'
|
||||
jni_ns = 'org/renpy/android'
|
||||
else:
|
||||
logger.error('unsupported bootstrap for android recipe: {}'.format(bootstrap_name))
|
||||
exit(1)
|
||||
|
||||
config = {
|
||||
'BOOTSTRAP': bootstrap,
|
||||
'IS_SDL2': int(is_sdl2),
|
||||
'IS_PYGAME': int(is_pygame),
|
||||
'PY2': int(will_build('python2')(self)),
|
||||
'JAVA_NAMESPACE': java_ns,
|
||||
'JNI_NAMESPACE': jni_ns,
|
||||
}
|
||||
|
||||
with current_directory(self.get_build_dir(arch.arch)):
|
||||
with open(join('android', 'config.pxi'), 'w') as fpxi:
|
||||
with open(join('android', 'config.h'), 'w') as fh:
|
||||
with open(join('android', 'config.py'), 'w') as fpy:
|
||||
for key, value in config.items():
|
||||
fpxi.write(tpxi.format(key, repr(value)))
|
||||
fpy.write(tpy.format(key, repr(value)))
|
||||
fh.write(th.format(key, value if isinstance(value, int)
|
||||
else '"{}"'.format(value)))
|
||||
self.config_env[key] = str(value)
|
||||
|
||||
if is_sdl2:
|
||||
fh.write('JNIEnv *SDL_AndroidGetJNIEnv(void);\n')
|
||||
fh.write('#define SDL_ANDROID_GetJNIEnv SDL_AndroidGetJNIEnv\n')
|
||||
elif is_pygame:
|
||||
fh.write('JNIEnv *SDL_ANDROID_GetJNIEnv(void);\n')
|
||||
|
||||
|
||||
recipe = AndroidRecipe()
|
||||
|
||||
|
||||
'''
|
||||
from pythonforandroid.recipe import CythonRecipe, Recipe, IncludedFilesBehaviour
|
||||
from pythonforandroid.util import current_directory
|
||||
from pythonforandroid.patching import will_build
|
||||
@@ -83,3 +163,4 @@ class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
|
||||
|
||||
|
||||
recipe = AndroidRecipe()
|
||||
'''
|
||||
@@ -6,7 +6,7 @@ lib_dict = {
|
||||
'pygame': ['sdl'],
|
||||
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf']
|
||||
}
|
||||
sdl_libs = lib_dict[os.environ['BOOTSTRAP']]
|
||||
sdl_libs = lib_dict[os.environ['BOOTSTRAP']] if os.environ['BOOTSTRAP'] == 'sdl2' else []
|
||||
|
||||
renpy_sound = Extension('android._android_sound',
|
||||
['android/_android_sound.c', 'android/_android_sound_jni.c', ],
|
||||
|
||||
+49
-27
@@ -1,36 +1,58 @@
|
||||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
|
||||
from os.path import join
|
||||
|
||||
import os
|
||||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
|
||||
|
||||
|
||||
class CffiRecipe(CompiledComponentsPythonRecipe):
|
||||
name = 'cffi'
|
||||
version = '1.11.0'
|
||||
#url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'
|
||||
url = 'https://pypi.python.org/packages/4e/32/4070bdf32812c89eb635c80880a5caa2e0189aa7999994c265577e5154f3/cffi-{version}.tar.gz'
|
||||
name = 'cffi'
|
||||
version = '1.11.5'
|
||||
url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'
|
||||
|
||||
depends = [('python2', 'python3crystax'), 'setuptools', 'pycparser', 'libffi']
|
||||
depends = [('python2', 'python3crystax'), 'setuptools', 'pycparser', 'libffi']
|
||||
|
||||
patches = ['disable-pkg-config.patch']
|
||||
patches = ['disable-pkg-config.patch']
|
||||
|
||||
# call_hostpython_via_targetpython = False
|
||||
install_in_hostpython = True
|
||||
# call_hostpython_via_targetpython = False
|
||||
install_in_hostpython = True
|
||||
|
||||
def get_recipe_env(self, arch=None):
|
||||
env = super(CffiRecipe, self).get_recipe_env(arch)
|
||||
libffi = self.get_recipe('libffi', self.ctx)
|
||||
includes = libffi.get_include_dirs(arch)
|
||||
env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes)
|
||||
env['LDFLAGS'] = (env.get('CFLAGS', '') + ' -L' +
|
||||
self.ctx.get_libs_dir(arch.arch))
|
||||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
|
||||
env['PYTHONPATH'] = ':'.join([self.ctx.get_site_packages_dir(), env['BUILDLIB_PATH']])
|
||||
|
||||
target_python = Recipe.get_recipe('python2', self.ctx).get_build_dir(arch.arch)
|
||||
env['PYTHON_ROOT'] = join(target_python, 'python-install')
|
||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7'
|
||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython2.7'
|
||||
|
||||
return env
|
||||
def get_hostrecipe_env(self, arch=None):
|
||||
# fixes missing ffi.h on some host systems (e.g. gentoo)
|
||||
env = super(CffiRecipe, self).get_hostrecipe_env(arch)
|
||||
libffi = self.get_recipe('libffi', self.ctx)
|
||||
includes = libffi.get_include_dirs(arch)
|
||||
env['FFI_INC'] = ",".join(includes)
|
||||
return env
|
||||
|
||||
def get_recipe_env(self, arch=None):
|
||||
env = super(CffiRecipe, self).get_recipe_env(arch)
|
||||
# sets linker to use the correct gcc (cross compiler)
|
||||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
|
||||
libffi = self.get_recipe('libffi', self.ctx)
|
||||
includes = libffi.get_include_dirs(arch)
|
||||
env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes)
|
||||
env['LDFLAGS'] = (env.get('CFLAGS', '') + ' -L' +
|
||||
self.ctx.get_libs_dir(arch.arch))
|
||||
env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch))
|
||||
|
||||
# required for libc and libdl/include
|
||||
ndk_dir = self.ctx.ndk_platform
|
||||
ndk_lib_dir = os.path.join(ndk_dir, 'usr', 'lib')
|
||||
env['LDFLAGS'] += ' -L{}'.format(ndk_lib_dir)
|
||||
env['LDFLAGS'] += " --sysroot={}".format(self.ctx.ndk_platform)
|
||||
env['PYTHONPATH'] = ':'.join([
|
||||
self.ctx.get_site_packages_dir(),
|
||||
env['BUILDLIB_PATH'],
|
||||
])
|
||||
if self.ctx.ndk == 'crystax':
|
||||
# only keeps major.minor (discards patch)
|
||||
python_version = self.ctx.python_recipe.version[0:3]
|
||||
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version)
|
||||
env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch))
|
||||
env['LDFLAGS'] += ' -lpython{}m'.format(python_version)
|
||||
# until `pythonforandroid/archs.py` gets merged upstream:
|
||||
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
|
||||
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)
|
||||
return env
|
||||
|
||||
|
||||
recipe = CffiRecipe()
|
||||
recipe = CffiRecipe()
|
||||
@@ -1,17 +1,18 @@
|
||||
diff -Naur cffi-1.4.2/setup.py b/setup.py
|
||||
--- cffi-1.4.2/setup.py 2015-12-21 12:09:47.000000000 -0600
|
||||
+++ b/setup.py 2015-12-23 10:20:40.590622524 -0600
|
||||
@@ -5,8 +5,7 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index c1db368..57311c3 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -5,8 +5,7 @@ import errno
|
||||
|
||||
sources = ['c/_cffi_backend.c']
|
||||
libraries = ['ffi']
|
||||
-include_dirs = ['/usr/include/ffi',
|
||||
- '/usr/include/libffi'] # may be changed by pkg-config
|
||||
+include_dirs = []
|
||||
+include_dirs = os.environ['FFI_INC'].split(",") if 'FFI_INC' in os.environ else []
|
||||
define_macros = []
|
||||
library_dirs = []
|
||||
extra_compile_args = []
|
||||
@@ -67,14 +66,7 @@
|
||||
@@ -67,14 +66,7 @@ def ask_supports_thread():
|
||||
sys.stderr.write("The above error message can be safely ignored\n")
|
||||
|
||||
def use_pkg_config():
|
||||
|
||||
Loaded 100 of 500 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user