-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Jason017/main
Merging work from @Jason017 to main repo
- Loading branch information
Showing
157 changed files
with
17,140 additions
and
18,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
] | ||
} | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,70 @@ | ||
import React, { useEffect } from "react"; | ||
import { Platform, StatusBar } from "react-native"; | ||
import AppLoading from "expo-app-loading"; | ||
import { NavigationContainer } from "@react-navigation/native"; | ||
|
||
import { AppNavigator } from "./navigators/AppNavigator"; | ||
import { useFonts, Rubik_300Light, Rubik_400Regular, Rubik_500Medium } from "@expo-google-fonts/rubik"; | ||
import { SafeAreaProvider } from "react-native-safe-area-context"; | ||
import { ErrorBoundary } from "./components/ErrorBoundary"; | ||
import { theme } from "./theme"; | ||
|
||
export default function App() { | ||
const [fontsLoaded] = useFonts({ | ||
Rubik_300Light, | ||
Rubik_400Regular, | ||
Rubik_500Medium, | ||
}); | ||
|
||
useEffect(() => { | ||
StatusBar.setBarStyle("dark-content"); | ||
|
||
if (Platform.OS === "android") { | ||
StatusBar.setBackgroundColor(theme.background); | ||
} | ||
}); | ||
|
||
if (!fontsLoaded) { | ||
return <AppLoading />; | ||
} else { | ||
return ( | ||
<ErrorBoundary> | ||
<SafeAreaProvider> | ||
<NavigationContainer> | ||
<AppNavigator /> | ||
</NavigationContainer> | ||
</SafeAreaProvider> | ||
</ErrorBoundary> | ||
); | ||
} | ||
} | ||
import React, { useEffect } from "react"; | ||
import { Platform, StatusBar } from "react-native"; | ||
import AppLoading from "expo-app-loading"; | ||
import { NavigationContainer } from "@react-navigation/native"; | ||
|
||
import { AppNavigator } from "./navigators/AppNavigator"; | ||
import { useFonts, Rubik_300Light, Rubik_400Regular, Rubik_500Medium } from "@expo-google-fonts/rubik"; | ||
import { SafeAreaProvider } from "react-native-safe-area-context"; | ||
import { ErrorBoundary } from "./components/ErrorBoundary"; | ||
import { theme } from "./theme"; | ||
import { WelcomeScreen } from "./screens/WelcomeScreen"; | ||
import { createNativeStackNavigator } from "@react-navigation/native-stack"; | ||
import { AppScreenParamsList } from "./types"; | ||
import { MacAddressScreen } from "./screens/MacAddressScreen"; | ||
import { OptionsMenuScreen } from "./screens/OptionsMenuScreen"; | ||
import { SettingsScreen } from "./screens/SettingsScreen"; | ||
import { AuthTokenScreen } from "./screens/AuthTokenScreen"; | ||
|
||
const { Navigator, Screen } = createNativeStackNavigator<AppScreenParamsList>(); | ||
|
||
function MainNavigator() { | ||
const headerTintColor = theme.text; | ||
const headerTitleStyle = { | ||
fontFamily: theme.fonts.title, | ||
}; | ||
|
||
return ( | ||
<Navigator initialRouteName="DebugWelcome"> | ||
<Screen name="DebugWelcome" component={WelcomeScreen} options={{ headerShown: false }} /> | ||
<Screen name="DebugMacAddress" component={MacAddressScreen} options={{ animation: "none", headerShown: false }} /> | ||
<Screen name="AppNavigator" component={AppNavigator} options={{ animation: "none", headerShown: false }} /> | ||
|
||
<Screen name="Options" component={OptionsMenuScreen} /> | ||
<Screen name="SettingsScreen" component={SettingsScreen} options={{ headerTintColor, headerTitleStyle }} /> | ||
<Screen name="AuthTokenScreen" component={AuthTokenScreen} options={{ headerTintColor, headerTitleStyle }} /> | ||
</Navigator> | ||
); | ||
} | ||
|
||
export default function App() { | ||
const [fontsLoaded] = useFonts({ | ||
Rubik_300Light, | ||
Rubik_400Regular, | ||
Rubik_500Medium, | ||
}); | ||
|
||
// console.log("process.env.NODE_ENV: ", process.env.NODE_ENV); | ||
|
||
useEffect(() => { | ||
StatusBar.setBarStyle("dark-content"); | ||
|
||
if (Platform.OS === "android") { | ||
StatusBar.setBackgroundColor(theme.background); | ||
} | ||
}); | ||
|
||
if (!fontsLoaded) { | ||
return <AppLoading />; | ||
} else { | ||
return ( | ||
<ErrorBoundary> | ||
<SafeAreaProvider> | ||
<NavigationContainer> | ||
<MainNavigator /> | ||
</NavigationContainer> | ||
</SafeAreaProvider> | ||
</ErrorBoundary> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...solutions/open_hems_app/MainActivity.java → ...ions/connecting_mha_app/MainActivity.java
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-3.76 MB
(3.0%)
android/app/src/main/res/drawable-hdpi/splashscreen_image.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 MB
(3.0%)
android/app/src/main/res/drawable-mdpi/splashscreen_image.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 MB
(3.0%)
android/app/src/main/res/drawable-xhdpi/splashscreen_image.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 MB
(3.0%)
android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 MB
(3.0%)
android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file modified
0
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
100755 → 100644
Empty file.
Binary file modified
BIN
-1.45 KB
(57%)
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.41 KB
(7.7%)
android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+876 Bytes
(190%)
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.13 KB
(75%)
android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-785 Bytes
(61%)
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.28 KB
(11%)
android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+408 Bytes
(160%)
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-566 Bytes
(80%)
android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.22 KB
(55%)
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.62 KB
(6.7%)
android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.14 KB
(180%)
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.88 KB
(72%)
android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.84 KB
(55%)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.17 KB
(5.9%)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.1 KB
(180%)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.38 KB
(70%)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.75 KB
(55%)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8.96 KB
(5.6%)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.06 KB
(180%)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.88 KB
(70%)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion
1
android/app/src/main/res/values-night/colors.xml
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<resources/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<resources> | ||
<string name="app_name">Open HEMS</string> | ||
<string name="app_name">Connecting MHA</string> | ||
<string name="expo_splash_screen_resize_mode" translatable="false">cover</string> | ||
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,48 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
ext { | ||
buildToolsVersion = "29.0.3" | ||
minSdkVersion = 21 | ||
compileSdkVersion = 30 | ||
targetSdkVersion = 30 | ||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath("com.android.tools.build:gradle:4.1.0") | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android")) | ||
} | ||
maven { | ||
// Android JSC is installed from npm | ||
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist")) | ||
} | ||
|
||
google() | ||
mavenCentral() | ||
jcenter() | ||
maven { url 'https://www.jitpack.io' } | ||
} | ||
} | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
ext { | ||
buildToolsVersion = "29.0.3" | ||
minSdkVersion = 21 | ||
compileSdkVersion = 30 | ||
targetSdkVersion = 30 | ||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath("com.android.tools.build:gradle:4.1.0") | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim()) | ||
|
||
allprojects { | ||
configurations.all { | ||
resolutionStrategy { | ||
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android")) | ||
} | ||
maven { | ||
// Android JSC is installed from npm | ||
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist")) | ||
} | ||
|
||
google() | ||
mavenCentral() | ||
jcenter() | ||
maven { url 'https://www.jitpack.io' } | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.