fix merge conflict with master, prettier.

This commit is contained in:
Akinwale Ariwodola 2019-06-26 16:06:44 +01:00
commit def105c8d2
24 changed files with 480 additions and 277 deletions

View file

@ -1,6 +1,8 @@
## Linux Build Instructions ## Linux Build Instructions
This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04, but these instructions, or an analog of them, should work on most Linux or macOS environments. This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04, but these instructions, or an analog of them, should work on most Linux or macOS environments. An abridged version of these instructions is available at [QUICKSTART.md](QUICKSTART.md).
For instructions on how to build using a Docker image, please see [DOCKER.md](DOCKER.md).
### Install Prerequisites ### Install Prerequisites
@ -14,25 +16,31 @@ This app has currently only been built on Ubuntu 14.04, 16.04, 17.10, and 18.04,
* yarn * yarn
#### apt Packages #### apt Packages
Based on the quick-start instructions at http://buildozer.readthedocs.io/en/latest/installation.html Install all apt packages required by running the following commands:
``` ```
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
sudo apt-get update sudo apt-get -y update
sudo apt-get install autoconf autogen build-essential curl libtool libffi-dev python python-pip python-openssl python3.7 python3.7-dev python3-pip ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 sudo apt-get install -y curl ca-certificates software-properties-common gpg-agent wget
sudo add-apt-repository ppa:deadsnakes/ppa -y && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get -y update && apt-get -y install autoconf autogen automake libtool libffi-dev \
build-essential python3.7 python3.7-dev python3.7-venv python3-pip ccache git libncurses5:i386 libstdc++6:i386 \
libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev \
python-pip openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 yarn gawk nodejs npm
``` ```
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. Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package.
#### Install Cython and Setuptools #### Install Cython and Setuptools
``` ```
sudo pip install --upgrade cython==0.28.1 setuptools sudo -H pip install --upgrade cython==0.28.1 setuptools
``` ```
#### Install buildozer #### Install buildozer
A forked version of `buildozer` needs to be installed in order to copy the React Native UI source files into the corresponding directories. A forked version of `buildozer` needs to be installed in order to copy the React Native UI source files into the corresponding directories.
``` ```
git clone https://github.com/lbryio/buildozer.git git clone https://github.com/lbryio/buildozer.git
cd buildozer cd buildozer && python2.7 setup.py install && cd ..
sudo python2.7 setup.py install
``` ```
#### Create buildozer.spec #### Create buildozer.spec
@ -59,11 +67,18 @@ Assuming `lbry-android` as the current working folder:
| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder | | 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 | | 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 |
#### Create google-services.json
The `google-services.json` file is required for the build to be successful due to the Firebase implementation. Simply copy the provided sample file into the same destination folder.
```
cd lbry-android
cp p4a/pythonforandroid/bootstraps/lbry/templates/google-services.sample.json p4a/pythonforandroid/bootstraps/lbry/templates/google-services.json
```
#### Setup Android SDK for buildozer #### Setup Android SDK for buildozer
Download the Android SDK, platform and build tools archives. 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 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 API 28 platform - https://dl.google.com/android/repository/platform-28_r06.zip
* Android build tools 26.0.1 - https://dl.google.com/android/repository/build-tools_r26.0.1-linux. * Android build tools 26.0.2 - https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip
Create the `.buildozer` path (and the `android` sub-path) in your home folder if it doesn't already exist. Create the `.buildozer` path (and the `android` sub-path) in your home folder if it doesn't already exist.
`mkdir ~/.buildozer` `mkdir ~/.buildozer`
@ -75,17 +90,17 @@ tar -xf android-sdk_r23-linux.tgz ~/.buildozer/android/platform/
mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23 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. Extract the API 28 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 unzip ~/.buildozer/android/platform/platform-28_r06.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-27 mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-9 ~/.buildozer/android/platform/android-sdk-23/platforms/android-2
``` ```
Extract the build tools 26.0.1 build tools into the `android-sdk-23` folder and rename the extracted folder. Extract the build tools 26.0.2 build tools into the `android-sdk-23` folder and rename the extracted folder.
``` ```
mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools 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 unzip ~/.buildozer/android/platform/build-tools_r26.0.2-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1 mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.1.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.2
``` ```
Finally, create the Android SDK license file. This prevents being prompted to accept the SDK license during the build process. Finally, create the Android SDK license file. This prevents being prompted to accept the SDK license during the build process.
@ -97,14 +112,17 @@ echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platfo
#### Setup Crystax Android NDK for buildozer #### 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. * 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. * 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.
* Copy `mangled-glibc-syscalls.h` from the `scripts` folder in the cloned `lbry-android` repository to the `crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/` 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. * 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 #### Build and Deploy
Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface. Run `npm install -g react-native-cli` to install React Native CLI tools.
Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface, and then run `./bundle.sh`.
Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory. Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory.
To build and deploy, you can run `./deploy.sh`. This requires a connected device or running Android emulator. To build and deploy, you can run `./deploy.sh`. This requires a connected device or a running Android emulator.
#### Development #### Development
If you already installed `Android SDK` and `adb` If you already installed `Android SDK` and `adb`

69
DOCKER.md Normal file
View file

@ -0,0 +1,69 @@
# Introduction
The purpose of this guide is to help whomever is interested in running the LBRY Android application from scratch on their device, but they're main computing platform is not Linux but macOS.
## Estimated build time
25 - 40 minutes (depending on Internet connection speeds)
## What do you need?
* A computer running the latest OS
* Internet access to download modules and packages
* At least 15GB of free disk space
* Docker
* Patience
## Step 1/6
Create an application on [Firebase](https://console.firebase.google.com). In the **Android package name** field, input `io.lbry.browser`. Download the resulting `google-services.json` file and keep it safe, you'll be needing it later.
## Step 2/6
Start the docker application and paste all of these lines into Terminal:
```bash
docker run -it lbry/android-base:latest /bin/bash
wget "https://www.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz" -P ~/.buildozer/android/
tar -xvf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
git clone https://github.com/lbryio/lbry-android
cd lbry-android;cp buildozer.spec.sample buildozer.spec
cd app;npm i;cd ..
cp scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
cp scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
cd p4a/pythonforandroid/bootstraps/lbry/build/templates
apt install nano -y
```
## Step 3/6
Copy the contents of the `google-services.json` you downloaded earlier and paste them into Terminal after running the next command:
```bash
nano google-services.json
```
Type `^X` to save and exit.
## Step 4/6
Paste more lines and I guess check your email, this will take some time:
```bash
cd /lbry-android/app
./bundle.sh
cd ..
buildozer android debug
```
When the build is complete, you should see a message like: `[INFO]: # APK renamed to browser-0.7.3-debug.apk`. You will need this filename for the next step.
## Step 5/6
In a separate Terminal window:
```bash
docker ps # get container name
docker cp CONTAINER_NAME:/lbry-android/bin/STEP_4_FILENAME ~/Desktop/ # copies STEP_4_FILENAME to your Desktop
```
## Step 6/6
- Download [Android File Transfer](https://www.android.com/filetransfer) and install it.
- On your Android device, install [File Explorer](https://play.google.com/store/apps/details?id=com.mauriciotogneri.fileexplorer).
- Plug in your Android device and swipe down from the top into the "USB for file transfer" settings (or similar name on your device) and make sure "Transfer files" is selected.
- Open **Android File Transfer** on your computer and drag and drop `STEP_4_FILENAME` from your Desktop to the `Downloads` folder on the Android device.
- Back on the Android device, navigate to `STEP_4_FILENAME` in the `Downloads` folder and tap it to begin installation.

View file

@ -72,18 +72,20 @@ wget 'https://www.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -
``` ```
### Step 7 of 10 ### Step 7 of 10
Clone the lbryio/lbry-android git repository and create your buildozer.spec file. The provide buildozer.spec.sample contains defaults provided you followed steps 1 through 5 exactly as described. You can also customise the spec file if you want to. Clone the lbryio/lbry-android git repository and create your `buildozer.spec` and `google-services.json` files. The provided `buildozer.spec.sample` contains defaults provided you followed steps 1 through 5 exactly as described. You can also customise the spec file if you want to. The `google-services.sample.json` can be used to ensure the build completes successfully.
``` ```
git clone https://github.com/lbryio/lbry-android git clone https://github.com/lbryio/lbry-android
cd lbry-android cd lbry-android
cp buildozer.spec.sample buildozer.spec cp buildozer.spec.sample buildozer.spec
cp p4a/pythonforandroid/bootstraps/lbry/templates/google-services.sample.json p4a/pythonforandroid/bootstraps/lbry/templates/google-services.json
``` ```
### Step 8 of 10 ### Step 8 of 10
Install the npm packages required for the app's React Native code. Install the npm packages required for the app's React Native code, and create the React Native app bundle.
``` ```
cd app cd app
npm install npm install
./bundle.sh
cd .. cd ..
``` ```

2
app/package-lock.json generated
View file

@ -5553,7 +5553,7 @@
} }
}, },
"lbry-redux": { "lbry-redux": {
"version": "github:lbryio/lbry-redux#71586660b61c5e98c9f183e06d9c881e33a38e5e", "version": "github:lbryio/lbry-redux#b998577698d703714b0aa0c0e80c991902725a5c",
"from": "github:lbryio/lbry-redux#publishing", "from": "github:lbryio/lbry-redux#publishing",
"requires": { "requires": {
"proxy-polyfill": "0.1.6", "proxy-polyfill": "0.1.6",

View file

@ -21,4 +21,7 @@ const perform = dispatch => ({
fetchChannelListMine: () => dispatch(doFetchChannelListMine()), fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
}); });
export default connect(select, perform)(ChannelSelector); export default connect(
select,
perform
)(ChannelSelector);

View file

@ -34,19 +34,19 @@ export default class ChannelSelector extends React.PureComponent {
handleCreateCancel = () => { handleCreateCancel = () => {
this.setState({ showCreateChannel: false, newChannelName: '', newChannelBid: 0.1 }); this.setState({ showCreateChannel: false, newChannelName: '', newChannelBid: 0.1 });
} };
handlePickerValueChange = (itemValue, itemIndex) => { handlePickerValueChange = (itemValue, itemIndex) => {
if (Constants.ITEM_CREATE_A_CHANNEL === itemValue) { if (Constants.ITEM_CREATE_A_CHANNEL === itemValue) {
this.setState({ showCreateChannel: true }); this.setState({ showCreateChannel: true });
} else { } else {
this.handleCreateCancel(); this.handleCreateCancel();
this.handleChannelChange((Constants.ITEM_ANONYMOUS === itemValue) ? CLAIM_VALUES.CHANNEL_ANONYMOUS : itemValue); this.handleChannelChange(Constants.ITEM_ANONYMOUS === itemValue ? CLAIM_VALUES.CHANNEL_ANONYMOUS : itemValue);
} }
this.setState({ currentSelectedValue: itemValue }); this.setState({ currentSelectedValue: itemValue });
} };
handleChannelChange = (value) => { handleChannelChange = value => {
const { onChannelChange } = this.props; const { onChannelChange } = this.props;
const { newChannelBid } = this.state; const { newChannelBid } = this.state;
const channel = value; const channel = value;
@ -63,9 +63,9 @@ export default class ChannelSelector extends React.PureComponent {
onChannelChange(channel); onChannelChange(channel);
} }
} }
} };
handleNewChannelNameChange = (value) => { handleNewChannelNameChange = value => {
const { notify } = this.props; const { notify } = this.props;
let newChannelName = value; let newChannelName = value;
@ -83,9 +83,9 @@ export default class ChannelSelector extends React.PureComponent {
newChannelNameError, newChannelNameError,
newChannelName, newChannelName,
}); });
} };
handleNewChannelBidChange = (newChannelBid) => { handleNewChannelBidChange = newChannelBid => {
const { balance, notify } = this.props; const { balance, notify } = this.props;
let newChannelBidError; let newChannelBidError;
if (newChannelBid === 0) { if (newChannelBid === 0) {
@ -102,7 +102,7 @@ export default class ChannelSelector extends React.PureComponent {
newChannelBid, newChannelBid,
newChannelBidError, newChannelBidError,
}); });
} };
handleCreateChannelClick = () => { handleCreateChannelClick = () => {
const { balance, createChannel, onChannelChange, notify } = this.props; const { balance, createChannel, onChannelChange, notify } = this.props;
@ -114,11 +114,10 @@ export default class ChannelSelector extends React.PureComponent {
} }
if (this.channelExists(newChannelName)) { if (this.channelExists(newChannelName)) {
notify({ message: 'You have already created a channel with the same name.'}); notify({ message: 'You have already created a channel with the same name.' });
return; return;
} }
if (newChannelBid > balance) { if (newChannelBid > balance) {
notify({ message: 'Deposit cannot be higher than your balance' }); notify({ message: 'Deposit cannot be higher than your balance' });
return; return;
@ -136,7 +135,7 @@ export default class ChannelSelector extends React.PureComponent {
creatingChannel: false, creatingChannel: false,
addingChannel: false, addingChannel: false,
currentSelectedValue: channelName, currentSelectedValue: channelName,
showCreateChannel: false showCreateChannel: false,
}); });
if (onChannelChange) { if (onChannelChange) {
@ -147,31 +146,34 @@ export default class ChannelSelector extends React.PureComponent {
const failure = () => { const failure = () => {
notify({ message: 'Unable to create channel due to an internal error.' }); notify({ message: 'Unable to create channel due to an internal error.' });
this.setState({ this.setState({
creatingChannel: false creatingChannel: false,
}); });
}; };
createChannel(channelName, newChannelBid).then(success, failure); createChannel(channelName, newChannelBid).then(success, failure);
} };
channelExists = (name) => { channelExists = name => {
const { channels = [] } = this.props; const { channels = [] } = this.props;
for (let channel of channels) { for (let channel of channels) {
if (name.toLowerCase() === channel.name.toLowerCase() || `@${name}`.toLowerCase() === channel.name.toLowerCase()) { if (
name.toLowerCase() === channel.name.toLowerCase() ||
`@${name}`.toLowerCase() === channel.name.toLowerCase()
) {
return true; return true;
} }
} }
return false; return false;
} };
render() { render() {
const channel = this.state.addingChannel ? 'new' : this.props.channel; const channel = this.state.addingChannel ? 'new' : this.props.channel;
const { fetchingChannels, channels = [] } = this.props; const { fetchingChannels, channels = [] } = this.props;
console.log(channels); console.log(channels);
const pickerItems = [ const pickerItems = [{ name: Constants.ITEM_ANONYMOUS }, { name: Constants.ITEM_CREATE_A_CHANNEL }].concat(
{ name: Constants.ITEM_ANONYMOUS }, channels
{ name: Constants.ITEM_CREATE_A_CHANNEL }].concat(channels); );
const { const {
newChannelName, newChannelName,
newChannelNameError, newChannelNameError,
@ -188,47 +190,55 @@ export default class ChannelSelector extends React.PureComponent {
selectedValue={this.state.currentSelectedValue} selectedValue={this.state.currentSelectedValue}
style={channelSelectorStyle.channelPicker} style={channelSelectorStyle.channelPicker}
itemStyle={channelSelectorStyle.channelPickerItem} itemStyle={channelSelectorStyle.channelPickerItem}
onValueChange={this.handlePickerValueChange}> onValueChange={this.handlePickerValueChange}
{pickerItems.map(item => <Picker.Item label={item.name} value={item.name} key={item.name} />)} >
{pickerItems.map(item => (
<Picker.Item label={item.name} value={item.name} key={item.name} />
))}
</Picker> </Picker>
{this.state.showCreateChannel && ( {this.state.showCreateChannel && (
<View style={channelSelectorStyle.createChannelContainer}> <View style={channelSelectorStyle.createChannelContainer}>
<TextInput
style={channelSelectorStyle.channelNameInput}
value={this.state.newChannelName}
onChangeText={this.handleNewChannelNameChange}
placeholder={'Channel name'}
underlineColorAndroid={Colors.NextLbryGreen}
/>
<View style={channelSelectorStyle.bidRow}>
<Text style={channelSelectorStyle.label}>Deposit</Text>
<TextInput <TextInput
style={channelSelectorStyle.bidAmountInput} style={channelSelectorStyle.channelNameInput}
value={String(this.state.newChannelBid)} value={this.state.newChannelName}
onChangeText={this.handleNewChannelBidChange} onChangeText={this.handleNewChannelNameChange}
placeholder={'0.00'} placeholder={'Channel name'}
keyboardType={'number-pad'}
underlineColorAndroid={Colors.NextLbryGreen} underlineColorAndroid={Colors.NextLbryGreen}
/>
<View style={channelSelectorStyle.bidRow}>
<Text style={channelSelectorStyle.label}>Deposit</Text>
<TextInput
style={channelSelectorStyle.bidAmountInput}
value={String(this.state.newChannelBid)}
onChangeText={this.handleNewChannelBidChange}
placeholder={'0.00'}
keyboardType={'number-pad'}
underlineColorAndroid={Colors.NextLbryGreen}
/> />
<Text style={channelSelectorStyle.currency}>LBC</Text> <Text style={channelSelectorStyle.currency}>LBC</Text>
</View> </View>
<Text style={channelSelectorStyle.helpText}>This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.</Text> <Text style={channelSelectorStyle.helpText}>
This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.
</Text>
<View style={channelSelectorStyle.buttonContainer}> <View style={channelSelectorStyle.buttonContainer}>
{creatingChannel && <ActivityIndicator size={'small'} color={Colors.LbryGreen} />} {creatingChannel && <ActivityIndicator size={'small'} color={Colors.LbryGreen} />}
{!creatingChannel && {!creatingChannel && (
<View style={channelSelectorStyle.buttons}> <View style={channelSelectorStyle.buttons}>
<Link style={channelSelectorStyle.cancelLink} text="Cancel" onPress={this.handleCreateCancel} /> <Link style={channelSelectorStyle.cancelLink} text="Cancel" onPress={this.handleCreateCancel} />
<Button style={channelSelectorStyle.createButton} <Button
disabled={!(this.state.newChannelName.trim().length > 0 && this.state.newChannelBid > 0)} style={channelSelectorStyle.createButton}
text="Create" disabled={!(this.state.newChannelName.trim().length > 0 && this.state.newChannelBid > 0)}
onPress={this.handleCreateChannelClick} /> text="Create"
</View>} onPress={this.handleCreateChannelClick}
/>
</View>
)}
</View>
</View> </View>
</View>
)} )}
</View> </View>
); );
} }
} }

