Skip to content

Hi when i wanted to use carousel in Fragment class scroll is not smooth as in activity class #21

Description

@prashantisng

class CurrentBodyTypeFemale : Fragment() {

private lateinit var carousel_view:CarouselView


private var selected_val:Boolean = false
override fun onCreateView(
    inflater: LayoutInflater, container: ViewGroup?,
    savedInstanceState: Bundle?
): View? {
    // Inflate the layout for this fragment
    val view = inflater.inflate(R.layout.fragment_current_body_type_female, container, false)
    carousel_view=view.findViewById<CarouselView>(R.id.carousel_view)
    
    selected_val=false

    val carouselDataList = ArrayList<BodyItem>()

    val item1= BodyItem("Thin", R.drawable.thinfemale)
    val item2= BodyItem("Medium",R.drawable.mediumfemale)
    val item3= BodyItem("Fat",R.drawable.fatfemale)
    carouselDataList.add(item1)
    carouselDataList.add(item2)
    carouselDataList.add(item3)

     val adapter=CurrentBodyAdapter(carouselDataList)


    val carousel = Carousel(activity as AppCompatActivity,  carousel_view, adapter)
    carousel.setOrientation(CarouselView.HORIZONTAL, false)
    carousel.scaleView(true)


    return view
}

} this is my fragmetn class here scroll is not so smooth

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions