From 6d6c749338a434b236c0bad5d4a6965d47c2df08 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 4 Sep 2018 05:21:26 +0100 Subject: [PATCH] ongoing pre-beta tasks --- app/package-lock.json | 9 ++++----- app/package.json | 2 +- app/src/component/fileItem/index.js | 2 +- app/src/component/fileItem/view.js | 7 ++++++- app/src/page/discover/index.js | 2 ++ app/src/page/discover/view.js | 4 +++- app/src/page/file/index.js | 4 ++-- app/src/page/splash/index.js | 4 +++- app/src/page/splash/view.js | 2 ++ app/src/styles/discover.js | 15 ++++++++++++++- src/main/java/io/lbry/browser/LbrynetService.java | 9 +++++++-- 11 files changed, 45 insertions(+), 15 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index aa8db715..dac133e4 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -3990,8 +3990,8 @@ } }, "lbryinc": { - "version": "github:lbryio/lbryinc#7910b565d7edda16be1c9d291f296982261ba60a", - "from": "github:lbryio/lbryinc#phone-verification", + "version": "github:lbryio/lbryinc#f2fff2a331578aef84eb77c108f976967afc50e0", + "from": "github:lbryio/lbryinc", "requires": { "lbry-redux": "github:lbryio/lbry-redux#31f7afa8a37f5741dac01fc1ecdf153f3bed95dc", "reselect": "^3.0.0" @@ -5315,9 +5315,8 @@ } }, "react-native-phone-input": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/react-native-phone-input/-/react-native-phone-input-0.2.1.tgz", - "integrity": "sha1-rGhSoeo32NWP+D3tUtGNe2MD5mc=", + "version": "github:lbryio/react-native-phone-input#60fdef484e8bf27328c7fb6a203baab9eb9cd4a1", + "from": "github:lbryio/react-native-phone-input", "requires": { "google-libphonenumber": "^2.0.9", "lodash": "^4.17.4", diff --git a/app/package.json b/app/package.json index a4071f1d..3c61ce67 100644 --- a/app/package.json +++ b/app/package.json @@ -16,7 +16,7 @@ "react-native-fast-image": "^5.0.3", "react-native-fetch-blob": "^0.10.8", "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-video": "lbryio/react-native-video#exoplayer-lbry-android", "react-navigation": "^2.12.1", diff --git a/app/src/component/fileItem/index.js b/app/src/component/fileItem/index.js index 13209f08..f53ef77d 100644 --- a/app/src/component/fileItem/index.js +++ b/app/src/component/fileItem/index.js @@ -5,8 +5,8 @@ import { makeSelectMetadataForUri, makeSelectFileInfoForUri, makeSelectIsUriResolving, - selectRewardContentClaimIds } from 'lbry-redux'; +import { selectRewardContentClaimIds } from 'lbryinc'; import { selectShowNsfw } from '../../redux/selectors/settings'; import FileItem from './view'; diff --git a/app/src/component/fileItem/view.js b/app/src/component/fileItem/view.js index 9539a251..56547638 100644 --- a/app/src/component/fileItem/view.js +++ b/app/src/component/fileItem/view.js @@ -3,8 +3,10 @@ import { normalizeURI } from 'lbry-redux'; import { NavigationActions } from 'react-navigation'; import { NativeModules, Text, View, TouchableOpacity } from 'react-native'; import { navigateToUri } from '../../utils/helper'; +import Colors from '../../styles/colors'; import FileItemMedia from '../fileItemMedia'; import FilePrice from '../filePrice'; +import Icon from 'react-native-vector-icons/FontAwesome5'; import Link from '../link'; import NsfwOverlay from '../nsfwOverlay'; import discoverStyle from '../../styles/discover'; @@ -65,7 +67,10 @@ class FileItem extends React.PureComponent { isResolvingUri={isResolvingUri} style={mediaStyle} /> - {title} + + {title} + {isRewardContent && } + {channelName && { const channelUri = normalizeURI(channelName); diff --git a/app/src/page/discover/index.js b/app/src/page/discover/index.js index 0930f683..0d3da513 100644 --- a/app/src/page/discover/index.js +++ b/app/src/page/discover/index.js @@ -5,6 +5,7 @@ import { selectFeaturedUris, selectFetchingFeaturedUris } from 'lbry-redux'; +import { doFetchRewardedContent } from 'lbryinc'; import DiscoverPage from './view'; const select = state => ({ @@ -15,6 +16,7 @@ const select = state => ({ const perform = dispatch => ({ fetchFeaturedUris: () => dispatch(doFetchFeaturedUris()), + fetchRewardedContent: () => dispatch(doFetchRewardedContent()), }); export default connect(select, perform)(DiscoverPage); \ No newline at end of file diff --git a/app/src/page/discover/view.js b/app/src/page/discover/view.js index 93c55716..b2a81534 100644 --- a/app/src/page/discover/view.js +++ b/app/src/page/discover/view.js @@ -41,7 +41,9 @@ class DiscoverPage extends React.PureComponent { } }); - this.props.fetchFeaturedUris(); + const { fetchFeaturedUris, fetchRewardedContent } = this.props; + fetchFeaturedUris(); + fetchRewardedContent(); } render() { diff --git a/app/src/page/file/index.js b/app/src/page/file/index.js index 19e5d49d..e653fff0 100644 --- a/app/src/page/file/index.js +++ b/app/src/page/file/index.js @@ -9,9 +9,9 @@ import { makeSelectClaimForUri, makeSelectContentTypeForUri, makeSelectMetadataForUri, - selectRewardContentClaimIds, - selectBlackListedOutpoints, + selectBlackListedOutpoints, } from 'lbry-redux'; +import { selectRewardContentClaimIds } from 'lbryinc'; import { doDeleteFile, doStopDownloadingFile } from '../../redux/actions/file'; import FilePage from './view'; diff --git a/app/src/page/splash/index.js b/app/src/page/splash/index.js index d9ac7ed6..f85f128f 100644 --- a/app/src/page/splash/index.js +++ b/app/src/page/splash/index.js @@ -2,6 +2,7 @@ import { connect } from 'react-redux'; import { doBalanceSubscribe, doNotify } from 'lbry-redux'; import { doAuthenticate, + doFetchRewardedContent, doUserEmailToVerify, doUserEmailVerify, doUserEmailVerifyFailure, @@ -18,8 +19,9 @@ const select = state => ({ const perform = dispatch => ({ authenticate: (appVersion, os) => dispatch(doAuthenticate(appVersion, os)), - deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()), balanceSubscribe: () => dispatch(doBalanceSubscribe()), + deleteCompleteBlobs: () => dispatch(doDeleteCompleteBlobs()), + fetchRewardedContent: () => dispatch(doFetchRewardedContent()), notify: data => dispatch(doNotify(data)), setEmailToVerify: email => dispatch(doUserEmailToVerify(email)), verifyUserEmail: (token, recaptcha) => dispatch(doUserEmailVerify(token, recaptcha)), diff --git a/app/src/page/splash/view.js b/app/src/page/splash/view.js index debde4ba..bf0cb797 100644 --- a/app/src/page/splash/view.js +++ b/app/src/page/splash/view.js @@ -50,6 +50,8 @@ class SplashScreen extends React.PureComponent { AsyncStorage.setItem('firstLaunchTime', String(moment().unix())); } }); + + this.props.fetchRewardedContent(); } updateStatus() { diff --git a/app/src/styles/discover.js b/app/src/styles/discover.js index b73b1bc9..dd671d90 100644 --- a/app/src/styles/discover.js +++ b/app/src/styles/discover.js @@ -107,10 +107,23 @@ const discoverStyle = StyleSheet.create({ height: '100%' }, overlayText: { - color: '#ffffff', + color: Colors.White, fontSize: 14, textAlign: 'center', fontFamily: 'Metropolis-Regular' + }, + rewardTitleContainer: { + alignItems: 'center', + flexDirection: 'row', + justifyContent: 'space-between' + }, + rewardIcon: { + color: Colors.LbryGreen, + flex: 0.1, + textAlign: 'center' + }, + rewardTitle: { + flex: 0.9 } }); diff --git a/src/main/java/io/lbry/browser/LbrynetService.java b/src/main/java/io/lbry/browser/LbrynetService.java index 8384dc11..f4adbf24 100644 --- a/src/main/java/io/lbry/browser/LbrynetService.java +++ b/src/main/java/io/lbry/browser/LbrynetService.java @@ -78,7 +78,6 @@ public class LbrynetService extends PythonService { String serviceDescription = "The LBRY service is running in the background."; Context context = getApplicationContext(); - NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { @@ -145,11 +144,17 @@ public class LbrynetService extends PythonService { @Override public void onDestroy() { - super.onDestroy(); if (stopServiceReceiver != null) { unregisterReceiver(stopServiceReceiver); stopServiceReceiver = null; } + + Context context = getApplicationContext(); + NotificationManager notificationManager = + (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancelAll(); + + super.onDestroy(); serviceInstance = null; }