Compare commits

...
Author SHA1 Message Date
Akinwale Ariwodola daa4f5c5dc enable pressing the entire media container area to play or download content 2019-12-13 10:29:07 +01:00
Akinwale Ariwodola 6ae9632fb9 fixes before release (#95)
* fixes before next release
* make channel sort by selection component-specific
2019-12-11 09:06:10 +01:00
Akinwale Ariwodola c33cf47397 add Arabic language setting 2019-12-06 19:33:26 +01:00
Akinwale Ariwodola e0fa80f640 i18n reward intro driver title 2019-12-06 19:21:06 +01:00
Akinwale Ariwodola 0e65d526d8 fix header sync progress value 2019-12-06 19:13:47 +01:00
Akinwale Ariwodola 86e5bcf7e0 app strings 2019-12-06 17:55:10 +01:00
Akinwale Ariwodola e9858f85e8 Merge pull request #94 from lbryio/i18n-strings
i18n more strings
2019-12-06 17:54:28 +01:00
13 changed files with 433 additions and 100 deletions

No files matched your search

+242
View File
@@ -0,0 +1,242 @@
{
"Waiting for name resolution": "Waiting for name resolution",
"Starting up": "Starting up",
"Connecting": "Connecting",
"Unlocking account": "Unlocking account",
"Decrypting wallet": "Decrypting wallet",
"Your Tags": "Your Tags",
"Customize": "Customize",
"Find content": "Find content",
"Your content": "Your content",
"Wallet": "Wallet",
"All tags you follow": "All tags you follow",
"FREE": "FREE",
"Delete": "Delete",
"Share": "Share",
"Tip": "Tip",
"Report": "Report",
"View": "View",
"Follow": "Follow",
"Fetching cost info...": "Fetching cost info...",
"Play": "Play",
"Channels you follow": "Channels you follow",
"Suggested": "Suggested",
"ALL": "ALL",
"No content to display at this time. Please check back later.": "No content to display at this time. Please check back later.",
"All Content": "All Content",
"Create a channel": "Create a channel",
"Title": "Title",
"Channel": "Channel",
"Deposit": "Deposit",
"This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.": "This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.",
"Show optional fields": "Show optional fields",
"Cancel": "Cancel",
"Create": "Create",
"Description": "Description",
"Website": "Website",
"Email": "Email",
"Tags": "Tags",
"Hide optional fields": "Hide optional fields",
"Mature tags": "Mature tags",
"Other": "Other",
"Publish something new": "Publish something new",
"Record": "Record",
"Take a photo": "Take a photo",
"Upload a file": "Upload a file",
"Please wait while we load your videos...": "Please wait while we load your videos...",
"Price": "Price",
"Your content will be free. Press the toggle to set a price.": "Your content will be free. Press the toggle to set a price.",
"Content address": "Content address",
"The address where people can find your content (ex. lbry://myvideo). ": "The address where people can find your content (ex. lbry://myvideo). ",
"This LBC remains yours and the deposit can be undone at any time.": "This LBC remains yours and the deposit can be undone at any time.",
"Show extra fields": "Show extra fields",
"Publish": "Publish",
"Additional Options": "Additional Options",
"Language": "Language",
"License": "License",
"None": "None",
"Public Domain": "Public Domain",
"Copyrighted...": "Copyrighted...",
"Other...": "Other...",
"Hide extra fields": "Hide extra fields",
"Balance": "Balance",
"You currently have": "You currently have",
"Receive Credits": "Receive Credits",
"Use this wallet address to receive credits sent by another user (or yourself).": "Use this wallet address to receive credits sent by another user (or yourself).",
"Get new address": "Get new address",
"You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.": "You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.",
"Send Credits": "Send Credits",
"Recipient address": "Recipient address",
"Amount": "Amount",
"View All": "View All",
"Looks like you don't have any recent transactions.": "Looks like you don't have any recent transactions.",
"Wallet Sync": "Wallet Sync",
"Sync status": "Sync status",
"On": "On",
"Connected email": "Connected email",
"Manual backup": "Manual backup",
"Fetching transactions...": "Fetching transactions...",
"Loading transactions...": "Loading transactions...",
"The transaction URL could not be opened": "The transaction URL could not be opened",
"LBRY credits allow you to purchase content, publish content, and influence the network.": "LBRY credits allow you to purchase content, publish content, and influence the network.",
"You get credits for free for providing an email address and taking other basic actions.": "You get credits for free for providing an email address and taking other basic actions.",
"Learn more": "Learn more",
"Not interested": "Not interested",
"Get started": "Get started",
"Fetching rewards...": "Fetching rewards...",
"Custom Code": "Custom Code",
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
"Settings": "Settings",
"Content": "Content",
"Enable background media playback": "Enable background media playback",
"Enable this option to play audio or video in the background when the app is suspended.": "Enable this option to play audio or video in the background when the app is suspended.",
"Choose language": "Choose language",
"Show mature content": "Show mature content",
"Notifications": "Notifications",
"Choose the notifications you would like to receive.": "Choose the notifications you would like to receive.",
"Subscriptions": "Subscriptions",
"Rewards": "Rewards",
"Content Interests": "Content Interests",
"Search": "Search",
"Show URL suggestions": "Show URL suggestions",
"Keep the SDK background service running after closing the app": "Keep the SDK background service running after closing the app",
"Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.": "Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.",
"Loading...": "Loading...",
"LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.": "LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.",
"What is LBRY?": "What is LBRY?",
"Android App Basics": "Android App Basics",
"Frequently Asked Questions": "Frequently Asked Questions",
"You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.": "You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.",
"App info": "App info",
"Update mailing preferences": "Update mailing preferences",
"App version": "App version",
"LBRY SDK": "LBRY SDK",
"Platform": "Platform",
"Installation ID": "Installation ID",
"Logs": "Logs",
"Send log": "Send log",
"Testing network": "Testing network",
"Spanish": "Spanish",
"Portuguese": "Portuguese",
"Polish": "Polish",
"Malay": "Malay",
"Please wait while we get some things ready...": "Please wait while we get some things ready...",
"LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.": "LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.",
"Continue": "Continue",
"Setup account": "Setup account",
"An account will allow you to earn rewards and keep your account and settings synced.": "An account will allow you to earn rewards and keep your account and settings synced.",
"This information is disclosed only to LBRY, Inc. and not to the LBRY network.": "This information is disclosed only to LBRY, Inc. and not to the LBRY network.",
"No, thanks": "No, thanks",
"Use LBRY": "Use LBRY",
"Are you sure?": "Are you sure?",
"Without an account, you will not receive rewards, sync and backup services, or security updates.": "Without an account, you will not receive rewards, sync and backup services, or security updates.",
"I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)": "I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)",
"Change email": "Change email",
"Your email address was successfully verified.": "Your email address was successfully verified.",
"Retrieving your account information...": "Retrieving your account information...",
"Synchronizing": "Synchronizing",
"Validating password": "Validating password",
"Invalid password specified. Please enter the password for your previously synchronised wallet.": "Invalid password specified. Please enter the password for your previously synchronised wallet.",
"Please enter the password you used to secure your wallet.": "Please enter the password you used to secure your wallet.",
"If you did not provide a password, please press Use LBRY to continue.": "If you did not provide a password, please press Use LBRY to continue.",
"Note: for wallet security purposes, LBRY is unable to reset your password.": "Note: for wallet security purposes, LBRY is unable to reset your password.",
"More tags you follow": "More tags you follow",
"Blockchain Sync": "Blockchain Sync",
"Network Loading": "Network Loading",
"Initializing LBRY service": "Initializing LBRY service",
"Sign In": "Sign In",
"SIGN IN": "SIGN IN",
"You have not created a channel.\nStart now by creating a new channel!": "You have not created a channel.\nStart now by creating a new channel!",
"Send verification email": "Send verification email",
"You do not have any\ndownloaded content on this device.": "You do not have any\ndownloaded content on this device.",
"It looks like you have not\npublished any content to LBRY yet.": "It looks like you have not\npublished any content to LBRY yet.",
"An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.": "An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.",
"Without an account, you assume all responsibility for securing your wallet and LBRY data.": "Without an account, you assume all responsibility for securing your wallet and LBRY data.",
"Skip Account": "Skip Account",
"Sign Up": "Sign Up",
"Indonesian": "Indonesian",
"Hindi": "Hindi",
"Verify Email": "Verify Email",
"Resend": "Resend",
"Edit": "Edit",
"Please follow the instructions in the email sent to your address to continue.": "Please follow the instructions in the email sent to your address to continue.",
"Please enter a password to secure your account and wallet.": "Please enter a password to secure your account and wallet.",
"Anonymous": "Anonymous",
"Connecting...": "Connecting...",
"Gujarati": "Gujarati",
"Turkish": "Turkish",
"Italian": "Italian",
"English": "English",
"Use device language": "Use device language",
"Tags you follow": "Tags you follow",
"Everyone": "Everyone",
"Greek": "Greek",
"Romanian": "Romanian",
"Norwegian": "Norwegian",
"Korean": "Korean",
"Cambodian": "Cambodian",
"Croatian": "Croatian",
"Czech": "Czech",
"Arabic": "Arabic",
"Thai": "Thai",
"Vietnamese": "Vietnamese",
"Dutch": "Dutch",
"Russian": "Russian",
"Japanese": "Japanese",
"German": "German",
"Trending": "Trending",
"Channels": "Channels",
"Library": "Library",
"Publishes": "Publishes",
"New Publish": "New Publish",
"About": "About",
"Sort content by": "Sort content by",
"Trending content": "Trending content",
"New content": "New content",
"Top content": "Top content",
"Search movies, music, and more": "Search movies, music, and more",
"Please provide a valid email address to continue.": "Please provide a valid email address to continue.",
"A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.": "A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.",
"%num% blocks behind": "%num% blocks behind",
"Catching up with the blockchain ($%progress%%)": "Catching up with the blockchain ($%progress%%)",
"Catching up with the blockchain (%progress%%)": "Catching up with the blockchain (%progress%%)",
"Get %amount% free credits after creating an account.": "Get %amount% free credits after creating an account.",
"Off": "Off",
"Sync FAQ": "Sync FAQ",
"Please provide an email address.": "Please provide an email address.",
"An email has been sent to": "An email has been sent to",
"Please click the link in the message to complete signing in.": "Please click the link in the message to complete signing in.",
"%amount% free credits available in rewards.": "%amount% free credits available in rewards.",
"Tap to learn more.": "Tap to learn more.",
"password": "password",
"Enable sync": "Enable sync",
"Disable wallet sync": "Disable wallet sync",
"Are you sure you want to turn off wallet sync?": "Are you sure you want to turn off wallet sync?",
"No": "No",
"Yes": "Yes",
"Wallet sync was successfully disabled.": "Wallet sync was successfully disabled.",
"more": "more",
"Related Content": "Related Content",
"There are no results to display for \"%query%\". Please try a different search term.": "There are no results to display for \"%query%\". Please try a different search term.",
"Download": "Download",
"This content is Not Safe For Work. To view adult content, please change your Settings.": "This content is Not Safe For Work. To view adult content, please change your Settings.",
"Stop": "Stop",
"%progress%% complete": "%progress%% complete",
"Customize your tags": "Customize your tags",
"Done": "Done",
"Search for more tags": "Search for more tags",
"Send": "Send",
"Recent Transactions": "Recent Transactions",
"Nothing here. Publish something!": "Nothing here. Publish something!",
"CONTENT": "CONTENT",
"ABOUT": "ABOUT",
"New": "New",
"Content Freedom": "Content Freedom",
"Get Social": "Get Social",
"used": "used",
"Stats": "Stats",
"Welcome to LBRY.": "Welcome to LBRY.",
"Account Recommended": "Account Recommended",
"%amount% available credits": "%amount% available credits",
"%amount% available credit": "%amount% available credit"
}
+1 -3
View File
@@ -73,9 +73,7 @@ class FileDownloadButton extends React.PureComponent {
onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]}
onPress={() => {
if (NativeModules.Firebase) {
NativeModules.Firebase.track('purchase_uri', { uri: uri });
}
NativeModules.Firebase.track('purchase_uri', { uri: uri });
purchaseUri(uri, costInfo, !isPlayable);
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.checkDownloads();
+4 -1
View File
@@ -35,7 +35,10 @@ class RewardEnrolment extends React.Component {
<View style={rewardStyle.enrollContainer}>
<View style={rewardStyle.summaryRow}>
<Icon name="award" size={36} color={Colors.White} />
<Text style={rewardStyle.summaryText}>{unclaimedRewardAmount} available credits</Text>
<Text style={rewardStyle.summaryText}>
{unclaimedRewardAmount === 1 && __('%amount% available credit', { amount: unclaimedRewardAmount })}
{unclaimedRewardAmount !== 1 && __('%amount% available credits', { amount: unclaimedRewardAmount })}
</Text>
</View>
<View style={rewardStyle.onboarding}>
+6 -1
View File
@@ -95,6 +95,7 @@ const Constants = {
FULL_ROUTE_NAME_WALLET: 'WalletStack',
ROUTE_FILE: 'File',
DRAWER_ROUTE_FILE_VIEW: 'FileView',
ITEM_CREATE_A_CHANNEL: 'Create a channel...',
ITEM_ANONYMOUS: 'Publish anonymously',
@@ -167,4 +168,8 @@ export const DrawerRoutes = [
];
// sub-pages for main routes
export const InnerDrawerRoutes = [Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM, Constants.DRAWER_ROUTE_PUBLISH_FORM];
export const InnerDrawerRoutes = [
Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM,
Constants.DRAWER_ROUTE_PUBLISH_FORM,
Constants.DRAWER_ROUTE_FILE_VIEW,
];
+1
View File
@@ -56,6 +56,7 @@ window.__ = __;
const globalExceptionHandler = (error, isFatal) => {
if (error && NativeModules.Firebase) {
console.log(error);
NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
}
};
+11 -11
View File
@@ -38,6 +38,7 @@ class ChannelPage extends React.PureComponent {
showTimePicker: false,
orderBy: ['release_time'], // sort by new by default
activeTab: Constants.CONTENT_TAB,
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting channel pages by new
};
componentWillMount() {
@@ -48,16 +49,14 @@ class ChannelPage extends React.PureComponent {
}
componentDidMount() {
const { fetchChannelListMine, setSortByItem } = this.props;
const { fetchChannelListMine } = this.props;
NativeModules.Firebase.setCurrentScreen('Channel');
setSortByItem(Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1]); // sort by newest first
fetchChannelListMine();
}
handleSortByItemSelected = item => {
const { setSortByItem } = this.props;
setSortByItem(item);
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
// sort by specific only to this component state
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
};
handleTimeItemSelected = item => {
@@ -67,17 +66,18 @@ class ChannelPage extends React.PureComponent {
};
listHeader = () => {
const { sortByItem, timeItem } = this.props;
const { timeItem } = this.props;
const { currentSortByItem } = this.state;
return (
<View style={channelPageStyle.listHeader}>
<View style={discoverStyle.pickerRow}>
<View style={discoverStyle.leftPickerRow}>
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
<Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Text style={discoverStyle.tagSortText}>{__(currentSortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity>
{Constants.SORT_BY_TOP === sortByItem.name && (
{Constants.SORT_BY_TOP === currentSortByItem.name && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
@@ -207,9 +207,9 @@ class ChannelPage extends React.PureComponent {
};
render() {
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, timeItem } = this.props;
const { name, permanent_url: permanentUrl } = claim;
const { autoStyle, showSortPicker, showTimePicker } = this.state;
const { autoStyle, currentSortByItem, showSortPicker, showTimePicker } = this.state;
const ownedChannel = channels ? channels.map(channel => channel.permanent_url).includes(permanentUrl) : false;
let thumbnailUrl,
@@ -327,7 +327,7 @@ class ChannelPage extends React.PureComponent {
title={__('Sort content by')}
onOverlayPress={() => this.setState({ showSortPicker: false })}
onItemSelected={this.handleSortByItemSelected}
selectedItem={sortByItem}
selectedItem={currentSortByItem}
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
/>
)}
+2 -1
View File
@@ -44,7 +44,7 @@ import {
doDeleteFile,
doStopDownloadingFile,
} from 'redux/actions/file';
import { doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { doToggleFullscreenMode } from 'redux/actions/settings';
import { selectDrawerStack } from 'redux/selectors/drawer';
import FilePage from './view';
@@ -92,6 +92,7 @@ const perform = dispatch => ({
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
notify: data => dispatch(doToast(data)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
deletePurchasedUri: uri => dispatch(doDeletePurchasedUri(uri)),
resolveUri: uri => dispatch(doResolveUri(uri)),
+116 -55
View File
@@ -44,6 +44,7 @@ import Video from 'react-native-video';
import FileRewardsDriver from 'component/fileRewardsDriver';
import filePageStyle from 'styles/filePage';
import uriBarStyle from 'styles/uriBar';
import _ from 'lodash';
class FilePage extends React.PureComponent {
static navigationOptions = {
@@ -62,8 +63,9 @@ class FilePage extends React.PureComponent {
super(props);
this.state = {
attemptAutoGet: false,
autoPlayMedia: false,
autoOpened: false,
autoDownloadStarted: false,
autoPlayMedia: false,
downloadButtonShown: false,
downloadPressed: false,
fileViewLogged: false,
@@ -127,6 +129,17 @@ class FilePage extends React.PureComponent {
this.onComponentFocused();
}
difference = (object, base) => {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
result[key] = _.isObject(value) && _.isObject(base[key]) ? changes(value, base[key]) : value;
}
});
}
return changes(object, base);
};
componentWillReceiveProps(nextProps) {
const {
claim,
@@ -136,6 +149,7 @@ class FilePage extends React.PureComponent {
navigation,
contentType,
notify,
drawerStack: prevDrawerStack,
} = this.props;
const { uri } = navigation.state.params;
const {
@@ -145,6 +159,7 @@ class FilePage extends React.PureComponent {
purchasedUris,
purchaseUriErrorMessage,
streamingUrl,
drawerStack,
} = nextProps;
if (Constants.ROUTE_FILE === currentRoute && currentRoute !== prevRoute) {
@@ -184,6 +199,17 @@ class FilePage extends React.PureComponent {
this.setState({ streamingMode: true, currentStreamUrl: fileInfo.streaming_url });
}
}
if (
prevDrawerStack[prevDrawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW &&
prevDrawerStack.length !== drawerStack.length
) {
this.setState({
downloadPressed: false,
showImageViewer: false,
showWebView: false,
});
}
}
componentDidUpdate(prevProps) {
@@ -633,6 +659,50 @@ class FilePage extends React.PureComponent {
}
};
openFile = (localFileUri, mediaType) => {
const { pushDrawerStack } = this.props;
const isWebViewable = mediaType === 'text';
if (mediaType === 'image') {
// use image viewer
if (!this.state.showImageViewer) {
this.setState(
{
imageUrls: [
{
url: localFileUri,
},
],
showImageViewer: true,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW)
);
}
}
if (isWebViewable) {
// show webview
if (!this.state.showWebView) {
this.setState(
{
showWebView: true,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW)
);
}
}
};
onMediaContainerPressed = () => {
const { costInfo, contentType, purchaseUri } = this.props;
const { uri } = this.state;
const mediaType = Lbry.getMediaType(contentType);
const isPlayable = mediaType === 'video' || mediaType === 'audio';
purchaseUri(uri, costInfo, isPlayable);
if (isPlayable) {
this.onFileDownloadButtonPlayed();
}
};
render() {
const {
balance,
@@ -651,6 +721,7 @@ class FilePage extends React.PureComponent {
navigation,
position,
purchaseUri,
pushDrawerStack,
isSearchingRecommendContent,
recommendedContent,
thumbnail,
@@ -746,6 +817,7 @@ class FilePage extends React.PureComponent {
const description = metadata.description ? metadata.description : null;
const mediaType = Lbry.getMediaType(contentType);
const isPlayable = mediaType === 'video' || mediaType === 'audio';
const isWebViewable = mediaType === 'text';
const { height, signing_channel: signingChannel, value } = claim;
const channelName = signingChannel && signingChannel.name;
const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id;
@@ -784,35 +856,10 @@ class FilePage extends React.PureComponent {
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
const isViewable = mediaType === 'image' || mediaType === 'text';
const isWebViewable = mediaType === 'text';
const canOpen = isViewable && completed;
const localFileUri = this.localUriForFileInfo(fileInfo);
const unsupported = !isPlayable && !canOpen;
const openFile = () => {
if (mediaType === 'image') {
// use image viewer
if (!this.state.showImageViewer) {
this.setState({
imageUrls: [
{
url: localFileUri,
},
],
showImageViewer: true,
});
}
}
if (isWebViewable) {
// show webview
if (!this.state.showWebView) {
this.setState({
showWebView: true,
});
}
}
};
if (fileInfo && !this.state.autoDownloadStarted && this.state.uriVars && this.state.uriVars.download === 'true') {
this.setState({ autoDownloadStarted: true }, () => {
purchaseUri(uri, costInfo, !isPlayable);
@@ -822,9 +869,9 @@ class FilePage extends React.PureComponent {
});
}
if (this.state.downloadPressed && canOpen) {
if (this.state.downloadPressed && canOpen && !this.state.autoOpened) {
// automatically open a web viewable or image file after the download button is pressed
openFile();
this.setState({ autoOpened: true }, () => this.openFile(localFileUri, mediaType));
}
return (
@@ -849,7 +896,11 @@ class FilePage extends React.PureComponent {
}
onLayout={this.checkOrientation}
>
<View style={filePageStyle.mediaContainer}>
<TouchableOpacity
activeOpacity={0.5}
style={filePageStyle.mediaContainer}
onPress={this.onMediaContainerPressed}
>
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
<FileItemMedia
duration={duration}
@@ -889,7 +940,7 @@ class FilePage extends React.PureComponent {
<FileDownloadButton
uri={claim && claim.permanent_url ? claim.permanent_url : uri}
style={filePageStyle.downloadButton}
openFile={openFile}
openFile={() => this.openFile(localFileUri, mediaType)}
isPlayable={isPlayable}
isViewable={isViewable}
onPlay={this.onFileDownloadButtonPlayed}
@@ -908,7 +959,7 @@ class FilePage extends React.PureComponent {
<TouchableOpacity style={filePageStyle.backButton} onPress={this.onBackButtonPressed}>
<Icon name={'arrow-left'} size={18} style={filePageStyle.backButtonIcon} />
</TouchableOpacity>
</View>
</TouchableOpacity>
{(this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) && (
<View
style={playerBgStyle}
@@ -975,7 +1026,7 @@ class FilePage extends React.PureComponent {
<View style={filePageStyle.largeButtonsRow}>
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.handleSharePress}>
<Icon name={'share-alt'} size={20} style={filePageStyle.largeButtonIcon} />
<Icon name={'share-alt'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Share')}</Text>
</TouchableOpacity>
@@ -983,51 +1034,61 @@ class FilePage extends React.PureComponent {
style={filePageStyle.largeButton}
onPress={() => this.setState({ showTipView: true })}
>
<Icon name={'gift'} size={20} style={filePageStyle.largeButtonIcon} />
<Icon name={'gift'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Tip')}</Text>
</TouchableOpacity>
<View style={filePageStyle.sharedLargeButton}>
{!isPlayable && !fileInfo && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onDownloadPressed}>
<Icon name={'download'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Download')}</Text>
</TouchableOpacity>
)}
{!canEdit && !isPlayable && (
<View style={filePageStyle.sharedLargeButton}>
{!fileInfo ||
(fileInfo.written_bytes <= 0 && !completed && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onDownloadPressed}>
<Icon name={'download'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Download')}</Text>
</TouchableOpacity>
))}
{!completed &&
fileInfo &&
!fileInfo.stopped &&
fileInfo.written_bytes > 0 &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onStopDownloadPressed}>
<Icon name={'stop'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Stop')}</Text>
</TouchableOpacity>
)}
</View>
{!completed &&
fileInfo &&
!fileInfo.stopped &&
fileInfo.written_bytes > 0 &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onStopDownloadPressed}>
<Icon name={'stop'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Stop')}</Text>
</TouchableOpacity>
)}
{completed && fileInfo && fileInfo.written_bytes >= fileInfo.total_bytes && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onOpenFilePressed}>
<Icon name={'folder-open'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Open')}</Text>
</TouchableOpacity>
)}
</View>
)}
{!canEdit && (
<TouchableOpacity
style={filePageStyle.largeButton}
onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
>
<Icon name={'flag'} size={20} style={filePageStyle.largeButtonIcon} />
<Icon name={'flag'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Report')}</Text>
</TouchableOpacity>
)}
{canEdit && (
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.onEditPressed}>
<Icon name={'edit'} size={20} style={filePageStyle.largeButtonIcon} />
<Icon name={'edit'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Edit')}</Text>
</TouchableOpacity>
)}
{(completed || canEdit) && (
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.onDeletePressed}>
<Icon name={'trash-alt'} size={20} style={filePageStyle.largeButtonIcon} />
<Icon name={'trash-alt'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Delete')}</Text>
</TouchableOpacity>
)}
+30 -22
View File
@@ -89,33 +89,41 @@ class SettingsPage extends React.PureComponent {
}
// check the local filesystem for the language first? Or download remote strings first?
if (language === 'en') {
// don't attempt to download English
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
// download and save the language file
this.setState({ downloadingLanguage: true }, () => {
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
.then(r => r.json())
.then(j => {
window.i18n_messages[language] = j;
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
} else {
// download and save the language file
this.setState({ downloadingLanguage: true }, () => {
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
.then(r => r.json())
.then(j => {
window.i18n_messages[language] = j;
// write the language file to the filesystem
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
// write the language file to the filesystem
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
// so we have to load it from native settings
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, value);
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
// so we have to load it from native settings
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
this.setState({ downloadingLanguage: false });
})
.catch(e => {
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
this.setState({ downloadingLanguage: false });
});
});
this.setState({ downloadingLanguage: false });
})
.catch(e => {
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
this.setState({ downloadingLanguage: false });
});
});
}
};
handleBackPressed = () => {
+1 -1
View File
@@ -235,7 +235,7 @@ class SplashScreen extends React.PureComponent {
}
if (headerSyncProgress < 100) {
const downloadProgress = headerSyncProgress || 0;
const downloadProgress = isNaN(parseInt(headerSyncProgress, 10)) ? '0' : headerSyncProgress || '0';
this.setState({
message: __('Blockchain Sync'),
details: __('Catching up with the blockchain (%progress%%)', { progress: downloadProgress }),
+1 -1
View File
@@ -243,7 +243,7 @@ class SubscriptionsPage extends React.PureComponent {
title={__('Sort content by')}
onOverlayPress={() => this.setState({ showSortPicker: false })}
onItemSelected={this.handleSortByItemSelected}
selectedItem={this.state.currentSortByItem}
selectedItem={currentSortByItem}
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
/>
)}
+4 -4
View File
@@ -384,7 +384,7 @@ const filePageStyle = StyleSheet.create({
sharedLargeButton: {
alignItems: 'center',
justifyContent: 'center',
marginRight: 36,
flex: 0.2,
},
innerLargeButton: {
alignItems: 'center',
@@ -393,7 +393,7 @@ const filePageStyle = StyleSheet.create({
largeButton: {
alignItems: 'center',
justifyContent: 'center',
marginRight: 36,
flex: 0.2,
},
largeButtonIcon: {
color: Colors.DescriptionGrey,
@@ -406,8 +406,8 @@ const filePageStyle = StyleSheet.create({
largeButtonsRow: {
flexDirection: 'row',
alignItems: 'center',
marginLeft: 20,
marginRight: 20,
marginLeft: 16,
marginRight: 16,
marginTop: 12,
marginBottom: 12,
},
+14
View File
@@ -155,6 +155,14 @@ export function navigateToUri(navigation, uri, additionalParams, isNavigatingBac
}
export function navigateBack(navigation, drawerStack, popDrawerStack) {
if (drawerStack[drawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW) {
// inner file_view (web / image view) is handled differently
if (popDrawerStack) {
popDrawerStack();
}
return;
}
if (popDrawerStack) {
popDrawerStack();
}
@@ -186,6 +194,12 @@ export function navigateBack(navigation, drawerStack, popDrawerStack) {
}
export function dispatchNavigateBack(dispatch, nav, drawerStack) {
if (drawerStack[drawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW) {
// inner file_view (web / image view) is handled differently
dispatch(doPopDrawerStack());
return;
}
dispatch(doPopDrawerStack());
const target = drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0];