mirror of
https://github.com/LBRYFoundation/lbry-android.git
synced 2025-08-23 17:47:28 +00:00
ongoing pre-beta tasks (#284)
* tapping on the player controls container while it is visible should hide the container * change 'click' to 'tap' * add related content component * file list item resolving display tweaks * increase number of search results to 25 * fix name display for identity claims in search results
This commit is contained in:
parent
05531e0bc5
commit
0638b9f133
21 changed files with 228 additions and 58 deletions
9
app/package-lock.json
generated
9
app/package-lock.json
generated
|
@ -3990,8 +3990,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lbryinc": {
|
"lbryinc": {
|
||||||
"version": "github:lbryio/lbryinc#7910b565d7edda16be1c9d291f296982261ba60a",
|
"version": "github:lbryio/lbryinc#f2fff2a331578aef84eb77c108f976967afc50e0",
|
||||||
"from": "github:lbryio/lbryinc#phone-verification",
|
"from": "github:lbryio/lbryinc",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lbry-redux": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
|
"lbry-redux": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc",
|
||||||
"reselect": "^3.0.0"
|
"reselect": "^3.0.0"
|
||||||
|
@ -5315,9 +5315,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-native-phone-input": {
|
"react-native-phone-input": {
|
||||||
"version": "0.2.1",
|
"version": "github:lbryio/react-native-phone-input#60fdef484e8bf27328c7fb6a203baab9eb9cd4a1",
|
||||||
"resolved": "https://registry.npmjs.org/react-native-phone-input/-/react-native-phone-input-0.2.1.tgz",
|
"from": "github:lbryio/react-native-phone-input",
|
||||||
"integrity": "sha1-rGhSoeo32NWP+D3tUtGNe2MD5mc=",
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"google-libphonenumber": "^2.0.9",
|
"google-libphonenumber": "^2.0.9",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"react-native-fast-image": "^5.0.3",
|
"react-native-fast-image": "^5.0.3",
|
||||||
"react-native-fetch-blob": "^0.10.8",
|
"react-native-fetch-blob": "^0.10.8",
|
||||||
"react-native-image-zoom-viewer": "^2.2.5",
|
"react-native-image-zoom-viewer": "^2.2.5",
|
||||||
"react-native-phone-input": "^0.2.1",
|
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||||
"react-native-vector-icons": "^5.0.0",
|
"react-native-vector-icons": "^5.0.0",
|
||||||
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
||||||
"react-navigation": "^2.12.1",
|
"react-navigation": "^2.12.1",
|
||||||
|
|
|
@ -5,8 +5,8 @@ import {
|
||||||
makeSelectMetadataForUri,
|
makeSelectMetadataForUri,
|
||||||
makeSelectFileInfoForUri,
|
makeSelectFileInfoForUri,
|
||||||
makeSelectIsUriResolving,
|
makeSelectIsUriResolving,
|
||||||
selectRewardContentClaimIds
|
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { selectShowNsfw } from '../../redux/selectors/settings';
|
import { selectShowNsfw } from '../../redux/selectors/settings';
|
||||||
import FileItem from './view';
|
import FileItem from './view';
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,10 @@ import { normalizeURI } from 'lbry-redux';
|
||||||
import { NavigationActions } from 'react-navigation';
|
import { NavigationActions } from 'react-navigation';
|
||||||
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
|
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
|
||||||
import { navigateToUri } from '../../utils/helper';
|
import { navigateToUri } from '../../utils/helper';
|
||||||
|
import Colors from '../../styles/colors';
|
||||||
import FileItemMedia from '../fileItemMedia';
|
import FileItemMedia from '../fileItemMedia';
|
||||||
import FilePrice from '../filePrice';
|
import FilePrice from '../filePrice';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from '../link';
|
import Link from '../link';
|
||||||
import NsfwOverlay from '../nsfwOverlay';
|
import NsfwOverlay from '../nsfwOverlay';
|
||||||
import discoverStyle from '../../styles/discover';
|
import discoverStyle from '../../styles/discover';
|
||||||
|
@ -65,7 +67,10 @@ class FileItem extends React.PureComponent {
|
||||||
isResolvingUri={isResolvingUri}
|
isResolvingUri={isResolvingUri}
|
||||||
style={mediaStyle} />
|
style={mediaStyle} />
|
||||||
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />
|
<FilePrice uri={uri} style={discoverStyle.filePriceContainer} textStyle={discoverStyle.filePriceText} />
|
||||||
<Text style={discoverStyle.fileItemName}>{title}</Text>
|
<View style={isRewardContent ? discoverStyle.rewardTitleContainer : null}>
|
||||||
|
<Text style={[discoverStyle.fileItemName, discoverStyle.rewardTitle]}>{title}</Text>
|
||||||
|
{isRewardContent && <Icon style={discoverStyle.rewardIcon} name="award" size={20} />}
|
||||||
|
</View>
|
||||||
{channelName &&
|
{channelName &&
|
||||||
<Link style={discoverStyle.channelName} text={channelName} onPress={() => {
|
<Link style={discoverStyle.channelName} text={channelName} onPress={() => {
|
||||||
const channelUri = normalizeURI(channelName);
|
const channelUri = normalizeURI(channelName);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { navigateToUri } from '../../utils/helper';
|
import { navigateToUri, formatBytes } from '../../utils/helper';
|
||||||
import Colors from '../../styles/colors';
|
import Colors from '../../styles/colors';
|
||||||
import FileItemMedia from '../fileItemMedia';
|
import FileItemMedia from '../fileItemMedia';
|
||||||
import Link from '../../component/link';
|
import Link from '../../component/link';
|
||||||
|
@ -18,27 +18,12 @@ import fileListStyle from '../../styles/fileList';
|
||||||
class FileListItem extends React.PureComponent {
|
class FileListItem extends React.PureComponent {
|
||||||
getStorageForFileInfo = (fileInfo) => {
|
getStorageForFileInfo = (fileInfo) => {
|
||||||
if (!fileInfo.completed) {
|
if (!fileInfo.completed) {
|
||||||
const written = this.formatBytes(fileInfo.written_bytes);
|
const written = formatBytes(fileInfo.written_bytes);
|
||||||
const total = this.formatBytes(fileInfo.total_bytes);
|
const total = formatBytes(fileInfo.total_bytes);
|
||||||
return `(${written} / ${total})`;
|
return `(${written} / ${total})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.formatBytes(fileInfo.written_bytes);
|
return formatBytes(fileInfo.written_bytes);
|
||||||
}
|
|
||||||
|
|
||||||
formatBytes = (bytes) => {
|
|
||||||
if (bytes < 1048576) { // < 1MB
|
|
||||||
const value = (bytes / 1024.0).toFixed(0);
|
|
||||||
return `${value} KB`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bytes < 1073741824) { // < 1GB
|
|
||||||
const value = (bytes / (1024.0 * 1024.0)).toFixed(0);
|
|
||||||
return `${value} MB`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const value = (bytes / (1024.0 * 1024.0 * 1024.0)).toFixed(0);
|
|
||||||
return `${value} GB`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
formatTitle = (title) => {
|
formatTitle = (title) => {
|
||||||
|
@ -90,19 +75,19 @@ class FileListItem extends React.PureComponent {
|
||||||
<FileItemMedia style={fileListStyle.thumbnail}
|
<FileItemMedia style={fileListStyle.thumbnail}
|
||||||
blurRadius={obscureNsfw ? 15 : 0}
|
blurRadius={obscureNsfw ? 15 : 0}
|
||||||
resizeMode="cover"
|
resizeMode="cover"
|
||||||
title={title}
|
title={(title || name)}
|
||||||
thumbnail={metadata ? metadata.thumbnail : null} />
|
thumbnail={metadata ? metadata.thumbnail : null} />
|
||||||
<View style={fileListStyle.detailsContainer}>
|
<View style={fileListStyle.detailsContainer}>
|
||||||
{isResolving && (
|
{!title && !name && !channel && isResolving && (
|
||||||
<View>
|
<View>
|
||||||
<Text style={fileListStyle.uri}>{uri}</Text>
|
{(!title && !name) && <Text style={fileListStyle.uri}>{uri}</Text>}
|
||||||
<View style={fileListStyle.row}>
|
{(!title && !name) && <View style={fileListStyle.row}>
|
||||||
<ActivityIndicator size={"small"} color={Colors.LbryGreen} />
|
<ActivityIndicator size={"small"} color={Colors.LbryGreen} />
|
||||||
</View>
|
</View>}
|
||||||
</View>)}
|
</View>)}
|
||||||
|
|
||||||
{!isResolving && <Text style={fileListStyle.title}>{this.formatTitle(title) || this.formatTitle(name)}</Text>}
|
{(title || name) && <Text style={fileListStyle.title}>{this.formatTitle(title) || this.formatTitle(name)}</Text>}
|
||||||
{!isResolving && channel &&
|
{channel &&
|
||||||
<Link style={fileListStyle.publisher} text={channel} onPress={() => {
|
<Link style={fileListStyle.publisher} text={channel} onPress={() => {
|
||||||
const channelUri = normalizeURI(channel);
|
const channelUri = normalizeURI(channel);
|
||||||
navigateToUri(navigation, channelUri);
|
navigateToUri(navigation, channelUri);
|
||||||
|
|
|
@ -115,6 +115,11 @@ class MediaPlayer extends React.PureComponent {
|
||||||
this.hidePlayerControls();
|
this.hidePlayerControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
manualHidePlayerControls = () => {
|
||||||
|
this.clearControlsTimeout();
|
||||||
|
this.setState({ areControlsVisible: false });
|
||||||
|
}
|
||||||
|
|
||||||
hidePlayerControls() {
|
hidePlayerControls() {
|
||||||
const player = this;
|
const player = this;
|
||||||
let timeout = setTimeout(() => {
|
let timeout = setTimeout(() => {
|
||||||
|
@ -123,6 +128,14 @@ class MediaPlayer extends React.PureComponent {
|
||||||
player.setState({ controlsTimeout: timeout });
|
player.setState({ controlsTimeout: timeout });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglePlayerControls = () => {
|
||||||
|
if (this.state.areControlsVisible) {
|
||||||
|
this.manualHidePlayerControls();
|
||||||
|
} else {
|
||||||
|
this.showPlayerControls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
togglePlay = () => {
|
togglePlay = () => {
|
||||||
this.showPlayerControls();
|
this.showPlayerControls();
|
||||||
this.setState({ paused: !this.state.paused });
|
this.setState({ paused: !this.state.paused });
|
||||||
|
@ -342,7 +355,7 @@ class MediaPlayer extends React.PureComponent {
|
||||||
onEnd={this.onEnd}
|
onEnd={this.onEnd}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.showPlayerControls}>
|
<TouchableOpacity style={mediaPlayerStyle.playerControls} onPress={this.togglePlayerControls}>
|
||||||
{this.renderPlayerControls()}
|
{this.renderPlayerControls()}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
|
23
app/src/component/relatedContent/index.js
Normal file
23
app/src/component/relatedContent/index.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import {
|
||||||
|
makeSelectClaimForUri,
|
||||||
|
doSearch,
|
||||||
|
makeSelectRecommendedContentForUri,
|
||||||
|
selectIsSearching,
|
||||||
|
} from 'lbry-redux';
|
||||||
|
import RelatedContent from './view';
|
||||||
|
|
||||||
|
const select = (state, props) => ({
|
||||||
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
|
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
|
||||||
|
isSearching: selectIsSearching(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
search: query => dispatch(doSearch(query, 10, undefined, true)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform
|
||||||
|
)(RelatedContent);
|
66
app/src/component/relatedContent/view.js
Normal file
66
app/src/component/relatedContent/view.js
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
|
||||||
|
import { navigateToUri } from '../../utils/helper';
|
||||||
|
import Colors from '../../styles/colors';
|
||||||
|
import FileListItem from '../fileListItem';
|
||||||
|
import fileListStyle from '../../styles/fileList';
|
||||||
|
import relatedContentStyle from '../../styles/relatedContent';
|
||||||
|
|
||||||
|
export default class RelatedContent extends React.PureComponent<Props> {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.didSearch = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.getRecommendedContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps: Props) {
|
||||||
|
const { claim, uri } = this.props;
|
||||||
|
|
||||||
|
if (uri !== prevProps.uri) {
|
||||||
|
this.didSearch = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (claim && !this.didSearch) {
|
||||||
|
this.getRecommendedContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getRecommendedContent() {
|
||||||
|
const { claim, search } = this.props;
|
||||||
|
|
||||||
|
if (claim && claim.value && claim.value.stream && claim.value.stream.metadata) {
|
||||||
|
const { title } = claim.value.stream.metadata;
|
||||||
|
search(title);
|
||||||
|
this.didSearch = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
didSearch: ?boolean;
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { recommendedContent, isSearching, navigation } = this.props;
|
||||||
|
|
||||||
|
if (!isSearching && (!recommendedContent || recommendedContent.length === 0)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={relatedContentStyle.container}>
|
||||||
|
<Text style={relatedContentStyle.title}>Related Content</Text>
|
||||||
|
{recommendedContent && recommendedContent.map(recommendedUri => (
|
||||||
|
<FileListItem
|
||||||
|
style={fileListStyle.item}
|
||||||
|
key={recommendedUri}
|
||||||
|
uri={recommendedUri}
|
||||||
|
navigation={navigation}
|
||||||
|
onPress={() => navigateToUri(navigation, recommendedUri, { autoplay: true })} />
|
||||||
|
))}
|
||||||
|
{isSearching && <ActivityIndicator size="small" color={Colors.LbryGreen} style={relatedContentStyle.loading} />}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import {
|
||||||
selectFeaturedUris,
|
selectFeaturedUris,
|
||||||
selectFetchingFeaturedUris
|
selectFetchingFeaturedUris
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { doFetchRewardedContent } from 'lbryinc';
|
||||||
import DiscoverPage from './view';
|
import DiscoverPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
@ -15,6 +16,7 @@ const select = state => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
fetchFeaturedUris: () => dispatch(doFetchFeaturedUris()),
|
fetchFeaturedUris: () => dispatch(doFetchFeaturedUris()),
|
||||||
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(DiscoverPage);
|
export default connect(select, perform)(DiscoverPage);
|
|
@ -41,7 +41,9 @@ class DiscoverPage extends React.PureComponent {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.props.fetchFeaturedUris();
|
const { fetchFeaturedUris, fetchRewardedContent } = this.props;
|
||||||
|
fetchFeaturedUris();
|
||||||
|
fetchRewardedContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -9,9 +9,9 @@ import {
|
||||||
makeSelectClaimForUri,
|
makeSelectClaimForUri,
|
||||||
makeSelectContentTypeForUri,
|
makeSelectContentTypeForUri,
|
||||||
makeSelectMetadataForUri,
|
makeSelectMetadataForUri,
|
||||||
selectRewardContentClaimIds,
|
selectBlackListedOutpoints,
|
||||||
selectBlackListedOutpoints,
|
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { doDeleteFile, doStopDownloadingFile } from '../../redux/actions/file';
|
import { doDeleteFile, doStopDownloadingFile } from '../../redux/actions/file';
|
||||||
import FilePage from './view';
|
import FilePage from './view';
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {
|
||||||
View,
|
View,
|
||||||
WebView
|
WebView
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
|
import { navigateToUri } from '../../utils/helper';
|
||||||
import ImageViewer from 'react-native-image-zoom-viewer';
|
import ImageViewer from 'react-native-image-zoom-viewer';
|
||||||
import Button from '../../component/button';
|
import Button from '../../component/button';
|
||||||
import Colors from '../../styles/colors';
|
import Colors from '../../styles/colors';
|
||||||
|
@ -25,6 +26,7 @@ import FilePrice from '../../component/filePrice';
|
||||||
import FloatingWalletBalance from '../../component/floatingWalletBalance';
|
import FloatingWalletBalance from '../../component/floatingWalletBalance';
|
||||||
import Link from '../../component/link';
|
import Link from '../../component/link';
|
||||||
import MediaPlayer from '../../component/mediaPlayer';
|
import MediaPlayer from '../../component/mediaPlayer';
|
||||||
|
import RelatedContent from '../../component/relatedContent';
|
||||||
import UriBar from '../../component/uriBar';
|
import UriBar from '../../component/uriBar';
|
||||||
import Video from 'react-native-video';
|
import Video from 'react-native-video';
|
||||||
import filePageStyle from '../../styles/filePage';
|
import filePageStyle from '../../styles/filePage';
|
||||||
|
@ -435,19 +437,23 @@ class FilePage extends React.PureComponent {
|
||||||
onPress={this.onStopDownloadPressed} />
|
onPress={this.onStopDownloadPressed} />
|
||||||
}
|
}
|
||||||
</View>}
|
</View>}
|
||||||
<ScrollView style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}>
|
<ScrollView
|
||||||
|
style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}
|
||||||
|
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}>
|
||||||
<Text style={filePageStyle.title} selectable={true}>{title}</Text>
|
<Text style={filePageStyle.title} selectable={true}>{title}</Text>
|
||||||
{channelName && <Link style={filePageStyle.channelName}
|
{channelName && <Link style={filePageStyle.channelName}
|
||||||
selectable={true}
|
selectable={true}
|
||||||
text={channelName}
|
text={channelName}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
const channelUri = normalizeURI(channelName);
|
const channelUri = normalizeURI(channelName);
|
||||||
navigation.navigate({ routeName: 'File', key: 'filePage', params: { uri: channelUri }});
|
navigateToUri(navigation, channelUri);
|
||||||
}} />}
|
}} />}
|
||||||
|
|
||||||
{description && description.length > 0 && <View style={filePageStyle.divider} />}
|
{description && description.length > 0 && <View style={filePageStyle.divider} />}
|
||||||
|
|
||||||
{description && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>}
|
{description && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>}
|
||||||
|
|
||||||
|
<RelatedContent navigation={navigation} uri={uri} />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -14,7 +14,7 @@ const select = (state) => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
search: (query) => dispatch(doSearch(query))
|
search: (query) => dispatch(doSearch(query, 25))
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(SearchPage);
|
export default connect(select, perform)(SearchPage);
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { doBalanceSubscribe, doNotify } from 'lbry-redux';
|
import { doBalanceSubscribe, doNotify } from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
doAuthenticate,
|
doAuthenticate,
|
||||||
|
doFetchRewardedContent,
|
||||||
doUserEmailToVerify,
|
doUserEmailToVerify,
|
||||||
doUserEmailVerify,
|
doUserEmailVerify,
|
||||||
doUserEmailVerifyFailure,
|
doUserEmailVerifyFailure,
|
||||||
|
@ -18,8 +19,9 @@ const select = state => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
authenticate: (appVersion, os) => dispatch(doAuthenticate(appVersion, os)),
|
authenticate: (appVersion, os) => dispatch(doAuthenticate(appVersion, os)),
|
||||||
deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()),
|
|
||||||
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
||||||
|
deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()),
|
||||||
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||||
notify: data => dispatch(doNotify(data)),
|
notify: data => dispatch(doNotify(data)),
|
||||||
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
||||||
verifyUserEmail: (token, recaptcha) => dispatch(doUserEmailVerify(token, recaptcha)),
|
verifyUserEmail: (token, recaptcha) => dispatch(doUserEmailVerify(token, recaptcha)),
|
||||||
|
|
|
@ -50,6 +50,8 @@ class SplashScreen extends React.PureComponent {
|
||||||
AsyncStorage.setItem('firstLaunchTime', String(moment().unix()));
|
AsyncStorage.setItem('firstLaunchTime', String(moment().unix()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.props.fetchRewardedContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatus() {
|
updateStatus() {
|
||||||
|
@ -109,7 +111,7 @@ class SplashScreen extends React.PureComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
navigation.navigate({ routeName: 'File', key: 'filePage', params: { uri: launchUrl } });
|
navigateToUri(navigation, launchUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ class WalletPage extends React.PureComponent {
|
||||||
<View>
|
<View>
|
||||||
<View style={walletStyle.warning}>
|
<View style={walletStyle.warning}>
|
||||||
<Text style={walletStyle.warningText}>
|
<Text style={walletStyle.warningText}>
|
||||||
This is beta software. You may lose any LBC that you send to your wallet due to uninstallation, software bugs, deleted files, or malicious third-party software. You should not use this wallet as your primary wallet. If you understand the risks and you wish to continue, please click the button below.
|
This is beta software. You may lose any LBC that you send to your wallet due to uninstallation, software bugs, deleted files, or malicious third-party software. You should not use this wallet as your primary wallet. If you understand the risks and you wish to continue, please tap the button below.
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Button text={'I understand the risks'} style={[walletStyle.button, walletStyle.understand]}
|
<Button text={'I understand the risks'} style={[walletStyle.button, walletStyle.understand]}
|
||||||
|
|
|
@ -15,6 +15,14 @@ import Constants from '../../constants';
|
||||||
|
|
||||||
const DOWNLOAD_POLL_INTERVAL = 250;
|
const DOWNLOAD_POLL_INTERVAL = 250;
|
||||||
|
|
||||||
|
const deleteBlobsForSdHash = (sdHash) => {
|
||||||
|
Lbry.blob_list({ sd_hash: sdHash }).then(hashes => {
|
||||||
|
hashes.filter(hash => hash != sdHash).forEach(hash => {
|
||||||
|
Lbry.blob_delete({ blob_hash: hash });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export function doUpdateLoadStatus(uri, outpoint) {
|
export function doUpdateLoadStatus(uri, outpoint) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
Lbry.file_list({
|
Lbry.file_list({
|
||||||
|
@ -44,10 +52,10 @@ export function doUpdateLoadStatus(uri, outpoint) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once a download has been completed, delete the individual blob files to save space
|
// Once a download has been completed, delete the individual blob files to save space
|
||||||
Lbry.blob_list({ sd_hash: fileInfo.sd_hash }).then(hashes => {
|
Lbry.file_set_status({ status: 'stop', sd_hash: fileInfo.sd_hash }).then(() => {
|
||||||
hashes.filter(hash => hash != fileInfo.sd_hash).forEach(hash => {
|
deleteBlobsForSdHash(fileInfo.sd_hash);
|
||||||
Lbry.blob_delete({ blob_hash: hash });
|
}).catch(() => {
|
||||||
});
|
deleteBlobsForSdHash(fileInfo.sd_hash);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*const notif = new window.Notification('LBRY Download Complete', {
|
/*const notif = new window.Notification('LBRY Download Complete', {
|
||||||
|
@ -316,10 +324,10 @@ export function doDeleteCompleteBlobs() {
|
||||||
Lbry.file_list().then(files => {
|
Lbry.file_list().then(files => {
|
||||||
files.forEach(fileInfo => {
|
files.forEach(fileInfo => {
|
||||||
if (fileInfo.completed) {
|
if (fileInfo.completed) {
|
||||||
Lbry.blob_list({ sd_hash: fileInfo.sd_hash }).then(hashes => {
|
Lbry.file_set_status({ status: 'stop', sd_hash: fileInfo.sd_hash }).then(() => {
|
||||||
hashes.filter(hash => hash != fileInfo.sd_hash).forEach(hash => {
|
deleteBlobsForSdHash(fileInfo.sd_hash);
|
||||||
Lbry.blob_delete({ blob_hash: hash });
|
}).catch(() => {
|
||||||
});
|
deleteBlobsForSdHash(fileInfo.sd_hash);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,10 +107,24 @@ const discoverStyle = StyleSheet.create({
|
||||||
height: '100%'
|
height: '100%'
|
||||||
},
|
},
|
||||||
overlayText: {
|
overlayText: {
|
||||||
color: '#ffffff',
|
color: Colors.White,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
fontFamily: 'Metropolis-Regular'
|
fontFamily: 'Metropolis-Regular'
|
||||||
|
},
|
||||||
|
rewardTitleContainer: {
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between'
|
||||||
|
},
|
||||||
|
rewardIcon: {
|
||||||
|
color: Colors.LbryGreen,
|
||||||
|
flex: 0.1,
|
||||||
|
textAlign: 'right',
|
||||||
|
marginTop: 6
|
||||||
|
},
|
||||||
|
rewardTitle: {
|
||||||
|
flex: 0.9
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,9 @@ const filePageStyle = StyleSheet.create({
|
||||||
},
|
},
|
||||||
scrollContainer: {
|
scrollContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
marginTop: -16,
|
marginTop: -16
|
||||||
marginBottom: -4,
|
},
|
||||||
|
scrollContent: {
|
||||||
paddingTop: 10
|
paddingTop: 10
|
||||||
},
|
},
|
||||||
scrollContainerActions: {
|
scrollContainerActions: {
|
||||||
|
@ -73,7 +74,7 @@ const filePageStyle = StyleSheet.create({
|
||||||
lineHeight: 20,
|
lineHeight: 20,
|
||||||
marginLeft: 20,
|
marginLeft: 20,
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
marginBottom: 40
|
marginBottom: 16
|
||||||
},
|
},
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
width: screenWidth,
|
width: screenWidth,
|
||||||
|
|
37
app/src/styles/relatedContent.js
Normal file
37
app/src/styles/relatedContent.js
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
import Colors from './colors';
|
||||||
|
|
||||||
|
const relatedContentStyle = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
paddingTop: 16,
|
||||||
|
paddingBottom: 16,
|
||||||
|
paddingLeft: 24,
|
||||||
|
paddingRight: 24,
|
||||||
|
borderTopColor: Colors.LighterGrey,
|
||||||
|
borderTopWidth: 1
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontFamily: 'Metropolis-Regular',
|
||||||
|
fontSize: 18,
|
||||||
|
},
|
||||||
|
itemList: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
scrollContainer: {
|
||||||
|
flex: 1,
|
||||||
|
paddingLeft: 16,
|
||||||
|
paddingRight: 16,
|
||||||
|
marginTop: 16,
|
||||||
|
marginBottom: 60
|
||||||
|
},
|
||||||
|
scrollPadding: {
|
||||||
|
marginTop: -16,
|
||||||
|
paddingBottom: 16
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
marginTop: 16
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default relatedContentStyle;
|
|
@ -78,7 +78,6 @@ public class LbrynetService extends PythonService {
|
||||||
String serviceDescription = "The LBRY service is running in the background.";
|
String serviceDescription = "The LBRY service is running in the background.";
|
||||||
|
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
|
|
||||||
NotificationManager notificationManager =
|
NotificationManager notificationManager =
|
||||||
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
@ -145,11 +144,17 @@ public class LbrynetService extends PythonService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
|
||||||
if (stopServiceReceiver != null) {
|
if (stopServiceReceiver != null) {
|
||||||
unregisterReceiver(stopServiceReceiver);
|
unregisterReceiver(stopServiceReceiver);
|
||||||
stopServiceReceiver = null;
|
stopServiceReceiver = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Context context = getApplicationContext();
|
||||||
|
NotificationManager notificationManager =
|
||||||
|
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
notificationManager.cancelAll();
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
serviceInstance = null;
|
serviceInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue