Pluto is an Easy, lightweight and high performance slider view library for Android. You have the flexibility to customize it to any view since it based RecyclerView.
I have an issue always crash in line setCustomIndicator. My items in list is not null, i'm already debugged it and that list have an items. I don't know why property helper in your library not initiate it. and its not a pass parameter from setCustomIndicator. Can you help me solve this?
class BannerSliderAdapter(items: MutableList<Uri?>) :
PlutoAdapter<Uri?, BannerSliderAdapter.ViewHolder>(items) {
override fun getViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(parent, R.layout.item_banner_slider)
}
class ViewHolder(parent: ViewGroup, itemLayoutId: Int) :
PlutoViewHolder<Uri?>(parent, itemLayoutId) {
private var ivBanner: ImageView = getView(R.id.iv_banner)
override fun set(item: Uri?, position: Int) {
Picasso.with(context).load(item).into(ivBanner)
}
}
}
This is where i'm initialize to call PlutoView and PlutoIndicator :
private fun showBanner() {
val adapter = BannerSliderAdapter(vote?.listPhoto ?: mutableListOf())
iv_banner_detail_vote_election.setCustomIndicator(custom_indicator_detail_vote_election)
iv_banner_detail_vote_election.create(adapter, 4000, lifecycle)
}
And this is error log by crash :
DetailVoteElectionActivity: kotlin.UninitializedPropertyAccessException: lateinit property helper has not been initialized
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property helper has not been initialized
at com.opensooq.pluto.PlutoView.setCustomIndicator(PlutoView.kt:157)
at com.ksmandroid.gravoteadmin.ui.detailvoteelection.DetailVoteElectionActivity.showBanner(DetailVoteElectionActivity.kt:89)
at com.ksmandroid.gravoteadmin.ui.detailvoteelection.DetailVoteElectionActivity.onCreate(DetailVoteElectionActivity.kt:78)
I have an issue always crash in line setCustomIndicator. My items in list is not null, i'm already debugged it and that list have an items. I don't know why property helper in your library not initiate it. and its not a pass parameter from setCustomIndicator. Can you help me solve this?
This my view :
This is my adapter :
This is where i'm initialize to call PlutoView and PlutoIndicator :
And this is error log by crash :