@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,225 @@
1
+ package com.tencent.mtt.hippy.views.audioview;
2
+
3
+ /* Tencent is pleased to support the open source community by making Hippy available.
4
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import com.tencent.mtt.hippy.HippyEngineContext;
20
+ import com.tencent.mtt.hippy.HippyInstanceContext;
21
+ import com.tencent.mtt.hippy.common.HippyMap;
22
+ import com.tencent.mtt.hippy.modules.javascriptmodules.EventDispatcher;
23
+ import com.tencent.mtt.hippy.uimanager.HippyViewBase;
24
+ import com.tencent.mtt.hippy.views.view.HippyViewGroup;
25
+
26
+ import android.content.Context;
27
+ import android.text.TextUtils;
28
+
29
+ /**
30
+ * @Description: TODO
31
+ * @author: robinsli
32
+ * @date: 2019/6/11 11:18
33
+ * @version: V1.0
34
+ */
35
+ public class AudioView extends HippyViewGroup implements AudioPlayManager.AudioManagerListener,HippyViewBase
36
+ {
37
+ private AudioPlayManager mAudioPlayerManager = null;
38
+ private int mUniqPlayId = 0;
39
+ private boolean mOnPlayStartCallBack = false;
40
+ private boolean mOnPlayProgressCallBack = false;
41
+ private boolean mOnPlayResumeCallBack = false;
42
+ private boolean mOnPlayPauseCallBack = false;
43
+ private boolean mOnPlayCompleteCallBack = false;
44
+ private boolean mOnPlayErrorCallBack = false;
45
+ private boolean mAutoPlay = false;
46
+ private String mCurrentPlayAudio = "";
47
+
48
+
49
+ HippyEngineContext mHippyContext;
50
+
51
+
52
+
53
+ public AudioView(Context context)
54
+ {
55
+ super(context);
56
+ mAudioPlayerManager = AudioPlayManager.getInstance();
57
+ mUniqPlayId = AudioPlayManager.globalUiqPlayId();
58
+ mHippyContext = ((HippyInstanceContext) context).getEngineContext();
59
+ }
60
+
61
+
62
+
63
+ //播放地址
64
+ public boolean setAudioPlayUrl(String sAudioUrl)
65
+ {
66
+ mCurrentPlayAudio = sAudioUrl;
67
+ return mAudioPlayerManager.setAudioPlayUrl(mUniqPlayId, sAudioUrl, this); //TODO 这个view被mAudioPlayerManager持有了
68
+ }
69
+ //自动播放
70
+ public boolean setAudioAutoPlay(boolean autoPlay)
71
+ {
72
+ mAutoPlay = autoPlay;//mAudioPlayerManager.setAudioPlayUrl(mUniqPlayId, sAudioUrl, this);
73
+ if (mAutoPlay && !TextUtils.isEmpty(mCurrentPlayAudio))
74
+ mAudioPlayerManager.playAudio(mUniqPlayId);
75
+ return true;
76
+ }
77
+ //播放
78
+ public boolean playAudio()
79
+ {
80
+ return mAudioPlayerManager.playAudio(mUniqPlayId);
81
+ }
82
+ //seekTo
83
+ public boolean seekTo(int seekToPos)
84
+ {
85
+ return mAudioPlayerManager.seekTo(mUniqPlayId,seekToPos);
86
+ }
87
+ //pause
88
+ public boolean pauseAudio()
89
+ {
90
+ return mAudioPlayerManager.pauseAudio(mUniqPlayId);
91
+ }
92
+ //TODO is this need
93
+ public boolean stopAudio()
94
+ {
95
+ return mAudioPlayerManager.stopAudio(mUniqPlayId);
96
+ }
97
+
98
+ public boolean releaseAudio()
99
+ {
100
+ return mAudioPlayerManager.releaseAudio(mUniqPlayId);
101
+ }
102
+ //播放状态回调
103
+ public void setOnPlayStart(boolean onPlayStartCallBack)
104
+ {
105
+ mOnPlayStartCallBack = onPlayStartCallBack;
106
+ }
107
+
108
+ public void setOnPlayPause(boolean onPlayPauseCallBack)
109
+ {
110
+ mOnPlayPauseCallBack = onPlayPauseCallBack;
111
+ }
112
+
113
+ public void setOnPlayResume(boolean onPlayResumeCallBack)
114
+ {
115
+ mOnPlayResumeCallBack = onPlayResumeCallBack;
116
+ }
117
+
118
+ public void setOnPlayProgress(boolean onPlayProgressCallBack)
119
+ {
120
+ mOnPlayProgressCallBack = onPlayProgressCallBack;
121
+ }
122
+
123
+ public void setOnPlayComplete(boolean onPlayCompleteCallBack)
124
+ {
125
+ mOnPlayCompleteCallBack = onPlayCompleteCallBack;
126
+ }
127
+ public void setOnPlayError(boolean onPlayErrorCallBack)
128
+ {
129
+ mOnPlayErrorCallBack = onPlayErrorCallBack;
130
+ }
131
+
132
+
133
+
134
+ @Override
135
+ public void onPlayStart(String playAudioUrl)
136
+ {
137
+ if(mOnPlayStartCallBack)
138
+ {
139
+ HippyMap hippyMap = new HippyMap();
140
+ hippyMap.pushString("currentSrc",playAudioUrl);
141
+ hippyMap.pushInt("size", 0 ); //TODO not specific yet
142
+ hippyMap.pushInt("current", mAudioPlayerManager.currentPlayAudioPosition() );
143
+ hippyMap.pushInt("length",mAudioPlayerManager.currentPlayAudioDuration());
144
+
145
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
146
+ "onPlaying", hippyMap);
147
+ }
148
+ }
149
+
150
+ @Override
151
+ public void onPlayPause(String playAudioUrl)
152
+ {
153
+ if(mOnPlayPauseCallBack)
154
+ {
155
+ HippyMap hippyMap = new HippyMap();
156
+ hippyMap.pushString("currentSrc",playAudioUrl);
157
+ hippyMap.pushInt("size", 0 ); //TODO not specific yet
158
+ hippyMap.pushInt("current", mAudioPlayerManager.currentPlayAudioPosition() );
159
+ hippyMap.pushInt("length",mAudioPlayerManager.currentPlayAudioDuration());
160
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
161
+ "onPause", hippyMap);
162
+ }
163
+ }
164
+
165
+ @Override
166
+ public void onPlayResume(String playAudioUrl)
167
+ {
168
+ if(mOnPlayResumeCallBack)
169
+ {
170
+ HippyMap hippyMap = new HippyMap();
171
+ hippyMap.pushString("currentSrc",playAudioUrl);
172
+ hippyMap.pushInt("size", 0 ); //TODO not specific yet
173
+ hippyMap.pushInt("current", mAudioPlayerManager.currentPlayAudioPosition() );
174
+ hippyMap.pushInt("length",mAudioPlayerManager.currentPlayAudioDuration());
175
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
176
+ "onPlaying", hippyMap);
177
+ }
178
+ }
179
+
180
+ @Override
181
+ public void onPlayError(String playAudioUrl,int what, int extra)
182
+ {
183
+ if(mOnPlayErrorCallBack)
184
+ {
185
+ HippyMap hippyMap = new HippyMap();
186
+ hippyMap.pushString("currentSrc",playAudioUrl);
187
+ hippyMap.pushInt("what",what);
188
+ hippyMap.pushInt("extra",extra);
189
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
190
+ "onError", hippyMap);
191
+ }
192
+ }
193
+
194
+ @Override
195
+ public void onPlayComplete(String playAudioUrl)
196
+ {
197
+ if(mOnPlayCompleteCallBack)
198
+ {
199
+ HippyMap hippyMap = new HippyMap();
200
+ hippyMap.pushString("playAudioUrl",playAudioUrl);
201
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
202
+ "onEnded", hippyMap);
203
+ }
204
+ }
205
+
206
+ @Override
207
+ public void onPlayBuffering(String playAudioUrl)
208
+ {
209
+
210
+ }
211
+
212
+ @Override
213
+ public void onPlayProgress(String playAudioUrl,int currentPlayTimeMs, int audioPlayTotalTimeMs)
214
+ {
215
+ if(mOnPlayProgressCallBack)
216
+ {
217
+ HippyMap hippyMap = new HippyMap();
218
+ hippyMap.pushInt("playTimeMs",currentPlayTimeMs);
219
+ hippyMap.pushInt("current", currentPlayTimeMs );
220
+ hippyMap.pushInt("length",audioPlayTotalTimeMs);
221
+ mHippyContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(getId(),
222
+ "onProgress", hippyMap);
223
+ }
224
+ }
225
+ }
@@ -0,0 +1,135 @@
1
+ package com.tencent.mtt.hippy.views.audioview;
2
+
3
+ /* Tencent is pleased to support the open source community by making Hippy available.
4
+ * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import com.tencent.mtt.hippy.annotation.HippyController;
20
+ import com.tencent.mtt.hippy.annotation.HippyControllerProps;
21
+ import com.tencent.mtt.hippy.common.HippyArray;
22
+ import com.tencent.mtt.hippy.modules.Promise;
23
+ import com.tencent.mtt.hippy.uimanager.HippyGroupController;
24
+ import com.tencent.mtt.hippy.uimanager.HippyViewController;
25
+ import com.tencent.mtt.hippy.views.refresh.RefreshWrapper;
26
+ import com.tencent.mtt.hippy.views.textinput.HippyTextInput;
27
+ import com.tencent.mtt.hippy.views.view.HippyViewGroupController;
28
+
29
+ import android.content.Context;
30
+ import android.text.TextUtils;
31
+ import android.view.View;
32
+
33
+
34
+ /**
35
+ * @Description: TODO
36
+ * @author: robinsli
37
+ * @date: 2019/6/11 11:18
38
+ * @version: V1.0
39
+ */
40
+ @HippyController(name = "AudioView")
41
+ public class AudioViewController extends HippyGroupController<AudioView>
42
+ {
43
+ //AudioView支持的操作
44
+ public static final String ACATION_PLAY = "play";
45
+ public static final String ACATION_PAUSE = "pause";
46
+ public static final String ACATION_SEEKTO = "seek";
47
+ public static final String ACATION_STOP = "stop";
48
+ public static final String ACATION_RELEASE = "release"; //TODO AudioView准备AudioManager持有,如何释放
49
+
50
+ @Override
51
+ protected View createViewImpl(Context context)
52
+ {
53
+ return new AudioView(context);
54
+ }
55
+
56
+ @HippyControllerProps(name = "src", defaultType = HippyControllerProps.STRING, defaultString = "")
57
+ public void setUrl(AudioView hippyAudioView, String url)
58
+ {
59
+ hippyAudioView.setAudioPlayUrl(url);
60
+ }
61
+
62
+ @HippyControllerProps(name = "autoPlay", defaultType = HippyControllerProps.BOOLEAN, defaultBoolean = false)
63
+ public void setAutoPlay(AudioView hippyAudioView, boolean autoPlay)
64
+ {
65
+ hippyAudioView.setAudioAutoPlay(autoPlay);
66
+ }
67
+
68
+ @HippyControllerProps(name = "onPlayStart", defaultType = "boolean")
69
+ public void setOnPlayStart(AudioView hippyAudioView, boolean change)
70
+ {
71
+ hippyAudioView.setOnPlayStart(change);
72
+ }
73
+
74
+ @HippyControllerProps(name = "onPlayProgress", defaultType = "boolean")
75
+ public void setOnPlayProgress(AudioView hippyAudioView, boolean change)
76
+ {
77
+ hippyAudioView.setOnPlayProgress(change);
78
+ }
79
+
80
+ @HippyControllerProps(name = "onPlayPause", defaultType = "boolean")
81
+ public void setOnPlayPause(AudioView hippyAudioView, boolean change)
82
+ {
83
+ hippyAudioView.setOnPlayPause(change);
84
+ }
85
+
86
+ @HippyControllerProps(name = "onPlayResume", defaultType = "boolean")
87
+ public void setOnPlayResume(AudioView hippyAudioView, boolean change)
88
+ {
89
+ hippyAudioView.setOnPlayResume(change);
90
+ }
91
+
92
+ @HippyControllerProps(name = "onPlayComplete", defaultType = "boolean")
93
+ public void setOnPlayComplete(AudioView hippyAudioView, boolean change)
94
+ {
95
+ hippyAudioView.setOnPlayComplete(change);
96
+ }
97
+
98
+ @HippyControllerProps(name = "setOnPlayError", defaultType = "boolean")
99
+ public void setOnPlayError(AudioView hippyAudioView, boolean change)
100
+ {
101
+ hippyAudioView.setOnPlayError(change);
102
+ }
103
+
104
+ @Override
105
+ public void dispatchFunction(final AudioView hippyAudioView, String functionName, final HippyArray var, Promise promise)
106
+ {
107
+ switch (functionName)
108
+ {
109
+ case ACATION_PLAY:
110
+ //如果没有传递audiourl参数,播放当前视频
111
+ if (var.getObject(0) != null && !TextUtils.isEmpty(var.getString(0)))
112
+ {
113
+ hippyAudioView.setAudioPlayUrl(var.getString(0));
114
+ }
115
+ hippyAudioView.playAudio();
116
+ break;
117
+
118
+ case ACATION_PAUSE:
119
+ hippyAudioView.pauseAudio();
120
+ break;
121
+ case ACATION_RELEASE:
122
+ hippyAudioView.releaseAudio();
123
+ break;
124
+ case ACATION_SEEKTO:
125
+ if (var.getObject(0) != null && var.getInt(0) > 0)
126
+ hippyAudioView.seekTo(var.getInt(0));
127
+ break;
128
+ case ACATION_STOP:
129
+ hippyAudioView.stopAudio();
130
+ }
131
+ super.dispatchFunction(hippyAudioView, functionName, var);
132
+ }
133
+
134
+
135
+ }
@@ -0,0 +1,58 @@
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.common;
17
+
18
+ import com.tencent.mtt.hippy.dom.flex.FlexConstants;
19
+ import com.tencent.mtt.hippy.utils.PixelUtil;
20
+ import com.tencent.mtt.supportui.views.asyncimage.BackgroundDrawable;
21
+
22
+ public class CommonBackgroundDrawable extends BackgroundDrawable {
23
+
24
+ public void setBorderRadius(float radius, int position) {
25
+ if (!FlexConstants.isUndefined(radius)) {
26
+ radius = PixelUtil.dp2px(radius);
27
+ super.setBorderRadius(radius, position);
28
+ }
29
+ }
30
+
31
+ public void setBorderWidth(float width, int position) {
32
+ if (!FlexConstants.isUndefined(width)) {
33
+ width = PixelUtil.dp2px(width);
34
+ super.setBorderWidth(width, position);
35
+ }
36
+ }
37
+
38
+ public void setShadowOffsetX(float x) {
39
+ if (!FlexConstants.isUndefined(x)) {
40
+ x = PixelUtil.dp2px(x);
41
+ super.setShadowOffsetX(x);
42
+ }
43
+ }
44
+
45
+ public void setShadowOffsetY(float y) {
46
+ if (!FlexConstants.isUndefined(y)) {
47
+ y = PixelUtil.dp2px(y);
48
+ super.setShadowOffsetY(y);
49
+ }
50
+ }
51
+
52
+ public void setShadowRadius(float radius) {
53
+ if (!FlexConstants.isUndefined(radius)) {
54
+ radius = PixelUtil.dp2px(radius);
55
+ super.setShadowRadius(radius);
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,37 @@
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.common;
17
+
18
+ import com.tencent.mtt.supportui.views.IBorder;
19
+
20
+ public interface CommonBorder extends IBorder {
21
+
22
+ enum BorderRadiusDirection {
23
+ ALL,
24
+ TOP_LEFT,
25
+ TOP_RIGHT,
26
+ BOTTOM_RIGHT,
27
+ BOTTOM_LEFT
28
+ }
29
+
30
+ enum BorderWidthDirection {
31
+ ALL,
32
+ LEFT,
33
+ TOP,
34
+ RIGHT,
35
+ BOTTOM
36
+ }
37
+ }
@@ -0,0 +1,61 @@
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.custom;
17
+
18
+ import com.tencent.mtt.hippy.HippyEngineContext;
19
+ import com.tencent.mtt.hippy.HippyInstanceContext;
20
+ import com.tencent.mtt.hippy.annotation.HippyController;
21
+ import com.tencent.mtt.hippy.uimanager.HippyViewController;
22
+ import com.tencent.mtt.hippy.uimanager.RenderNode;
23
+
24
+ import android.content.Context;
25
+ import android.view.View;
26
+
27
+ @SuppressWarnings("rawtypes")
28
+ @HippyController(name = HippyCustomPropsController.CLASS_NAME)
29
+ public class HippyCustomPropsController extends HippyViewController {
30
+
31
+ public static final String CLASS_NAME = "CustomProps";
32
+ public static final String DT_EBLID = "dt_elementBizLeafIdentifier";
33
+
34
+ @SuppressWarnings("unused")
35
+ @Override
36
+ protected View createViewImpl(Context context) {
37
+ return null;
38
+ }
39
+
40
+ @SuppressWarnings("unused")
41
+ protected void onSetDTElementBizLeafIdentifier(View view) {
42
+ if (view == null) {
43
+ return;
44
+ }
45
+
46
+ Context context = view.getContext();
47
+ if (context instanceof HippyInstanceContext) {
48
+ HippyEngineContext engineContext = ((HippyInstanceContext) context).getEngineContext();
49
+ assert (engineContext != null);
50
+ //noinspection ConstantConditions
51
+ if (engineContext == null) {
52
+ return;
53
+ }
54
+
55
+ RenderNode node = engineContext.getRenderManager().getRenderNode(view.getId());
56
+ if (node != null) {
57
+ node.mHasSetDteblId = true;
58
+ }
59
+ }
60
+ }
61
+ }