added two thumb slider for device auto brightness
parent
6eca86355c
commit
ed3b92fafb
|
@ -14,17 +14,13 @@ import { useTranslation } from "react-i18next";
|
||||||
import MySwitch from "../../Components/Switch";
|
import MySwitch from "../../Components/Switch";
|
||||||
import MyButton, { MyIconButton } from "../../Components/Button";
|
import MyButton, { MyIconButton } from "../../Components/Button";
|
||||||
import { MyBottomSheetModal } from "../../Components/Modal";
|
import { MyBottomSheetModal } from "../../Components/Modal";
|
||||||
import { Slider } from "@miblanchard/react-native-slider";
|
import { MyTwoThumbsSlider } from "../../Components/Slider";
|
||||||
import {
|
|
||||||
MySliderContainer,
|
|
||||||
MyTwoThumbsSlider,
|
|
||||||
SliderContainer,
|
|
||||||
} from "../../Components/Slider";
|
|
||||||
|
|
||||||
export default function SettingsView({ navigation }) {
|
export default function SettingsView({ navigation }) {
|
||||||
const appContext = useContext(AppContext);
|
const appContext = useContext(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [switchState, setSwitchState] = useState(false);
|
const [switchWifiStandby, setSwitchWifiStandby] = useState(false);
|
||||||
|
const [switchAutoBrightness, setSwitchAutoBrightness] = useState(false);
|
||||||
const [textDeviceIdHidden, setTextDeviceIdHidden] = useState(true);
|
const [textDeviceIdHidden, setTextDeviceIdHidden] = useState(true);
|
||||||
const [textDeviceMacAddressHidden, setTextDeviceMacAddressHidden] =
|
const [textDeviceMacAddressHidden, setTextDeviceMacAddressHidden] =
|
||||||
useState(true);
|
useState(true);
|
||||||
|
@ -113,20 +109,34 @@ export default function SettingsView({ navigation }) {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<MySwitch
|
<MySwitch
|
||||||
value={switchState}
|
value={switchWifiStandby}
|
||||||
onValueChange={(e) => setSwitchState(e)}
|
onValueChange={(e) => setSwitchWifiStandby(e)}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<SettingsText
|
<SettingsText
|
||||||
|
containerStyle={{ width: "80%" }}
|
||||||
title={t("screens.device.settings.deviceAutoBrightnessTitle")}
|
title={t("screens.device.settings.deviceAutoBrightnessTitle")}
|
||||||
description={t(
|
description={t(
|
||||||
"screens.device.settings.deviceAutoBrightnessDescription"
|
"screens.device.settings.deviceAutoBrightnessDescription"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<MySwitch
|
||||||
|
value={switchAutoBrightness}
|
||||||
|
onValueChange={(e) => setSwitchAutoBrightness(e)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
<MyTwoThumbsSlider
|
<MyTwoThumbsSlider
|
||||||
appContext={appContext}
|
appContext={appContext}
|
||||||
sliderValue={[20, 80]}
|
sliderValue={[20, 80]}
|
||||||
|
|
Loading…
Reference in New Issue