Timeline-View icon indicating copy to clipboard operation
Timeline-View copied to clipboard

line broke when set marker size

Open caotian opened this issue 9 years ago • 7 comments

line broke when set each marker size not the same size, any idea?

caotian avatar Jul 04 '16 16:07 caotian

@caotian can you please post screenshot of it.

vipulasri avatar Jul 05 '16 05:07 vipulasri

1

below is I have done in ios: 2

caotian avatar Jul 05 '16 05:07 caotian

I think according to my code or implementation of Timeline view this was supposed to happen. I will have to change the implementation of it, according to this case. Can you provide me the link to above iOS library of yours? One more thing can you describe me what was your approach of implementing your iOS Library?

vipulasri avatar Jul 05 '16 05:07 vipulasri

I did it myself in ios, not using any library, just by customized tableview cells.

caotian avatar Jul 06 '16 00:07 caotian

Looks like the iOS implementation adjusts the layout margins to keep the marker in the center of the view as well as the view the same size even with larger marker size.

jervan avatar Oct 15 '16 04:10 jervan

@jervan I have a workaround for you, you can simply apply the big drawable as marker and while you are applying smaller marker by calculating the smaller drawable width - bigger drawable width apply that much padding to smaller one. One more thing linePadding has introduced in v1.0.5 so that you can apply similar line effect of ios on android

vipulasri avatar Mar 09 '17 02:03 vipulasri

there's a temporary solution where you can solve this by putting the timeline view inside linear layout with fixed widthand gravity to center and set your timelineview with to wrap content in your recyclerview adapter's item_layout

<LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_gravity="center"
       android:gravity="center"
       android:orientation="horizontal">
    <LinearLayout <!-- TIMELINVIEW -->
            android:layout_width="30dp" <!-- FIXED WIDTH -->
            android:layout_height="match_parent"
            android:layout_gravity="center" <!-- GRAVITY -->
            android:gravity="center"  <!-- GRAVITY -->
            android:orientation="vertical">

          <com.github.vipulasri.timelineview.TimelineView
                     android:id="@+id/timeline"
                     android:layout_width="wrap_content"
                     android:layout_height="match_parent"
                    android:layout_gravity="center"/>
    </LinearLayout>
    
    <!-- YOUR CONTENT HERE -->
</LinearLayout>

raquezha avatar Apr 25 '19 18:04 raquezha