Skip to content

Commit

Permalink
Fix #55, #26, #25
Browse files Browse the repository at this point in the history
  • Loading branch information
kee23 committed May 27, 2020
1 parent 1964d89 commit 8f3978b
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 80 deletions.
6 changes: 6 additions & 0 deletions actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const TOGGLE_SCREEN_AWAKE = "TOGGLE_SCREEN_AWAKE";
export const SET_BANI_ORDER = "SET_BANI_ORDER";
export const SET_BANI_LENGTH = "SET_BANI_LENGTH";
export const TOGGLE_LARIVAAR = "TOGGLE_LARIVAAR";
export const TOGGLE_LARIVAAR_ASSIST = "TOGGLE_LARIVAAR_ASSIST";
export const SET_MANGLACHARAN_POSITION = "SET_MANGLACHARAN_POSITION";
export const SET_PADCHHED_SETTINGS = "SET_PADCHHED_SETTINGS";
export const TOGGLE_STATISTICS = "TOGGLE_STATISTICS";
Expand Down Expand Up @@ -201,6 +202,11 @@ export function toggleLarivaar(value) {
return { type: TOGGLE_LARIVAAR, value };
}

export function toggleLarivaarAssist(value) {
AnalyticsManager.getInstance().trackSettingsEvent("larivaarAssist", value);
return { type: TOGGLE_LARIVAAR_ASSIST, value };
}

export function setManglacharanPosition(position) {
AnalyticsManager.getInstance().trackSettingsEvent("manglacharan", position);
return { type: SET_MANGLACHARAN_POSITION, position };
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ android {
applicationId "com.WahegurooNetwork.SundarGutka"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 98
versionName "5.6.2"
versionCode 99
versionName "5.6.3"
multiDexEnabled true
}
splits {
Expand Down
Binary file modified android/app/release/app-release.aab
Binary file not shown.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.2')
classpath('com.android.tools.build:gradle:3.6.3')
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.28.1'
// NOTE: Do not place your application dependencies here; they belong
Expand Down
29 changes: 13 additions & 16 deletions components/BaniLengthSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import Icon from "react-native-vector-icons/Entypo";
import * as actions from "../actions/actions";
import GLOBAL from "../utils/globals";
import Strings from "../utils/localization";

class BaniLengthSelector extends Component {
state = {
Expand Down Expand Up @@ -61,7 +62,7 @@ class BaniLengthSelector extends Component {
}
]}
>
{"Kwlsw suMdr gutkw"}
{Strings.khalsa_sundar_gutka}
</Text>

<Text
Expand All @@ -72,13 +73,8 @@ class BaniLengthSelector extends Component {
}
]}
>
{"\n"}Based on user feedback, we know there are many different
variations of certain Banis out there that people read. To make
sure you get the best experience from our app, please choose a
preference below which best describes your preferences.{"\n"}
{"\n"}This will be a one-time setup, but you can change these
settings at any time by going to Settings > Bani Length in the
app.
{"\n"}{Strings.bani_length_message_1}{"\n"}
{"\n"}{Strings.bani_length_message_2}
</Text>
<Text
style={[
Expand All @@ -89,28 +85,28 @@ class BaniLengthSelector extends Component {
}
]}
>
{"\n"}Choose your preference:
{"\n"}{Strings.choose_your_preference}:
</Text>

<TouchableOpacity
onPress={() => this.updateBaniLength(actions.BANI_LENGTHS[0])}
>
<Text style={styles.button}>SHORT</Text>
<Text style={styles.button}>{Strings.short}</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => this.updateBaniLength(actions.BANI_LENGTHS[1])}
>
<Text style={styles.button}>MEDIUM</Text>
<Text style={styles.button}>{Strings.medium}</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => this.updateBaniLength(actions.BANI_LENGTHS[2])}
>
<Text style={styles.button}>LONG</Text>
<Text style={styles.button}>{Strings.long}</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => this.updateBaniLength(actions.BANI_LENGTHS[3])}
>
<Text style={styles.button}>EXTRA LONG</Text>
<Text style={styles.button}>{Strings.extra_long}</Text>
</TouchableOpacity>

