use of com.test.banner.adapter.ImageNetAdapter in project banner by youth5201314.
the class BannerFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
banner.setAdapter(new ImageNetAdapter(DataBean.getTestData3()));
banner.setIndicator(new RectangleIndicator(getActivity()));
banner.setIndicatorSpace((int) BannerUtils.dp2px(4));
banner.setIndicatorRadius(0);
}
use of com.test.banner.adapter.ImageNetAdapter in project banner by youth5201314.
the class BlankFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
LinearLayout linearLayout = getView().findViewById(R.id.ll_view);
// 通过new的方式创建banner
Banner banner = new Banner(getActivity());
banner.setAdapter(new ImageNetAdapter(DataBean.getTestData3()));
banner.addBannerLifecycleObserver(this);
banner.setIndicator(new CircleIndicator(getActivity()));
// 将banner加入到父容器中,实际使用不一定一样
linearLayout.addView(banner, LinearLayout.LayoutParams.MATCH_PARENT, (int) BannerUtils.dp2px(120));
}
Aggregations