diff --git a/App.js b/App.js index 7a46697..b74f208 100644 --- a/App.js +++ b/App.js @@ -65,7 +65,7 @@ export function MyApp() { screenOptions={{ // headerShown: false, headerStyle: { - backgroundColor: appContext.appTheme.drawer.backgroundColor, + backgroundColor: appContext.appTheme.backgroundColor, }, headerTintColor: appContext.appTheme.text, drawerStyle: { diff --git a/README.md b/README.md index 4a855d5..f31b8ba 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,6 @@ npx expo start -c https://pictogrammers.com/library/mdi/ -# RNUILib - -https://wix.github.io/react-native-ui-lib/docs/getting-started/setup - https://stackoverflow.com/questions/68243384/dark-mode-usecolorscheme-always-returns-light-on-android https://stackoverflow.com/questions/70493788/i18nextpluralresolver-your-environment-seems-not-to-be-intl-api-compatible-u diff --git a/assets/icons/chevronDown.png b/assets/icons/chevronDown.png deleted file mode 100644 index 6439e5c..0000000 Binary files a/assets/icons/chevronDown.png and /dev/null differ diff --git a/locales/de.json b/locales/de.json index ed6ae46..ef0ab17 100644 --- a/locales/de.json +++ b/locales/de.json @@ -10,7 +10,9 @@ "device": { "light": { "pickerColorModeText": "Farbauswahl", - "pickerColorModePlaceholder": "Wählen Sie einen Farbmodus" + "pickerColorModePlaceholder": "Wählen Sie einen Farbmodus", + "minimumBrightnessText": "Minimale Helligkeit", + "maximumBrightnessText": "Maximale Helligkeit" }, "settings": { "settingsTitle": "Einstellungen", diff --git a/locales/en.json b/locales/en.json index feb5c81..37df20d 100644 --- a/locales/en.json +++ b/locales/en.json @@ -10,7 +10,9 @@ "device": { "light": { "pickerColorModeText": "Color selection", - "pickerColorModePlaceholder": "Select a color mode" + "pickerColorModePlaceholder": "Select a color mode", + "minimumBrightnessText": "Minimum brightness", + "maximumBrightnessText": "Maximum brightness" }, "settings": { "settingsTitle": "Settings", diff --git a/src/Components/Slider/index.js b/src/Components/Slider/index.js index 7147c4b..258743a 100644 --- a/src/Components/Slider/index.js +++ b/src/Components/Slider/index.js @@ -8,6 +8,7 @@ export default function MySlider({ onValueChange, minimumValue, maximumValue, + inverted, }) { const appContext = useContext(AppContext); @@ -17,6 +18,7 @@ export default function MySlider({ minimumValue={minimumValue} maximumValue={maximumValue} value={value} + inverted={inverted} onValueChange={onValueChange} minimumTrackTintColor={appContext.appTheme.slider.minimumTrackTintColor} maximumTrackTintColor={appContext.appTheme.slider.maximumTrackTintColor} diff --git a/src/Components/Switch/index.js b/src/Components/Switch/index.js index 0df437c..766ae0b 100644 --- a/src/Components/Switch/index.js +++ b/src/Components/Switch/index.js @@ -2,11 +2,12 @@ import { useContext } from "react"; import { Switch } from "react-native"; import { AppContext } from "../../utils"; -export default function MySwitch({ value, onValueChange }) { +export default function MySwitch({ style, value, onValueChange }) { const appContext = useContext(AppContext); return ( { selectedColorPickerColor.value = color.hex; @@ -133,191 +137,268 @@ export default function LightView() { }; return ( - - setModalDeviceColorModeVisible(true)}> - - - - {t("screens.device.light.pickerColorModeText")} - - - {selectedDeviceColorMode === "" - ? t("screens.device.light.pickerColorModePlaceholder") - : colorModePickerOptions.find( - (item) => item.value === selectedDeviceColorMode - ).label} - + <> + + setModalDeviceColorModeVisible(true)}> + + + + {t("screens.device.light.pickerColorModeText")} + + + {selectedDeviceColorMode === "" + ? t("screens.device.light.pickerColorModePlaceholder") + : colorModePickerOptions.find( + (item) => item.value === selectedDeviceColorMode + ).label} + + + + + + { + return { + label: item.label, + onPress: () => setSelectedDeviceColorMode(item.value), + selected: selectedDeviceColorMode === item.value, + }; + })} + /> + + + setSwitchState(e)} + /> + setSliderBrightness(v)} + /> + + + + + + { + setSelectedGlasLayer(1); + selectedColorPickerColor.value = selectedColorLayer1.value; + }} + /> + { + setSelectedGlasLayer(2); + selectedColorPickerColor.value = selectedColorLayer2.value; + }} + /> + { + setSelectedGlasLayer(3); + selectedColorPickerColor.value = selectedColorLayer3.value; + }} + /> + { + setSelectedGlasLayer(4); + selectedColorPickerColor.value = selectedColorLayer4.value; + }} + /> + + + + setColorSwatchesFavorites([ + ...colorSwatchesFavorites, + selectedColorPickerColor.value, + ]) + } + style={{ + position: "absolute", + top: 20, + right: 0, + }} + > + + + + + + + + + + + + {appContext.isUserExpertModeEnabled && ( + + + + )} + + + + + + + - - - - { - return { - label: item.label, - onPress: () => setSelectedDeviceColorMode(item.value), - selected: selectedDeviceColorMode === item.value, - }; - })} - /> - - - setSwitchState(e)} - /> - - - - - - - - - - { - setSelectedGlasLayer(1); - selectedColorPickerColor.value = selectedColorLayer1.value; - }} - /> - { - setSelectedGlasLayer(2); - selectedColorPickerColor.value = selectedColorLayer2.value; - }} - /> - { - setSelectedGlasLayer(3); - selectedColorPickerColor.value = selectedColorLayer3.value; - }} - /> - { - setSelectedGlasLayer(4); - selectedColorPickerColor.value = selectedColorLayer4.value; - }} - /> - - - - setColorSwatchesFavorites([ - ...colorSwatchesFavorites, - selectedColorPickerColor.value, - ]) - } - style={{ - position: "absolute", - top: 20, - right: 0, - }} - > - - - - - - - - - - + Auto brightness + + setSwitchState(e)} /> + - {appContext.isUserExpertModeEnabled && ( - - - - )} - - - + + + {t("screens.device.light.minimumBrightnessText")} + + + {sliderMinimumBrightness} % + + + + + {t("screens.device.light.maximumBrightnessText")} + + + {sliderMaximumBrightness} % + + + + + + setSliderMinimumBrightness(Math.round(v))} + /> + + + setSliderMaximumBrightness(Math.round(v))} + /> + + + + ); } -/* - - {colorSwatchesFavorites.map((color, i) => ( - { - console.log("press", color, renderKey); - selectedColorPickerColor.value = color; - setRenderKey((prevKey) => prevKey + 1); - }} - /> - ))} - -*/ - -// - const styles = StyleSheet.create({ previewTxtContainer: { paddingTop: 20, diff --git a/src/utils.js b/src/utils.js index cf75c5e..de087f9 100644 --- a/src/utils.js +++ b/src/utils.js @@ -54,12 +54,12 @@ const DarkAppTheme = { activeBackgroundColor: "rgba(0, 0, 0, 0.1)", }, }, - divider: "#888", + divider: "#434443", icon: "#ddd", switch: { - trackColorTrue: "#b2b3b3", + trackColorTrue: "#01d064", trackColorFalse: "#b2b3b3", - thumbColorTrue: "#e67e22", + thumbColorTrue: "#f4f3f4", thumbColorFalse: "#f4f3f4", ios_backgroundColor: "#3e3e3e", }, @@ -93,9 +93,9 @@ const LightAppTheme = { divider: "#ddd", icon: "#000", switch: { - trackColorTrue: "#b2b3b3", + trackColorTrue: "#01d064", trackColorFalse: "#b2b3b3", - thumbColorTrue: "#e67e22", + thumbColorTrue: "#f4f3f4", thumbColorFalse: "#f4f3f4", ios_backgroundColor: "#3e3e3e", },