@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,46 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.modal;
17
+
18
+ import android.annotation.TargetApi;
19
+ import android.content.Context;
20
+ import android.graphics.Point;
21
+ import android.os.Build;
22
+ import android.view.Display;
23
+ import android.view.WindowManager;
24
+
25
+ /*package*/ class ModalHostHelper {
26
+
27
+ private static final Point MIN_POINT = new Point();
28
+ private static final Point MAX_POINT = new Point();
29
+ private static final Point SIZE_POINT = new Point();
30
+
31
+
32
+ @TargetApi(16)
33
+ public static Point getModalHostSize(Context context) {
34
+ WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
35
+ Display display = wm.getDefaultDisplay();
36
+ if (Build.VERSION.SDK_INT >= 16) {
37
+ display.getCurrentSizeRange(MIN_POINT, MAX_POINT);
38
+ }
39
+ display.getSize(SIZE_POINT);
40
+ if (SIZE_POINT.x < SIZE_POINT.y) {
41
+ return new Point(MIN_POINT.x, MAX_POINT.y);
42
+ } else {
43
+ return new Point(MAX_POINT.x, MIN_POINT.y);
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,34 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.modal;
17
+
18
+ import android.graphics.Point;
19
+
20
+ import com.tencent.mtt.hippy.dom.node.StyleNode;
21
+ import com.tencent.mtt.hippy.utils.ContextHolder;
22
+ import com.tencent.smtt.flexbox.FlexNode;
23
+
24
+ @SuppressWarnings({"unused"})
25
+ class ModalStyleNode extends StyleNode {
26
+
27
+ @Override
28
+ public void addChildAt(FlexNode child, int i) {
29
+ super.addChildAt(child, i);
30
+ Point modalSize = ModalHostHelper.getModalHostSize(ContextHolder.getAppContext());
31
+ child.setStyleWidth(modalSize.x);
32
+ child.setStyleHeight(modalSize.y);
33
+ }
34
+ }
@@ -0,0 +1,32 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.modal;
17
+
18
+ import com.tencent.mtt.hippy.uimanager.HippyViewEvent;
19
+
20
+ /**
21
+ *
22
+ */
23
+ public class RequestCloseEvent extends HippyViewEvent {
24
+
25
+ public static final String EVENT_NAME = "onRequestClose";
26
+
27
+ public RequestCloseEvent() {
28
+ super(EVENT_NAME);
29
+ }
30
+
31
+
32
+ }
@@ -0,0 +1,31 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.modal;
17
+
18
+ import com.tencent.mtt.hippy.uimanager.HippyViewEvent;
19
+
20
+ /**
21
+ *
22
+ */
23
+ public class ShowEvent extends HippyViewEvent {
24
+
25
+ public static final String EVENT_NAME = "onShow";
26
+
27
+ public ShowEvent() {
28
+ super(EVENT_NAME);
29
+ }
30
+
31
+ }
@@ -0,0 +1,126 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.navigator;
17
+
18
+ import android.animation.Animator;
19
+ import android.animation.ObjectAnimator;
20
+ import android.content.Context;
21
+ import android.view.View;
22
+ import com.tencent.mtt.hippy.HippyRootView;
23
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
24
+
25
+ public class Navigator extends HippyViewGroup {
26
+
27
+ private final static String DIRECTION_LEFT = "left";
28
+ private final static String DIRECTION_RIGHT = "right";
29
+ private final static String DIRECTION_TOP = "top";
30
+ private final static String DIRECTION_BOTTOM = "bottom";
31
+
32
+ public Navigator(Context context) {
33
+ super(context);
34
+ }
35
+
36
+ public void push(HippyRootView hippyRootView, boolean animated, String fromDirection) {
37
+ addView(hippyRootView);
38
+ hippyRootView.layout(0, 0, getWidth(), getHeight());
39
+
40
+ if (animated) {
41
+ Animator animator;
42
+ switch (fromDirection == null ? "" : fromDirection) {
43
+ case DIRECTION_TOP:
44
+ animator = ObjectAnimator.ofFloat(hippyRootView, "translationY", -getHeight(), 0);
45
+ break;
46
+ case DIRECTION_BOTTOM:
47
+ animator = ObjectAnimator.ofFloat(hippyRootView, "translationY", getHeight(), 0);
48
+ break;
49
+ case DIRECTION_LEFT:
50
+ animator = ObjectAnimator.ofFloat(hippyRootView, "translationX", -getWidth(), 0);
51
+ break;
52
+ case DIRECTION_RIGHT:
53
+ default:
54
+ // 默认值就是"right"
55
+ animator = ObjectAnimator.ofFloat(hippyRootView, "translationX", getWidth(), 0);
56
+ break;
57
+ }
58
+ if (animator != null) {
59
+ animator.start();
60
+ }
61
+ }
62
+ }
63
+
64
+
65
+ @Override
66
+ protected void onLayout(boolean change, int l, int t, int r, int b) {
67
+ // super.onLayout(b, i, i1, i2, i3);
68
+
69
+ int childCount = getChildCount();
70
+
71
+ for (int i = 0; i < childCount; i++) {
72
+ getChildAt(i).layout(0, 0, getWidth(), getHeight());
73
+ }
74
+ }
75
+
76
+ public void init(HippyRootView hippyRootView) {
77
+ addView(hippyRootView);
78
+ }
79
+
80
+
81
+ @Override
82
+ public void onAnimationEnd(Animator animator) {
83
+ super.onAnimationEnd(animator);
84
+
85
+ final View chileView = (View) ((ObjectAnimator) animator).getTarget();
86
+ NavigatorController.destroyInstance(chileView);
87
+ animator.removeAllListeners();
88
+
89
+ post(new Runnable() {
90
+ @Override
91
+ public void run() {
92
+ removeView(chileView);
93
+ }
94
+ });
95
+ }
96
+
97
+ public void pop(boolean animated, String toDirection) {
98
+ final View childView = getChildAt(getChildCount() - 1);
99
+ if (animated) {
100
+ Animator animator;
101
+ switch (toDirection == null ? "" : toDirection) {
102
+ case DIRECTION_TOP:
103
+ animator = ObjectAnimator.ofFloat(childView, "translationY", 0, -getHeight());
104
+ break;
105
+ case DIRECTION_BOTTOM:
106
+ animator = ObjectAnimator.ofFloat(childView, "translationY", 0, getHeight());
107
+ break;
108
+ case DIRECTION_LEFT:
109
+ animator = ObjectAnimator.ofFloat(childView, "translationX", 0, -getWidth());
110
+ break;
111
+ case DIRECTION_RIGHT:
112
+ default:
113
+ // 默认值就是"right"
114
+ animator = ObjectAnimator.ofFloat(childView, "translationX", 0, getWidth());
115
+ break;
116
+ }
117
+ if (animator != null) {
118
+ animator.addListener(this);
119
+ animator.start();
120
+ }
121
+ } else {
122
+ NavigatorController.destroyInstance(childView);
123
+ removeView(childView);
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,120 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.navigator;
17
+
18
+ import android.content.Context;
19
+ import android.util.Log;
20
+ import android.view.View;
21
+ import android.view.ViewGroup;
22
+
23
+ import com.tencent.mtt.hippy.HippyEngine;
24
+ import com.tencent.mtt.hippy.HippyInstanceContext;
25
+ import com.tencent.mtt.hippy.HippyRootView;
26
+ import com.tencent.mtt.hippy.annotation.HippyController;
27
+ import com.tencent.mtt.hippy.annotation.HippyControllerProps;
28
+ import com.tencent.mtt.hippy.common.HippyArray;
29
+ import com.tencent.mtt.hippy.common.HippyMap;
30
+ import com.tencent.mtt.hippy.uimanager.HippyGroupController;
31
+
32
+ @SuppressWarnings({"deprecation", "unused"})
33
+ @HippyController(name = NavigatorController.CLASS)
34
+ public class NavigatorController extends HippyGroupController<Navigator> {
35
+
36
+ public static final String CLASS = "Navigator";
37
+
38
+ private final static String PUSH = "push";
39
+ private final static String POP = "pop";
40
+
41
+ @Override
42
+ protected View createViewImpl(Context context) {
43
+ return new Navigator(context);
44
+ }
45
+
46
+ @Override
47
+ protected void addView(ViewGroup parentView, View view, int index) {
48
+ // super.addView(parentView, view, index);
49
+ Log.d(CLASS, "addView");
50
+ }
51
+
52
+ @Override
53
+ public void dispatchFunction(Navigator view, String functionName, HippyArray var) {
54
+ super.dispatchFunction(view, functionName, var);
55
+
56
+ switch (functionName) {
57
+ case POP:
58
+ boolean animated = false;
59
+ String toDirection = null;
60
+ if (var != null) {
61
+ HippyMap hippyMap = var.getMap(0);
62
+ if (hippyMap != null) {
63
+ animated = hippyMap.getBoolean("animated");
64
+ toDirection = hippyMap.getString("toDirection");
65
+ }
66
+ }
67
+ view.pop(animated, toDirection);
68
+ break;
69
+ case PUSH:
70
+ if (var != null) {
71
+ HippyMap hippyMap = var.getMap(0);
72
+ if (hippyMap != null) {
73
+ String component = hippyMap.getString("routeName");
74
+ HippyMap initProps = hippyMap.getMap("initProps");
75
+ animated = hippyMap.getBoolean("animated");
76
+ String fromDirection = hippyMap.getString("fromDirection");
77
+ HippyRootView hippyRootView = loadNavPage(view, component, initProps);
78
+ view.push(hippyRootView, animated, fromDirection);
79
+ }
80
+ }
81
+ break;
82
+ }
83
+ }
84
+
85
+ private HippyRootView loadNavPage(Navigator view, String component, HippyMap initProps) {
86
+ HippyInstanceContext hippyInstanceContext = (HippyInstanceContext) view.getContext();
87
+ HippyEngine.ModuleLoadParams moduleParams = new HippyEngine.ModuleLoadParams(
88
+ hippyInstanceContext.getModuleParams());
89
+ moduleParams.componentName = component;
90
+ moduleParams.jsParams = initProps;
91
+ return hippyInstanceContext.getEngineManager().loadModule(moduleParams);
92
+ }
93
+
94
+ @HippyControllerProps(name = "initialRoute", defaultType = HippyControllerProps.MAP)
95
+ public void initPage(Navigator navigator, HippyMap hippyMap) {
96
+ String component = hippyMap.getString("routeName");
97
+ HippyMap initProps = hippyMap.getMap("initProps");
98
+
99
+ HippyRootView hippyRootView = loadNavPage(navigator, component, initProps);
100
+
101
+ navigator.init(hippyRootView);
102
+ }
103
+
104
+ public static void destroyInstance(View view) {
105
+ if (view instanceof HippyRootView) {
106
+ HippyInstanceContext hippyInstanceContext = (HippyInstanceContext) view.getContext();
107
+ HippyRootView hippyRootView = (HippyRootView) view;
108
+ hippyInstanceContext.getEngineManager().destroyModule(hippyRootView);
109
+ }
110
+ }
111
+
112
+ @Override
113
+ protected void deleteChild(ViewGroup parentView, View childView) {
114
+ // super.deleteChild(parentView, childView);
115
+
116
+ destroyInstance(childView);
117
+
118
+ Log.d(CLASS, "deleteChild");
119
+ }
120
+ }
@@ -0,0 +1,47 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.refresh;
17
+
18
+ import android.content.Context;
19
+ import android.view.View;
20
+
21
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
22
+
23
+ public class HippyPullFooterView extends HippyViewGroup {
24
+
25
+ private View mParentView;
26
+ private boolean mStickEnabled = false;
27
+
28
+ public HippyPullFooterView(Context context) {
29
+ super(context);
30
+ }
31
+
32
+ public void setParentView(View parentView) {
33
+ mParentView = parentView;
34
+ }
35
+
36
+ public View getParentView() {
37
+ return mParentView;
38
+ }
39
+
40
+ public void setStickEnabled(boolean enabled) {
41
+ mStickEnabled = enabled;
42
+ }
43
+
44
+ public boolean getStickEnabled() {
45
+ return mStickEnabled;
46
+ }
47
+ }
@@ -0,0 +1,65 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.refresh;
17
+
18
+ import android.content.Context;
19
+ import android.view.View;
20
+
21
+ import com.tencent.mtt.hippy.HippyRootView;
22
+ import com.tencent.mtt.hippy.annotation.HippyController;
23
+ import com.tencent.mtt.hippy.annotation.HippyControllerProps;
24
+ import com.tencent.mtt.hippy.common.HippyArray;
25
+ import com.tencent.mtt.hippy.common.HippyMap;
26
+ import com.tencent.mtt.hippy.uimanager.ControllerManager;
27
+ import com.tencent.mtt.hippy.uimanager.HippyViewController;
28
+ import com.tencent.mtt.hippy.uimanager.PullFooterRenderNode;
29
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
30
+ import com.tencent.mtt.hippy.views.list.HippyListView;
31
+
32
+ @SuppressWarnings({"deprecation", "unused"})
33
+ @HippyController(name = HippyPullFooterViewController.CLASS_NAME, isLazyLoad = true)
34
+ public class HippyPullFooterViewController extends HippyViewController<HippyPullFooterView> {
35
+
36
+ public static final String CLASS_NAME = "PullFooterView";
37
+
38
+ @Override
39
+ protected View createViewImpl(Context context) {
40
+ return new HippyPullFooterView(context);
41
+ }
42
+
43
+ @Override
44
+ public RenderNode createRenderNode(int id, HippyMap props, String className,
45
+ HippyRootView hippyRootView, ControllerManager controllerManager, boolean lazy) {
46
+ return new PullFooterRenderNode(id, props, className, hippyRootView, controllerManager, lazy);
47
+ }
48
+
49
+ @HippyControllerProps(name = "sticky", defaultType = HippyControllerProps.BOOLEAN)
50
+ public void setStickEnabled(HippyPullFooterView view, boolean flag) {
51
+ view.setStickEnabled(flag);
52
+ }
53
+
54
+ @Override
55
+ public void dispatchFunction(HippyPullFooterView view, String functionName,
56
+ HippyArray dataArray) {
57
+ super.dispatchFunction(view, functionName, dataArray);
58
+ View parent = view.getParentView();
59
+ if (parent instanceof HippyListView) {
60
+ if ("collapsePullFooter".equals(functionName)) {
61
+ ((HippyListView) parent).onFooterRefreshFinish();
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,39 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.tencent.mtt.hippy.views.refresh;
17
+
18
+ import android.content.Context;
19
+ import android.view.View;
20
+
21
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
22
+
23
+ public class HippyPullHeaderView extends HippyViewGroup {
24
+
25
+ private View mParentView;
26
+
27
+ public HippyPullHeaderView(Context context) {
28
+ super(context);
29
+ }
30
+
31
+ public void setParentView(View parentView) {
32
+ mParentView = parentView;
33
+ }
34
+
35
+ public View getParentView() {
36
+ return mParentView;
37
+ }
38
+
39
+ }
@@ -0,0 +1,104 @@
1
+ /* Tencent is pleased to support the open source community by making Hippy available.
2
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package com.tencent.mtt.hippy.views.refresh;
18
+
19
+ import android.content.Context;
20
+ import android.view.View;
21
+
22
+ import com.tencent.mtt.hippy.HippyRootView;
23
+ import com.tencent.mtt.hippy.annotation.HippyController;
24
+ import com.tencent.mtt.hippy.common.HippyArray;
25
+ import com.tencent.mtt.hippy.common.HippyMap;
26
+ import com.tencent.mtt.hippy.uimanager.ControllerManager;
27
+ import com.tencent.mtt.hippy.uimanager.HippyViewController;
28
+ import com.tencent.mtt.hippy.uimanager.PullHeaderRenderNode;
29
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
30
+ import com.tencent.mtt.hippy.utils.LogUtils;
31
+ import com.tencent.mtt.hippy.views.hippylist.HippyRecyclerView;
32
+ import com.tencent.mtt.hippy.views.hippylist.PullHeaderEventHelper;
33
+ import com.tencent.mtt.hippy.views.list.HippyListView;
34
+
35
+ @SuppressWarnings({"deprecation", "unused"})
36
+ @HippyController(name = HippyPullHeaderViewController.CLASS_NAME, isLazyLoad = true)
37
+ public class HippyPullHeaderViewController extends HippyViewController<HippyPullHeaderView> {
38
+
39
+ public static final String CLASS_NAME = "PullHeaderView";
40
+ public static final String COLLAPSE_PULL_HEADER = "collapsePullHeader";
41
+ public static final String EXPAND_PULL_HEADER = "expandPullHeader";
42
+
43
+ @Override
44
+ protected View createViewImpl(Context context) {
45
+ return new HippyPullHeaderView(context);
46
+ }
47
+
48
+ @Override
49
+ public RenderNode createRenderNode(int id, HippyMap props, String className,
50
+ HippyRootView hippyRootView,
51
+ ControllerManager controllerManager, boolean lazy) {
52
+ return new PullHeaderRenderNode(id, props, className, hippyRootView, controllerManager, lazy);
53
+ }
54
+
55
+ private void execListViewFunction(HippyListView listView, String functionName) {
56
+ switch (functionName) {
57
+ case COLLAPSE_PULL_HEADER: {
58
+ listView.onHeaderRefreshFinish();
59
+ break;
60
+ }
61
+ case EXPAND_PULL_HEADER: {
62
+ listView.onHeaderRefresh();
63
+ break;
64
+ }
65
+ default: {
66
+ LogUtils
67
+ .d("HippyPullHeaderViewController", "execListViewFunction: unknown function name!!");
68
+ }
69
+ }
70
+ }
71
+
72
+ private void execRecyclerViewFunction(HippyRecyclerView recyclerView, String functionName) {
73
+ PullHeaderEventHelper headerEventHelper = recyclerView.getAdapter()
74
+ .getHeaderEventHelper();
75
+ if (headerEventHelper != null) {
76
+ switch (functionName) {
77
+ case COLLAPSE_PULL_HEADER: {
78
+ headerEventHelper.onHeaderRefreshFinish();
79
+ break;
80
+ }
81
+ case EXPAND_PULL_HEADER: {
82
+ headerEventHelper.onHeaderRefresh();
83
+ break;
84
+ }
85
+ default: {
86
+ LogUtils.d("HippyPullHeaderViewController",
87
+ "execRecyclerViewFunction: unknown function name!!");
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+ @Override
94
+ public void dispatchFunction(HippyPullHeaderView view, String functionName,
95
+ HippyArray dataArray) {
96
+ super.dispatchFunction(view, functionName, dataArray);
97
+ View parent = view.getParentView();
98
+ if (parent instanceof HippyListView) {
99
+ execListViewFunction((HippyListView)parent, functionName);
100
+ } else if (parent instanceof HippyRecyclerView) {
101
+ execRecyclerViewFunction((HippyRecyclerView)parent, functionName);
102
+ }
103
+ }
104
+ }