Skip to content

Commit

Permalink
Merge pull request #1 from Jason017/main
Browse files Browse the repository at this point in the history
Merging work from @Jason017 to main repo
  • Loading branch information
acedrew authored Feb 9, 2023
2 parents e2774d2 + 0609b06 commit b5eaf93
Show file tree
Hide file tree
Showing 157 changed files with 17,140 additions and 18,041 deletions.
20 changes: 10 additions & 10 deletions .eslintrc
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"
]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ coverage
# macOS
.DS_Store


# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
# The following patterns were generated by expo-cli

Expand Down Expand Up @@ -77,4 +78,4 @@ buck-out/
web-build/
dist/

# @end expo-cli
# @end expo-cli
110 changes: 70 additions & 40 deletions App.tsx
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>
);
}
}
4 changes: 2 additions & 2 deletions android/app/BUCK
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.ace_iot_solutions.open_hems_app",
package = "com.aceiotsolutions.connecting_mha_app",
)

android_resource(
name = "res",
package = "com.ace_iot_solutions.open_hems_app",
package = "com.aceiotsolutions.connecting_mha_app",
res = "src/main/res",
)

Expand Down
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ android {
}

defaultConfig {
applicationId 'com.ace_iot_solutions.open_hems_app'
applicationId 'com.aceiotsolutions.connecting_mha_app'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36
versionName "0.0.25"
versionCode 7
versionName "0.0.7"
}
splits {
abi {
Expand Down
Empty file modified android/app/build_defs.bzl
100755 → 100644
Empty file.
Empty file modified android/app/debug.keystore
100755 → 100644
Empty file.
Empty file modified android/app/proguard-rules.pro
100755 → 100644
Empty file.
Empty file modified android/app/src/debug/AndroidManifest.xml
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.ace_iot_solutions.open_hems_app;
package com.aceiotsolutions.connecting_mha_app;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
Expand Down Expand Up @@ -66,4 +66,4 @@ public void run() {
}
}
}
}
}
8 changes: 4 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ace_iot_solutions.open_hems_app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aceiotsolutions.connecting_mha_app">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Expand All @@ -16,8 +16,8 @@
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="43.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@ace-iot/hems-mobile-app"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@ace-iot/connecting-mha-app"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -26,7 +26,7 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="com.ace_iot_solutions.open_hems_app"/>
<data android:scheme="com.aceiotsolutions.connecting_mha_app"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ace_iot_solutions.open_hems_app;
package com.aceiotsolutions.connecting_mha_app;

import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ace_iot_solutions.open_hems_app;
package com.aceiotsolutions.connecting_mha_app;

import android.app.Application;
import android.content.Context;
Expand Down Expand Up @@ -85,7 +85,7 @@ private static void initializeFlipper(
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.ace_iot_solutions.open_hems_app.ReactNativeFlipper");
Class<?> aClass = Class.forName("com.aceiotsolutions.connecting_mha_app.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
Expand Down
Binary file modified 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 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 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 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 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 modified android/app/src/main/res/drawable/splashscreen.xml
100755 → 100644
Empty file.
Empty file modified android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
100755 → 100644
Empty file.
Empty file.
Binary file modified 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 android/app/src/main/res/values-night/colors.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources/>
1 change: 0 additions & 1 deletion android/app/src/main/res/values/colors.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<color name="splashscreen_background">#170B47</color>
<color name="iconBackground">#FFFFFF</color>
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/res/values/strings.xml
100755 → 100644
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>
1 change: 0 additions & 1 deletion android/app/src/main/res/values/styles.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">@android:color/black</item>
Expand Down
88 changes: 48 additions & 40 deletions android/build.gradle
100755 → 100644
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 modified android/gradle.properties
100755 → 100644
Empty file.
Empty file modified android/gradle/wrapper/gradle-wrapper.jar
100755 → 100644
Empty file.
Empty file modified android/gradle/wrapper/gradle-wrapper.properties
100755 → 100644
Empty file.
Empty file modified android/gradlew.bat
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion android/settings.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'Open HEMS'
rootProject.name = 'Connecting MHA'

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
useExpoModules()
Expand Down
Loading

0 comments on commit b5eaf93

Please sign in to comment.