A simple, customizable and easy to use picker where centre view is scaled up
dependencies {
compile 'com.github.adityagohad:HorizontalPicker:1.0.0'
}
Your picker will be recyclerView and this lib is just a custom layout manager to initialize the PickerLayoutManager and set the properties
PickerLayoutManager pickerLayoutManager = new PickerLayoutManager(this, PickerLayoutManager.HORIZONTAL, false);
pickerLayoutManager.setChangeAlpha(true);
pickerLayoutManager.setScaleDownBy(0.99f);
pickerLayoutManager.setScaleDownDistance(0.8f);
To make it snap to centre use SnapHelper
SnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(recyclerView);
set layout manager of your recyclerVew
recyclerView.setLayoutManager(pickerLayoutManager);
To get selected view use onScrollStopListener
pickerLayoutManager.setOnScrollStopListener(new PickerLayoutManager.onScrollStopListener() {
@Override
public void selectedView(View view) {
//Do your thing
}
});
}