@quicktvui/ai 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/package.json +1 -1
  2. package/rules/.clinerules +27 -4
  3. package/rules/.cursorrules +27 -4
  4. package/rules/.github/copilot-instructions.md +27 -4
  5. package/rules/.source/hippy/extend_views/CoverFlowHorizontalView.java +203 -0
  6. package/rules/.source/hippy/extend_views/CoverFlowVerticalView.java +203 -0
  7. package/rules/.source/hippy/extend_views/CoverFlowViewController.java +195 -0
  8. package/rules/.source/hippy/extend_views/EngineRootView.java +125 -0
  9. package/rules/.source/hippy/extend_views/ExtendTag.java +83 -0
  10. package/rules/.source/hippy/extend_views/FocusSearchHelper.java +124 -0
  11. package/rules/.source/hippy/extend_views/IRecyclerItemView.java +12 -0
  12. package/rules/.source/hippy/extend_views/JSEventHandleView.java +5 -0
  13. package/rules/.source/hippy/extend_views/MarqueeRelayManager.java +133 -0
  14. package/rules/.source/hippy/extend_views/MarqueeRelayTextView.java +211 -0
  15. package/rules/.source/hippy/extend_views/ProgressBarView.java +83 -0
  16. package/rules/.source/hippy/extend_views/ProgressBarViewController.java +145 -0
  17. package/rules/.source/hippy/extend_views/SeekBarView.java +104 -0
  18. package/rules/.source/hippy/extend_views/SeekBarViewController.java +218 -0
  19. package/rules/.source/hippy/extend_views/StateImageView.java +149 -0
  20. package/rules/.source/hippy/extend_views/StateImageViewController.java +34 -0
  21. package/rules/.source/hippy/extend_views/TVButtonView.java +314 -0
  22. package/rules/.source/hippy/extend_views/TVButtonViewController.java +89 -0
  23. package/rules/.source/hippy/extend_views/TVTextView.java +684 -0
  24. package/rules/.source/hippy/extend_views/TVViewActor.java +811 -0
  25. package/rules/.source/hippy/extend_views/TVViewActorHost.java +6 -0
  26. package/rules/.source/hippy/extend_views/TVViewActor/346/216/245/345/205/245.md +66 -0
  27. package/rules/.source/hippy/extend_views/TemplateUtil.java +336 -0
  28. package/rules/.source/hippy/extend_views/TextButtonNode.java +47 -0
  29. package/rules/.source/hippy/extend_views/TextViewController.java +377 -0
  30. package/rules/.source/hippy/extend_views/fastlist/CenterFlyInAnimator.java +96 -0
  31. package/rules/.source/hippy/extend_views/fastlist/ChildOnScreenScroller.java +548 -0
  32. package/rules/.source/hippy/extend_views/fastlist/ClonedViewTag.java +17 -0
  33. package/rules/.source/hippy/extend_views/fastlist/EventDeliverer.java +55 -0
  34. package/rules/.source/hippy/extend_views/fastlist/FastAdapter.java +4683 -0
  35. package/rules/.source/hippy/extend_views/fastlist/FastAdapterUtil.java +982 -0
  36. package/rules/.source/hippy/extend_views/fastlist/FastFlexNode.java +48 -0
  37. package/rules/.source/hippy/extend_views/fastlist/FastFlexView.java +873 -0
  38. package/rules/.source/hippy/extend_views/fastlist/FastFlexViewController.java +130 -0
  39. package/rules/.source/hippy/extend_views/fastlist/FastItemNode.java +67 -0
  40. package/rules/.source/hippy/extend_views/fastlist/FastItemView.java +306 -0
  41. package/rules/.source/hippy/extend_views/fastlist/FastItemViewController.java +106 -0
  42. package/rules/.source/hippy/extend_views/fastlist/FastListModule.java +95 -0
  43. package/rules/.source/hippy/extend_views/fastlist/FastListNode.java +90 -0
  44. package/rules/.source/hippy/extend_views/fastlist/FastListView.java +2466 -0
  45. package/rules/.source/hippy/extend_views/fastlist/FastListViewController.java +1038 -0
  46. package/rules/.source/hippy/extend_views/fastlist/FastListView/346/270/262/346/237/223/346/265/201/347/250/213/345/233/276.graffle +0 -0
  47. package/rules/.source/hippy/extend_views/fastlist/FastPendingView.java +47 -0
  48. package/rules/.source/hippy/extend_views/fastlist/ItemDecorations.java +71 -0
  49. package/rules/.source/hippy/extend_views/fastlist/ItemStoreNode.java +64 -0
  50. package/rules/.source/hippy/extend_views/fastlist/ItemStoreView.java +13 -0
  51. package/rules/.source/hippy/extend_views/fastlist/ItemStoreViewController.java +45 -0
  52. package/rules/.source/hippy/extend_views/fastlist/ListItemHolder.java +7 -0
  53. package/rules/.source/hippy/extend_views/fastlist/ListViewControlProp.java +41 -0
  54. package/rules/.source/hippy/extend_views/fastlist/MouseRecycleView.java +509 -0
  55. package/rules/.source/hippy/extend_views/fastlist/OnFastItemClickListener.java +12 -0
  56. package/rules/.source/hippy/extend_views/fastlist/OnFastItemFocusChangeListener.java +9 -0
  57. package/rules/.source/hippy/extend_views/fastlist/OnFastScrollStateChangedListener.java +7 -0
  58. package/rules/.source/hippy/extend_views/fastlist/PendingListNode.java +18 -0
  59. package/rules/.source/hippy/extend_views/fastlist/PendingViewController.java +13 -0
  60. package/rules/.source/hippy/extend_views/fastlist/PostHandlerView.java +6 -0
  61. package/rules/.source/hippy/extend_views/fastlist/PostTaskHolder.java +20 -0
  62. package/rules/.source/hippy/extend_views/fastlist/ReplaceChildController.java +105 -0
  63. package/rules/.source/hippy/extend_views/fastlist/ReplaceChildView.java +312 -0
  64. package/rules/.source/hippy/extend_views/fastlist/TVListView.java +3692 -0
  65. package/rules/.source/hippy/extend_views/fastlist/TemplateCodeParser.java +247 -0
  66. package/rules/.source/hippy/extend_views/fastlist/Utils.java +572 -0
  67. package/rules/.source/hippy/extend_views/fastlist/ViewTag.java +317 -0
  68. package/rules/.source/hippy/extend_views/fastlist/VirtualListView.java +8 -0
  69. package/rules/.source/hippy/extend_views/fastlist/diff/FastListDataBindingHelper.java +320 -0
  70. package/rules/.source/hippy/extend_views/fastlist/diff/KeyDiffHelper.java +289 -0
  71. package/rules/.source/hippy/extend_views/fastlist/diff/NoKeyDiffHelper.java +278 -0
  72. package/rules/.source/hippy/extend_views/tag/FontTag.java +53 -0
  73. package/rules/.source/hippy/extend_views/tag/HtmlTag.java +191 -0
  74. package/rules/.source/hippy/extend_views/tag/HtmlTagHandler.java +185 -0
  75. package/rules/.source/hippy/extend_views/tag/SpanTag.java +160 -0
  76. package/rules/.source/hippy/extend_views/tag/TextFontSpan.java +102 -0
  77. package/rules/.source/hippy/extend_views/waterfall/Chunk.java +10 -0
  78. package/rules/.source/hippy/extend_views/waterfall/ChunkGroup.java +5 -0
  79. package/rules/.source/hippy/extend_views/waterfall/Section.java +4 -0
  80. package/rules/.source/hippy/extend_views/waterfall/Tabs.java +5 -0
  81. package/rules/.source/hippy/extend_views/waterfall/WaterfallUtils.java +26 -0
  82. package/rules/.source/hippy/hippy_uimanager/ControllerHolder.java +30 -0
  83. package/rules/.source/hippy/hippy_uimanager/ControllerManager.java +651 -0
  84. package/rules/.source/hippy/hippy_uimanager/ControllerRegistry.java +102 -0
  85. package/rules/.source/hippy/hippy_uimanager/ControllerUpdateManger.java +252 -0
  86. package/rules/.source/hippy/hippy_uimanager/CustomControllerHelper.java +425 -0
  87. package/rules/.source/hippy/hippy_uimanager/DiffUtils.java +526 -0
  88. package/rules/.source/hippy/hippy_uimanager/ExtendViewGroup.java +36 -0
  89. package/rules/.source/hippy/hippy_uimanager/HippyCustomViewCreator.java +29 -0
  90. package/rules/.source/hippy/hippy_uimanager/HippyGroupController.java +83 -0
  91. package/rules/.source/hippy/hippy_uimanager/HippyViewBase.java +27 -0
  92. package/rules/.source/hippy/hippy_uimanager/HippyViewController.java +2189 -0
  93. package/rules/.source/hippy/hippy_uimanager/HippyViewEvent.java +52 -0
  94. package/rules/.source/hippy/hippy_uimanager/IHippyZIndexViewGroup.java +24 -0
  95. package/rules/.source/hippy/hippy_uimanager/InternalExtendViewUtil.java +395 -0
  96. package/rules/.source/hippy/hippy_uimanager/ListItemRenderNode.java +143 -0
  97. package/rules/.source/hippy/hippy_uimanager/ListViewRenderNode.java +44 -0
  98. package/rules/.source/hippy/hippy_uimanager/MatrixUtil.java +470 -0
  99. package/rules/.source/hippy/hippy_uimanager/NativeGestureDispatcher.java +349 -0
  100. package/rules/.source/hippy/hippy_uimanager/NativeGestureProcessor.java +188 -0
  101. package/rules/.source/hippy/hippy_uimanager/PullFooterRenderNode.java +43 -0
  102. package/rules/.source/hippy/hippy_uimanager/PullHeaderRenderNode.java +43 -0
  103. package/rules/.source/hippy/hippy_uimanager/RenderManager.java +304 -0
  104. package/rules/.source/hippy/hippy_uimanager/RenderNode.java +533 -0
  105. package/rules/.source/hippy/hippy_uimanager/StateView.java +17 -0
  106. package/rules/.source/hippy/hippy_uimanager/TransformUtil.java +125 -0
  107. package/rules/.source/hippy/hippy_uimanager/ViewGroupDrawingOrderHelper.java +108 -0
  108. package/rules/.source/hippy/hippy_uimanager/ViewStateProvider.java +10 -0
  109. package/rules/.source/hippy/hippy_views/audioview/AudioPlayManager.java +457 -0
  110. package/rules/.source/hippy/hippy_views/audioview/AudioView.java +225 -0
  111. package/rules/.source/hippy/hippy_views/audioview/AudioViewController.java +135 -0
  112. package/rules/.source/hippy/hippy_views/common/CommonBackgroundDrawable.java +58 -0
  113. package/rules/.source/hippy/hippy_views/common/CommonBorder.java +37 -0
  114. package/rules/.source/hippy/hippy_views/custom/HippyCustomPropsController.java +61 -0
  115. package/rules/.source/hippy/hippy_views/hippylist/HippyRecyclerListAdapter.java +399 -0
  116. package/rules/.source/hippy/hippy_views/hippylist/HippyRecyclerView.java +378 -0
  117. package/rules/.source/hippy/hippy_views/hippylist/HippyRecyclerViewController.java +187 -0
  118. package/rules/.source/hippy/hippy_views/hippylist/HippyRecyclerViewHolder.java +39 -0
  119. package/rules/.source/hippy/hippy_views/hippylist/HippyRecyclerViewWrapper.java +134 -0
  120. package/rules/.source/hippy/hippy_views/hippylist/NodePositionHelper.java +55 -0
  121. package/rules/.source/hippy/hippy_views/hippylist/PreloadHelper.java +54 -0
  122. package/rules/.source/hippy/hippy_views/hippylist/PullFooterEventHelper.java +61 -0
  123. package/rules/.source/hippy/hippy_views/hippylist/PullHeaderEventHelper.java +127 -0
  124. package/rules/.source/hippy/hippy_views/hippylist/RecyclerViewEventHelper.java +394 -0
  125. package/rules/.source/hippy/hippy_views/image/HippyContentDrawable.java +113 -0
  126. package/rules/.source/hippy/hippy_views/image/HippyImageView.java +1608 -0
  127. package/rules/.source/hippy/hippy_views/image/HippyImageViewController.java +382 -0
  128. package/rules/.source/hippy/hippy_views/image/IImageStateListener.java +7 -0
  129. package/rules/.source/hippy/hippy_views/list/ChildOnScreenScroller.java +255 -0
  130. package/rules/.source/hippy/hippy_views/list/HippyListAdapter.java +647 -0
  131. package/rules/.source/hippy/hippy_views/list/HippyListItemView.java +162 -0
  132. package/rules/.source/hippy/hippy_views/list/HippyListItemViewController.java +45 -0
  133. package/rules/.source/hippy/hippy_views/list/HippyListView.java +915 -0
  134. package/rules/.source/hippy/hippy_views/list/HippyListViewController.java +622 -0
  135. package/rules/.source/hippy/hippy_views/list/HippyRecycler.java +31 -0
  136. package/rules/.source/hippy/hippy_views/list/IRecycleItemTypeChange.java +23 -0
  137. package/rules/.source/hippy/hippy_views/list/ItemDecorations.java +70 -0
  138. package/rules/.source/hippy/hippy_views/list/NegativeLongKeyFlinger.java +156 -0
  139. package/rules/.source/hippy/hippy_views/list/NodeHolder.java +34 -0
  140. package/rules/.source/hippy/hippy_views/list/RecycleViewFlinger.java +126 -0
  141. package/rules/.source/hippy/hippy_views/list/TVRecyclerView.java +2070 -0
  142. package/rules/.source/hippy/hippy_views/list/TVSingleLineListView.java +15 -0
  143. package/rules/.source/hippy/hippy_views/modal/HippyModalHostManager.java +102 -0
  144. package/rules/.source/hippy/hippy_views/modal/HippyModalHostView.java +597 -0
  145. package/rules/.source/hippy/hippy_views/modal/ModalHostHelper.java +46 -0
  146. package/rules/.source/hippy/hippy_views/modal/ModalStyleNode.java +34 -0
  147. package/rules/.source/hippy/hippy_views/modal/RequestCloseEvent.java +32 -0
  148. package/rules/.source/hippy/hippy_views/modal/ShowEvent.java +31 -0
  149. package/rules/.source/hippy/hippy_views/navigator/Navigator.java +126 -0
  150. package/rules/.source/hippy/hippy_views/navigator/NavigatorController.java +120 -0
  151. package/rules/.source/hippy/hippy_views/refresh/HippyPullFooterView.java +47 -0
  152. package/rules/.source/hippy/hippy_views/refresh/HippyPullFooterViewController.java +65 -0
  153. package/rules/.source/hippy/hippy_views/refresh/HippyPullHeaderView.java +39 -0
  154. package/rules/.source/hippy/hippy_views/refresh/HippyPullHeaderViewController.java +104 -0
  155. package/rules/.source/hippy/hippy_views/refresh/RefreshWrapper.java +237 -0
  156. package/rules/.source/hippy/hippy_views/refresh/RefreshWrapperController.java +62 -0
  157. package/rules/.source/hippy/hippy_views/refresh/RefreshWrapperItemController.java +39 -0
  158. package/rules/.source/hippy/hippy_views/refresh/RefreshWrapperItemView.java +26 -0
  159. package/rules/.source/hippy/hippy_views/scroll/HippyHorizontalScrollView.java +500 -0
  160. package/rules/.source/hippy/hippy_views/scroll/HippyOnScrollHelper.java +39 -0
  161. package/rules/.source/hippy/hippy_views/scroll/HippyScrollView.java +46 -0
  162. package/rules/.source/hippy/hippy_views/scroll/HippyScrollViewController.java +178 -0
  163. package/rules/.source/hippy/hippy_views/scroll/HippyScrollViewEventHelper.java +92 -0
  164. package/rules/.source/hippy/hippy_views/scroll/HippyVerticalScrollView.java +522 -0
  165. package/rules/.source/hippy/hippy_views/text/HippyTextView.java +512 -0
  166. package/rules/.source/hippy/hippy_views/text/HippyTextViewController.java +77 -0
  167. package/rules/.source/hippy/hippy_views/textinput/HippyTextInput.java +668 -0
  168. package/rules/.source/hippy/hippy_views/textinput/HippyTextInputController.java +528 -0
  169. package/rules/.source/hippy/hippy_views/textinput/TextInputNode.java +115 -0
  170. package/rules/.source/hippy/hippy_views/videoview/APEZProvider.java +287 -0
  171. package/rules/.source/hippy/hippy_views/videoview/APKExpansionSupport.java +82 -0
  172. package/rules/.source/hippy/hippy_views/videoview/PivotPoint.java +13 -0
  173. package/rules/.source/hippy/hippy_views/videoview/ScalableType.java +34 -0
  174. package/rules/.source/hippy/hippy_views/videoview/ScalableVideoView.java +265 -0
  175. package/rules/.source/hippy/hippy_views/videoview/ScaleManager.java +191 -0
  176. package/rules/.source/hippy/hippy_views/videoview/Size.java +19 -0
  177. package/rules/.source/hippy/hippy_views/videoview/VideoHippyView.java +917 -0
  178. package/rules/.source/hippy/hippy_views/videoview/VideoHippyViewController.java +236 -0
  179. package/rules/.source/hippy/hippy_views/videoview/ZipResourceFile.java +427 -0
  180. package/rules/.source/hippy/hippy_views/view/CardRootView.java +28 -0
  181. package/rules/.source/hippy/hippy_views/view/CustomLayoutView.java +10 -0
  182. package/rules/.source/hippy/hippy_views/view/CustomNodeView.java +5 -0
  183. package/rules/.source/hippy/hippy_views/view/DialogViewGroup.java +113 -0
  184. package/rules/.source/hippy/hippy_views/view/HippyViewGroup.java +2042 -0
  185. package/rules/.source/hippy/hippy_views/view/HippyViewGroupController.java +583 -0
  186. package/rules/.source/hippy/hippy_views/view/WindowRoot.java +5 -0
  187. package/rules/.source/hippy/hippy_views/viewpager/HippyViewPager.java +308 -0
  188. package/rules/.source/hippy/hippy_views/viewpager/HippyViewPagerAdapter.java +148 -0
  189. package/rules/.source/hippy/hippy_views/viewpager/HippyViewPagerController.java +246 -0
  190. package/rules/.source/hippy/hippy_views/viewpager/HippyViewPagerItem.java +27 -0
  191. package/rules/.source/hippy/hippy_views/viewpager/HippyViewPagerItemController.java +42 -0
  192. package/rules/.source/hippy/hippy_views/viewpager/ViewPagerPageChangeListener.java +114 -0
  193. package/rules/.source/hippy/hippy_views/viewpager/event/HippyPageItemExposureEvent.java +40 -0
  194. package/rules/.source/hippy/hippy_views/viewpager/event/HippyPageScrollEvent.java +43 -0
  195. package/rules/.source/hippy/hippy_views/viewpager/event/HippyPageScrollStateChangedEvent.java +42 -0
  196. package/rules/.source/hippy/hippy_views/viewpager/event/HippyPageSelectedEvent.java +42 -0
  197. package/rules/.source/hippy/hippy_views/webview/HippyWebView.java +160 -0
  198. package/rules/.source/hippy/hippy_views/webview/HippyWebViewBridge.java +20 -0
  199. package/rules/.source/hippy/hippy_views/webview/HippyWebViewController.java +103 -0
  200. package/rules/.source/hippy/hippy_views/webview/HippyWebViewInner.java +77 -0
  201. package/rules/.windsurfrules +27 -4
  202. package/rules/AGENTS.md +27 -4
  203. package/rules/CLAUDE.md +27 -3
  204. package/rules/GEMINI.md +25 -3
