|
|
@@ -13,7 +13,7 @@ import routeUtil from '../utils/routeUtil';
|
|
|
import storage, { getStorage, setStorage } from '../utils/storage';
|
|
|
import app from '../../app.json';
|
|
|
|
|
|
-export const SETTINGS_KEY = 'CHARGE_SETTINGS'
|
|
|
+export const SETTINGS_KEY = 'CHARGE_SETTINGS_V2'
|
|
|
export const SettingUtil = {
|
|
|
getSettings: (back) => {
|
|
|
if (!global.settingsInfo) {
|
|
|
@@ -25,6 +25,7 @@ export const SettingUtil = {
|
|
|
} else {
|
|
|
back({
|
|
|
alwaysLocation: true,
|
|
|
+ moveMyLocation: true,
|
|
|
refreshInterval: 10
|
|
|
})
|
|
|
}
|
|
|
@@ -41,6 +42,7 @@ export default class Settings extends Component {
|
|
|
this.state = {
|
|
|
settings: {
|
|
|
alwaysLocation: true,
|
|
|
+ moveMyLocation: true,
|
|
|
refreshInterval: undefined
|
|
|
},
|
|
|
userInfo: {
|
|
|
@@ -214,6 +216,15 @@ export default class Settings extends Component {
|
|
|
value={this.state.settings.alwaysLocation}
|
|
|
onValueChange={v => this.changeSwitch('alwaysLocation', v)}/>
|
|
|
</Button>
|
|
|
+ <Button
|
|
|
+ style={styles.itemButton}
|
|
|
+ viewStyle={styles.itemView}
|
|
|
+ onClick={() => this.changeSwitch('moveMyLocation', !this.state.settings.moveMyLocation)}>
|
|
|
+ <Text style={styles.buttonText}>{$t('settings.moveMyLocations')}</Text>
|
|
|
+ <Switch
|
|
|
+ value={this.state.settings.moveMyLocation}
|
|
|
+ onValueChange={v => this.changeSwitch('moveMyLocation', v)}/>
|
|
|
+ </Button>
|
|
|
<View style={styles.menuView}>
|
|
|
<Text style={styles.buttonText}>{$t('settings.autoRefreshInterval')}</Text>
|
|
|
<Dropdown
|