1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Android: Resolves #538 (kind of): Added info to ask user to set app permissions

This commit is contained in:
Laurent Cozic 2018-05-21 17:24:09 +01:00
parent 429f2d5aab
commit c83a61d45d

View File

@ -70,6 +70,12 @@ class ConfigScreenComponent extends BaseScreenComponent {
fontSize: theme.fontSize, fontSize: theme.fontSize,
flex: 1, flex: 1,
}, },
permissionText: {
color: theme.color,
fontSize: theme.fontSize,
flex: 1,
marginTop: 10,
},
settingControl: { settingControl: {
color: theme.color, color: theme.color,
flex: 1, flex: 1,
@ -201,6 +207,21 @@ class ConfigScreenComponent extends BaseScreenComponent {
</View>); </View>);
} }
if (Platform.OS === 'android' && Platform.Version >= 23) {
// Note: `PermissionsAndroid` doesn't work so we have to ask the user to manually
// set these permissions. https://stackoverflow.com/questions/49771084/permission-always-returns-never-ask-again
settingComps.push(
<View key="permission_info" style={this.styles().settingContainer}>
<View key="permission_info_wrapper">
<Text key="perm1a" style={this.styles().settingText}>{_('To work correctly, the app needs the following permissions. Please enable them in your phone settings, in Apps > Joplin > Permissions')}</Text>
<Text key="perm2" style={this.styles().permissionText}>{_('- Storage: to allow attaching files to notes and to enable filesystem synchronisation.')}</Text>
<Text key="perm3" style={this.styles().permissionText}>{_('- Camera: to allow taking a picture and attaching it to a note.')}</Text>
<Text key="perm4" style={this.styles().permissionText}>{_('- Location: to allow attaching geo-location information to a note.')}</Text>
</View>
</View>
);
}
settingComps.push( settingComps.push(
<View key="donate_link" style={this.styles().settingContainer}> <View key="donate_link" style={this.styles().settingContainer}>
<TouchableOpacity onPress={() => { Linking.openURL('https://joplin.cozic.net/donate/') }}> <TouchableOpacity onPress={() => { Linking.openURL('https://joplin.cozic.net/donate/') }}>