CPullWindow.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * CPullWindow.h
  3. *
  4. * Created on: 2021年3月30日
  5. * Author: Administrator
  6. */
  7. #ifndef JNI_W_FILE_INCLUDE_W_SCROLLWINDOWWRAPPER_H_
  8. #define JNI_W_FILE_INCLUDE_W_SCROLLWINDOWWRAPPER_H_
  9. #include "w_DefPullWidnow.h"
  10. class CPullWindow:public Thread {
  11. public:
  12. CPullWindow();
  13. /// 清空
  14. void resetPage();
  15. /// 设置下拉栏初始位置
  16. void onCPullWindow_init(ZKBase *pBase = NULL);
  17. // 通过滑动判断左移还是右移动
  18. bool onTouchEvent(const MotionEvent &ev);
  19. /// 获取下拉栏y轴坐标
  20. LayoutPosition getPosition();
  21. /// 上移。增加移动效果
  22. void setBaseUpMove();
  23. /// 上拉。增加移动效果
  24. void setBaseDownMove();
  25. /** 额外添加的功能 *****************************************/
  26. /// 下拉状态栏,设置透明度
  27. void setBottomWindowColor(ZKBase* pBaseColor = NULL);
  28. protected:
  29. // 判断可不可以滑动
  30. bool needToRoll() const;
  31. // 移动函数
  32. void movePage(int dy);
  33. /**
  34. * @brief 线程循环调用该接口
  35. * @return true 不退出线程,false 将退出线程
  36. */
  37. virtual bool threadLoop();
  38. private:
  39. /// 额外添加功能成员
  40. bool isTextView1GraymaskShow;/// 灰色蒙版
  41. ZKBase* mBaseColor; /// 设置Base背景色
  42. /// 固定成员
  43. bool isDownPull;//true:是下拉
  44. bool isRegistered;
  45. bool isCanMove;//true:有滑动事件
  46. bool isFuncMove;/// 函数调用移动
  47. bool mHasDown;
  48. bool mIsRolling;
  49. int mCurRollSpeed;
  50. unsigned int mRollSpeed;
  51. ZKBase* mBase;
  52. long int mStartDownTime;
  53. PWPOINT mDownPoint;
  54. PWPOINT mUpPoint;
  55. VelocityTracker mVelocityTracker; // 速度追踪
  56. };
  57. #endif /* JNI_W_FILE_INCLUDE_W_SCROLLWINDOWWRAPPER_H_ */