@@ -0,0 +1,130 @@
1
+ package com.tencent.extend.views.fastlist;
2
+
3
+ import android.content.Context;
4
+ import android.util.Log;
5
+ import android.view.View;
6
+ import android.view.ViewGroup;
7
+
8
+ import com.tencent.mtt.hippy.HippyRootView;
9
+ import com.tencent.mtt.hippy.annotation.HippyController;
10
+ import com.tencent.mtt.hippy.annotation.HippyControllerProps;
11
+ import com.tencent.mtt.hippy.common.HippyArray;
12
+ import com.tencent.mtt.hippy.common.HippyMap;
13
+ import com.tencent.mtt.hippy.modules.Promise;
14
+ import com.tencent.mtt.hippy.uimanager.ControllerManager;
15
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
16
+ import com.tencent.mtt.hippy.utils.LogUtils;
17
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
18
+ import com.tencent.mtt.hippy.views.view.HippyViewGroupController;
19
+
20
+
21
+ @HippyController(
22
+ name = FastFlexViewController.CLASS_NAME
23
+ )
24
+ public class FastFlexViewController extends HippyViewGroupController implements PendingViewController {
25
+ public static final String CLASS_NAME = "FastFlexView";
26
+
27
+ public FastFlexViewController() {
28
+ }
29
+
30
+
31
+ @Override
32
+ protected void addView(ViewGroup parentView, View view, int index) {
33
+ // super.addView(parentView, view, index);
34
+ }
35
+
36
+
37
+ @HippyControllerProps(name = PendingViewController.PROP_LIST, defaultType = HippyControllerProps.ARRAY)
38
+ public void setListData(final View lv, HippyArray list){
39
+ if(lv instanceof FastFlexView){
40
+ ((FastFlexView) lv).setPendingData(list, Utils.getRenderNode(lv));
41
+ }
42
+ }
43
+
44
+ protected View createViewImpl(Context context) {
45
+ //return new FastFlexView(context);
46
+ return null;
47
+ }
48
+
49
+ @Override
50
+ protected View createViewImpl(Context context, HippyMap iniProps) {
51
+ FastFlexView fastFlexView = new FastFlexView(context);
52
+ if(iniProps != null && iniProps.containsKey("enablePlaceholder")){
53
+ fastFlexView.setEnablePlaceholder(iniProps.getBoolean("enablePlaceholder"));
54
+ // Log.e("ZHAOPENG","createViewImpl flex enablePlaceholder " +iniProps.getBoolean("enablePlaceholder"));
55
+ }
56
+ return fastFlexView;
57
+ }
58
+
59
+
60
+ @Override
61
+ public RenderNode createRenderNode(int id, HippyMap props, String className, HippyRootView hippyRootView, ControllerManager controllerManager, boolean lazy) {
62
+ return new FastFlexNode(id, props, className, hippyRootView, controllerManager, lazy);
63
+ }
64
+
65
+ // @HippyControllerProps(name = "enablePlaceholder", defaultType = HippyControllerProps.BOOLEAN, defaultBoolean = true)
66
+ // public void setEnablePlaceholder(View view, boolean enable) {
67
+ // if (view instanceof FastFlexView) {
68
+ // ((FastFlexView) view).setEnablePlaceholder(enable);
69
+ // }
70
+ // }
71
+
72
+ @Override
73
+ public void setPendingData(View view, Object data, RenderNode templateNode,boolean useDiff) {
74
+ if(LogUtils.isDebug()) {
75
+ Log.i("FastFlexLog", "setPendingData InFlexController data:" + data + ",templateNode:" + templateNode + ",view:" + view);
76
+ }
77
+ if(view instanceof FastFlexView){
78
+ ((FastFlexView) view).setPendingData(data,templateNode,useDiff);
79
+ }
80
+ }
81
+
82
+ @Override
83
+ public void setPendingData(View view, Object data, RenderNode templateNode) {
84
+ this.setPendingData(view,data,templateNode,false);
85
+ }
86
+
87
+ @HippyControllerProps(name = "cachePool", defaultType = HippyControllerProps.MAP)
88
+ public void setCacheSizeMap(View view,HippyMap map) {
89
+ if(view instanceof FastFlexView) {
90
+ ((FastFlexView) view).setCachePoolMap(map);
91
+ }
92
+ }
93
+
94
+ @HippyControllerProps(name = "useDiff", defaultType = HippyControllerProps.BOOLEAN, defaultBoolean = false)
95
+ public void setUseDiff(View view, boolean useDiff) {
96
+ if(view instanceof FastFlexView) {
97
+ ((FastFlexView) view).setUseDiff(useDiff);
98
+ }
99
+ }
100
+
101
+ @HippyControllerProps(name = "keyName", defaultType = HippyControllerProps.STRING)
102
+ public void setUseDiff(View view, String keyName) {
103
+ if(view instanceof FastFlexView) {
104
+ ((FastFlexView) view).setKeyName(keyName);
105
+ }
106
+ }
107
+
108
+ @HippyControllerProps(name = "firstFocusChild", defaultType = HippyControllerProps.MAP)
109
+ public void setTouchScrollEnable(FastFlexView view, HippyMap map) {
110
+ view.getFirstFocusHelper().setFirstFocusChildMap(map);
111
+ }
112
+
113
+ @Override
114
+ public void dispatchFunction(HippyViewGroup view, String functionName, HippyArray var, Promise promise) {
115
+ super.dispatchFunction(view, functionName, var, promise);
116
+ if (view instanceof FastFlexView) {
117
+ switch (functionName){
118
+ case "updateItem":
119
+ ((FastFlexView) view).updateItem(var.getInt(0), var.getObject(1));
120
+ break;
121
+ }
122
+ }
123
+
124
+ }
125
+
126
+ @HippyControllerProps(name = "sharedItemStore", defaultType = HippyControllerProps.STRING)
127
+ public void setSharedItemStore(final FastFlexView lv, String name) {
128
+ lv.setSharedItemStore(name);
129
+ }
130
+ }
@@ -0,0 +1,67 @@
1
+ package com.tencent.extend.views.fastlist;
2
+
3
+ import android.util.Log;
4
+ import android.view.View;
5
+
6
+ import com.tencent.mtt.hippy.HippyRootView;
7
+ import com.tencent.mtt.hippy.common.HippyArray;
8
+ import com.tencent.mtt.hippy.common.HippyMap;
9
+ import com.tencent.mtt.hippy.modules.Promise;
10
+ import com.tencent.mtt.hippy.uimanager.ControllerManager;
11
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
12
+ import com.tencent.mtt.hippy.utils.LogUtils;
13
+
14
+ public class FastItemNode extends RenderNode {
15
+ final ControllerManager controllerManager;
16
+
17
+ public FastItemNode(int mId, HippyMap mPropsToUpdate, String className, HippyRootView rootView, ControllerManager componentManager, boolean isLazyLoad) {
18
+ super(mId, mPropsToUpdate, className, rootView, componentManager, isLazyLoad);
19
+ this.controllerManager = componentManager;
20
+
21
+ }
22
+
23
+ public static boolean isFastItemNode(RenderNode node){
24
+ return node instanceof FastItemNode;
25
+ }
26
+
27
+
28
+ @Override
29
+ public View createView() {
30
+ return super.createView();
31
+ }
32
+
33
+ @Override
34
+ public void updateLayout(int x, int y, int w, int h) {
35
+ //zhaopeng 这里由于模版view在ListViwe中的位置由adapter在bind时确定,所以这时没有理由可以updateLayout
36
+ // super.updateLayout(x, y, w, h);
37
+ }
38
+
39
+ @Override
40
+ public void dispatchUIFunction(String functionName, HippyArray parameter, Promise promise) {
41
+ if(LogUtils.isDebug()) {
42
+ Log.d("FastList", "-- FastItemNode dispatchUIFunction functionName:" + functionName + ",parameter:" + parameter);
43
+ }
44
+ super.dispatchUIFunction(functionName, parameter, promise);
45
+ //FIXME 可能由于此列表不再正常受控制,所有导致dispatchUIFunction时parameter传递的参数会有错误
46
+ // controllerManager.dispatchUIFunction(getId(),getClassName(),functionName,parameter,promise);
47
+ }
48
+
49
+
50
+
51
+ @Override
52
+ public void batchComplete() {
53
+ super.batchComplete();
54
+ }
55
+
56
+
57
+
58
+ public void updateViewRecursive(){
59
+ //zhaopeng 这里不进行update,因为模版不需要
60
+ }
61
+
62
+
63
+
64
+ public View getBoundView() {
65
+ return controllerManager.findView(getId());
66
+ }
67
+ }
@@ -0,0 +1,306 @@
1
+ package com.tencent.extend.views.fastlist;
2
+
3
+ import android.content.Context;
4
+ import android.graphics.Color;
5
+ import android.util.Log;
6
+ import android.view.View;
7
+
8
+ import com.tencent.extend.views.IRecyclerItemView;
9
+ import com.tencent.mtt.hippy.common.HippyArray;
10
+ import com.tencent.mtt.hippy.common.HippyMap;
11
+ import com.tencent.mtt.hippy.modules.Promise;
12
+ import com.tencent.mtt.hippy.uimanager.HippyViewEvent;
13
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
14
+ import com.tencent.mtt.hippy.utils.LogUtils;
15
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
16
+
17
+ public class FastItemView extends HippyViewGroup implements IRecyclerItemView, FastAdapter.ScrollTaskHandler, FastAdapter.ItemContainer {
18
+ private FastListView parentListView;
19
+ private FastFlexView parentFlexView;
20
+ protected int bindPosition = -1;
21
+ protected Object bindItem = null;
22
+ protected int JSEventViewID = -1;
23
+ boolean enablePlaceholder = false;
24
+ boolean disablePlaceholderFocus = false;
25
+ public FastItemView(Context context) {
26
+ super(context);
27
+ setClipChildren(false);
28
+ setFocusable(false);
29
+ }
30
+
31
+ public void setParentListView(FastListView parentListView) {
32
+ this.parentListView = parentListView;
33
+ }
34
+
35
+ public void setParentFlexView(FastFlexView parentFlexView) {
36
+ this.parentFlexView = parentFlexView;
37
+ }
38
+
39
+ public void setJSEventViewID(int JSEventViewID) {
40
+ this.JSEventViewID = JSEventViewID;
41
+ }
42
+
43
+ public void updateInstance(int index, Object object) {
44
+
45
+ }
46
+
47
+ @Override
48
+ public HippyMap getScrollOverride() {
49
+ HippyMap map = super.getScrollOverride();
50
+ if (map != null) {
51
+ return map;
52
+ }
53
+ if (getContentView() instanceof HippyViewGroup) {
54
+ return ((HippyViewGroup) getContentView()).getScrollOverride();
55
+ }
56
+ return null;
57
+ }
58
+
59
+ public FastListView getParentListView() {
60
+ return parentListView;
61
+ }
62
+
63
+ public FastFlexView getParentFlexView() {
64
+ return parentFlexView;
65
+ }
66
+
67
+ public void updateItemDataInList(int position, Object object){
68
+ assert getId() != -1;
69
+ FastPendingView parent = parentListView;
70
+ if(LogUtils.isDebug()){
71
+ Log.i("FastItemViewLog","updateIteDataInList id:"+getId()+",parent:"+parent);
72
+ }
73
+ if(parent != null){
74
+ parent.updateItem(position,object);
75
+ }else{
76
+ throw new IllegalStateException("updateItemProps error, parent cant be null here,position:"+position);
77
+ }
78
+ }
79
+
80
+ private FastPendingView findParent(){
81
+ if(getParent() instanceof FastPendingView){
82
+ return (FastPendingView) getParent();
83
+ }
84
+ if(LogUtils.isDebug()){
85
+ Log.d("FastItemViewLog","findParent step 1 null id:"+getId()+",parent:"+getParent());
86
+ }
87
+ final RenderNode node = Utils.getRenderNode(this);
88
+ if(node != null && node.getParent() != null){
89
+ final View view = Utils.findBoundView(getHippyContext(),node.getParent());
90
+ if(view instanceof FastPendingView){
91
+ return (FastPendingView) view;
92
+ }
93
+ }
94
+ if(LogUtils.isDebug()){
95
+ Log.e("FastItemViewLog","findParent final null id:"+getId()+",parent:"+getParent());
96
+ }
97
+ return null;
98
+ }
99
+
100
+
101
+ public void batchUpdate(int position) {
102
+
103
+ }
104
+
105
+ public static FastItemView findTemplateItemView(View view){
106
+ if(view instanceof FastItemView){
107
+ return (FastItemView) view;
108
+ }
109
+ if(view .getParent() instanceof View) {
110
+ return findTemplateItemView((View) view.getParent());
111
+ }
112
+ return null;
113
+ }
114
+
115
+ public void updateItemProps(String name,int anInt, HippyMap map, boolean aBoolean) {
116
+ FastPendingView parent = parentListView;
117
+ if(LogUtils.isDebug()){
118
+ Log.i("FastItemViewLog","updateItemProps id:"+getId()+",parent:"+parent+",name:"+name+",pos:"+anInt);
119
+ }
120
+ if(parent != null){
121
+ parent.updateItemProps(name,anInt,map,aBoolean);
122
+ }else{
123
+ throw new IllegalStateException("updateItemProps error, parent cant be null here,name:"+name+",position:"+anInt);
124
+ }
125
+ }
126
+
127
+ public void dispatchItemFunction(HippyArray var, Promise promise) {
128
+ FastPendingView parent = parentListView;
129
+ if(LogUtils.isDebug()){
130
+ Log.i("FastItemViewLog","dispatchItemFunction id:"+getId()+",parent:"+parent);
131
+ }
132
+ if(parent != null){
133
+ parent.dispatchItemFunction(var,promise);
134
+ }else{
135
+ throw new IllegalStateException("dispatchItemFunction error, parent cant be null,var:"+var);
136
+ }
137
+ }
138
+
139
+ HippyViewEvent itemEvent;
140
+
141
+
142
+
143
+ protected HippyViewEvent getItemEvent(){
144
+ if(itemEvent == null){
145
+ itemEvent = new HippyViewEvent("onItemViewEvent");
146
+ }
147
+ return itemEvent;
148
+ }
149
+
150
+ protected HippyMap generateItemEventMap(String eventName,int position,Object item){
151
+ HippyMap hm = new HippyMap();
152
+ hm.pushString("eventName",eventName);
153
+ hm.pushInt("position",position);
154
+ hm.pushObject("itemData",item);
155
+ return hm;
156
+ }
157
+
158
+ @Override
159
+ public void onBind(View parent, int position, Object item) {
160
+ this.bindPosition = position;
161
+ this.bindItem = item;
162
+ if(JSEventViewID > -1) {
163
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("bind", position, item));
164
+ }
165
+ }
166
+
167
+ @Override
168
+ public void onCreate(View parent) {
169
+ if(JSEventViewID > -1) {
170
+ getItemEvent().send(JSEventViewID, getHippyContext(),generateItemEventMap("create", -1, null));
171
+ }
172
+ }
173
+
174
+ @Override
175
+ public void onUnBind(View parent, int position, Object item) {
176
+ this.bindPosition = -1;
177
+ this.bindItem = null;
178
+ if(JSEventViewID > -1) {
179
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("unBind", position, item));
180
+ }
181
+ }
182
+
183
+
184
+ @Override
185
+ public void onAttachToWindow(View parent, int position, Object item) {
186
+ if(JSEventViewID > -1) {
187
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("attach", position, item));
188
+ }
189
+ }
190
+
191
+ @Override
192
+ public void onDetachFromWindow(View parent, int position, Object item) {
193
+ if(JSEventViewID > -1) {
194
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("detach", position, item));
195
+ }
196
+ }
197
+
198
+ @Override
199
+ public void clearPostTask(int type) {
200
+
201
+ }
202
+
203
+ @Override
204
+ public void notifyDetachFromParent() {
205
+
206
+ }
207
+
208
+ @Override
209
+ public void notifyAttachToParent() {
210
+
211
+ }
212
+
213
+ @Override
214
+ public void notifyBringToFront(boolean front) {
215
+ if(JSEventViewID > -1) {
216
+ if (front) {
217
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("toFront", bindPosition, bindItem));
218
+ } else {
219
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("toBack", bindPosition, bindItem));
220
+ }
221
+ }
222
+ }
223
+
224
+
225
+ @Override
226
+ public void notifyPauseTask() {
227
+ if(JSEventViewID > -1) {
228
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("pause", bindPosition, bindItem));
229
+ }
230
+ }
231
+
232
+ @Override
233
+ public void notifyResumeTask() {
234
+ if(JSEventViewID > -1) {
235
+ getItemEvent().send(JSEventViewID, getHippyContext(), generateItemEventMap("resume", bindPosition, bindItem));
236
+ }
237
+ }
238
+
239
+
240
+ @Override
241
+ public View getItemView() {
242
+ return this;
243
+ }
244
+
245
+
246
+ @Override
247
+ public View getContentView() {
248
+ if(getChildCount() > 0){
249
+ return getChildAt(0);
250
+ }
251
+ return null;
252
+ }
253
+
254
+ @Override
255
+ protected void drawableStateChanged() {
256
+ super.drawableStateChanged();
257
+ if (enablePlaceholder && isFocusable() && getContentView() != null && !disablePlaceholderFocus) {
258
+ getContentView().refreshDrawableState();
259
+ }
260
+ }
261
+
262
+ @Override
263
+ public void toggle(boolean toPlaceholder) {
264
+ if(!enablePlaceholder){
265
+ return;
266
+ }
267
+ final View content = getContentView();
268
+ if(toPlaceholder){
269
+ if (content != null) {
270
+ content.setAlpha(0);
271
+ }
272
+ setBackgroundColor(placeholderBackgroundColor);
273
+ }else {
274
+ if (content != null) {
275
+ if(!disablePlaceholderFocus) {
276
+ content.setDuplicateParentStateEnabled(true);
277
+ }
278
+ content.setAlpha(1);
279
+ }
280
+ setBackgroundColor(Color.TRANSPARENT);
281
+ }
282
+ }
283
+
284
+
285
+ public void setEnablePlaceholder(boolean enablePlaceholder) {
286
+ this.enablePlaceholder = enablePlaceholder;
287
+ }
288
+
289
+ int placeholderBackgroundColor;
290
+ float placeholderBorderRadius = 0;
291
+
292
+ public void configPlaceholder(int placeholderBackgroundColor, float placeholderBorderRadius) {
293
+ if(enablePlaceholder) {
294
+ this.placeholderBackgroundColor = placeholderBackgroundColor;
295
+ this.placeholderBorderRadius = placeholderBorderRadius;
296
+ if (getContentView() != null) {
297
+ setBackgroundColor(placeholderBackgroundColor);
298
+ }
299
+ setBorderRadius(placeholderBorderRadius, BorderRadiusDirection.ALL.ordinal());
300
+ }
301
+ }
302
+
303
+ public void setDisablePlaceholderFocus(boolean disablePlaceholderFocus) {
304
+ this.disablePlaceholderFocus = disablePlaceholderFocus;
305
+ }
306
+ }
@@ -0,0 +1,106 @@
1
+ package com.tencent.extend.views.fastlist;
2
+
3
+ import android.content.Context;
4
+ import android.util.Log;
5
+ import android.view.View;
6
+ import android.view.ViewGroup;
7
+
8
+ import com.tencent.mtt.hippy.HippyRootView;
9
+ import com.tencent.mtt.hippy.annotation.HippyController;
10
+ import com.tencent.mtt.hippy.annotation.HippyControllerProps;
11
+ import com.tencent.mtt.hippy.common.HippyArray;
12
+ import com.tencent.mtt.hippy.common.HippyMap;
13
+ import com.tencent.mtt.hippy.modules.Promise;
14
+ import com.tencent.mtt.hippy.uimanager.ControllerManager;
15
+ import com.tencent.mtt.hippy.uimanager.HippyViewController;
16
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
17
+ import com.tencent.mtt.hippy.utils.LogUtils;
18
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
19
+
20
+
21
+ @HippyController(
22
+ name = FastItemViewController.CLASS_NAME
23
+ )
24
+ public class FastItemViewController extends HippyViewController<FastItemView> {
25
+ public static final String CLASS_NAME = "FastItemView";
26
+ public static final String TAG = "FastItemViewLog";
27
+
28
+ public FastItemViewController() {
29
+ }
30
+
31
+ @Override
32
+ protected void addView(ViewGroup parentView, View view, int index) {
33
+ super.addView(parentView, view, index);
34
+ }
35
+
36
+
37
+ protected View createViewImpl(Context context) {
38
+ return new FastItemView(context);
39
+ }
40
+
41
+ @Override
42
+ protected View createViewImpl(Context context, HippyMap iniProps) {
43
+ // if(iniProps != null) {
44
+ // if (iniProps.containsKey("type")) {
45
+ // Log.d(CLASS_NAME, "createViewImpl hasType:" + iniProps.get("type"));
46
+ // } else {
47
+ // //throw new IllegalArgumentException("tv-item必须指定type属性");
48
+ // Log.e(CLASS_NAME, "createViewImpl eror hasType null");
49
+ // }
50
+ // }
51
+ return super.createViewImpl(context, iniProps);
52
+ }
53
+
54
+
55
+ @Override
56
+ public RenderNode createRenderNode(int id, HippyMap props, String className, HippyRootView hippyRootView, ControllerManager controllerManager, boolean lazy) {
57
+ return new FastItemNode(id, props, className, hippyRootView, controllerManager, lazy);
58
+ }
59
+
60
+
61
+ @HippyControllerProps(name = "focusScrollTarget", defaultType = HippyControllerProps.BOOLEAN,defaultBoolean = false)
62
+ public void setFocusScrollTarget(FastItemView view, boolean enable) {
63
+ if(view != null){
64
+ view.setFocusScrollTarget(enable);
65
+ }
66
+ }
67
+
68
+ @Override
69
+ public void dispatchFunction(FastItemView view, String functionName, HippyArray params, Promise promise) {
70
+ super.dispatchFunction(view, functionName, params, promise);
71
+ switch (functionName) {
72
+ case "dispatchItemFunctionWithPromise":
73
+ view.dispatchItemFunction(params,promise);
74
+ break;
75
+ }
76
+ }
77
+
78
+ @Override
79
+ public void dispatchFunction(FastItemView view, String functionName, HippyArray var) {
80
+ if (LogUtils.isDebug()) {
81
+ Log.d(TAG, "dispatchFunction functionName:" + functionName + ",var :" + var);
82
+ }
83
+ super.dispatchFunction(view,functionName,var);
84
+ switch (functionName) {
85
+ case "updateInstance":
86
+ view.updateInstance(var.getInt(0),var.getObject(1));
87
+ break;
88
+ case "updateItem":
89
+ view.updateItemDataInList(var.getInt(0),var.getObject(1));
90
+ break;
91
+ case "batch":
92
+ view.batchUpdate(var.getInt(0));
93
+ break;
94
+ case "updateItemProps":
95
+ view.updateItemProps(var.getString(0), var.getInt(1),var.getMap(2),var.getBoolean(3));
96
+ break;
97
+ case "dispatchItemFunction":
98
+ view.dispatchItemFunction(var,null);
99
+ break;
100
+
101
+
102
+ }
103
+ }
104
+
105
+
106
+ }
@@ -0,0 +1,95 @@
1
+ package com.tencent.extend.views.fastlist;
2
+
3
+
4
+ import android.support.annotation.NonNull;
5
+ import android.support.annotation.Nullable;
6
+ import android.util.Log;
7
+
8
+ import com.tencent.extend.FocusManagerModule;
9
+ import com.tencent.mtt.hippy.HippyEngineContext;
10
+ import com.tencent.mtt.hippy.annotation.HippyMethod;
11
+ import com.tencent.mtt.hippy.annotation.HippyNativeModule;
12
+ import com.tencent.mtt.hippy.common.HippyArray;
13
+ import com.tencent.mtt.hippy.modules.nativemodules.HippyNativeModuleBase;
14
+
15
+ import java.util.HashMap;
16
+
17
+ @HippyNativeModule(name = "FastListModule")
18
+ public class FastListModule extends HippyNativeModuleBase {
19
+ public static HashMap<Integer, GlobalConfig> globalConfig;
20
+ private GlobalConfig config;
21
+ public FastListModule(HippyEngineContext context) {
22
+ super(context);
23
+ config = new GlobalConfig();
24
+ if(globalConfig == null){
25
+ globalConfig = new HashMap<>();
26
+ }
27
+ globalConfig.put(context.hashCode(),config);
28
+ }
29
+
30
+ @HippyMethod(name = "clearAllCache")
31
+ public void clearAllCache() {
32
+ if(FastAdapter.gSharedCachePools != null){
33
+ FastAdapter.gSharedCachePools.clear();
34
+ FastAdapter.gSharedCachePools = null;
35
+ }
36
+ }
37
+
38
+ @HippyMethod(name = "setPlaceholderIcon")
39
+ public void setPlaceholderIcon(HippyArray array) {
40
+ Log.i("FastListModule","setPlaceholderIcon array:"+array);
41
+ config.placeholderIcon = array.getString(0);
42
+ config.placeholderIconSize = array.getArray(1);
43
+ }
44
+
45
+ @HippyMethod(name = "setPlaceholderBorderRadius")
46
+ public void setPlaceholderIcon(int radius) {
47
+ Log.i("FastListModule","setPlaceholderBorderRadius radius:"+radius);
48
+ config.placeholderBorderRadius = radius;
49
+ }
50
+
51
+ @HippyMethod(name = "scrollFactor")
52
+ public void setScrollFactor(float scrollFactor) {
53
+ Log.i("FastListModule","scrollFactor scrollFactor:"+scrollFactor);
54
+ config.scrollFactor = scrollFactor;
55
+ }
56
+
57
+ @HippyMethod(name = "setFadeEnabled")
58
+ public void setFadeEnabled(boolean fadeImageEnable) {
59
+ Log.i("FastListModule","setFadeEnabled fadeImageEnable:"+fadeImageEnable);
60
+ config.fadeImageEnable = fadeImageEnable;
61
+ }
62
+
63
+ @HippyMethod(name = "setDefaultFadingEdgeLength")
64
+ public void setFadingEdgeLength(double length) {
65
+ Log.i("FastListModule","setDefaultFadingEdgeLength length:"+length);
66
+ config.defaultFadingEdgeLength = (float) length;
67
+ }
68
+
69
+ @HippyMethod(name = "setFadeDuration")
70
+ public void setFadeDuration(int duration) {
71
+ Log.i("FastListModule","setFadeDuration duration:"+duration);
72
+ config.fadeDuration = duration;
73
+ }
74
+
75
+ public static class GlobalConfig {
76
+ public String placeholderIcon = null;
77
+ public HippyArray placeholderIconSize = null;
78
+ public float scrollFactor = 1.2f;
79
+ public int placeholderBorderRadius = 8;
80
+ public float defaultFadingEdgeLength = 0.0f;
81
+ public boolean fadeImageEnable = false;
82
+ public int fadeDuration = 500;
83
+ }
84
+
85
+ public static @NonNull FastListModule.GlobalConfig getGlobalConfig(@Nullable HippyEngineContext context){
86
+ FastListModule.GlobalConfig config = null;
87
+ if (globalConfig != null && context != null) {
88
+ config = globalConfig.get(context.hashCode());
89
+ }
90
+ if (config != null) {
91
+ return config;
92
+ }
93
+ return new FastListModule.GlobalConfig();
94
+ }
95
+ }