Code pull completed, the page will refresh automatically
Галерея, реализованная с помощью RecyclerView. 0 затрат на изучение, быстрая интеграция за 1 минуту.
Шаг 1. Добавьте репозиторий JitPack в свой файл сборки:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Шаг 2. Добавьте зависимость:
dependencies {
compile 'com.github.mengpeng920223:RecyclerView-Gallery:v1.0.0'
}
Скачайте jar и поместите его в папку lib.
RecyclerView recyclerView = findViewById(R.id.recyclerView);
// Горизонтальное направление CarouselLayoutManager.HORIZONTAL, вертикальное направление CarouselLayoutManager.VERTICAL
CarouselLayoutManager layoutManager = new CarouselLayoutManager(CarouselLayoutManager.HORIZONTAL);
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.addOnScrollListener(new CenterScrollListener());
// Ваш собственный адаптер, в адаптере не требуется никаких изменений
recyclerView.setAdapter(adapter);
You can comment after Login
Inappropriate content may be displayed here and will not be shown on the page. You can check and modify it through the relevant editing function
If you confirm that the content does not involve inappropriate language/advertisement redirection/violence/vulgar pornography/infringement/piracy/false/insignificant or illegal content related to national laws and regulations, you can click submit to make an appeal, and we will handle it as soon as possible.
Comments ( 0 )