code: public boolean setScrollMode(int mode) {
          if (mode != MODE_LEFT_AND_RIGHT && mode != MODE_RIGHT_TO_LEFT) {
              return false;
          }
          scrollMode = mode;
          if (mode == MODE_RIGHT_TO_LEFT) {
              distance = 100;
          } else {
              offset = -1;
              if (getWidth() > MAX_RIGHT) {
                  distance = MAX_RIGHT;
              } else {
                  distance = getWidth() / 2;
              }
          }
  
          curL = distance;
          first = true;
          return true;
      }
docs: 更新显示的MODE, 如果mode 非法将设置失败, 不做任何更改
  
  @param mode
  @return 返回设置是否成功