Hey guys, welcome back to another Blog. This is Shahbaz here and today in this blog we are going to make an Image Slider Using the XBanner library in Sketchware Pro.
Code used in the Project:
• View pager:
[Put in Inject]
app:isClipChildrenMode="true"
app:pointContainerLeftRightPadding="25dp"
[Put in CONVERT]
com.stx.xhb.androidx.XBanner
• Cardview:
app:cardElevation="10dp"
app:cardBackgroundColor="#38BD40"
app:cardCornerRadius="6dp"
• On Create:
banner.setData(R.layout.xbanner_item,list,null);
banner.loadImage(new com.stx.xhb.androidx.XBanner.XBannerAdapter() {
@Override
public void loadBanner(final com.stx.xhb.androidx.XBanner banner, final Object model, final View vw, final int po) {
final String image_link=list.get(po);
final ImageView tx=(ImageView)vw.findViewById(R.id.tx);
Glide.with(getApplicationContext()).load(Uri.parse(image_link)).into(tx);
}
});
No comments: