Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prashantisng opened this issue Jul 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@prashantisng
Copy link

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

@prashantisng prashantisng added the bug Something isn't working label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant