pushpalroy / JetLime

A Kotlin Multiplatform library to display a timeline view in Android. 🍋
https://jetlime.pushpalroy.com
MIT License
431 stars 25 forks source link

Add support of dashed timeline for JetLimeExtendedEvent type event #42

Closed N7ghtm4r3 closed 17 hours ago

N7ghtm4r3 commented 2 days ago

Hi I'm using the io.github.pushpalroy:jetlime:3.0.0 version in a KMM project. I'm trying to apply the dashed effect to the line but still to be solid, may I am wrong to apply it?

Code:

JetLimeColumn(
      modifier = Modifier
          .padding(
              top = it.calculateTopPadding() + 16.dp,
              start = 16.dp,
              end = 16.dp,
              bottom = it.calculateBottomPadding() + 16.dp
          ),
      itemsList = ItemsList(items),
      key = { _, item -> item.id },
      style = JetLimeDefaults.columnStyle(
          contentDistance = 24.dp,
         // is it here where to apply the dashed effect? 
          pathEffect = PathEffect.dashPathEffect(
              intervals = floatArrayOf(30f, 30f)
          )
      ),
  ) { index, mileage, position ->
      JetLimeExtendedEvent(
          style = JetLimeEventDefaults.eventStyle(
              position = position
          ),
          additionalContent = {
              // Additional content here
          }
      ) {
          // content
      }
  }

The result:

pushpalroy commented 2 days ago

@N7ghtm4r3 The way you are applying the dashed effect is correct. I'm not sure why you are not being able to see the proper effect.

Can you please check the sample already added to the repo: BasicDashedTimeLine?

N7ghtm4r3 commented 2 days ago

Yes for sure!

pushpalroy commented 2 days ago

@N7ghtm4r3 Seems like your observation is correct. 👍🏻 Currently Dashed Effect is not supported for JetLimeExtendedEvent type event. You can use JetLimeEvent for the dashed effect.

Thanks for raising this issue.

I will add support of dashed line for JetLimeExtendedEvent in the next patch.

N7ghtm4r3 commented 2 days ago

Thank you for the fast reply and for the tip

N7ghtm4r3 commented 2 days ago

@N7ghtm4r3 The way you are applying the dashed effect is correct. I'm not sure why you are not being able to see the proper effect.

Can you please check the sample already added to the repo: BasicDashedTimeLine?

I have to check it anyway?

pushpalroy commented 2 days ago

@N7ghtm4r3 No need to verify anything. There is a bug due to which dashed effect is not supported in JetLimeExtendedEvent. I confirmed that.

You can check the sample I mentioned to use dashed effect for normal JetLimeEvent.

N7ghtm4r3 commented 2 days ago

Okay thank you!