<TouchableOpacity
Expand Down Expand Up @@ -139,7 +135,7 @@ class BaniLengthSelector extends Component {
}
]}
>
{" "}Need help deciding?
{" "}{Strings.need_help_deciding}
<Text
style={[
{
Expand All @@ -150,7 +146,7 @@ class BaniLengthSelector extends Component {
]}
>
{" "}
Click here for more information
{Strings.click_more_info}
</Text>
</Text>
</TouchableOpacity>
Expand All @@ -169,7 +165,8 @@ const styles = StyleSheet.create({
marginTop: 15,
fontSize: 24,
fontWeight: "bold",
textAlign: "center"
textAlign: "center",
textTransform: "uppercase"
}
});

Expand Down
4 changes: 2 additions & 2 deletions ios/SundarGutka.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
DEVELOPMENT_TEAM = B3W82WVBU9;
INFOPLIST_FILE = SundarGutka/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 5.6.2;
MARKETING_VERSION = 5.6.3;
OTHER_CFLAGS = (
"$(inherited)",
"-DFB_SONARKIT_ENABLED=1",
Expand Down Expand Up @@ -797,7 +797,7 @@
DEVELOPMENT_TEAM = B3W82WVBU9;
INFOPLIST_FILE = SundarGutka/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 5.6.2;
MARKETING_VERSION = 5.6.3;
OTHER_CFLAGS = (
"$(inherited)",
"-DFB_SONARKIT_ENABLED=1",
Expand Down
11 changes: 11 additions & 0 deletions reducers/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SET_BANI_ORDER,
SET_BANI_LENGTH,
TOGGLE_LARIVAAR,
TOGGLE_LARIVAAR_ASSIST,
SET_MANGLACHARAN_POSITION,
SET_PADCHHED_SETTINGS,
TOGGLE_STATISTICS,
Expand Down Expand Up @@ -140,6 +141,15 @@ function larivaar(state = false, action) {
}
}

function larivaarAssist(state = false, action) {
switch (action.type) {
case TOGGLE_LARIVAAR_ASSIST:
return action.value;
default:
return state;
}
}

function manglacharanPosition(state = "CURRENT_SAROOPS", action) {
switch (action.type) {
case SET_MANGLACHARAN_POSITION:
Expand Down Expand Up @@ -307,6 +317,7 @@ const rootReducer = combineReducers({
baniOrder,
baniLength,
larivaar,
larivaarAssist,
manglacharanPosition,
padchhedSetting,
statistics,
Expand Down
4 changes: 2 additions & 2 deletions screens/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class Home extends React.Component {
}

loadBaniList() {
Database.getBaniList(this.props.transliterationLanguage).then(
Database.initDB().then(() => Database.getBaniList(this.props.transliterationLanguage).then(
(baniList) => {
this.props.setMergedBaniData(mergedBaniList(baniList));
this.sortBani();
this.setState({
isLoading: false,
});
}
);
));
}

sortBani() {
Expand Down
3 changes: 3 additions & 0 deletions screens/Reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Reader extends React.Component {
this.props.currentShabad,
this.props.baniLength,
this.props.larivaar,
this.props.larivaarAssist,
this.props.padchhedSetting,
this.props.manglacharanPosition,
this.props.paragraphMode,
Expand All @@ -83,6 +84,7 @@ class Reader extends React.Component {
if (
prevProps.baniLength != this.props.baniLength ||
prevProps.larivaar != this.props.larivaar ||
prevProps.larivaarAssist != this.props.larivaarAssist ||
prevProps.paragraphMode != this.props.paragraphMode ||
prevProps.manglacharanPosition != this.props.manglacharanPosition ||
prevProps.padchhedSetting != this.props.padchhedSetting ||
Expand Down Expand Up @@ -706,6 +708,7 @@ function mapStateToProps(state) {
fontFace: state.fontFace,
baniLength: state.baniLength,
larivaar: state.larivaar,
larivaarAssist: state.larivaarAssist,
padchhedSetting: state.padchhedSetting,
manglacharanPosition: state.manglacharanPosition,
englishTranslations: state.englishTranslations,
Expand Down
30 changes: 30 additions & 0 deletions screens/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,35 @@ class Settings extends React.Component {
titleStyle={[this.props.nightMode && { color: "#fff" }]}
bottomDivider={true}
/>
{this.props.larivaar && (
<ListItem
backgroundColor={this.props.nightMode ? "#464646" : "#fff"}
leftAvatar={
<Icon
style={styles.imageStyle}
color={
this.props.nightMode
? GLOBAL.COLOR.COMPONENT_COLOR_NIGHT_MODE
: GLOBAL.COLOR.COMPONENT_COLOR
}
name="opacity"
size={30}
/>
}
switch={{
switchStyle,
value: this.props.larivaarAssist,
onValueChange: this.props.toggleLarivaarAssist,
}}
title={Strings.larivaar_assist}
containerStyle={[
styles.titleText,
this.props.nightMode && { backgroundColor: "#464646" },
]}
titleStyle={[this.props.nightMode && { color: "#fff" }]}
bottomDivider={true}
/>
)}
<ListItem
backgroundColor={this.props.nightMode ? "#464646" : "#fff"}
leftAvatar={
Expand Down Expand Up @@ -1091,6 +1120,7 @@ function mapStateToProps(state) {
screenAwake: state.screenAwake,
baniLength: state.baniLength,
larivaar: state.larivaar,
larivaarAssist: state.larivaarAssist,
manglacharanPosition: state.manglacharanPosition,
padchhedSetting: state.padchhedSetting,
statistics: state.statistics,
Expand Down
Loading

0 comments on commit 8f3978b

Please sign in to comment.