Skip to content

Commit

Permalink
Merge pull request #88 from SamTheisens/feature/#83-small-fixes
Browse files Browse the repository at this point in the history
Small fixes for #83
  • Loading branch information
SamTheisens authored May 23, 2022
2 parents 48c861f + 91f0131 commit 44a970f
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 49 deletions.
94 changes: 49 additions & 45 deletions mobile/MatahariTerbit/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { MaterialIcons } from '@expo/vector-icons'
import { WebViewErrorEvent } from 'react-native-webview/lib/WebViewTypes'
import * as Location from 'expo-location'
import { LocationGeocodedAddress } from 'expo-location'
import { LinearGradient } from 'expo-linear-gradient'

const deviceLanguage =
Platform.OS === 'ios'
Expand Down Expand Up @@ -125,55 +124,60 @@ export default function App() {
Platform.OS === 'web' ? <iframe src={baseUrl} height={896} width={414}/> :
<NativeBaseProvider >
<View style={{ flex: 1 }} backgroundColor={backGroundColor}>
<Box safeAreaTop bg={backGroundColor} />
<HStack bg={backGroundColor} px="1" py="3" justifyContent="space-between" alignItems="center" w="100%">
<HStack alignItems="center">
<SunriseLogo width={50} height={50} style={{ marginLeft: 5 }} />
<VStack style={{ marginLeft: 10 }}>
<Heading size="lg" color='white' bold>{title}</Heading>
<Heading size="xs" color='gray.300'>{subTitle}</Heading>
</VStack>
<View>
<Box safeAreaTop bg={backGroundColor} />
<HStack bg={backGroundColor} px="1" py="3" justifyContent="space-between" alignItems="center" w="100%">
<HStack alignItems="center">
<SunriseLogo width={50} height={50} style={{ marginLeft: 5 }} />
<VStack style={{ marginLeft: 10 }}>
<Heading size="lg" color='white' bold>{title}</Heading>
<Heading size="xs" color='gray.300'>{subTitle}</Heading>
</VStack>
</HStack>
<HStack>
<IconButton icon={<Icon as={MaterialIcons} name="info" size="sm" color="white" />}
onPress={() => {
sendMessage(infoOpen ? { messageType: MessageType.InfoClosed } : { messageType: MessageType.InfoOpen })
setInfoOpen(!infoOpen)
}}
/>
</HStack>
</HStack>
<HStack>
<IconButton icon={<Icon as={MaterialIcons} name="info" size="sm" color="white" />}
onPress={() => {
sendMessage(infoOpen ? { messageType: MessageType.InfoClosed } : { messageType: MessageType.InfoOpen })
setInfoOpen(!infoOpen)
</View>
<View style={{ flex:1 }}>
<VStack style={{ width: '100%', height: '100%' }}>
<WebView originWhitelist={[baseUrl]}
ref={webViewRef}
source={{
uri: uri,
baseUrl: ''
}}
/>
</HStack>
</HStack>
<LinearGradient locations={[1.0, 0.75, 0.4, 0.3]} colors={['#F4D797', '#EBB58A', '#DA7F7D', '#B5728E']} style={{ width: '100%', height: '100%' }}>
<WebView originWhitelist={['https://*']}
ref={webViewRef}
source={{
uri: uri,
baseUrl: ''
}}
startInLoadingState={true}
renderLoading={() => <ActivityIndicator size="large" />}
onLoadEnd={() => {
setShow(true)
setReadyForLocation(true)
sendLocationMessage()
}}
geolocationEnabled={true}
setSupportMultipleWindows={false}
scrollEnabled={true}
bounces={false}
onError={onError}
javaScriptEnabled={true}
injectedJavaScript={injectedJavascript}
onMessage={
(incomingMessage) => {
console.log('got da message!', incomingMessage.nativeEvent.data)
automaticallyAdjustContentInsets={false}
startInLoadingState={true}
renderLoading={() => <ActivityIndicator size="large" />}
onLoadEnd={() => {
setShow(true)
setReadyForLocation(true)
sendLocationMessage()
}}
geolocationEnabled={true}
setSupportMultipleWindows={false}
scrollEnabled={true}
bounces={false}
onError={onError}
javaScriptEnabled={true}
injectedJavaScript={injectedJavascript}
onContentProcessDidTerminate={() => webViewRef.current?.reload()}
onMessage={
(incomingMessage) => {
console.log('got da message!', incomingMessage.nativeEvent.data)
setReadyForLocation(true)
sendLocationMessage()
}
}
}
style={{ flex: 1, height: 2, backgroundColor: '#5689CE', display: show ? 'flex' : 'none' }}
/>
</LinearGradient>
/>
</VStack>
</View>
</View>
</NativeBaseProvider>
)
Expand Down
10 changes: 6 additions & 4 deletions mobile/MatahariTerbit/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "Solar Calculator Indonesia",
"slug": "SolarCalculatorIndonesia",
"version": "1.0.1",
"version": "1.0.2",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
Expand All @@ -17,9 +17,10 @@
"**/*"
],
"ios": {
"buildNumber": "23",
"buildNumber": "26",
"supportsTablet": true,
"bundleIdentifier": "com.sjappelodorus.MatahariTerbit",
"googleServicesFile": "./firebase/GoogleService-Info.plist",
"config": {
"usesNonExemptEncryption": false
},
Expand All @@ -32,12 +33,13 @@
"en": "./i18n/english.json"
},
"android": {
"versionCode": 15,
"versionCode": 18,
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#1890ff"
},
"package": "com.sjappelodorus.MatahariTerbit"
"package": "com.sjappelodorus.MatahariTerbit",
"googleServicesFile": "./firebase/google-services.json"
},
"web": {
"favicon": "./assets/favicon.png"
Expand Down
34 changes: 34 additions & 0 deletions mobile/MatahariTerbit/firebase/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>519055258-3mcfri56e3n396c00j4fc0mf75v0tmks.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.519055258-3mcfri56e3n396c00j4fc0mf75v0tmks</string>
<key>API_KEY</key>
<string>AIzaSyCsXHX6Yd2tY8Ppz2STVOUgCn79T5Ut0Rw</string>
<key>GCM_SENDER_ID</key>
<string>519055258</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.sjappelodorus.MatahariTerbit</string>
<key>PROJECT_ID</key>
<string>matahariterbit</string>
<key>STORAGE_BUCKET</key>
<string>matahariterbit.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:519055258:ios:5d63c55e852ab419a4fc23</string>
</dict>
</plist>
55 changes: 55 additions & 0 deletions mobile/MatahariTerbit/firebase/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"project_info": {
"project_number": "519055258",
"project_id": "matahariterbit",
"storage_bucket": "matahariterbit.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:519055258:android:93a441c72ca8ac9ba4fc23",
"android_client_info": {
"package_name": "com.sjappelodorus.MatahariTerbit"
}
},
"oauth_client": [
{
"client_id": "519055258-4icf1nrs9p8mvdeig9rlr7og451916f6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.sjappelodorus.MatahariTerbit",
"certificate_hash": "e35b941380cc60e60e9a11ac6e38e3836311f366"
}
},
{
"client_id": "519055258-eid6mb7m02obv47huqos2mtt77shudd9.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAe3yoW57MDaf0nbENAnHvvUTOIeT1VAME"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "519055258-eid6mb7m02obv47huqos2mtt77shudd9.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "519055258-3mcfri56e3n396c00j4fc0mf75v0tmks.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.sjappelodorus.MatahariTerbit",
"app_store_id": "1618024702"
}
}
]
}
}
}
],
"configuration_version": "1"
}

0 comments on commit 44a970f

Please sign in to comment.