thegamenicorus / react-native-timeline-listview

Timeline component for React Native App
https://www.npmjs.com/package/react-native-timeline-listview
MIT License
1.16k stars 184 forks source link

Timeline not showing 'dots' when I have many elements on the list #18

Open Schwarzenegger opened 6 years ago

Schwarzenegger commented 6 years ago

I'm having this problem on my android/ios, when I create a timeline with more than 10 elements the 'dots' start not showing up

screenshot_2017-09-11-16-50-07

screenshot_2017-09-11-16-50-09

I've already tried setting up minWidth on timeContainerStyle

Hulva commented 6 years ago

@Schwarzenegger Have you figure it out? I've got the same issue as you were...

Hulva commented 6 years ago

@Schwarzenegger I've fixed it by overriderenderCircle

Schwarzenegger commented 6 years ago

@Hulva Yes, i figured it out by overiding renderCircle like you did.

Still messing it css to place the circle in the right place on all devices.

Hulva commented 6 years ago

@Schwarzenegger I've only played it on android... I didn't know that it'll display different on different device. Hope you'll find a good way to deal with it. Let me know if you do.

linhanyang commented 6 years ago

I also have the same problem on ios devices.

danielgarciasantos commented 6 years ago

i have some problem with icon, someone resolved?

thegamenicorus commented 6 years ago

Hi all.

Is it happen on emulator or real device?

danielgarciasantos commented 6 years ago

in both, debug...

danielgarciasantos commented 6 years ago

this problem is related to the initialListSize property, which by default is 10

danielgarciasantos commented 6 years ago

this problem is related to _renderCicle in circleStyle => left: this.state.x - (circleSize / 2) + ((lineWidth-1) / 2),

this.state.x may be zeroed due to _renderEvent's onLayout

onLayout Invoked on mount and layout changes with:

{nativeEvent: {layout: {x, y, width, height}}}

This event is fired immediately once the layout has been calculated, but the new layout may not be reflected on the screen at the time the event is received, especially if the layout animation is in progress.

danielgarciasantos commented 6 years ago

any solution for this ?

Schwarzenegger commented 6 years ago

@danielgarciasantos like I said, i overwrote renderCircle to look like this.

 renderCircle(rowData, sectionID, rowID) {
    var circleSize = 20
    var circleColor = rowData.circleColor
    var lineWidth = 2
    var ballPadding = (Platform.OS === 'ios') ? width/1.11 : width/1.10

    return (
       <View style={{
          width: 22,
           height: 22,
           borderRadius: 50,
           backgroundColor: circleColor,
           right: ballPadding
         }} />
     )
  } 

And the component

<Timeline
   style={timelineScreenStyle.list}
   data={this.state.data}
   timeContainerStyle={{minWidth:0}}
   detailContainerStyle={timelineScreenStyle.detailContainerStyle}
   separator={false}
   innerCircle={'none'}
   lineWidth={2}
   renderDetail={this.renderDetail}
   renderCircle={this.renderCircle}
   descriptionStyle={{color:'gray'}}
   enableEmptySections={true}
   options={{
     style:{paddingTop: 5}
    }}
    circleSize={22}
             />

It worked smooth for me on Android and IOs after this.

dsah commented 6 years ago

overwrote renderCircle helped but circle position css is messed, its showing on the far right and line on the left. timeline

danielgarciasantos commented 6 years ago

gave up component?

naklow12 commented 5 years ago

Have same problem and I can't do overwrite just like you. Any other solution for this ?

bhaskardabhi commented 5 years ago

I am also facing issue while overriding renderCircle