vbea пре 2 година
родитељ
комит
2d26a12499

+ 2 - 1
Strides-APP/app/components/TextView.js

@@ -78,7 +78,7 @@ const getRadius = (style, fixedAlign) => {
   }
 }
 
-const TextView = ({style, ellipsizeMode, numberOfLines, allowFontScaling=false, onPress, onLongPress, fixedAlign=true, children}) => {
+const TextView = ({style, ellipsizeMode, numberOfLines, allowFontScaling=false, onPress, onLongPress, fixedAlign=true, selectable, children}) => {
   const styles = getRadius(style, fixedAlign);
   return (
     <View style={styles.view}>
@@ -87,6 +87,7 @@ const TextView = ({style, ellipsizeMode, numberOfLines, allowFontScaling=false,
         allowFontScaling={allowFontScaling}
         ellipsizeMode={ellipsizeMode}
         numberOfLines={numberOfLines}
+        selectable={selectable}
         onPress={onPress}
         onLongPress={onLongPress}>{children}</Text>
     </View>

+ 2 - 1
Strides-APP/app/pages/alert/ViewAlerts.js

@@ -87,7 +87,8 @@ export default class ViewAlerts extends Component {
         <ScrollView
           style={ui.flex1}>
           <TextView
-            style={styles.textMessage}>
+            style={styles.textMessage}
+            selectable={true}>
             {this.state.messageInfo.notificationText}
           </TextView>
         </ScrollView>

+ 4 - 2
Strides-APP/app/pages/alert/ViewArticle.js

@@ -74,7 +74,8 @@ export default class ViewArticle extends Component {
             style={{height: $width}}
             autoplay={true}
             autoplayTimeout={5}
-            renderPagination={() => <></>}>
+            renderPagination={() => <></>}
+            removeClippedSubviews={false}>
             { this.state.messageInfo.articleImages.map((item, index) => {
               return (
                 <Image
@@ -119,7 +120,8 @@ export default class ViewArticle extends Component {
           </View>
         </View>
         <TextView
-          style={styles.textMessage}>
+          style={styles.textMessage}
+          selectable={true}>
           {this.state.messageInfo.articleContent}
         </TextView>
         { utils.isNotEmpty(this.state.messageInfo.articleLinks) &&

+ 4 - 2
Strides-APP/app/pages/alert/ViewCampaign.js

@@ -86,7 +86,8 @@ export default class ViewCampaign extends Component {
             style={{height: $width}}
             autoplay={true}
             autoplayTimeout={5}
-            renderPagination={() => <></>}>
+            renderPagination={() => <></>}
+            removeClippedSubviews={false}>
             { this.state.messageInfo.articleImages.map((item, index) => {
               return (
                 <Image
@@ -150,7 +151,8 @@ export default class ViewCampaign extends Component {
         </TextView>
         <TextView style={styles.textLinkTitle}>{$t("notification.labelDetails")}</TextView>
         <TextView
-          style={styles.textMessage}>
+          style={styles.textMessage}
+          selectable={true}>
           {this.state.messageInfo.articleContent}
         </TextView>
         { utils.isNotEmpty(this.state.messageInfo.articleLinks) &&

+ 23 - 0
Strides-APP/app/pages/chargeV2/TabInfos.js

@@ -7,6 +7,7 @@ import { View, StyleSheet, ScrollView, RefreshControl } from 'react-native';
 import TextView from '../../components/TextView';
 import PagerUtil from './PagerUtil';
 import { MyRefreshProps } from '../../components/ThemesConfig';
+import utils from '../../utils/utils';
 
 export default class TabInfos extends Component {
   constructor(props) {
@@ -89,6 +90,13 @@ export default class TabInfos extends Component {
         <TextView style={styles.title}>{$t('charging.additionalInformation')}</TextView>
         <View style={styles.infoView}>
           <TextView style={styles.infoText}>{this.state.stationInfo?.additionalNotes}</TextView>
+          <View style={styles.labelRows}>
+            { utils.isNotEmpty(this.state.stationInfo?.labels) &&
+              this.state.stationInfo?.labels.map((label, idx) =>
+                <TextView key={idx} style={styles.labels}>{label}</TextView>
+              )
+            }
+          </View>
         </View>
       </ScrollView>
     );
@@ -114,5 +122,20 @@ const styles = StyleSheet.create({
   infoText: {
     color: '#444',
     fontSize: 14
+  },
+  labelRows: {
+    flexWrap: 'wrap',
+    alignItems: 'center',
+    flexDirection: 'row'
+  },
+  labels: {
+    color: colorLight,
+    height: 22,
+    fontSize: 12,
+    borderRadius: 3,
+    marginRight: 5,
+    marginBottom: 5,
+    ...$padding(0, 8),
+    backgroundColor: colorPrimary
   }
 })

+ 9 - 1
Strides-APP/app/pages/home/Home.js

@@ -439,6 +439,12 @@ export default class HomePage extends Component {
     }
   }
 
+  hidePermissionPanel() {
+    this.setState({
+      permissionDenied: false
+    })
+  }
+
   render() {
     return (
       <View style={ui.flex1}>
@@ -454,7 +460,9 @@ export default class HomePage extends Component {
           showUserLocation={this.state.hasPermission && this.settingInfo.alwaysLocation}
           viewChargeStation={id => this.viewChargeStation(id)}
         />
-        <LocationPermission.VIEW visible={this.state.permissionDenied}/>
+        <LocationPermission.VIEW
+          visible={this.state.permissionDenied}
+          onView={() => this.hidePermissionPanel()}/>
         <View style={styles.drawerLeftTouchView}></View>
       </View>
     );

+ 6 - 2
Strides-APP/app/pages/home/maps/LocationPermission.js

@@ -82,7 +82,7 @@ const getPermission = (back) => {
   });
 }
 
-const LocationPermission = ({visible=false}) => (
+const LocationPermission = ({visible=false, onView}) => (
   visible
   ? <View style={styles.permissionView}>
       <TextView
@@ -91,7 +91,11 @@ const LocationPermission = ({visible=false}) => (
       <Button
         style={styles.viewButton}
         viewStyle={styles.viewButtonStyle}
-        onClick={() => openSettings().catch(() => console.warn('cannot open settings'))}>
+        onClick={() => {
+          openSettings().then(res => {
+            if (onView) onView();
+          }).catch(() => console.warn('cannot open settings'))
+        }}>
         <TextView style={styles.buttonText}>{$t("nav.view")}</TextView>
         <FontAwesome
           size={16}