Giter VIP home page Giter VIP logo

bannerview's Introduction

BannerView

Banner轮播图

截图

images

环境配置

allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
  }

    dependencies {
          implementation 'com.github.Wiser-Wong:BannerView:1.0.0'
  }

使用说明

bannerPagerView.setPages(this, new BannerHolder<String>() {

      private AppCompatImageView ivBanner;

      @Override public View createView(Context context, LayoutInflater inflater, ViewGroup container) {
        View view = inflater.inflate(R.layout.banner_layout, container, false);
        ivBanner = view.findViewById(R.id.iv_banner);
        return view;
      }

      @Override public void bindData(Context context, int position, String data) {
        if (!TextUtils.isEmpty(data)) Glide.with(context).load(data).thumbnail(0.1f).into(ivBanner);
      }
    }, imageUrls).isDot(true, Color.YELLOW, Color.RED, BannerPagerView.RIGHT_DOT).setOnItemClickListener(new BannerPagerAdapter.OnItemClickListener() {
      @Override
      public void setOnItemListener(View view, int position) {//点击监听
        Toast.makeText(MainActivity.this,"点击位置:-->>" + position,Toast.LENGTH_LONG).show();
      }
    }).addOnPageChangeListener(new BannerPagerView.OnPageChangeListener() {//滚动监听
      @Override
      public void onPageScrolled(int i, float v, int i1) {

      }

      @Override
      public void onPageSelected(int i) {

      }

      @Override
      public void onPageScrollStateChanged(int i) {

      }
    }).startTurning(2200);
    
    <com.wiser.banner.BannerPagerView
        android:id="@+id/bpv_page_view"
        android:layout_width="match_parent"
        android:layout_height="250dp" />

bannerview's People

Contributors

wiser-wong avatar lengxiaoyu513 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.