Skip to content

Commit

Permalink
Merge pull request #203 from ostdotcom/post-denver-fixes
Browse files Browse the repository at this point in the history
Post denver fixes
  • Loading branch information
akshayraje authored Mar 1, 2020
2 parents 9194304 + f0af0b1 commit a70bb4e
Show file tree
Hide file tree
Showing 19 changed files with 349 additions and 219 deletions.
10 changes: 7 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: "com.google.gms.google-services"

repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.fabric.io/public' }
}

import com.android.build.OutputFile
Expand Down Expand Up @@ -136,8 +137,8 @@ android {
applicationId "com.pepo.v2.production"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 30
versionName "1.0.3"
versionCode 31
versionName "1.0.4"
missingDimensionStrategy 'react-native-camera', 'general'
manifestPlaceholders = [
appAuthRedirectScheme: 'com.pepo.v2.production'
Expand Down Expand Up @@ -242,6 +243,9 @@ dependencies {
implementation 'com.datatheorem.android.trustkit:trustkit:1.0.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-dynamic-animation:28.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/java/com/pepo2/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import io.invertase.firebase.links.RNFirebaseLinksPackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.config.RNFirebaseRemoteConfigPackage;
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
import com.pepo2.bridge.PepoNativePackage;

public class MainApplication extends Application implements ReactApplication {
Expand All @@ -41,6 +44,7 @@ protected List<ReactPackage> getPackages() {
packages.add(new RNFirebaseLinksPackage());
packages.add(new RNFirebaseNotificationsPackage());
packages.add(new RNFirebaseRemoteConfigPackage());
packages.add(new RNFirebaseCrashlyticsPackage());
return packages;
}

Expand All @@ -59,6 +63,7 @@ public ReactNativeHost getReactNativeHost() {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
Fabric.with(this, new Crashlytics());
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
OstWalletUI.setLoaderManager(LoaderManager.getInstance());
OstSdkErrors.init(this.getApplicationContext());
Expand Down
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
classpath("com.google.gms:google-services:4.2.0")
classpath("io.fabric.tools:gradle:1.28.1")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
8 changes: 4 additions & 4 deletions ios/Pepo2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Pepo2/Pepo2.entitlements;
CURRENT_PROJECT_VERSION = 28;
CURRENT_PROJECT_VERSION = 29;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = N83K86W6P4;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -628,7 +628,7 @@
INFOPLIST_FILE = Pepo2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -649,7 +649,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Pepo2/Pepo2.entitlements;
CURRENT_PROJECT_VERSION = 28;
CURRENT_PROJECT_VERSION = 29;
DEVELOPMENT_TEAM = N83K86W6P4;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -659,7 +659,7 @@
INFOPLIST_FILE = Pepo2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ target 'Pepo2' do

# Custom additions
pod 'Firebase/Core', '~> 6.3.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
pod 'Firebase/Messaging', '~> 6.3.0'
pod 'Firebase/DynamicLinks', '~> 6.3.0'
pod 'Firebase/RemoteConfig', '~> 6.3.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'

Expand Down
8 changes: 4 additions & 4 deletions src/components/BottomStatus/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BottomStatus extends PureComponent {
getTappedIncludesEntity = ( tag ) => {
let tappedIncludesEntity = ReduxGetters.getTappedIncludesEntity(this.props.entityDescriptionId, tag);
return tappedIncludesEntity;
}
};

render() {
return (
Expand Down Expand Up @@ -66,7 +66,7 @@ class BottomStatus extends PureComponent {
ellipsizeMode={'tail'}
numberOfLines={3}
>
<TextFormatter text={this.props.description} getTappedIncludesEntity={this.getTappedIncludesEntity}
<TextFormatter text={this.props.description} getTappedIncludesEntity={this.getTappedIncludesEntity}
navigation={this.props.navigation}/>
</Text>
) : (
Expand All @@ -88,7 +88,7 @@ class BottomStatus extends PureComponent {
numberOfLines={1}
ellipsizeMode={'tail'}
>
{this.props.link.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '')}
{this.props.link.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '').replace(/\/$/, '')}
</Text>
</TouchableOpacity>
) : (
Expand All @@ -101,6 +101,6 @@ class BottomStatus extends PureComponent {

BottomStatus.defaultProps = {
isUserNavigate : true
}
};

export default BottomStatus;
35 changes: 35 additions & 0 deletions src/components/CommonComponents/ProgressBarWrapper/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { PureComponent } from 'react';
import ProgressBar from 'react-native-progress/Bar';

class ProgressBarWrapper extends PureComponent {

constructor(props){
super(props);
this.state = {
progress: 0
}
}

updateProgress(val){
this.setState({progress: val});
}

getProgress(){
return this.state.progress;
}

render(){
return <ProgressBar
width={null}
color="#EF5566"
progress={this.state.progress}
indeterminate={false}
style={this.props.style}
useNativeDriver={true}
/>
}


}

export default ProgressBarWrapper;
28 changes: 16 additions & 12 deletions src/components/NotificationPermissionModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function enableAccess() {
})
.catch((err) => console.error('An error occurred', err));
}
}
}

export default class NotificationPermissionModal extends React.PureComponent{

Expand All @@ -44,29 +44,33 @@ export default class NotificationPermissionModal extends React.PureComponent{
}
});
}).finally(() => {
utilities.saveItem(`notification-permission-${this.props.userId}`, true);
utilities.saveItem(`notification-permission-show-${this.props.userId}`, true);
utilities.saveItem(`notification-permission-app`, true);
PushNotificationMethods.getToken(this.props.userId);
console.log('handlePermissionButtonClick.askForPNPermission: finally');
PushNotificationMethods.getToken(this.props.userId, () => {
console.log('on callback of getToken');
utilities.saveItem(`notification-permission-${this.props.userId}`, true);
utilities.saveItem(`notification-permission-show-${this.props.userId}`, true);
utilities.saveItem(`notification-permission-app`, true);
});

this.props.onPermissionModalDismiss && this.props.onPermissionModalDismiss();
});
}
};

handlePermissionDismiss = () => {
utilities.saveItem(`notification-permission-show-${this.props.userId}`, true);
this.props.onPermissionModalDismiss && this.props.onPermissionModalDismiss();
}
};

render() {
return (
<Modal style={styles.backgroundStyle} transparent={true}>
<View style={styles.wrappedView}>
<Text style={styles.headerText}>Don't miss out!</Text>

<Text style={styles.smallText}>
Get updates about important activity, videos, people, and communities you follow.
</Text>

<LinearGradient
colors={['#ff7499', '#ff5566']}
locations={[0, 1]}
Expand All @@ -84,7 +88,7 @@ export default class NotificationPermissionModal extends React.PureComponent{
</Text>
</TouchableOpacity>
</LinearGradient>

<TouchableOpacity
onPress={this.handlePermissionDismiss}
style={[Theme.Button.btn, { borderWidth: 0, marginTop: 10 }]}
Expand All @@ -96,9 +100,9 @@ export default class NotificationPermissionModal extends React.PureComponent{
No, Thanks
</Text>
</TouchableOpacity>

</View>
</Modal>
);
}
}
}
4 changes: 2 additions & 2 deletions src/components/PreviewRecordedVideo/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { TouchableOpacity, View, Image, BackHandler, AppState, Text } from 'react-native';
import Video from 'react-native-video';
import NavigationService from '../../services/NavigationService';
import ProgressBar from './ProgressBarWrapper';
import ProgressBar from '../CommonComponents/ProgressBarWrapper';
import playIcon from '../../assets/preview_play_icon.png';
import Store from '../../store';
import { upsertRecordedVideo, videoInProcessing } from '../../actions';
Expand Down Expand Up @@ -210,7 +210,7 @@ class Base extends PureComponent {
paused={this.isPaused()}
repeat={this.repeat}
/>
<ProgressBar ref={this.setProgressBarRef}/>
<ProgressBar ref={this.setProgressBarRef} style={styles.progressBar} />
<TouchableOpacity onPressIn={this.cancleVideoHandling} style={styles.closeBtWrapper}>
<Image style={styles.closeIconSkipFont} source={closeIcon}></Image>
</TouchableOpacity>
Expand Down
17 changes: 9 additions & 8 deletions src/components/PreviewRecordedVideo/MultipleVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ class MultipleVideo extends Base {
this.totalVideos = this.props.videoUrlsList.length || 0;
this.updateProgressIgnoreOnce = false;
this.repeat = false;
this.prevVideosLength = 0;
}

handleProgress = (progress) => {
if(this.isPaused()) return;
this.currentVideoTime = progress.currentTime;
let totalProgress = ( this.getPrevVideoDuration() / 1000) + this.currentVideoTime ,
let totalProgress = ( this.prevVideosLength / 1000) + this.currentVideoTime,
val = totalProgress / ( this.props.totalDuration / 1000);
if(isNaN(val)) return;
this.updateProgress(val);
Expand All @@ -28,6 +29,7 @@ class MultipleVideo extends Base {
}

changeVideo(){
this.prevVideosLength += this.props.videoUrlsList[this.state.activeIndex].durationInMS;
let nextVideoIndex = this.state.activeIndex + 1;
//Check if all video are played
if( nextVideoIndex >= this.totalVideos ){
Expand All @@ -37,21 +39,20 @@ class MultipleVideo extends Base {
this.updateProgress(1);
//Reset next video Index
nextVideoIndex = 0;
this.prevVideosLength = 0;
}
this.seekCount = 0;
this.currentVideoTime = 0;
this.setState({activeIndex: nextVideoIndex});
}

getPrevVideoDuration = () => {
if (this.state.activeIndex < 1){
return 0;
}
return this.props.videoUrlsList[this.state.activeIndex - 1].progress * 100 * 300;
};

getVideoUri = () => {
return {uri : this.props.videoUrlsList[this.state.activeIndex].uri};
};

replay = () => {
this.prevVideosLength = 0;
super.replay();
}

}
Expand Down
31 changes: 0 additions & 31 deletions src/components/PreviewRecordedVideo/ProgressBarWrapper.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/components/Profile/ProfileEditScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ class ProfileEdit extends React.PureComponent {
});
isValid = false;
}
if (this.state.name.length > 30 || this.state.name.length < 2) {
this.setState({
name_error: ostErrors.getUIErrorMessage('name_min_max')
});
isValid = false;
}
if (this.state.user_name.length > 15 || this.state.user_name.length < 1) {
this.setState({
user_name_error: ostErrors.getUIErrorMessage('user_name_min_max')
Expand Down
Loading

0 comments on commit a70bb4e

Please sign in to comment.