Closed Pbansal09 closed 1 year ago
I have added this library. Data is displayed in horizontal way. I want to add circular indicator. For this I added DiscreteScrollViewIndicator file in our project and added piece of code which is required, but indicator is not shown.
// Java Code
binding.picker.setOrientation(DSVOrientation.HORIZONTAL); infiniteAdapter = InfiniteScrollAdapter.wrap(adapter); binding.picker.setAdapter(infiniteAdapter); binding.picker.setItemTransitionTimeMillis(150); binding.picker.setItemTransformer(new ScaleTransformer.Builder() .setMinScale(0.8f) .build());
viewModel.getData();
float DP = Resources.getSystem().getDisplayMetrics().density; DiscreteScrollViewIndicator pageIndicator = DiscreteScrollViewIndicator.Builder(binding.picker) .setColorActive(R.color.green_error) .setColorInactive((R.color.red_error)) .setIndicatorStrokeWidth(4 * DP) .setIndicatorItemPadding(10 * DP) .align(DiscreteScrollViewIndicator.Alignment.PARENT_TOP) .matchParentWidth(); binding.picker.addItemDecoration(pageIndicator); pageIndicator.setItemsCount(adapter.getItemCount());
@Pbansal09 how many items are in the adapter?
closing this, since no response from info requested.
I have added this library. Data is displayed in horizontal way. I want to add circular indicator. For this I added DiscreteScrollViewIndicator file in our project and added piece of code which is required, but indicator is not shown.
// Java Code
viewModel.getData();