Skip to content

Commit

Permalink
Merge pull request #17 from Bridgeconn/infographics
Browse files Browse the repository at this point in the history
Infographics
  • Loading branch information
rinsingh authored Sep 21, 2020
2 parents 8f4ebde + c388bad commit ac54fe0
Show file tree
Hide file tree
Showing 42 changed files with 850 additions and 596 deletions.
Binary file added app/assets/Acts_Gospel_Progress-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/headerbook.jpeg
Binary file not shown.
Binary file added app/assets/headerbook.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions app/components/Audio/Controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
View, TouchableOpacity,
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons'

const Controls = ({
styles,
paused,
Expand All @@ -17,7 +16,7 @@ const Controls = ({
<View style={styles.controlerContainer}>
<View style={{ width: 20 }} />
<TouchableOpacity onPress={onBack}>
<Icon onPress={onBack} styles={styles.iconStyle} name="fast-rewind" size={24} />
<Icon onPress={onBack} style={styles.iconStyle} name="fast-rewind" size={24} />
</TouchableOpacity>
<View style={{ width: 10 }} />
{!paused ?
Expand All @@ -26,12 +25,12 @@ const Controls = ({
</View>
:
<View style={styles.playButton}>
<Icon onPress={onPressPlay} styles={styles.iconStyle} name="play-arrow" size={24} />
<Icon onPress={onPressPlay} style={styles.iconStyle} name="play-arrow" size={24} />
</View>
}
<View style={{ width: 10 }} />
<TouchableOpacity onPress={onForward}>
<Icon styles={styles.iconStyle} name="fast-forward" size={24} />
<Icon style={styles.iconStyle} name="fast-forward" size={24} />
</TouchableOpacity>
<View style={{ width: 20 }} />
</View>
Expand Down
100 changes: 59 additions & 41 deletions app/components/Bible/BibleChapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { connect } from 'react-redux'
import { getResultText } from '../../utils/UtilFunctions'
import { Header, Button, Right, Title } from 'native-base'
import Color from '../../utils/colorConstants'
import APIFetch from '../../utils/APIFetch'
import ReloadButton from '../ReloadButton';

class BibleChapter extends Component {
Expand All @@ -21,43 +22,64 @@ class BibleChapter extends Component {
this.styles = styles(this.props.colorFile, this.props.sizeFile);
this.state = {
currentParallelViewChapter: JSON.parse(this.props.currentChapter),
id: this.props.id,
bookId: this.props.bookId,
bookName: this.props.bookName,
totalChapters: this.props.totalChapters,
error: null,
}
this.alertPresent = false
}
queryParallelBible = (val) => {
this.setState({ currentParallelViewChapter: val != null ? this.state.currentParallelViewChapter + val : this.props.currentChapter }, () => {
this.props.fetchParallelBible({
isDownloaded: false, sourceId: this.props.parallelContentSourceId,
language: this.props.parallelContentLanguage,
version: this.props.parallelContentVersionCode,
bookId: this.state.id,
isDownloaded: false, sourceId: this.props.parallelLanguage.sourceId,
language: this.props.parallelLanguage.languageName,
version: this.props.parallelLanguage.versionCode,
bookId: this.props.bookId,
chapter: this.state.currentParallelViewChapter
})
})
}
getRef = (item) => {
this.setState({ currentParallelViewChapter: item.chapterNumber }, () => {
this.setState({
currentParallelViewChapter: item.chapterNumber,
id: item.bookId,
bookName: item.bookName,
totalChapters: item.totalChapters
}, () => {
this.props.fetchParallelBible({
isDownloaded: false, sourceId: this.props.parallelContentSourceId,
language: this.props.parallelContentLanguage, version: this.props.parallelContentVersionCode,
isDownloaded: false, sourceId: this.props.parallelLanguage.sourceId,
language: this.props.parallelLanguage.languageName, version: this.props.parallelLanguage.versionCode,
bookId: item.bookId, chapter: item.chapterNumber
})
this.setState({
currentParallelViewChapter: item.chapterNumber,
id: item.bookId,
bookName: item.bookName,
totalChapters: item.totalChapters
})

})
}

componentDidMount() {
async componentDidMount() {
this.queryParallelBible(null)
try {
let bookName=''
let bookId=''
let response = await APIFetch.fetchBookInLanguage()
for (var i = 0; i <= response.length-1; i++) {
if (this.props.parallelLanguage.languageName.toLowerCase() == response[i].language.name) {
for (var j = 0; j <= response[i].bookNames.length - 1; j++) {
if (response[i].bookNames[j].book_code == this.state.bookId) {
bookName = response[i].bookNames[j].short
bookId = response[i].bookNames[j].book_code
}
}
}
}
this.setState({ bookName: bookName,bookId:bookId })
} catch (error) {
this.setState({ error: error });
}
}
componentWillUnmount() {
// to get the books name in language for single reading page
this.props.books.length = 0;
this.props.fetchVersionBooks({
language: this.props.language,
versionCode: this.props.versionCode,
Expand All @@ -67,7 +89,7 @@ class BibleChapter extends Component {
errorMessage() {
if (!this.alertPresent) {
this.alertPresent = true;
if (this.props.error) {
if (this.props.error || this.state.error) {
Alert.alert("", "Check your internet connection", [{ text: 'OK', onPress: () => { this.alertPresent = false } }], { cancelable: false });
} else {
this.alertPresent = false;
Expand All @@ -84,22 +106,28 @@ class BibleChapter extends Component {
return
}
}
goToSelectionTab = () => {
this.props.navigation.navigate("SelectionTab", {
getReference: this.getRef, parallelContent: true, bookId: this.state.bookId, bookName: this.state.bookName,
chapterNumber: this.state.currentParallelViewChapter, totalChapters: this.state.totalChapters,
language: this.props.parallelLanguage.languageName, version: this.props.parallelLanguage.versionCode,
sourceId: this.props.parallelLanguage.sourceId, downloaded: false,
})

}
render() {
const bookId = this.state.id
const value = this.props.books.length != 0 && this.props.books.filter(function (entry) {
return entry.bookId == bookId
})
const bookName = value ? value[0].bookName : this.state.bookName
let shortbookName = this.props.language.toLowerCase() == ('malayalam' || 'tamil' || 'kannada') ?
(this.state.bookName.length > 4 ? this.state.bookName.slice(0, 3) + "..." : this.state.bookName) :
this.state.bookName.length > 8 ? this.state.bookName.slice(0, 7) + "..." : this.state.bookName
this.styles = styles(this.props.colorFile, this.props.sizeFile);
return (
<View style={this.styles.container}>
<Header style={{ height: 40, borderLeftWidth: 0.2, borderLeftColor: Color.White }}>
<Button transparent onPress={() => { this.props.navigation.navigate("SelectionTab", { getReference: this.getRef, parallelContent: true, bookId: this.state.id, bookName: this.state.bookName, chapterNumber: this.state.currentParallelViewChapter, totalChapters: this.state.totalChapters }) }}>
<Title style={{ fontSize: 16 }}>{bookName.length > 8 ? bookName.slice(0, 7) + "..." : bookName} {this.state.currentParallelViewChapter}</Title>
<Header style={{ backgroundColor: Color.Blue_Color, height: 40, borderLeftWidth: 0.2, borderLeftColor: Color.White }}>
<Button transparent onPress={this.goToSelectionTab}>
<Title style={{ fontSize: 16 }}>{shortbookName} {this.state.currentParallelViewChapter}</Title>
<Icon name="arrow-drop-down" color={Color.White} size={20} />
</Button>
<Right style={{paddingRight:8}}>
<Right>
<Button transparent onPress={() => this.props.toggleParallelView(false)}>
<Icon name='cancel' color={Color.White} size={20} />
</Button>
Expand All @@ -122,7 +150,7 @@ class BibleChapter extends Component {
<View style={{ flex: 1 }}>
<ScrollView contentContainerStyle={{ paddingBottom: 20 }} showsVerticalScrollIndicator={false} ref={(ref) => { this.scrollViewRef = ref; }} >
{this.props.parallelBible.map((verse, index) =>
<View style={{ marginHorizontal: 16 }}>
<View style={{ marginHorizontal: 16, paddingTop: 8 }}>
{verse.number == 1 ?
<Text letterSpacing={24}
style={this.styles.verseWrapperText}>
Expand Down Expand Up @@ -157,9 +185,9 @@ class BibleChapter extends Component {
<View style={this.styles.addToSharefooterComponent}>
{
<View style={this.styles.footerView}>
{(this.props.revision !== null && this.props.revision !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>Copyright:</Text>{' '}{this.props.revision}</Text>}
{(this.props.license !== null && this.props.license !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>License:</Text>{' '}{this.props.license}</Text>}
{(this.props.technologyPartner !== null && this.props.technologyPartner !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>Technology partner:</Text>{' '}{this.props.technologyPartner}</Text>}
{(this.props.parallelMetaData.revision !== null && this.props.parallelMetaData.revision !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>Copyright:</Text>{' '}{this.props.parallelMetaData.revision}</Text>}
{(this.props.parallelMetaData.license !== null && this.props.parallelMetaData.license !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>License:</Text>{' '}{this.props.parallelMetaData.license}</Text>}
{(this.props.parallelMetaData.technologyPartner !== null && this.props.parallelMetaData.technologyPartner !== '') && <Text style={this.styles.textListFooter}><Text style={this.styles.footerText}>Technology partner:</Text>{' '}{this.props.parallelMetaData.technologyPartner}</Text>}
</View>
}
</View>
Expand Down Expand Up @@ -205,17 +233,9 @@ const mapStateToProps = state => {
versionCode: state.updateVersion.versionCode,
sourceId: state.updateVersion.sourceId,
downloaded: state.updateVersion.downloaded,

parallelContentSourceId: state.updateVersion.parallelContentSourceId,
parallelContentVersionCode: state.updateVersion.parallelContentVersionCode,
parallelContentLanguage: state.updateVersion.parallelContentLanguage,
parallelContentLanguageCode: state.updateVersion.parallelContentLanguageCode,
bookId:state.updateVersion.bookId,
bookName:state.updateVersion.bookName,
parallelBible: state.parallel.parallelBible,
parallelContentType: state.updateVersion.parallelContentType,

revision: state.updateVersion.pRevision,
license: state.updateVersion.pLicense,
technologyPartner: state.updateVersion.pTechnologyPartner,

error: state.parallel.error,
loading: state.parallel.loading
Expand All @@ -226,8 +246,6 @@ const mapDispatchToProps = dispatch => {
return {
fetchParallelBible: (data) => dispatch(fetchParallelBible(data)),
fetchVersionBooks: (payload) => dispatch(fetchVersionBooks(payload)),


}
}

Expand Down
27 changes: 8 additions & 19 deletions app/components/Bible/SelectContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,15 @@ class SelectContent extends Component {
<TouchableOpacity
style={this.styles.selectionInnerContent}
onPress={() => {
this.props.navigation.setParams({ modalVisible: false, visibleParallelView: true });
this.props.navigation.setParams({ modalVisible: false, visibleParallelView: true,
parallelLanguage:{languageName:item.languageName,versionCode:v.versionCode,sourceId:v.sourceId},
parallelMetaData:v.metaData[0]
});
this.props.updateContentType({
parallelContentType: contentType, parallelContentLanguage: item.languageName,
parallelContentLanguageCode: item.languageCode, parallelContentVersion: v.versionName,
parallelContentVersionCode: v.versionCode, parallelContentSourceId: v.sourceId
})
this.props.fetchVersionBooks({
language: item.languageName, versionCode: v.versionCode,
downloaded: false, sourceId: v.sourceId
})
this.props.parallelMetadta({
pCopyrightHolder: v.metaData[0].copyrightHolder,
pDescription: v.metaData[0].description,
pLicense: v.metaData[0].license,
pSource: v.metaData[0].source,
pTechnologyPartner: v.metaData[0].technologyPartner,
pRevision: v.metaData[0].revision,
pVersionNameGL: v.metaData[0].versionNameGL
parallelContentType: contentType
})
}}

>
<Text style={this.styles.selectionHeaderModal}>{v.versionName}</Text>
<Text style={this.styles.selectionHeaderModal}>{v.versionCode}</Text>
Expand Down Expand Up @@ -146,11 +135,11 @@ class SelectContent extends Component {
</View>
</Modal>

<TouchableOpacity onPress={this.onPressModal} style={[this.props.navStyles.touchableStyleRight, { flexDirection: 'row' }]}>
<TouchableOpacity onPress={this.onPressModal} style={this.props.navStyles.touchableStyleRight}>
<MaterialCommunityIcons
name='book-open-variant'
color={Color.White}
size={24}
size={26}
/>
</TouchableOpacity>
</View>
Expand Down
59 changes: 0 additions & 59 deletions app/components/Video/VideoPlayer.js

This file was deleted.

1 change: 1 addition & 0 deletions app/models/ChapterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ChapterModel.schema = {
properties: {
chapterNumber: 'int',
numberOfVerses:'int',
chapterHeading:{type: 'string', optional: true},
// totalChapters:'int',
verses: 'VerseModel[]',
// chapterOwner: {type: 'linkingObjects', objectType: 'BookModel', property:'chapters' }
Expand Down
4 changes: 2 additions & 2 deletions app/models/VerseMetadataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ VerseMetadataModel.schema = {
name: 'VerseMetadataModel',
properties: {
// styling:{type: 'string?[]'},
styling:'VerseStylingModel[]',

// styling:'VerseStylingModel[]',
// section:{type: 'string', optional: true},
// VerseMetadataOwner: {type: 'linkingObjects', objectType: 'VerseModel', property: 'metadata' }
}
};
3 changes: 1 addition & 2 deletions app/models/VerseModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ VerseModel.schema = {
properties: {
text: {type: 'string', indexed: true},
number: {type: 'string', indexed: true},
// metadata:'VerseMetadataModel[]',
// verseOwner: {type: 'linkingObjects', objectType: 'ChapterModel', property: 'verses' }
section:{type: 'string', optional: true}
}
};

5 changes: 4 additions & 1 deletion app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import History from '../screens/History/'

import Commentary from '../screens/StudyHelp/Commentary/'
import Dictionary from '../screens/StudyHelp/Dictionary/'
import Infographics from '../screens/StudyHelp/InfoGraphics/';
import InfographicsImage from '../screens/StudyHelp/InfoGraphics/infographicsImage';


import Reset from '../screens/Auth/Reset'
import Register from '../screens/Auth/Register'
Expand All @@ -23,7 +26,6 @@ import LanguageList from '../screens/LanguageList'

import SelectionTab from '../screens/ReferenceSelection/'
import BookMarks from '../screens/Bookmarks/';
import Infographics from '../screens/StudyHelp/InfoGraphics/';
import Color from '../utils/colorConstants'
import Video from '../screens/Video'
import PlayVideo from '../screens/Video/PlayVideo'
Expand Down Expand Up @@ -62,6 +64,7 @@ const NavStack = createStackNavigator(
BookMarks: { screen: BookMarks },
Highlights: { screen: Highlights },
Infographics: { screen: Infographics },
InfographicsImage:{ screen: InfographicsImage },
Login: { screen: Login },
Video: { screen: Video },
PlayVideo: { screen: PlayVideo },
Expand Down
Loading

0 comments on commit ac54fe0

Please sign in to comment.