content: package io.alcatraz.audiohq.extended;
  
  import android.content.Context;
  import android.util.AttributeSet;
  import android.view.MotionEvent;
  
  import androidx.viewpager.widget.ViewPager;
  
  public class NoScrollViewPager extends ViewPager {
      private boolean isScroll = false;
  
      public NoScrollViewPager(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public NoScrollViewPager(Context context) {
          super(context);
      }
  
      @Override
      public boolean dispatchTouchEvent(MotionEvent ev) {
          return super.dispatchTouchEvent(ev);
      }
  
      @Override
      public boolean onInterceptTouchEvent(MotionEvent ev) {
          if (isScroll) {
              return super.onInterceptTouchEvent(ev);
          } else {
              return false;
          }
      }
  
      @Override
      public boolean onTouchEvent(MotionEvent ev) {
          if (isScroll) {
              return super.onTouchEvent(ev);
          } else {
              return true;
          }
      }
  
      public void setScroll(boolean scroll) {
          isScroll = scroll;
      }
  }