code: private void initializeView(AttributeSet attrs, int defStyleAttr) {
          if (attrs != null) {
              final TypedArray attributes = mContext.getTheme().obtainStyledAttributes(attrs, R.styleable.CircularViewPager,
                      defStyleAttr, 0);
  
              boolean enableOnClick = attributes.getBoolean(R.styleable.CircularViewPager_progress_pager_on_click_enabled, false);
              isPaddingSet = false;
  
              LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              RelativeLayout view = (RelativeLayout) inflater.inflate(R.layout.circularbar_view_pager, this);
  
              mCircularBar = (CircularBar) view.findViewById(R.id.circular_bar);
              mViewPager = (ViewPager) view.findViewById(R.id.view_pager);
              mCirclePageIndicator = (CirclePageIndicator) view.findViewById(R.id.circle_page_indicator);
  
              //Default init
              if(mCircularBar != null){
                  mCircularBar.loadStyledAttributes(attrs, defStyleAttr);
              }
              if(mViewPager != null){
                  mViewPager.setPageTransformer(false, new FadeViewPagerTransformer());
              }
  
  
              //If we enable onClick, ie. we can switch between pages with both a swipe and a touch
              //Touch just goes to the next page % number of pages
              if (enableOnClick) {
                  final GestureDetectorCompat tapGestureDetector = new GestureDetectorCompat(getContext(), new GestureDetector.SimpleOnGestureListener() {
  
                      @Override
                      public boolean onSingleTapConfirmed(MotionEvent e) {
                          mViewPager.setCurrentItem((mViewPager.getCurrentItem() + 1) % mViewPager.getAdapter().getCount());
                          return super.onSingleTapConfirmed(e);
                      }
                  });
                  if(mViewPager != null){
                      mViewPager.setOnTouchListener(new OnTouchListener() {
                          public boolean onTouch(View v, MotionEvent event) {
                              tapGestureDetector.onTouchEvent(event);
                              return false;
                          }
                      });
                  }
  
              }
          }
      }
docs: Init the view by getting the {@link CircularBar},
  the {@link android.support.v4.view.ViewPager} and the {@link com.viewpagerindicator.CirclePageIndicator}.
  Init also some default values as PageTranformer etc...