View file

@ -96,7 +96,8 @@ class FileItemMedia extends React.PureComponent {
)} )}
{!isResolvingUri && ( {!isResolvingUri && (
<Text style={fileItemMediaStyle.autothumbText}> <Text style={fileItemMediaStyle.autothumbText}>
{title && title.trim().length > 0 && {title &&
title.trim().length > 0 &&
title title
.replace(/\s+/g, '') .replace(/\s+/g, '')
.substring(0, Math.min(title.replace(' ', '').length, 5)) .substring(0, Math.min(title.replace(' ', '').length, 5))

View file

@ -1,9 +1,10 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { regexAddress } from 'lbry-redux'; import { regexAddress } from 'lbry-redux';
import { Alert, TextInput, Text, View } from 'react-native'; import { Alert, Clipboard, TextInput, Text, View } from 'react-native';
import Button from '../button'; import Button from 'component/button';
import walletStyle from '../../styles/wallet'; import Colors from 'styles/colors';
import walletStyle from 'styles/wallet';
type DraftTransaction = { type DraftTransaction = {
address: string, address: string,
@ -99,10 +100,16 @@ class WalletSend extends React.PureComponent<Props> {
onBlur={this.handleAddressInputBlur} onBlur={this.handleAddressInputBlur}
onSubmitEditing={this.handleAddressInputSubmit} onSubmitEditing={this.handleAddressInputSubmit}
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'} placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
underlineColorAndroid={Colors.NextLbryGreen}
value={this.state.address} value={this.state.address}
returnKeyType={'next'} returnKeyType={'next'}
style={[walletStyle.input, walletStyle.addressInput, walletStyle.bottomMarginMedium]} style={[walletStyle.input, walletStyle.addressInput, walletStyle.bottomMarginMedium]}
/> />
<Button
icon={'paste'}
style={walletStyle.button}
onPress={() => Clipboard.getString().then(value => this.setState({ address: value, addressChanged: true }))}
/>
</View> </View>
<Text style={walletStyle.text}>Amount</Text> <Text style={walletStyle.text}>Amount</Text>
<View style={walletStyle.row}> <View style={walletStyle.row}>
@ -112,6 +119,7 @@ class WalletSend extends React.PureComponent<Props> {
onChangeText={value => this.setState({ amount: value })} onChangeText={value => this.setState({ amount: value })}
keyboardType={'numeric'} keyboardType={'numeric'}
placeholder={'0'} placeholder={'0'}
underlineColorAndroid={Colors.NextLbryGreen}
value={this.state.amount} value={this.state.amount}
style={[walletStyle.input, walletStyle.amountInput]} style={[walletStyle.input, walletStyle.amountInput]}
/> />

View file

@ -865,14 +865,15 @@ class FilePage extends React.PureComponent {
/> />
</View> </View>
<View style={filePageStyle.subscriptionRow}> <View style={filePageStyle.subscriptionRow}>
{((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && ( {false &&
<Button ((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && (
style={[filePageStyle.actionButton, filePageStyle.saveFileButton]} <Button
theme={'light'} style={[filePageStyle.actionButton, filePageStyle.saveFileButton]}
icon={'download'} theme={'light'}
onPress={this.onSaveFilePressed} icon={'download'}
/> onPress={this.onSaveFilePressed}
)} />
)}
<Button <Button
style={[filePageStyle.actionButton, filePageStyle.tipButton]} style={[filePageStyle.actionButton, filePageStyle.tipButton]}
theme={'light'} theme={'light'}

View file

@ -43,7 +43,7 @@ class EmailCollectPage extends React.PureComponent {
const { onEmailViewLayout } = this.props; const { onEmailViewLayout } = this.props;
const content = ( const content = (
<View onLayout={onEmailViewLayout}> <View onLayout={() => onEmailViewLayout('collect')}>
<Text style={firstRunStyle.title}>Setup account</Text> <Text style={firstRunStyle.title}>Setup account</Text>
<TextInput <TextInput
style={firstRunStyle.emailInput} style={firstRunStyle.emailInput}

View file

@ -20,7 +20,7 @@ class EmailVerifyPage extends React.PureComponent {
const { onEmailViewLayout, email } = this.props; const { onEmailViewLayout, email } = this.props;
const content = ( const content = (
<View onLayout={onEmailViewLayout}> <View onLayout={() => onEmailViewLayout('verify')}>
<Text style={firstRunStyle.title}>Verify Email</Text> <Text style={firstRunStyle.title}>Verify Email</Text>
<Text style={firstRunStyle.paragraph}> <Text style={firstRunStyle.paragraph}>
An email has been sent to{' '} An email has been sent to{' '}

View file

@ -24,7 +24,9 @@ class FirstRunScreen extends React.PureComponent {
state = { state = {
currentPage: null, currentPage: null,
email: null, email: null,
emailCollectTracked: false,
emailSubmitted: false, emailSubmitted: false,
enterPasswordTracked: false,
isFirstRun: false, isFirstRun: false,
launchUrl: null, launchUrl: null,
showSkip: false, showSkip: false,
@ -44,7 +46,10 @@ class FirstRunScreen extends React.PureComponent {
if (NativeModules.FirstRun) { if (NativeModules.FirstRun) {
NativeModules.FirstRun.isFirstRun().then(firstRun => { NativeModules.FirstRun.isFirstRun().then(firstRun => {
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING);
this.setState({ isFirstRun: firstRun }); this.setState({ isFirstRun: firstRun });
if (firstRun) { if (firstRun) {
this.setState({ currentPage: FirstRunScreen.pages[0] }); this.setState({ currentPage: FirstRunScreen.pages[0] });
} else { } else {
@ -118,6 +123,7 @@ class FirstRunScreen extends React.PureComponent {
handleLeftButtonPressed = () => { handleLeftButtonPressed = () => {
// Go to setup account page when "Setup account" is pressed // Go to setup account page when "Setup account" is pressed
if (Constants.FIRST_RUN_PAGE_SKIP_ACCOUNT === this.state.currentPage) { if (Constants.FIRST_RUN_PAGE_SKIP_ACCOUNT === this.state.currentPage) {
this.setState({ emailCollectTracked: false }); // reset tracked flag
return this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_COLLECT); return this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_COLLECT);
} }
@ -128,6 +134,7 @@ class FirstRunScreen extends React.PureComponent {
// Go to email collection page if user cancels from email verification // Go to email collection page if user cancels from email verification
if (Constants.FIRST_RUN_PAGE_EMAIL_VERIFY === this.state.currentPage) { if (Constants.FIRST_RUN_PAGE_EMAIL_VERIFY === this.state.currentPage) {
this.setState({ emailCollectTracked: false }); // reset tracked flag
this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_COLLECT); this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_COLLECT);
} }
}; };
@ -228,10 +235,19 @@ class FirstRunScreen extends React.PureComponent {
} }
}; };
onEmailViewLayout = () => { onEmailViewLayout = phase => {
if ('collect' === phase) {
if (!this.state.emailCollectTracked) {
// we only want to track this once
this.setState({ emailCollectTracked: true }, () =>
NativeModules.Firebase.track('first_run_email_collect', null)
);
}
} else if ('verify' === phase) {
NativeModules.Firebase.track('first_run_email_verify', null);
}
this.setState({ showBottomContainer: true, showSkip: true }); this.setState({ showBottomContainer: true, showSkip: true });
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING);
}; };
onWalletPasswordChanged = password => { onWalletPasswordChanged = password => {
@ -239,6 +255,11 @@ class FirstRunScreen extends React.PureComponent {
}; };
onWalletViewLayout = () => { onWalletViewLayout = () => {
if (!this.state.enterPasswordTracked) {
this.setState({ enterPasswordTracked: true }, () =>
NativeModules.Firebase.track('first_run_enter_password', null)
);
}
this.setState({ showBottomContainer: true }); this.setState({ showBottomContainer: true });
}; };
@ -246,6 +267,11 @@ class FirstRunScreen extends React.PureComponent {
this.setState({ showBottomContainer: true }); this.setState({ showBottomContainer: true });
}; };
onSkipAccountViewLayout = () => {
NativeModules.Firebase.track('first_run_skip_account', null);
this.setState({ showBottomContainer: true });
};
onSkipSwitchChanged = checked => { onSkipSwitchChanged = checked => {
this.setState({ skipAccountConfirmed: checked }); this.setState({ skipAccountConfirmed: checked });
}; };

View file

@ -10,17 +10,10 @@ import {
Text, Text,
TextInput, TextInput,
TouchableOpacity, TouchableOpacity,
View View,
} from 'react-native'; } from 'react-native';
import { FlatGrid } from 'react-native-super-grid'; import { FlatGrid } from 'react-native-super-grid';
import { import { isNameValid, buildURI, regexInvalidURI, CLAIM_VALUES, LICENSES, THUMBNAIL_STATUSES } from 'lbry-redux';
isNameValid,
buildURI,
regexInvalidURI,
CLAIM_VALUES,
LICENSES,
THUMBNAIL_STATUSES
} from 'lbry-redux';
import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker'; import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker';
import { RNCamera } from 'react-native-camera'; import { RNCamera } from 'react-native-camera';
import Button from 'component/button'; import Button from 'component/button';
@ -53,7 +46,7 @@ class PublishPage extends React.PureComponent {
title: null, title: null,
name: null, name: null,
price: 0, price: 0,
uri: null uri: null,
}; };
didFocusListener; didFocusListener;
@ -72,7 +65,8 @@ class PublishPage extends React.PureComponent {
getNewUri(name, channel) { getNewUri(name, channel) {
const { resolveUri } = this.props; const { resolveUri } = this.props;
// If they are midway through a channel creation, treat it as anonymous until it completes // If they are midway through a channel creation, treat it as anonymous until it completes
const channelName = channel === CLAIM_VALUES.CHANNEL_ANONYMOUS || channel === CLAIM_VALUES.CHANNEL_NEW ? '' : channel; const channelName =
channel === CLAIM_VALUES.CHANNEL_ANONYMOUS || channel === CLAIM_VALUES.CHANNEL_NEW ? '' : channel;
// We are only going to store the full uri, but we need to resolve the uri with and without the channel name // We are only going to store the full uri, but we need to resolve the uri with and without the channel name
let uri; let uri;
@ -97,21 +91,11 @@ class PublishPage extends React.PureComponent {
handleModePressed = () => { handleModePressed = () => {
this.setState({ advancedMode: !this.state.advancedMode }); this.setState({ advancedMode: !this.state.advancedMode });
} };
handlePublishPressed = () => { handlePublishPressed = () => {
const { notify, publish } = this.props; const { notify, publish } = this.props;
const { const { bid, channelName, currentMedia, description, name, price, priceSet, title, uri } = this.state;
bid,
channelName,
currentMedia,
description,
name,
price,
priceSet,
title,
uri
} = this.state;
const thumbnail = null; const thumbnail = null;
if (!name) { if (!name) {
@ -134,13 +118,13 @@ class PublishPage extends React.PureComponent {
contentIsFree: !priceSet, contentIsFree: !priceSet,
fee: { currency: 'LBC', price }, fee: { currency: 'LBC', price },
uri: uri || undefined, uri: uri || undefined,
channel: (CLAIM_VALUES.CHANNEL_ANONYMOUS === channelName) ? undefined : channelName, channel: CLAIM_VALUES.CHANNEL_ANONYMOUS === channelName ? undefined : channelName,
isStillEditing: false, isStillEditing: false,
claim: null, claim: null,
}; };
this.setState({ currentPhase: Constants.PHASE_PUBLISH }, () => publish(publishParams)); this.setState({ currentPhase: Constants.PHASE_PUBLISH }, () => publish(publishParams));
} };
onComponentFocused = () => { onComponentFocused = () => {
const { pushDrawerStack, setPlayerVisible } = this.props; const { pushDrawerStack, setPlayerVisible } = this.props;
@ -175,13 +159,13 @@ class PublishPage extends React.PureComponent {
currentMedia: media, currentMedia: media,
title: media.name, title: media.name,
name: this.formatNameForTitle(media.name), name: this.formatNameForTitle(media.name),
currentPhase: Constants.PHASE_DETAILS currentPhase: Constants.PHASE_DETAILS,
}); });
} }
formatNameForTitle = (title) => { formatNameForTitle = title => {
return title.replace(regexInvalidURI, '-').toLowerCase(); return title.replace(regexInvalidURI, '-').toLowerCase();
} };
showSelector() { showSelector() {
this.setState({ this.setState({
@ -200,36 +184,39 @@ class PublishPage extends React.PureComponent {
title: null, title: null,
name: null, name: null,
price: 0, price: 0,
uri: null uri: null,
}); });
} }
handleUploadPressed = () => { handleUploadPressed = () => {
DocumentPicker.show({ DocumentPicker.show(
filetype: [DocumentPickerUtil.allFiles()] {
}, (error, res) => { filetype: [DocumentPickerUtil.allFiles()],
console.log(error); },
console.log('***') (error, res) => {
console.log(res); console.log(error);
if (!error) { console.log('***');
console.log(res); console.log(res);
if (!error) {
console.log(res);
}
} }
}); );
} };
handlePublishAgainPressed = () => { handlePublishAgainPressed = () => {
this.showSelector(); this.showSelector();
} };
handleBidChange = (bid) => { handleBidChange = bid => {
this.setState({ bid }); this.setState({ bid });
} };
handlePriceChange = (price) => { handlePriceChange = price => {
this.setState({ price }); this.setState({ price });
} };
handleNameChange = (name) => { handleNameChange = name => {
const { notify } = this.props; const { notify } = this.props;
this.setState({ name }); this.setState({ name });
if (!isNameValid(name, false)) { if (!isNameValid(name, false)) {
@ -239,20 +226,23 @@ class PublishPage extends React.PureComponent {
const uri = this.getNewUri(name, this.state.channelName); const uri = this.getNewUri(name, this.state.channelName);
this.setState({ uri }); this.setState({ uri });
} };
handleChannelChanged = (channel) => { handleChannelChanged = channel => {
this.setState({ channelName: channel }); this.setState({ channelName: channel });
} };
handleTitleChange = (title) => { handleTitleChange = title => {
this.setState({ this.setState(
title, {
name: this.formatNameForTitle(title) title,
}, () => { name: this.formatNameForTitle(title),
this.handleNameChange(this.state.name); },
}); () => {
} this.handleNameChange(this.state.name);
}
);
};
render() { render() {
const { navigation, notify } = this.props; const { navigation, notify } = this.props;
@ -300,28 +290,30 @@ class PublishPage extends React.PureComponent {
</View> </View>
</View> </View>
</View> </View>
{(!this.state.videos || !thumbnailPath) && {(!this.state.videos || !thumbnailPath) && (
<View style={publishStyle.loadingView}> <View style={publishStyle.loadingView}>
<ActivityIndicator size='large' color={Colors.LbryGreen} /> <ActivityIndicator size="large" color={Colors.LbryGreen} />
</View> </View>
} )}
{(this.state.videos && thumbnailPath) && {this.state.videos && thumbnailPath && (
<FlatGrid <FlatGrid
style={publishStyle.galleryGrid} style={publishStyle.galleryGrid}
itemDimension={134} itemDimension={134}
spacing={2} spacing={2}
items={this.state.videos} items={this.state.videos}
renderItem={({ item, index }) => { renderItem={({ item, index }) => {
return ( return (
<TouchableOpacity key={index} onPress={() => this.setCurrentMedia(item)}> <TouchableOpacity key={index} onPress={() => this.setCurrentMedia(item)}>
<FastImage <FastImage
style={publishStyle.galleryGridImage} style={publishStyle.galleryGridImage}
resizeMode={FastImage.resizeMode.cover} resizeMode={FastImage.resizeMode.cover}
source={{ uri: `file://${thumbnailPath}/${item.id}.png` }} /> source={{ uri: `file://${thumbnailPath}/${item.id}.png` }}
</TouchableOpacity> />
); </TouchableOpacity>
}} );
/>} }}
/>
)}
</View> </View>
); );
} else if (Constants.PHASE_DETAILS === this.state.currentPhase && this.state.currentMedia) { } else if (Constants.PHASE_DETAILS === this.state.currentPhase && this.state.currentMedia) {
@ -333,30 +325,30 @@ class PublishPage extends React.PureComponent {
style={publishStyle.mainThumbnail} style={publishStyle.mainThumbnail}
resizeMode={FastImage.resizeMode.contain} resizeMode={FastImage.resizeMode.contain}
source={{ uri: `file://${thumbnailPath}/${currentMedia.id}.png` }} source={{ uri: `file://${thumbnailPath}/${currentMedia.id}.png` }}
/> />
</View> </View>
<View style={publishStyle.card}> <View style={publishStyle.card}>
<Text style={publishStyle.cardTitle}>Title</Text> <Text style={publishStyle.cardTitle}>Title</Text>
<TextInput <TextInput
placeholder={"Title"} placeholder={'Title'}
style={publishStyle.inputText} style={publishStyle.inputText}
value={this.state.title} value={this.state.title}
numberOfLines={1} numberOfLines={1}
underlineColorAndroid={Colors.NextLbryGreen} underlineColorAndroid={Colors.NextLbryGreen}
onChangeText={this.state.handleTitleChange} onChangeText={this.state.handleTitleChange}
/> />
</View> </View>
<View style={publishStyle.card}> <View style={publishStyle.card}>
<Text style={publishStyle.cardTitle}>Description</Text> <Text style={publishStyle.cardTitle}>Description</Text>
<TextInput <TextInput
placeholder={"Description"} placeholder={'Description'}
style={publishStyle.inputText} style={publishStyle.inputText}
value={this.state.description} value={this.state.description}
underlineColorAndroid={Colors.NextLbryGreen} underlineColorAndroid={Colors.NextLbryGreen}
onChangeText={this.state.handleDescriptionChange} onChangeText={this.state.handleDescriptionChange}
/> />
</View> </View>
<View style={publishStyle.card}> <View style={publishStyle.card}>
@ -364,70 +356,85 @@ class PublishPage extends React.PureComponent {
<Text style={publishStyle.cardTitle}>Channel</Text> <Text style={publishStyle.cardTitle}>Channel</Text>
</View> </View>
<ChannelSelector onChannelChange={this.handleChannelChange} /> <ChannelSelector onChannelChange={this.handleChannelChange} />
</View> </View>
{this.state.advancedMode && {this.state.advancedMode && (
<View style={publishStyle.card}> <View style={publishStyle.card}>
<View style={publishStyle.titleRow}> <View style={publishStyle.titleRow}>
<Text style={publishStyle.cardTitle}>Price</Text> <Text style={publishStyle.cardTitle}>Price</Text>
<View style={publishStyle.switchTitleRow}> <View style={publishStyle.switchTitleRow}>
<Switch value={this.state.priceSet} onValueChange={value => this.setState({ priceSet: value }) } /> <Switch value={this.state.priceSet} onValueChange={value => this.setState({ priceSet: value })} />
</View>
</View> </View>
{!this.state.priceSet && (
<Text style={publishStyle.cardText}>Your content will be free. Press the toggle to set a price.</Text>
)}
{this.state.priceSet && (
<View style={[publishStyle.inputRow, publishStyle.priceInputRow]}>
<TextInput
placeholder={'0.00'}
keyboardType={'number-pad'}
style={publishStyle.priceInput}
underlineColorAndroid={Colors.NextLbryGreen}
numberOfLines={1}
value={String(this.state.price)}
onChangeText={this.handlePriceChange}
/>
<Text style={publishStyle.currency}>LBC</Text>
</View>
)}
</View> </View>
)}
{!this.state.priceSet && {this.state.advancedMode && (
<Text style={publishStyle.cardText}>Your content will be free. Press the toggle to set a price.</Text>} <View style={publishStyle.card}>
<Text style={publishStyle.cardTitle}>Content Address</Text>
<Text style={publishStyle.helpText}>
The address where people can find your content (ex. lbry://myvideo)
</Text>
{this.state.priceSet &&
<View style={[publishStyle.inputRow, publishStyle.priceInputRow]}>
<TextInput <TextInput
placeholder={"0.00"} placeholder={'lbry://'}
keyboardType={'number-pad'} style={publishStyle.inputText}
style={publishStyle.priceInput}
underlineColorAndroid={Colors.NextLbryGreen} underlineColorAndroid={Colors.NextLbryGreen}
numberOfLines={1} numberOfLines={1}
value={String(this.state.price)} value={this.state.name}
onChangeText={this.handlePriceChange} onChangeText={this.handleNameChange}
/> />
<Text style={publishStyle.currency}>LBC</Text> <View style={publishStyle.inputRow}>
</View>} <TextInput
</View>} placeholder={'0.00'}
style={publishStyle.priceInput}
{this.state.advancedMode && underlineColorAndroid={Colors.NextLbryGreen}
<View style={publishStyle.card}> numberOfLines={1}
<Text style={publishStyle.cardTitle}>Content Address</Text> keyboardType={'numeric'}
<Text style={publishStyle.helpText}>The address where people can find your content (ex. lbry://myvideo)</Text> value={String(this.state.bid)}
onChangeText={this.handleBidChange}
<TextInput />
placeholder={"lbry://"} <Text style={publishStyle.currency}>LBC</Text>
style={publishStyle.inputText} </View>
underlineColorAndroid={Colors.NextLbryGreen} <Text style={publishStyle.helpText}>
numberOfLines={1} This LBC remains yours and the deposit can be undone at any time.
value={this.state.name} </Text>
onChangeText={this.handleNameChange}
/>
<View style={publishStyle.inputRow}>
<TextInput
placeholder={"0.00"}
style={publishStyle.priceInput}
underlineColorAndroid={Colors.NextLbryGreen}
numberOfLines={1}
keyboardType={'numeric'}
value={String(this.state.bid)}
onChangeText={this.handleBidChange} />
<Text style={publishStyle.currency}>LBC</Text>
</View> </View>
<Text style={publishStyle.helpText}>This LBC remains yours and the deposit can be undone at any time.</Text> )}
</View>}
<View style={publishStyle.actionButtons}> <View style={publishStyle.actionButtons}>
<Link style={publishStyle.cancelLink} text="Cancel" onPress={() => this.setState({ currentPhase: Constants.PHASE_SELECTOR })} /> <Link
style={publishStyle.cancelLink}
text="Cancel"
onPress={() => this.setState({ currentPhase: Constants.PHASE_SELECTOR })}
/>
<View style={publishStyle.rightActionButtons}> <View style={publishStyle.rightActionButtons}>
<Button style={publishStyle.modeButton} <Button
style={publishStyle.modeButton}
text={this.state.advancedMode ? 'Simple' : 'Advanced'} text={this.state.advancedMode ? 'Simple' : 'Advanced'}
onPress={this.handleModePressed} /> onPress={this.handleModePressed}
/>
<Button style={publishStyle.publishButton} text="Publish" onPress={this.handlePublishPressed} /> <Button style={publishStyle.publishButton} text="Publish" onPress={this.handlePublishPressed} />
</View> </View>
</View> </View>
@ -441,11 +448,19 @@ class PublishPage extends React.PureComponent {
<Text style={publishStyle.successText}>Congratulations! Your content was successfully uploaded.</Text> <Text style={publishStyle.successText}>Congratulations! Your content was successfully uploaded.</Text>
<View style={publishStyle.successRow}> <View style={publishStyle.successRow}>
<Link style={publishStyle.successUrl} text={this.state.uri} href={this.state.uri} /> <Link style={publishStyle.successUrl} text={this.state.uri} href={this.state.uri} />
<TouchableOpacity onPress={() => { Clipboard.setString(this.state.uri); notify({ message: 'Copied.' }); }}> <TouchableOpacity
onPress={() => {
Clipboard.setString(this.state.uri);
notify({ message: 'Copied.' });
}}
>
<Icon name="clipboard" size={24} color={Colors.LbryGreen} /> <Icon name="clipboard" size={24} color={Colors.LbryGreen} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<Text style={publishStyle.successText}>Your content will be live in a few minutes. In the mean time, feel free to publish more content or explore the app.</Text> <Text style={publishStyle.successText}>
Your content will be live in a few minutes. In the mean time, feel free to publish more content or explore
the app.
</Text>
</View> </View>
<View style={publishStyle.actionButtons}> <View style={publishStyle.actionButtons}>
<Button style={publishStyle.publishButton} text="Publish again" onPress={this.handlePublishAgainPressed} /> <Button style={publishStyle.publishButton} text="Publish again" onPress={this.handlePublishAgainPressed} />
@ -458,7 +473,9 @@ class PublishPage extends React.PureComponent {
<View style={publishStyle.container}> <View style={publishStyle.container}>
<UriBar navigation={navigation} /> <UriBar navigation={navigation} />
{content} {content}
{(false && Constants.PHASE_SELECTOR !== this.state.currentPhase) && <FloatingWalletBalance navigation={navigation} />} {false && Constants.PHASE_SELECTOR !== this.state.currentPhase && (
<FloatingWalletBalance navigation={navigation} />
)}
</View> </View>
); );
} }

View file

@ -214,7 +214,7 @@ class SplashScreen extends React.PureComponent {
setTimeout(() => { setTimeout(() => {
this.updateStatus(); this.updateStatus();
}, 500); }, 1000);
} }
componentDidMount() { componentDidMount() {

View file

@ -101,7 +101,11 @@ class WalletPage extends React.PureComponent {
return ( return (
<View style={walletStyle.container}> <View style={walletStyle.container}>
<UriBar navigation={navigation} /> <UriBar navigation={navigation} />
<ScrollView style={walletStyle.scrollContainer} keyboardShouldPersistTaps={'handled'}> <ScrollView
style={walletStyle.scrollContainer}
keyboardShouldPersistTaps={'handled'}
removeClippedSubviews={false}
>
<WalletSyncDriver navigation={navigation} /> <WalletSyncDriver navigation={navigation} />
{!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />} {!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />}
<WalletBalance /> <WalletBalance />

View file

@ -3,60 +3,60 @@ import Colors from './colors';
const channelSelectorStyle = StyleSheet.create({ const channelSelectorStyle = StyleSheet.create({
container: { container: {
flex: 1 flex: 1,
}, },
channelPicker: { channelPicker: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16, fontSize: 16,
height: 52, height: 52,
width: '100%' width: '100%',
}, },
bidRow: { bidRow: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center' alignItems: 'center',
}, },
label: { label: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16 fontSize: 16,
}, },
channelNameInput: { channelNameInput: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16 fontSize: 16,
}, },
bidAmountInput: { bidAmountInput: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16, fontSize: 16,
marginLeft: 16, marginLeft: 16,
textAlign: 'right', textAlign: 'right',
width: 80 width: 80,
}, },
helpText: { helpText: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 12 fontSize: 12,
}, },
createChannelContainer: { createChannelContainer: {
flex: 1, flex: 1,
marginLeft: 8, marginLeft: 8,
marginRight: 8 marginRight: 8,
}, },
buttonContainer: { buttonContainer: {
flex: 1, flex: 1,
marginTop: 16, marginTop: 16,
justifyContent: 'flex-end' justifyContent: 'flex-end',
}, },
buttons: { buttons: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'flex-end' justifyContent: 'flex-end',
}, },
cancelLink: { cancelLink: {
marginRight: 16 marginRight: 16,
}, },
createButton: { createButton: {
backgroundColor: Colors.NextLbryGreen backgroundColor: Colors.NextLbryGreen,
} },
}); });
export default channelSelectorStyle; export default channelSelectorStyle;

View file

@ -10,18 +10,18 @@ const publishStyle = StyleSheet.create({
flex: 1, flex: 1,
marginTop: 62, marginTop: 62,
paddingTop: 2, paddingTop: 2,
backgroundColor: Colors.DarkGrey backgroundColor: Colors.DarkGrey,
}, },
galleryGrid: { galleryGrid: {
flex: 1 flex: 1,
}, },
galleryGridImage: { galleryGridImage: {
width: 134, width: 134,
height: 90 height: 90,
}, },
inputText: { inputText: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16 fontSize: 16,
}, },
card: { card: {
backgroundColor: Colors.White, backgroundColor: Colors.White,
@ -38,53 +38,53 @@ const publishStyle = StyleSheet.create({
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between' justifyContent: 'space-between',
}, },
rightActionButtons: { rightActionButtons: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center' alignItems: 'center',
}, },
modeButton: { modeButton: {
backgroundColor: Colors.NextLbryGreen, backgroundColor: Colors.NextLbryGreen,
alignSelf: 'flex-end', alignSelf: 'flex-end',
marginRight: 20 marginRight: 20,
}, },
publishButton: { publishButton: {
backgroundColor: Colors.LbryGreen, backgroundColor: Colors.LbryGreen,
alignSelf: 'flex-end' alignSelf: 'flex-end',
}, },
cardTitle: { cardTitle: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 20, fontSize: 20,
marginBottom: 8 marginBottom: 8,
}, },
actionsView: { actionsView: {
width: '100%', width: '100%',
height: 240, height: 240,
overflow: 'hidden' overflow: 'hidden',
}, },
record: { record: {
backgroundColor: 'transparent', backgroundColor: 'transparent',
flex: 0.5, flex: 0.5,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center' alignItems: 'center',
}, },
subActions: { subActions: {
flex: 0.5, flex: 0.5,
borderLeftWidth: 2, borderLeftWidth: 2,
borderLeftColor: Colors.DarkerGrey borderLeftColor: Colors.DarkerGrey,
}, },
actionText: { actionText: {
color: Colors.White, color: Colors.White,
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 14, fontSize: 14,
marginTop: 8 marginTop: 8,
}, },
photo: { photo: {
backgroundColor: 'transparent', backgroundColor: 'transparent',
height: 120, height: 120,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center' alignItems: 'center',
}, },
upload: { upload: {
backgroundColor: Colors.Black, backgroundColor: Colors.Black,
@ -92,65 +92,65 @@ const publishStyle = StyleSheet.create({
borderTopWidth: 2, borderTopWidth: 2,
borderTopColor: Colors.DarkerGrey, borderTopColor: Colors.DarkerGrey,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center' alignItems: 'center',
}, },
publishDetails: { publishDetails: {
marginTop: 60 marginTop: 60,
}, },
mainThumbnailContainer: { mainThumbnailContainer: {
backgroundColor: Colors.Black, backgroundColor: Colors.Black,
width: '100%', width: '100%',
height: 240 height: 240,
}, },
mainThumbnail: { mainThumbnail: {
height: 240 height: 240,
}, },
inputRow: { inputRow: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center' alignItems: 'center',
}, },
priceInput: { priceInput: {
width: 80, width: 80,
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16 fontSize: 16,
}, },
currency: { currency: {
fontFamily: 'Inter-UI-Regular' fontFamily: 'Inter-UI-Regular',
}, },
cardRow: { cardRow: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'flex-start' alignItems: 'flex-start',
}, },
switchRow: { switchRow: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
marginLeft: 24 marginLeft: 24,
}, },
switchTitleRow: { switchTitleRow: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
marginLeft: 24, marginLeft: 24,
marginTop: -10 marginTop: -10,
}, },
switchText: { switchText: {
marginRight: 4, marginRight: 4,
fontSize: 16 fontSize: 16,
}, },
loadingView: { loadingView: {
flex: 1, flex: 1,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center' justifyContent: 'center',
}, },
titleRow: { titleRow: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between' justifyContent: 'space-between',
}, },
cardText: { cardText: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 14 fontSize: 14,
}, },
cameraPreview: { cameraPreview: {
position: 'absolute', position: 'absolute',
@ -158,7 +158,7 @@ const publishStyle = StyleSheet.create({
right: 0, right: 0,
top: 0, top: 0,
bottom: 0, bottom: 0,
height: 240 height: 240,
}, },
actionsSubView: { actionsSubView: {
flex: 1, flex: 1,
@ -167,34 +167,34 @@ const publishStyle = StyleSheet.create({
left: 0, left: 0,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0,
}, },
successContainer: { successContainer: {
padding: 16 padding: 16,
}, },
successTitle: { successTitle: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 28, fontSize: 28,
marginBottom: 16 marginBottom: 16,
}, },
successText: { successText: {
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
fontSize: 16, fontSize: 16,
marginBottom: 16, marginBottom: 16,
lineHeight: 20 lineHeight: 20,
}, },
successRow: { successRow: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
marginBottom: 16 marginBottom: 16,
}, },
successUrl: { successUrl: {
fontSize: 32, fontSize: 32,
fontFamily: 'Inter-UI-Regular', fontFamily: 'Inter-UI-Regular',
color: Colors.NextLbryGreen, color: Colors.NextLbryGreen,
marginRight: 16 marginRight: 16,
} },
}); });
export default publishStyle; export default publishStyle;

View file

@ -138,6 +138,7 @@ const walletStyle = StyleSheet.create({
flex: 1, flex: 1,
fontSize: 16, fontSize: 16,
letterSpacing: 1.5, letterSpacing: 1.5,
marginRight: 8,
}, },
warning: { warning: {
backgroundColor: Colors.Orange, backgroundColor: Colors.Orange,

View file

@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements # (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy # comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.2#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@397ebe842856a4297bea5281206f9fa40a84699c#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@v0.5.4a0#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir
# (str) Custom source folders for requirements # (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes # Sets custom source for any requirements with recipes

View file

@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements # (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy # comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.2#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@397ebe842856a4297bea5281206f9fa40a84699c#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@v0.5.4a0#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir
# (str) Custom source folders for requirements # (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes # Sets custom source for any requirements with recipes

View file

@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements # (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy # comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.2#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@397ebe842856a4297bea5281206f9fa40a84699c#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, git+https://github.com/lbryio/lbry.git@v0.37.4#egg=lbrynet, git+https://github.com/lbryio/aioupnp.git@a404269d91cff5358bcffb8067b0fd1d9c6842d3#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, git+https://github.com/lbryio/torba@v0.5.4a0#egg=torba, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir
# (str) Custom source folders for requirements # (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes # Sets custom source for any requirements with recipes

View file

@ -0,0 +1,40 @@
{
"project_info": {
"project_number": "861521963586",
"firebase_url": "https://lbry-mobile-builds-debug.firebaseio.com",
"project_id": "lbry-mobile-builds-debug",
"storage_bucket": "lbry-mobile-builds-debug.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:861521963586:android:592958d248940ab2",
"android_client_info": {
"package_name": "io.lbry.browser"
}
},
"oauth_client": [
{
"client_id": "861521963586-60cmvg5nmnrqkrc11a7bpmpv5ra2d50q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC7A3BYcIdZP9-Q-VNHoexYJWgZA7WzsPI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "861521963586-60cmvg5nmnrqkrc11a7bpmpv5ra2d50q.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

3
package-lock.json generated Normal file
View file

@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}

View file

@ -1,4 +1,4 @@
__version__ = "0.7.3" __version__ = "0.7.5"
class ServiceApp(App): class ServiceApp(App):
def build(self): def build(self):