fix media auto download view layout and minor tweak wifi
This commit is contained in:
parent
e0942b24a4
commit
332e51f2db
|
@ -67,7 +67,7 @@ const DownloadIndicator = ({ handleCancelDownload }: { handleCancelDownload(): v
|
||||||
<Text style={[styles.text, { color: colors.auxiliaryText }]}>{I18n.t('Cancel')}</Text>
|
<Text style={[styles.text, { color: colors.auxiliaryText }]}>{I18n.t('Cancel')}</Text>
|
||||||
</Touchable>
|
</Touchable>
|
||||||
</View>
|
</View>
|
||||||
<RCActivityIndicator />
|
<RCActivityIndicator size={48} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -905,6 +905,6 @@
|
||||||
"Images": "Images",
|
"Images": "Images",
|
||||||
"Video": "Video",
|
"Video": "Video",
|
||||||
"Wi_Fi_and_mobile_data":"Wi-Fi and mobile data",
|
"Wi_Fi_and_mobile_data":"Wi-Fi and mobile data",
|
||||||
"Wi_Fi": "Wi-fi",
|
"Wi_Fi": "Wi-Fi",
|
||||||
"Off": "Off"
|
"Off": "Off"
|
||||||
}
|
}
|
|
@ -891,6 +891,6 @@
|
||||||
"Images": "Imagens",
|
"Images": "Imagens",
|
||||||
"Video": "Vídeo",
|
"Video": "Vídeo",
|
||||||
"Wi_Fi_and_mobile_data":"Wi-Fi e dados móveis",
|
"Wi_Fi_and_mobile_data":"Wi-Fi e dados móveis",
|
||||||
"Wi_Fi": "Wi-fi",
|
"Wi_Fi": "Wi-Fi",
|
||||||
"Off": "Desativado"
|
"Off": "Desativado"
|
||||||
}
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
import React from 'react';
|
import React, { useLayoutEffect } from 'react';
|
||||||
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
import { StackNavigationProp } from '@react-navigation/stack';
|
||||||
|
|
||||||
import * as List from '../../containers/List';
|
import * as List from '../../containers/List';
|
||||||
import SafeAreaView from '../../containers/SafeAreaView';
|
import SafeAreaView from '../../containers/SafeAreaView';
|
||||||
|
@ -11,6 +13,8 @@ import {
|
||||||
MediaDownloadOption,
|
MediaDownloadOption,
|
||||||
VIDEO_PREFERENCE_DOWNLOAD
|
VIDEO_PREFERENCE_DOWNLOAD
|
||||||
} from '../../lib/constants';
|
} from '../../lib/constants';
|
||||||
|
import i18n from '../../i18n';
|
||||||
|
import { SettingsStackParamList } from '../../stacks/types';
|
||||||
|
|
||||||
const MediaAutoDownload = () => {
|
const MediaAutoDownload = () => {
|
||||||
const [imagesPreference, setImagesPreference] = useUserPreferences<MediaDownloadOption>(
|
const [imagesPreference, setImagesPreference] = useUserPreferences<MediaDownloadOption>(
|
||||||
|
@ -19,32 +23,40 @@ const MediaAutoDownload = () => {
|
||||||
);
|
);
|
||||||
const [videoPreference, setVideoPreference] = useUserPreferences<MediaDownloadOption>(VIDEO_PREFERENCE_DOWNLOAD, 'wifi');
|
const [videoPreference, setVideoPreference] = useUserPreferences<MediaDownloadOption>(VIDEO_PREFERENCE_DOWNLOAD, 'wifi');
|
||||||
const [audioPreference, setAudioPreference] = useUserPreferences<MediaDownloadOption>(AUDIO_PREFERENCE_DOWNLOAD, 'wifi');
|
const [audioPreference, setAudioPreference] = useUserPreferences<MediaDownloadOption>(AUDIO_PREFERENCE_DOWNLOAD, 'wifi');
|
||||||
|
const navigation = useNavigation<StackNavigationProp<SettingsStackParamList, 'MediaAutoDownloadView'>>();
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
navigation.setOptions({
|
||||||
|
title: i18n.t('Media_auto_download')
|
||||||
|
});
|
||||||
|
}, [navigation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView testID='security-privacy-view'>
|
<SafeAreaView testID='media-auto-download-view'>
|
||||||
<StatusBar />
|
<StatusBar />
|
||||||
<List.Container testID='security-privacy-view-list'>
|
<List.Container testID='media-auto-download-view-list'>
|
||||||
<List.Section>
|
<List.Separator />
|
||||||
<List.Separator />
|
<ListPicker
|
||||||
<ListPicker
|
onChangeValue={setImagesPreference}
|
||||||
onChangeValue={setImagesPreference}
|
value={imagesPreference}
|
||||||
value={imagesPreference}
|
title='Images'
|
||||||
title='Images'
|
testID='media-auto-download-view-images'
|
||||||
testID='media-auto-download-view-images'
|
/>
|
||||||
/>
|
<List.Separator />
|
||||||
<ListPicker
|
<ListPicker
|
||||||
onChangeValue={setVideoPreference}
|
onChangeValue={setVideoPreference}
|
||||||
value={videoPreference}
|
value={videoPreference}
|
||||||
title='Video'
|
title='Video'
|
||||||
testID='media-auto-download-view-video'
|
testID='media-auto-download-view-video'
|
||||||
/>
|
/>
|
||||||
<ListPicker
|
<List.Separator />
|
||||||
onChangeValue={setAudioPreference}
|
<ListPicker
|
||||||
value={audioPreference}
|
onChangeValue={setAudioPreference}
|
||||||
title='Audio'
|
value={audioPreference}
|
||||||
testID='media-auto-download-view-audio'
|
title='Audio'
|
||||||
/>
|
testID='media-auto-download-view-audio'
|
||||||
</List.Section>
|
/>
|
||||||
|
<List.Separator />
|
||||||
</List.Container>
|
</List.Container>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue