├── .gitignore ├── README.md ├── assets ├── .gitkeep ├── .gitkeeper └── main.js ├── build.gradle ├── config └── quality │ └── checkstyle.xml ├── gradle.properties ├── libs ├── armeabi │ ├── libweexjsb.so │ ├── libweexjsc.so │ ├── libweexjss.so │ └── libweexjst.so └── x86 │ ├── libweexjsb.so │ ├── libweexjsc.so │ └── libweexjss.so ├── proguard-rules.pro ├── publish.sh └── src ├── main ├── AndroidManifest.xml ├── java │ └── com │ │ └── taobao │ │ └── weex │ │ ├── ComponentObserver.java │ │ ├── IWXActivityStateListener.java │ │ ├── IWXRenderListener.java │ │ ├── IWXStatisticsListener.java │ │ ├── InitConfig.java │ │ ├── LayoutFinishListener.java │ │ ├── RenderContainer.java │ │ ├── WXEnvironment.java │ │ ├── WXGlobalEventModule.java │ │ ├── WXGlobalEventReceiver.java │ │ ├── WXRenderErrorCode.java │ │ ├── WXSDKEngine.java │ │ ├── WXSDKInstance.java │ │ ├── WXSDKManager.java │ │ ├── adapter │ │ ├── DefaultUriAdapter.java │ │ ├── DefaultWXHttpAdapter.java │ │ ├── DrawableStrategy.java │ │ ├── ICrashInfoReporter.java │ │ ├── IDrawableLoader.java │ │ ├── ITracingAdapter.java │ │ ├── IWXAccessibilityRoleAdapter.java │ │ ├── IWXDebugAdapter.java │ │ ├── IWXHttpAdapter.java │ │ ├── IWXImgLoaderAdapter.java │ │ ├── IWXJSExceptionAdapter.java │ │ ├── IWXSoLoaderAdapter.java │ │ ├── IWXTypefaceAdapter.java │ │ ├── IWXUserTrackAdapter.java │ │ └── URIAdapter.java │ │ ├── annotation │ │ ├── Component.java │ │ └── JSMethod.java │ │ ├── appfram │ │ ├── clipboard │ │ │ ├── IWXClipboard.java │ │ │ └── WXClipboardModule.java │ │ ├── navigator │ │ │ ├── IActivityNavBarSetter.java │ │ │ └── WXNavigatorModule.java │ │ ├── pickers │ │ │ ├── DatePickerImpl.java │ │ │ └── WXPickersModule.java │ │ ├── storage │ │ │ ├── DefaultWXStorage.java │ │ │ ├── IWXStorage.java │ │ │ ├── IWXStorageAdapter.java │ │ │ ├── StorageResultHandler.java │ │ │ ├── WXSQLiteOpenHelper.java │ │ │ └── WXStorageModule.java │ │ └── websocket │ │ │ ├── IWebSocketAdapter.java │ │ │ ├── IWebSocketAdapterFactory.java │ │ │ ├── WebSocketCloseCodes.java │ │ │ └── WebSocketModule.java │ │ ├── bridge │ │ ├── EventResult.java │ │ ├── Invoker.java │ │ ├── JSCallback.java │ │ ├── JavascriptInvokable.java │ │ ├── MethodInvoker.java │ │ ├── ModuleFactory.java │ │ ├── NativeInvokeHelper.java │ │ ├── SimpleJSCallback.java │ │ ├── WXBridge.java │ │ ├── WXBridgeManager.java │ │ ├── WXHashMap.java │ │ ├── WXJSObject.java │ │ ├── WXModuleManager.java │ │ ├── WXParams.java │ │ ├── WXServiceManager.java │ │ ├── WXTask.java │ │ └── WXValidateProcessor.java │ │ ├── common │ │ ├── Constants.java │ │ ├── Destroyable.java │ │ ├── ICheckBindingScroller.java │ │ ├── IWXBridge.java │ │ ├── IWXDebugProxy.java │ │ ├── IWXObject.java │ │ ├── IWXTask.java │ │ ├── OnWXScrollListener.java │ │ ├── TypeModuleFactory.java │ │ ├── WXCompatModule.java │ │ ├── WXConfig.java │ │ ├── WXErrorCode.java │ │ ├── WXException.java │ │ ├── WXImageSharpen.java │ │ ├── WXImageStrategy.java │ │ ├── WXInstanceWrap.java │ │ ├── WXJSBridgeMsgType.java │ │ ├── WXJSEngineListener.java │ │ ├── WXJSExceptionInfo.java │ │ ├── WXJSService.java │ │ ├── WXModule.java │ │ ├── WXModuleAnno.java │ │ ├── WXPerformance.java │ │ ├── WXRefreshData.java │ │ ├── WXRenderStrategy.java │ │ ├── WXRequest.java │ │ ├── WXRequestListener.java │ │ ├── WXResponse.java │ │ ├── WXRuntimeException.java │ │ ├── WXThread.java │ │ ├── WXWorkThreadManager.java │ │ └── 未命名 │ │ ├── dom │ │ ├── ApplyStyleConsumer.java │ │ ├── BasicEditTextDomObject.java │ │ ├── CSSAlignConvert.java │ │ ├── CSSFlexDirectionConvert.java │ │ ├── CSSJustifyConvert.java │ │ ├── CSSPositionTypeConvert.java │ │ ├── CSSWrapConvert.java │ │ ├── DOMAction.java │ │ ├── DOMActionContext.java │ │ ├── DOMActionContextImpl.java │ │ ├── DomContext.java │ │ ├── ImmutableDomObject.java │ │ ├── RenderAction.java │ │ ├── RenderActionContext.java │ │ ├── RenderActionTask.java │ │ ├── RichTextDomObject.java │ │ ├── SafePutConcurrentHashMap.java │ │ ├── TextAreaEditTextDomObject.java │ │ ├── TextDecorationSpan.java │ │ ├── WXAttr.java │ │ ├── WXCellDomObject.java │ │ ├── WXCustomStyleSpan.java │ │ ├── WXDomHandler.java │ │ ├── WXDomManager.java │ │ ├── WXDomModule.java │ │ ├── WXDomObject.java │ │ ├── WXDomObjectFactory.java │ │ ├── WXDomRegistry.java │ │ ├── WXDomTask.java │ │ ├── WXEvent.java │ │ ├── WXImageQuality.java │ │ ├── WXLineHeightSpan.java │ │ ├── WXListDomObject.java │ │ ├── WXRecyclerDomObject.java │ │ ├── WXScrollerDomObject.java │ │ ├── WXStyle.java │ │ ├── WXSwitchDomObject.java │ │ ├── WXTextDomObject.java │ │ ├── action │ │ │ ├── AbstractAddElementAction.java │ │ │ ├── AbstractLayoutFinishAction.java │ │ │ ├── Action.java │ │ │ ├── Actions.java │ │ │ ├── AddElementAction.java │ │ │ ├── AddEventAction.java │ │ │ ├── AddRuleAction.java │ │ │ ├── AnimationAction.java │ │ │ ├── CreateBodyAction.java │ │ │ ├── CreateFinishAction.java │ │ │ ├── ExecutableRenderAction.java │ │ │ ├── GetComponentRectAction.java │ │ │ ├── InvokeMethodAction.java │ │ │ ├── ModuleInvocationAction.java │ │ │ ├── MoveElementAction.java │ │ │ ├── RefreshFinishAction.java │ │ │ ├── ReloadPageAction.java │ │ │ ├── RemoveElementAction.java │ │ │ ├── RemoveEventAction.java │ │ │ ├── ScrollToElementAction.java │ │ │ ├── TraceableAction.java │ │ │ ├── UpdateAttributeAction.java │ │ │ ├── UpdateComponentDataAction.java │ │ │ ├── UpdateFinishAction.java │ │ │ └── UpdateStyleAction.java │ │ ├── binding │ │ │ ├── ELUtils.java │ │ │ └── WXStatement.java │ │ ├── flex │ │ │ ├── CSSAlign.java │ │ │ ├── CSSConstants.java │ │ │ ├── CSSDirection.java │ │ │ ├── CSSFlexDirection.java │ │ │ ├── CSSJustify.java │ │ │ ├── CSSLayout.java │ │ │ ├── CSSLayoutContext.java │ │ │ ├── CSSNode.java │ │ │ ├── CSSPositionType.java │ │ │ ├── CSSStyle.java │ │ │ ├── CSSWrap.java │ │ │ ├── CachedCSSLayout.java │ │ │ ├── FloatUtil.java │ │ │ ├── LayoutEngine.java │ │ │ ├── MeasureOutput.java │ │ │ └── Spacing.java │ │ └── transition │ │ │ └── WXTransition.java │ │ ├── el │ │ └── parse │ │ │ ├── ArrayStack.java │ │ │ ├── Block.java │ │ │ ├── Operator.java │ │ │ ├── Operators.java │ │ │ ├── Parser.java │ │ │ ├── Symbol.java │ │ │ └── Token.java │ │ ├── http │ │ ├── Options.java │ │ ├── Status.java │ │ ├── WXHttpUtil.java │ │ └── WXStreamModule.java │ │ ├── tracing │ │ ├── Stopwatch.java │ │ └── WXTracing.java │ │ ├── ui │ │ ├── ComponentCreator.java │ │ ├── ExternalLoaderComponentHolder.java │ │ ├── IExternalComponentGetter.java │ │ ├── IExternalModuleGetter.java │ │ ├── IExternalMoudleGetter.java │ │ ├── IFComponentHolder.java │ │ ├── IWXRenderTask.java │ │ ├── RenderActionContextImpl.java │ │ ├── SimpleComponentHolder.java │ │ ├── WXComponentRegistry.java │ │ ├── WXRenderHandler.java │ │ ├── WXRenderManager.java │ │ ├── animation │ │ │ ├── BackgroundColorProperty.java │ │ │ ├── CameraDistanceProperty.java │ │ │ ├── HeightProperty.java │ │ │ ├── LayoutParamsProperty.java │ │ │ ├── TransformParser.java │ │ │ ├── WXAnimationBean.java │ │ │ ├── WXAnimationModule.java │ │ │ └── WidthProperty.java │ │ ├── component │ │ │ ├── AbstractEditComponent.java │ │ │ ├── AppearanceHelper.java │ │ │ ├── ComponentUtils.java │ │ │ ├── NestedContainer.java │ │ │ ├── Scrollable.java │ │ │ ├── Textarea.java │ │ │ ├── WXA.java │ │ │ ├── WXBaseRefresh.java │ │ │ ├── WXBasicComponentType.java │ │ │ ├── WXComponent.java │ │ │ ├── WXComponentFactory.java │ │ │ ├── WXComponentProp.java │ │ │ ├── WXDiv.java │ │ │ ├── WXEmbed.java │ │ │ ├── WXHeader.java │ │ │ ├── WXImage.java │ │ │ ├── WXIndicator.java │ │ │ ├── WXInput.java │ │ │ ├── WXLoading.java │ │ │ ├── WXLoadingIndicator.java │ │ │ ├── WXRefresh.java │ │ │ ├── WXScroller.java │ │ │ ├── WXSlider.java │ │ │ ├── WXSliderNeighbor.java │ │ │ ├── WXSwitch.java │ │ │ ├── WXText.java │ │ │ ├── WXTextDecoration.java │ │ │ ├── WXVContainer.java │ │ │ ├── WXVideo.java │ │ │ ├── WXWeb.java │ │ │ ├── binding │ │ │ │ ├── Layouts.java │ │ │ │ └── Statements.java │ │ │ ├── helper │ │ │ │ ├── ScrollStartEndHelper.java │ │ │ │ ├── SoftKeyboardDetector.java │ │ │ │ ├── WXStickyHelper.java │ │ │ │ └── WXTimeInputHelper.java │ │ │ ├── inpututil │ │ │ │ ├── BMIdCardInputView.java │ │ │ │ ├── BMKeyboardUtil.java │ │ │ │ └── InputInter.java │ │ │ ├── list │ │ │ │ ├── BasicListComponent.java │ │ │ │ ├── DefaultDragHelper.java │ │ │ │ ├── DragHelper.java │ │ │ │ ├── DragSupportCallback.java │ │ │ │ ├── EventTrigger.java │ │ │ │ ├── HorizontalListComponent.java │ │ │ │ ├── ListComponentView.java │ │ │ │ ├── RecyclerTransform.java │ │ │ │ ├── SimpleListComponent.java │ │ │ │ ├── SimpleRecyclerView.java │ │ │ │ ├── StickyHeaderHelper.java │ │ │ │ ├── WXCell.java │ │ │ │ ├── WXListComponent.java │ │ │ │ └── template │ │ │ │ │ ├── AsyncCellLoadTask.java │ │ │ │ │ ├── CellDataManager.java │ │ │ │ │ ├── CellRenderContext.java │ │ │ │ │ ├── CellRenderState.java │ │ │ │ │ ├── PositionRef.java │ │ │ │ │ ├── TemplateCache.java │ │ │ │ │ ├── TemplateStickyHelper.java │ │ │ │ │ ├── TemplateViewHolder.java │ │ │ │ │ ├── VirtualComponentLifecycle.java │ │ │ │ │ └── WXRecyclerTemplateList.java │ │ │ └── pesudo │ │ │ │ ├── OnActivePseudoListener.java │ │ │ │ ├── PesudoStatus.java │ │ │ │ └── TouchActivePseudoListener.java │ │ ├── flat │ │ │ ├── FlatComponent.java │ │ │ ├── FlatGUIContext.java │ │ │ ├── WidgetContainer.java │ │ │ └── widget │ │ │ │ ├── AndroidViewWidget.java │ │ │ │ ├── BaseWidget.java │ │ │ │ ├── TextWidget.java │ │ │ │ ├── Widget.java │ │ │ │ └── WidgetGroup.java │ │ ├── module │ │ │ ├── WXLocaleModule.java │ │ │ ├── WXMetaModule.java │ │ │ ├── WXModalUIModule.java │ │ │ ├── WXTimerModule.java │ │ │ └── WXWebViewModule.java │ │ └── view │ │ │ ├── IRenderResult.java │ │ │ ├── IRenderStatus.java │ │ │ ├── IWXScroller.java │ │ │ ├── IWXTextView.java │ │ │ ├── IWebView.java │ │ │ ├── WXBaseCircleIndicator.java │ │ │ ├── WXBaseRefreshLayout.java │ │ │ ├── WXCircleIndicator.java │ │ │ ├── WXCirclePageAdapter.java │ │ │ ├── WXCircleViewPager.java │ │ │ ├── WXEditText.java │ │ │ ├── WXFrameLayout.java │ │ │ ├── WXHorizontalScrollView.java │ │ │ ├── WXImageView.java │ │ │ ├── WXLoadingLayout.java │ │ │ ├── WXRefreshLayout.java │ │ │ ├── WXScrollView.java │ │ │ ├── WXSmoothScroller.java │ │ │ ├── WXSwitchView.java │ │ │ ├── WXTextView.java │ │ │ ├── WXVideoView.java │ │ │ ├── WXWebView.java │ │ │ ├── border │ │ │ ├── BorderCorner.java │ │ │ ├── BorderDrawable.java │ │ │ ├── BorderEdge.java │ │ │ ├── BorderRadiusType.java │ │ │ ├── BorderStyle.java │ │ │ ├── BorderUtil.java │ │ │ ├── BorderWidthStyleColorType.java │ │ │ ├── BottomLeftCorner.java │ │ │ ├── BottomRightCorner.java │ │ │ ├── TopLeftCorner.java │ │ │ └── TopRightCorner.java │ │ │ ├── gesture │ │ │ ├── WXGesture.java │ │ │ ├── WXGestureObservable.java │ │ │ └── WXGestureType.java │ │ │ ├── listview │ │ │ ├── ExtendedLinearLayoutManager.java │ │ │ ├── ExtendedStaggeredGridLayoutManager.java │ │ │ ├── WXRecyclerView.java │ │ │ └── adapter │ │ │ │ ├── IOnLoadMoreListener.java │ │ │ │ ├── IRecyclerAdapterListener.java │ │ │ │ ├── ListBaseViewHolder.java │ │ │ │ ├── RecyclerViewBaseAdapter.java │ │ │ │ ├── TransformItemDecoration.java │ │ │ │ └── WXRecyclerViewOnScrollListener.java │ │ │ └── refresh │ │ │ ├── bmrefresh │ │ │ ├── BMBaseRefresh.java │ │ │ └── BMLoadingRefresh.java │ │ │ ├── circlebar │ │ │ ├── CircleProgressBar.java │ │ │ └── MaterialProgressDrawable.java │ │ │ ├── core │ │ │ ├── WXRefreshView.java │ │ │ └── WXSwipeLayout.java │ │ │ └── wrapper │ │ │ ├── BaseBounceView.java │ │ │ ├── BounceRecyclerView.java │ │ │ └── BounceScrollerView.java │ │ ├── utils │ │ ├── ATagUtil.java │ │ ├── BoxShadowUtil.java │ │ ├── ColorUtils.java │ │ ├── FontDO.java │ │ ├── FunctionParser.java │ │ ├── ImageDrawable.java │ │ ├── ImgURIUtil.java │ │ ├── LogLevel.java │ │ ├── OsVersion.java │ │ ├── SingleFunctionParser.java │ │ ├── StaticLayoutProxy.java │ │ ├── Trace.java │ │ ├── TypefaceUtil.java │ │ ├── WXDataStructureUtil.java │ │ ├── WXDomUtils.java │ │ ├── WXExceptionUtils.java │ │ ├── WXFileUtils.java │ │ ├── WXInterception.java │ │ ├── WXJsonUtils.java │ │ ├── WXLogUtils.java │ │ ├── WXReflectionUtils.java │ │ ├── WXResourceUtils.java │ │ ├── WXSoInstallMgrSdk.java │ │ ├── WXUtils.java │ │ ├── WXViewToImageUtil.java │ │ ├── WXViewUtils.java │ │ └── batch │ │ │ ├── BactchExecutor.java │ │ │ ├── BatchOperationHelper.java │ │ │ └── Interceptor.java │ │ └── wson │ │ └── Wson.java └── res │ ├── anim │ ├── hide_input.xml │ └── show_input.xml │ ├── drawable-xhdpi │ ├── icon_delete_32dp.png │ ├── icon_enter_32dp.png │ ├── icon_hide_keyboard.png │ ├── img_keyboard_normal.9.png │ ├── img_keyboard_pressed.9.png │ ├── loadding0001.png │ ├── loadding0002.png │ ├── loadding0003.png │ ├── loadding0004.png │ ├── loadding0005.png │ ├── loadding0006.png │ ├── loadding0007.png │ ├── loadding0008.png │ ├── loadding0009.png │ ├── loadding0010.png │ ├── loadding0011.png │ ├── loadding0012.png │ ├── loadding0013.png │ ├── loadding0014.png │ ├── loadding0015.png │ ├── loadding0016.png │ ├── loadding0017.png │ ├── loadding0018.png │ ├── loadding0019.png │ ├── loadding0020.png │ ├── loadding0021.png │ ├── loadding0022.png │ ├── loadding0023.png │ ├── loadding0024.png │ ├── loadding0025.png │ ├── loadding0026.png │ ├── loadding0027.png │ └── loadding0028.png │ ├── drawable │ ├── bg_keyboardview.xml │ ├── bg_keyboardview_yes.xml │ ├── error.png │ ├── sdk_bmloading.xml │ └── weexerror.png │ ├── layout │ └── sdk_layout_bmloading.xml │ ├── values │ ├── color.xml │ └── strings.xml │ └── xml │ └── idcard_keyboard.xml └── test └── java ├── com └── taobao │ └── weex │ ├── TestActivity.java │ ├── TestApplication.java │ ├── WXSDKEngineTest.java │ ├── WXSDKInstanceTest.java │ ├── WXSDKManagerTest.java │ ├── adapter │ └── DefaultUriAdapterTest.java │ ├── appfram │ ├── clipboard │ │ └── WXClipboardModuleTest.java │ ├── navigator │ │ └── WXNavigatorModuleTest.java │ └── storage │ │ ├── DefaultWXStorageTest.java │ │ └── WXStorageModuleTest.java │ ├── bridge │ ├── WXBridgeManagerTest.java │ ├── WXBridgeTest.java │ ├── WXHashMapTest.java │ └── WXModuleManagerTest.java │ ├── common │ ├── TestModule.java │ ├── TestModuleFactory.java │ └── WXModuleTest.java │ ├── dom │ ├── TestDomObject.java │ ├── WXAttrTest.java │ ├── WXDomManagerTest.java │ ├── WXDomModuleTest.java │ ├── WXDomObjectTest.java │ ├── WXDomStatementTest.java │ ├── WXStyleTest.java │ ├── WXTextDomObjectTest.java │ ├── action │ │ └── TestActions.java │ └── transition │ │ └── WXTransitionTest.java │ ├── el │ ├── FailedCaseTest.java │ ├── IfStatementTest.java │ └── ParserTest.java │ ├── http │ └── WXStreamModuleTest.java │ ├── ui │ ├── ComponentHolderTest.java │ ├── WXRenderStatementTest.java │ ├── animation │ │ ├── TransformParserTest.java │ │ └── WXAnimationModuleTest.java │ ├── component │ │ ├── ComponentTest.java │ │ ├── EditComponentTest.java │ │ ├── PriorityQueueTest.java │ │ ├── TestComponent.java │ │ ├── TestConstants.java │ │ ├── TextareaTest.java │ │ ├── WXComponentTest.java │ │ ├── WXDivTest.java │ │ ├── WXEmbedTest.java │ │ ├── WXHeaderTest.java │ │ ├── WXImageTest.java │ │ ├── WXLoadingTest.java │ │ ├── WXRefreshTest.java │ │ ├── WXScrollerTest.java │ │ ├── WXSliderNeighborTest.java │ │ ├── WXSliderTest.java │ │ ├── WXSwitchTest.java │ │ ├── WXTextTest.java │ │ ├── WXVideoTest.java │ │ ├── WXWebTest.java │ │ ├── binding │ │ │ ├── BindingValueTest.java │ │ │ └── StatementTest.java │ │ ├── helper │ │ │ └── WXTimeInputHelperTest.java │ │ └── list │ │ │ ├── DefaultDragHelperTest.java │ │ │ └── WXListComponentTest.java │ ├── module │ │ ├── WXMetaModuleTest.java │ │ ├── WXModalUIModuleTest.java │ │ ├── WXTimerModuleTest.java │ │ └── WXWebViewModuleTest.java │ └── view │ │ ├── WXCirclePageAdapterTest.java │ │ ├── WXScrollViewTest.java │ │ ├── WXWebViewTest.java │ │ ├── border │ │ ├── BorderCornerTest.java │ │ └── BorderDrawableTest.java │ │ └── gesture │ │ └── WXGestureTest.java │ └── utils │ ├── FunctionParserTest.java │ ├── TypefaceUtilTest.java │ ├── WXExceptionUtilsTest.java │ ├── WXFileUtilsTest.java │ ├── WXJsonUtilsTest.java │ ├── WXLogUtilsTest.java │ ├── WXReflectionUtilsTest.java │ ├── WXResourceUtilsTest.java │ └── WXUtilsTest.java └── org └── mockito └── configuration └── MockitoConfiguration.java /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .idea 3 | build 4 | captures 5 | local.properties 6 | target 7 | bin 8 | .classpath 9 | .project 10 | .settings 11 | gen 12 | *.iml 13 | lint.xml 14 | project.properties -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Unit Test 2 | 3 | Unit test code is under 'src/test'. You can run unit test use command: 4 | ```bash 5 | ./gradlew clean testDebugUnitTest jacocoTestReportDebug 6 | ``` 7 | This task will run all unit test and produce both unit test report and jacoco test coverage report in 'build/reports'. 8 | -------------------------------------------------------------------------------- /assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/assets/.gitkeep -------------------------------------------------------------------------------- /assets/.gitkeeper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/assets/.gitkeeper -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | org.gradle.daemon=false 22 | org.gradle.parallel=false 23 | org.gradle.jvmargs=-Xmx2048M 24 | -------------------------------------------------------------------------------- /libs/armeabi/libweexjsb.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/armeabi/libweexjsb.so -------------------------------------------------------------------------------- /libs/armeabi/libweexjsc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/armeabi/libweexjsc.so -------------------------------------------------------------------------------- /libs/armeabi/libweexjss.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/armeabi/libweexjss.so -------------------------------------------------------------------------------- /libs/armeabi/libweexjst.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/armeabi/libweexjst.so -------------------------------------------------------------------------------- /libs/x86/libweexjsb.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/x86/libweexjsb.so -------------------------------------------------------------------------------- /libs/x86/libweexjsc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/x86/libweexjsc.so -------------------------------------------------------------------------------- /libs/x86/libweexjss.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/libs/x86/libweexjss.so -------------------------------------------------------------------------------- /proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/ouy/Library/AndroidStudio/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -keep class com.taobao.weex.bridge.** { *; } 19 | -dontwarn com.taobao.weex.bridge.** 20 | -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ./gradlew clean assemble publish -------------------------------------------------------------------------------- /src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 24 | 25 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ComponentObserver.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import android.view.View; 22 | 23 | import com.taobao.weex.ui.component.WXComponent; 24 | 25 | /** 26 | * Created by sospartan on 14/06/2017. 27 | */ 28 | 29 | public interface ComponentObserver { 30 | 31 | /** 32 | * Called after component is create. 33 | * Notice: View is not created at this moment. 34 | * @param component 35 | */ 36 | void onCreate(WXComponent component); 37 | 38 | /** 39 | * Called before component destroy. 40 | * @param component 41 | */ 42 | void onPreDestory(WXComponent component); 43 | 44 | /** 45 | * Called when component's view is created 46 | * @param component 47 | * @param view 48 | */ 49 | void onViewCreated(WXComponent component,View view); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/IWXActivityStateListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | /** 22 | * Listener class for activity lifecycle 23 | */ 24 | 25 | @Deprecated 26 | public interface IWXActivityStateListener { 27 | 28 | void onActivityCreate(); 29 | 30 | void onActivityStart(); 31 | 32 | void onActivityPause(); 33 | 34 | void onActivityResume(); 35 | 36 | void onActivityStop(); 37 | 38 | void onActivityDestroy(); 39 | 40 | boolean onActivityBack(); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/LayoutFinishListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import android.support.annotation.NonNull; 22 | 23 | public interface LayoutFinishListener { 24 | 25 | void onLayoutFinish(@NonNull WXSDKInstance instance); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/WXGlobalEventModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import com.taobao.weex.annotation.JSMethod; 22 | import com.taobao.weex.common.WXModule; 23 | 24 | import java.util.Map; 25 | 26 | /** 27 | * Created by lixinke on 16/8/25. 28 | */ 29 | public class WXGlobalEventModule extends WXModule { 30 | 31 | 32 | @JSMethod 33 | public void addEventListener(String eventName, String callback) { 34 | mWXSDKInstance.addEventListener(eventName,callback); 35 | } 36 | 37 | public void removeEventListener(String eventName, String callback) { 38 | mWXSDKInstance.removeEventListener(eventName,callback); 39 | } 40 | 41 | @JSMethod 42 | public void removeEventListener(String eventName){ 43 | mWXSDKInstance.removeEventListener(eventName); 44 | } 45 | 46 | 47 | @Override 48 | public void addEventListener(String eventName, String callback, Map options) { 49 | super.addEventListener(eventName, callback, options); 50 | addEventListener(eventName,callback); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/DrawableStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.adapter; 21 | 22 | 23 | public class DrawableStrategy { 24 | 25 | public int width; 26 | public int height; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/ICrashInfoReporter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | /** 22 | * Created by zhengshihan on 2017/5/23. 23 | */ 24 | 25 | public interface ICrashInfoReporter { 26 | void addCrashInfo(String key ,String value); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IDrawableLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.adapter; 21 | 22 | import android.graphics.drawable.Drawable; 23 | import android.support.annotation.Nullable; 24 | 25 | public interface IDrawableLoader { 26 | 27 | interface DrawableTarget { 28 | 29 | } 30 | 31 | interface StaticTarget extends DrawableTarget{ 32 | void setDrawable(@Nullable Drawable drawable, boolean resetBounds); 33 | } 34 | 35 | interface AnimatedTarget extends DrawableTarget{ 36 | void setAnimatedDrawable(@Nullable Drawable drawable); 37 | } 38 | 39 | void setDrawable(String url, DrawableTarget drawableTarget, DrawableStrategy drawableStrategy); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/ITracingAdapter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | import com.taobao.weex.tracing.WXTracing; 22 | 23 | /** 24 | * Created by moxun on 2017/7/6. 25 | */ 26 | 27 | public interface ITracingAdapter { 28 | void enable(); 29 | void disable(); 30 | void submitTracingEvent(WXTracing.TraceEvent event); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXAccessibilityRoleAdapter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | /** 22 | * Created by moxun on 2017/11/13. 23 | */ 24 | 25 | public interface IWXAccessibilityRoleAdapter { 26 | String getRole(String key); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXDebugAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | import android.app.Application; 22 | import android.view.View; 23 | 24 | import com.taobao.weex.WXSDKInstance; 25 | 26 | /** 27 | * Created by lixinke on 16/6/6. 28 | */ 29 | public interface IWXDebugAdapter { 30 | 31 | void initDebug(Application application); 32 | 33 | /** 34 | * wrap weex container 35 | */ 36 | View wrapContainer(WXSDKInstance instance, View wxView); 37 | 38 | void putDebugOptions(String key, String value); 39 | 40 | String getDebugOptions(String key); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXImgLoaderAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | import android.widget.ImageView; 22 | 23 | import com.taobao.weex.common.WXImageStrategy; 24 | import com.taobao.weex.dom.WXImageQuality; 25 | 26 | /** 27 | * Interface for ImageLoader. This interface works as an adapter for various image library. 28 | */ 29 | public interface IWXImgLoaderAdapter { 30 | 31 | void setImage(String url, ImageView view, WXImageQuality quality, WXImageStrategy strategy); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXJSExceptionAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | import com.taobao.weex.common.WXJSExceptionInfo; 22 | 23 | public interface IWXJSExceptionAdapter { 24 | 25 | /** 26 | * report js exception 27 | * 28 | * @param exception {@link WXJSExceptionInfo} 29 | */ 30 | 31 | void onJSException(WXJSExceptionInfo exception); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXSoLoaderAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | /** 22 | * Interface for loading library. 23 | */ 24 | public interface IWXSoLoaderAdapter { 25 | /** 26 | * A method doLoadLibrary that 27 | * helps embedders to load a shared library with a short name. 28 | *

29 | * 30 | * Embedders would have a chance to take charge of library loading, 31 | * they could load libraries with different class loaders, 32 | * or load libraries from specified library pathes. 33 | * 34 | * @param shortName the name of the library 35 | */ 36 | void doLoadLibrary(String shortName); 37 | 38 | /** 39 | * A method doLoad that 40 | * helps embedders to load a shared library. 41 | *

42 | * 43 | * Embedders would have a chance to take charge of library loading, 44 | * they could load libraries with different class loaders, 45 | * or load libraries from specified library pathes. 46 | * 47 | * @param name the file to load. 48 | */ 49 | void doLoad(String name); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXTypefaceAdapter.java: -------------------------------------------------------------------------------- 1 | package com.taobao.weex.adapter; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * Created by Carry on 2017/10/26. 本木iconFont适配器接口 7 | */ 8 | 9 | public interface IWXTypefaceAdapter { 10 | 11 | //获取本地iconfont目录 12 | File getTypefaceDir(); 13 | 14 | //获取拦截器状态 15 | boolean isInterceptor(); 16 | 17 | //获取本地服务地址 18 | String getJsServer(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.adapter; 20 | 21 | import android.content.Context; 22 | 23 | import com.taobao.weex.common.WXPerformance; 24 | 25 | import java.io.Serializable; 26 | import java.util.Map; 27 | 28 | /** 29 | * Interface for commit log info. This interface works as an adapter for various log library. 30 | */ 31 | public interface IWXUserTrackAdapter { 32 | 33 | String MODULE_NAME = "weex"; 34 | 35 | //Performance 36 | String LOAD = "load"; 37 | 38 | //Alarm 39 | String JS_FRAMEWORK = "jsFramework"; 40 | String JS_DOWNLOAD = "jsDownload"; 41 | String DOM_MODULE = "domModule"; 42 | String JS_BRIDGE = "jsBridge"; 43 | String STREAM_MODULE = "streamModule"; 44 | String INVOKE_MODULE = "invokeModule"; 45 | 46 | void commit(Context context, String eventId, String type, WXPerformance perf, Map params); 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/annotation/Component.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.annotation; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Created by sospartan on 6/12/16. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target(ElementType.TYPE) 31 | public @interface Component { 32 | boolean lazyload() default true; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/annotation/JSMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.annotation; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Inherited; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Created by sospartan on 19/10/2016. 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Inherited 32 | @Target(ElementType.METHOD) 33 | public @interface JSMethod { 34 | boolean uiThread() default true; 35 | 36 | String alias() default NOT_SET; 37 | 38 | String NOT_SET = "_"; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/clipboard/IWXClipboard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.clipboard; 20 | 21 | import android.support.annotation.Nullable; 22 | 23 | import com.taobao.weex.bridge.JSCallback; 24 | 25 | /** 26 | * Created by yiyuan.zhangyy(xingjiu)
27 | */ 28 | interface IWXClipboard { 29 | public void setString(String text); 30 | public void getString(@Nullable JSCallback callback); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/navigator/IActivityNavBarSetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.navigator; 20 | 21 | /** 22 | * Define the NavBarSetter api of the Activity 23 | */ 24 | public interface IActivityNavBarSetter { 25 | 26 | boolean push(String param); 27 | 28 | boolean pop(String param); 29 | 30 | boolean setNavBarRightItem(String param); 31 | 32 | boolean clearNavBarRightItem(String param); 33 | 34 | boolean setNavBarLeftItem(String param); 35 | 36 | boolean clearNavBarLeftItem(String param); 37 | 38 | boolean setNavBarMoreItem(String param); 39 | 40 | boolean clearNavBarMoreItem(String param); 41 | 42 | boolean setNavBarTitle(String param); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/storage/IWXStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.storage; 20 | 21 | import android.support.annotation.Nullable; 22 | 23 | import com.taobao.weex.bridge.JSCallback; 24 | 25 | interface IWXStorage { 26 | public void setItem(String key, String value,@Nullable JSCallback callback); 27 | public void getItem(String key,@Nullable JSCallback callback); 28 | public void removeItem(String key,@Nullable JSCallback callback); 29 | public void length(@Nullable JSCallback callback); 30 | public void getAllKeys(@Nullable JSCallback callback); 31 | public void setItemPersistent(String key, String value, @Nullable JSCallback callback); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/websocket/IWebSocketAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.websocket; 20 | 21 | import android.support.annotation.Nullable; 22 | 23 | /** 24 | * Created by moxun on 16/12/27. 25 | */ 26 | 27 | public interface IWebSocketAdapter { 28 | 29 | String HEADER_SEC_WEBSOCKET_PROTOCOL = "Sec-WebSocket-Protocol"; 30 | 31 | void connect(String url, @Nullable String protocol, EventListener listener); 32 | 33 | void send(String data); 34 | 35 | void close(int code, String reason); 36 | 37 | void destroy(); 38 | 39 | interface EventListener { 40 | void onOpen(); 41 | 42 | void onMessage(String data); 43 | 44 | void onClose(int code, String reason, boolean wasClean); 45 | 46 | void onError(String msg); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/websocket/IWebSocketAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.websocket; 20 | 21 | /** 22 | * Created by moxun on 16/12/28. 23 | */ 24 | 25 | public interface IWebSocketAdapterFactory { 26 | IWebSocketAdapter createWebSocketAdapter(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/appfram/websocket/WebSocketCloseCodes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.appfram.websocket; 20 | 21 | /** 22 | * Created by moxun on 17/1/3. 23 | * @see CloseEvent 24 | */ 25 | 26 | public enum WebSocketCloseCodes { 27 | CLOSE_NORMAL(1000), 28 | CLOSE_GOING_AWAY(1001), 29 | CLOSE_PROTOCOL_ERROR(1002), 30 | CLOSE_UNSUPPORTED(1003), 31 | CLOSE_NO_STATUS(1005), 32 | CLOSE_ABNORMAL(1006), 33 | UNSUPPORTED_DATA(1007), 34 | POLICY_VIOLATION(1008), 35 | CLOSE_TOO_LARGE(1009), 36 | MISSING_EXTENSION(1010), 37 | INTERNAL_ERROR(1011), 38 | SERVICE_RESTART(1012), 39 | TRY_AGAIN_LATER(1013), 40 | TLS_HANDSHAKE(1015); 41 | 42 | private int code; 43 | 44 | WebSocketCloseCodes(int code) { 45 | this.code = code; 46 | } 47 | 48 | public int getCode() { 49 | return code; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/EventResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | /** 22 | * Created by furture on 2017/10/17. 23 | */ 24 | 25 | public class EventResult { 26 | 27 | private Object result; 28 | private boolean success = false; 29 | /** 30 | * onCallback javascript event callback method 31 | * @param result 32 | */ 33 | public void onCallback(Object result){ 34 | this.success = true; 35 | this.result = result; 36 | } 37 | 38 | public boolean isSuccess() { 39 | return success; 40 | } 41 | 42 | public Object getResult(){ 43 | return result; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/Invoker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | import java.lang.reflect.InvocationTargetException; 22 | import java.lang.reflect.Type; 23 | 24 | /** 25 | * Created by sospartan on 6/16/16. 26 | */ 27 | public interface Invoker { 28 | Object invoke(Object receiver,Object...params) throws InvocationTargetException, IllegalAccessException; 29 | 30 | Type[] getParameterTypes(); 31 | 32 | boolean isRunOnUIThread(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/JSCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | import java.io.Serializable; 22 | import java.util.Map; 23 | 24 | /** 25 | * Created by sospartan on 5/24/16. 26 | */ 27 | public interface JSCallback extends Serializable{ 28 | /** 29 | * invoke javascript callback method, this method will destoryed after invoke. 30 | * @param data 31 | */ 32 | void invoke(Object data); 33 | 34 | /** 35 | * invoke javascript callback method and keep callback alive for later use. 36 | * @param data 37 | */ 38 | void invokeAndKeepAlive(Object data); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/JavascriptInvokable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | /** 22 | * Created by sospartan on 11/11/2016. 23 | */ 24 | 25 | public interface JavascriptInvokable { 26 | String[] getMethods(); 27 | Invoker getMethodInvoker(String name); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/ModuleFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | import com.taobao.weex.common.WXModule; 22 | 23 | import java.util.ArrayList; 24 | import java.util.Map; 25 | 26 | /** 27 | * Created by sospartan on 6/17/16. 28 | */ 29 | public interface ModuleFactory extends JavascriptInvokable { 30 | 31 | T buildInstance() throws IllegalAccessException, InstantiationException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/SimpleJSCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | /** 22 | * Created by sospartan on 27/10/2016. 23 | */ 24 | public class SimpleJSCallback implements JSCallback { 25 | String mInstanceId; 26 | String mCallbackId; 27 | 28 | public SimpleJSCallback(String instanceId, String callbackId) { 29 | this.mCallbackId = callbackId; 30 | this.mInstanceId = instanceId; 31 | } 32 | 33 | 34 | @Override 35 | public void invoke(Object data) { 36 | WXBridgeManager.getInstance().callbackJavascript(mInstanceId, mCallbackId, data, false); 37 | } 38 | 39 | @Override 40 | public void invokeAndKeepAlive(Object data) { 41 | WXBridgeManager.getInstance().callbackJavascript(mInstanceId, mCallbackId, data, true); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/bridge/WXTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.bridge; 20 | 21 | import com.taobao.weex.common.IWXObject; 22 | 23 | import java.util.ArrayList; 24 | 25 | /** 26 | * Weex JS Native task 27 | */ 28 | public class WXTask implements IWXObject { 29 | 30 | /** 31 | * Native module 32 | */ 33 | public String module; 34 | 35 | /** 36 | * The method of native module 37 | */ 38 | public String method; 39 | 40 | /** 41 | * The method parameters 42 | */ 43 | public ArrayList args; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/Destroyable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | /** 22 | * Created by sospartan on 5/20/16. 23 | */ 24 | public interface Destroyable { 25 | public void destroy(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/ICheckBindingScroller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | /** 22 | * Created by zhengshihan on 2017/6/5. 23 | */ 24 | 25 | public interface ICheckBindingScroller { 26 | boolean isNeedScroller(String ref,Object option); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/IWXDebugProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | /** 22 | * Created by budao on 16/6/25. 23 | */ 24 | public interface IWXDebugProxy { 25 | String ACTION_DEBUG_INSTANCE_REFRESH = "DEBUG_INSTANCE_REFRESH"; 26 | 27 | String ACTION_INSTANCE_RELOAD = "INSTANCE_RELOAD"; 28 | 29 | void start(); 30 | 31 | void stop(boolean reload); 32 | 33 | IWXBridge getWXBridge(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/IWXObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public interface IWXObject { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/IWXTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public interface IWXTask { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public interface WXConfig { 22 | 23 | String os = "os"; 24 | String osName = "osName"; 25 | String appVersion="appVersion"; 26 | String cacheDir = "cacheDir"; 27 | String devId="devId"; 28 | String sysVersion="sysVersion"; 29 | String sysModel="sysModel"; 30 | String weexVersion="weexVersion"; 31 | String appName="appName"; 32 | String appGroup="appGroup"; 33 | String externalUserAgent="externalUserAgent"; 34 | String logLevel="logLevel"; 35 | String scale = "scale"; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public class WXException extends Exception { 22 | 23 | private static final long serialVersionUID = 7265837506862157379L; 24 | 25 | public WXException(String msg) { 26 | super(msg); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXImageSharpen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public enum WXImageSharpen { 22 | UNSHARPEN, 23 | SHARPEN 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXInstanceWrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import com.taobao.weex.annotation.JSMethod; 22 | 23 | /** 24 | * Report template error. 25 | */ 26 | public class WXInstanceWrap extends WXModule { 27 | 28 | @JSMethod 29 | public void error(String type, String code, String info) { 30 | if (mWXSDKInstance != null) { 31 | mWXSDKInstance.onRenderError(type + "|" + code, info); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXJSBridgeMsgType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public class WXJSBridgeMsgType { 22 | 23 | public static final int SET_TIMEOUT = 0x01; 24 | public static final int NATIVE_CALL = 0x02; 25 | public static final int FIRE_EVENT = 0x03; 26 | public static final int CALLBACK = 0x04; 27 | public static final int CALL_JS = 0x05; 28 | public static final int CALL_JS_BATCH = 0x06; 29 | public static final int INIT_FRAMEWORK = 0x07; 30 | public static final int REGISTER_COMPONENTS = 0x08; 31 | public static final int REGISTER_MODULES = 0x09; 32 | public static final int REFRESH_INSTANCE = 0x0a; 33 | public static final int MODULE_TIMEOUT = 0x0b; 34 | public static final int MODULE_INTERVAL = 0x0c; 35 | public static final int TAKE_HEAP_SNAPSHOT = 0x0d; 36 | 37 | public static final int RELOAD_PAGE_NATIVE = 0x0e; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXJSEngineListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public interface WXJSEngineListener { 22 | 23 | void createInstanceSuccess(String instanceId); 24 | 25 | void destroyInstanceSuccess(String instanceId); 26 | 27 | void createInstanceFailed(String instanceId); 28 | 29 | void destroyInstanceFailed(String instanceId); 30 | 31 | void fireEvent(boolean success, String instanceId, String ref, String type); 32 | 33 | void callback(boolean success, String instanceId, String funcId, String data); 34 | 35 | void initFramework(boolean success, String version, double jslibSize); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXJSService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | 24 | public class WXJSService implements IWXObject { 25 | private String name; 26 | private String script; 27 | private Map options = new HashMap<>(); 28 | 29 | public String getName() { return name; } 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | public String getScript() { return script; } 35 | public void setScript(String script) { 36 | this.script = script; 37 | } 38 | 39 | public Map getOptions() { return options; } 40 | public void setOptions(Map options) { 41 | this.options = options; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXModuleAnno.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import com.taobao.weex.annotation.JSMethod; 22 | 23 | import java.lang.annotation.Inherited; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | 27 | /** Use {@link JSMethod} instead. **/ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Inherited 30 | @Deprecated 31 | public @interface WXModuleAnno { 32 | 33 | @Deprecated 34 | boolean moduleMethod() default true; 35 | 36 | boolean runOnUIThread() default true; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXRefreshData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public class WXRefreshData { 22 | 23 | public String data; 24 | 25 | public boolean isDirty; 26 | 27 | public WXRefreshData(String data, boolean isDirty) { 28 | this.data = data; 29 | this.isDirty = isDirty; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXRenderStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public enum WXRenderStrategy { 22 | APPEND_ASYNC("APPEND_ASYNC"), 23 | APPEND_ONCE("APPEND_ONCE"); 24 | 25 | private String flag; 26 | 27 | WXRenderStrategy(String flag) { 28 | this.flag = flag; 29 | } 30 | 31 | public String getFlag() { 32 | return flag; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import java.util.Map; 22 | 23 | public class WXRequest { 24 | 25 | /** 26 | * The request parameter 27 | */ 28 | public Map paramMap; 29 | 30 | /** 31 | * The request URL 32 | */ 33 | public String url; 34 | /** 35 | * The request method 36 | */ 37 | public String method; 38 | /** 39 | * The request body 40 | */ 41 | public String body; 42 | 43 | /** 44 | * The request time out 45 | */ 46 | public int timeoutMs = WXRequest.DEFAULT_TIMEOUT_MS; 47 | 48 | /** 49 | * The default timeout 50 | */ 51 | public static final int DEFAULT_TIMEOUT_MS = 3000; 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXRequestListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | 22 | public interface WXRequestListener { 23 | 24 | void onSuccess(int requestType, Object context, WXResponse response); 25 | 26 | void onError(int requestType, Object context, WXResponse response); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import java.util.Map; 22 | 23 | public class WXResponse { 24 | 25 | /** 26 | * Status code 27 | */ 28 | public String statusCode; 29 | 30 | /** 31 | * Byte stream fetched from the connection 32 | */ 33 | public String data; 34 | 35 | public byte[] originalData; 36 | 37 | /** 38 | * Server internal error 39 | */ 40 | public String errorCode; 41 | 42 | /** 43 | * Server error message 44 | */ 45 | public String errorMsg; 46 | 47 | /** 48 | * Message for toast 49 | */ 50 | public String toastMsg; 51 | 52 | /** 53 | * Parameter for further extension. 54 | */ 55 | public Map extendParams; 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | public class WXRuntimeException extends RuntimeException { 22 | 23 | private static final long serialVersionUID = 5732315311747521491L; 24 | 25 | public WXRuntimeException(String e) { 26 | super(e); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/common/WXWorkThreadManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import java.util.concurrent.ExecutorService; 22 | import java.util.concurrent.Executors; 23 | 24 | /** 25 | * Class for managing work thread 26 | */ 27 | public final class WXWorkThreadManager { 28 | 29 | private ExecutorService singleThreadExecutor; 30 | 31 | public WXWorkThreadManager() { 32 | singleThreadExecutor = Executors.newSingleThreadExecutor(); 33 | } 34 | 35 | public void post(Runnable task) { 36 | if (singleThreadExecutor != null) 37 | singleThreadExecutor.execute(task); 38 | } 39 | 40 | /** 41 | * Destroy current instance 42 | */ 43 | public void destroy() { 44 | if (singleThreadExecutor != null) 45 | singleThreadExecutor.shutdown(); 46 | singleThreadExecutor = null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/ApplyStyleConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * Created by sospartan on 22/02/2017. 25 | */ 26 | class ApplyStyleConsumer implements WXDomObject.Consumer { 27 | static ApplyStyleConsumer sInstance; 28 | 29 | public static ApplyStyleConsumer getInstance() { 30 | if (sInstance == null) { 31 | sInstance = new ApplyStyleConsumer(); 32 | } 33 | return sInstance; 34 | } 35 | 36 | private ApplyStyleConsumer() { 37 | } 38 | 39 | ; 40 | 41 | @Override 42 | public void accept(WXDomObject dom) { 43 | WXStyle style = dom.getStyles(); 44 | 45 | /** merge default styles **/ 46 | Map defaults = dom.getDefaultStyle(); 47 | if (defaults != null) { 48 | for (Map.Entry entry : defaults.entrySet()) { 49 | if (!style.containsKey(entry.getKey())) { 50 | style.put(entry.getKey(), entry.getValue()); 51 | } 52 | } 53 | } 54 | 55 | if (dom.getStyles().size() > 0) { 56 | dom.applyStyleToNode(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/CSSFlexDirectionConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.text.TextUtils; 22 | 23 | import com.taobao.weex.dom.flex.CSSFlexDirection; 24 | 25 | class CSSFlexDirectionConvert { 26 | 27 | public static CSSFlexDirection convert(String s) { 28 | CSSFlexDirection cssFlexDirection = CSSFlexDirection.ROW; 29 | if (TextUtils.isEmpty(s)) { 30 | cssFlexDirection = CSSFlexDirection.ROW; 31 | } else if (s.equals("column")) { 32 | cssFlexDirection = CSSFlexDirection.COLUMN; 33 | } else if (s.equals("column-reverse")) { 34 | cssFlexDirection = CSSFlexDirection.COLUMN_REVERSE; 35 | } else if (s.equals("row")) { 36 | cssFlexDirection = CSSFlexDirection.ROW; 37 | } else if (s.equals("row-reverse")) { 38 | cssFlexDirection = CSSFlexDirection.ROW_REVERSE; 39 | } 40 | return cssFlexDirection; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/CSSJustifyConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.text.TextUtils; 22 | 23 | import com.taobao.weex.dom.flex.CSSJustify; 24 | 25 | class CSSJustifyConvert { 26 | 27 | public static CSSJustify convert(String s) { 28 | CSSJustify cssJustify = CSSJustify.FLEX_START; 29 | if (TextUtils.isEmpty(s) || s.equals("flex-start")) { 30 | cssJustify = CSSJustify.FLEX_START; 31 | } else if (s.equals("flex-end")) { 32 | cssJustify = CSSJustify.FLEX_END; 33 | } else if (s.equals("center")) { 34 | cssJustify = CSSJustify.CENTER; 35 | } else if (s.equals("space-between")) { 36 | cssJustify = CSSJustify.SPACE_BETWEEN; 37 | } else if (s.equals("space-around")) { 38 | cssJustify = CSSJustify.SPACE_AROUND; 39 | } 40 | return cssJustify; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/CSSPositionTypeConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.text.TextUtils; 22 | 23 | import com.taobao.weex.dom.flex.CSSPositionType; 24 | 25 | class CSSPositionTypeConvert { 26 | 27 | public static CSSPositionType convert(String s) { 28 | CSSPositionType position = CSSPositionType.RELATIVE; 29 | if (TextUtils.isEmpty(s) || s.equals("relative") || s.equals("sticky")) { 30 | position = CSSPositionType.RELATIVE; 31 | } else if (s.equals("absolute") || s.equals("fixed")) { 32 | position = CSSPositionType.ABSOLUTE; 33 | } 34 | return position; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/CSSWrapConvert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.text.TextUtils; 22 | 23 | import com.taobao.weex.dom.flex.CSSWrap; 24 | 25 | class CSSWrapConvert { 26 | 27 | public static CSSWrap convert(String s) { 28 | CSSWrap cssWrap = CSSWrap.NOWRAP; 29 | if (TextUtils.isEmpty(s)) { 30 | return cssWrap; 31 | } else if (s.equals("wrap")) { 32 | return CSSWrap.WRAP; 33 | } 34 | return cssWrap; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/DOMAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | 22 | import com.taobao.weex.dom.action.Action; 23 | 24 | /** 25 | * Created by sospartan on 23/02/2017. 26 | */ 27 | 28 | public interface DOMAction extends Action{ 29 | void executeDom(DOMActionContext context); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/DomContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.content.Context; 22 | 23 | /** 24 | * Created by sospartan on 31/10/2016. 25 | */ 26 | 27 | public interface DomContext { 28 | Context getUIContext(); 29 | String getInstanceId(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/RenderAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import com.taobao.weex.dom.action.Action; 22 | 23 | /** 24 | * Created by sospartan on 23/02/2017. 25 | */ 26 | 27 | public interface RenderAction extends Action{ 28 | void executeRender(RenderActionContext context); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/RenderActionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.ui.component.WXComponent; 23 | 24 | /** 25 | * Created by sospartan on 23/02/2017. 26 | */ 27 | 28 | public interface RenderActionContext { 29 | WXSDKInstance getInstance(); 30 | WXComponent getComponent(String ref); 31 | WXComponent unregisterComponent(String ref); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/SafePutConcurrentHashMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import java.util.Iterator; 22 | import java.util.Map; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * Created by sospartan on 8/23/16. 27 | */ 28 | public class SafePutConcurrentHashMap extends ConcurrentHashMap { 29 | 30 | 31 | @Override 32 | public void putAll(Map m) { 33 | Iterator> iterator = m.entrySet().iterator(); 34 | while (iterator.hasNext()) { 35 | Entry item = iterator.next(); 36 | if (item.getKey() == null || item.getValue() == null) { 37 | iterator.remove(); 38 | } 39 | } 40 | 41 | super.putAll(m); 42 | } 43 | 44 | @Override 45 | public V put(K key, V value) { 46 | if (key == null || value == null) { 47 | return null; 48 | } 49 | return super.put(key, value); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/WXDomTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import com.taobao.weex.common.IWXTask; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * Wrapper class for storing info about dom operation. Used when {@link WXDomModule} communicate 27 | * with handler. 28 | */ 29 | public class WXDomTask implements IWXTask { 30 | 31 | public String instanceId; 32 | public List args; 33 | public long startTime = System.nanoTime(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/WXImageQuality.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | public enum WXImageQuality { 22 | 23 | ORIGINAL, 24 | 25 | LOW, 26 | 27 | NORMAL, 28 | 29 | HIGH, 30 | 31 | AUTO 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/WXLineHeightSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.graphics.Paint; 22 | import android.text.style.LineHeightSpan; 23 | 24 | import com.taobao.weex.WXEnvironment; 25 | import com.taobao.weex.utils.WXLogUtils; 26 | 27 | public class WXLineHeightSpan implements LineHeightSpan{ 28 | 29 | private int lineHeight; 30 | public WXLineHeightSpan(int lineHeight){ 31 | this.lineHeight=lineHeight; 32 | } 33 | 34 | @Override 35 | public void chooseHeight(CharSequence text, int start, int end, int spanstartv, int v, Paint.FontMetricsInt fm) { 36 | if(WXEnvironment.isApkDebugable()) { 37 | WXLogUtils.d("LineHeight", text + " ; start " + start + "; end " + end + "; spanstartv " 38 | + spanstartv + "; v " + v + "; fm " + fm); 39 | } 40 | int halfLeading=(lineHeight-(fm.descent-fm.ascent))/2; 41 | fm.top-=halfLeading; 42 | fm.bottom+=halfLeading; 43 | fm.ascent-=halfLeading; 44 | fm.descent+=halfLeading; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/WXListDomObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.support.v4.util.ArrayMap; 22 | 23 | import com.taobao.weex.common.Constants; 24 | import com.taobao.weex.ui.component.WXBasicComponentType; 25 | 26 | import java.util.Map; 27 | 28 | public class WXListDomObject extends WXDomObject { 29 | 30 | @Override 31 | protected Map getDefaultStyle() { 32 | Map map = new ArrayMap<>(); 33 | 34 | boolean isVertical = true; 35 | if (parent != null) { 36 | if (parent.getType() != null) { 37 | if (parent.getType().equals(WXBasicComponentType.HLIST)) { 38 | isVertical = false; 39 | } 40 | } 41 | } 42 | 43 | String prop = isVertical ? Constants.Name.HEIGHT : Constants.Name.WIDTH; 44 | if (getStyles().get(prop) == null && 45 | getStyles().get(Constants.Name.FLEX) == null) { 46 | map.put(Constants.Name.FLEX, "1"); 47 | } 48 | 49 | return map; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/WXScrollerDomObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom; 20 | 21 | import android.support.v4.util.ArrayMap; 22 | 23 | import com.taobao.weex.common.Constants; 24 | 25 | import java.util.Map; 26 | 27 | public class WXScrollerDomObject extends WXDomObject { 28 | 29 | @Override 30 | protected Map getDefaultStyle() { 31 | Map map = new ArrayMap<>(); 32 | 33 | boolean isVertical = true; 34 | if (parent != null) { 35 | String direction = (String) parent.getAttrs().get(Constants.Name.SCROLL_DIRECTION); 36 | if (direction != null && direction.equals("horizontal")) { 37 | isVertical = false; 38 | } 39 | } 40 | 41 | String prop = isVertical?Constants.Name.HEIGHT:Constants.Name.WIDTH; 42 | if (getStyles().get(prop) == null && 43 | getStyles().get(Constants.Name.FLEX) == null) { 44 | map.put(Constants.Name.FLEX, "1"); 45 | } 46 | 47 | return map; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/AbstractLayoutFinishAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.adapter.IWXUserTrackAdapter; 23 | import com.taobao.weex.common.WXErrorCode; 24 | import com.taobao.weex.dom.DOMAction; 25 | import com.taobao.weex.dom.DOMActionContext; 26 | import com.taobao.weex.dom.RenderAction; 27 | import com.taobao.weex.dom.WXDomObject; 28 | 29 | /** 30 | * Created by sospartan on 02/03/2017. 31 | */ 32 | abstract class AbstractLayoutFinishAction extends TraceableAction implements DOMAction, RenderAction { 33 | 34 | protected int mLayoutWidth; 35 | protected int mLayoutHeight; 36 | 37 | @Override 38 | public void executeDom(DOMActionContext context) { 39 | if (context.isDestory()) { 40 | return; 41 | } 42 | 43 | WXDomObject root = context.getDomByRef(WXDomObject.ROOT); 44 | if(root == null){ 45 | return; 46 | } 47 | mLayoutHeight = (int)root.getLayoutHeight(); 48 | mLayoutWidth = (int)root.getLayoutWidth(); 49 | context.postRenderTask(this); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/Action.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | /** 22 | * Created by sospartan on 16/03/2017. 23 | */ 24 | 25 | public interface Action { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/ExecutableRenderAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | import com.taobao.weex.dom.DOMAction; 22 | import com.taobao.weex.dom.DOMActionContext; 23 | import com.taobao.weex.dom.RenderAction; 24 | import com.taobao.weex.dom.RenderActionContext; 25 | 26 | class ExecutableRenderAction implements DOMAction, RenderAction { 27 | 28 | private Runnable mRunnable; 29 | 30 | ExecutableRenderAction(Runnable runnable) { 31 | this.mRunnable = runnable; 32 | } 33 | 34 | @Override 35 | public void executeDom(DOMActionContext context) { 36 | if (context.isDestory()) { 37 | return; 38 | } 39 | context.postRenderTask(this); 40 | } 41 | 42 | @Override 43 | public void executeRender(RenderActionContext context) { 44 | if (mRunnable != null) { 45 | mRunnable.run(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/InvokeMethodAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | import com.alibaba.fastjson.JSONArray; 22 | import com.taobao.weex.dom.DOMAction; 23 | import com.taobao.weex.dom.DOMActionContext; 24 | import com.taobao.weex.ui.component.WXComponent; 25 | import com.taobao.weex.utils.WXLogUtils; 26 | 27 | /** 28 | * Created by sospartan on 02/03/2017. 29 | */ 30 | final class InvokeMethodAction implements DOMAction { 31 | private final String mRef; 32 | private final String mMethod; 33 | private final JSONArray mArgs; 34 | 35 | InvokeMethodAction(String ref, String method, JSONArray args) { 36 | this.mRef = ref; 37 | this.mMethod = method; 38 | this.mArgs = args; 39 | } 40 | 41 | @Override 42 | public void executeDom(DOMActionContext context) { 43 | WXComponent comp = context.getCompByRef(mRef); 44 | if(comp == null){ 45 | WXLogUtils.e("DOMAction","target component not found."); 46 | return; 47 | } 48 | comp.invoke(mMethod,mArgs); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/RefreshFinishAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.dom.RenderActionContext; 23 | import com.taobao.weex.tracing.WXTracing; 24 | 25 | /** 26 | * Created by sospartan on 02/03/2017. 27 | */ 28 | 29 | class RefreshFinishAction extends AbstractLayoutFinishAction { 30 | 31 | @Override 32 | public void executeRender(RenderActionContext context) { 33 | WXSDKInstance instance = context.getInstance(); 34 | instance.onRefreshSuccess(mLayoutWidth, mLayoutHeight); 35 | if (WXTracing.isAvailable()) { 36 | submitPerformance("refreshFinish", "I", context.getInstance().getInstanceId(), 0, 0); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/action/UpdateFinishAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.dom.action; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.adapter.IWXUserTrackAdapter; 23 | import com.taobao.weex.common.WXErrorCode; 24 | import com.taobao.weex.dom.DOMAction; 25 | import com.taobao.weex.dom.DOMActionContext; 26 | import com.taobao.weex.dom.RenderAction; 27 | import com.taobao.weex.dom.RenderActionContext; 28 | 29 | /** 30 | * Created by sospartan on 02/03/2017. 31 | */ 32 | 33 | final class UpdateFinishAction implements DOMAction, RenderAction { 34 | @Override 35 | public void executeDom(DOMActionContext context) { 36 | if (context.isDestory()) { 37 | return; 38 | } 39 | context.postRenderTask(this); 40 | } 41 | 42 | @Override 43 | public void executeRender(RenderActionContext context) { 44 | context.getInstance().onUpdateFinish(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSAlign.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSAlign { 9 | AUTO, 10 | FLEX_START, 11 | CENTER, 12 | FLEX_END, 13 | STRETCH, 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public class CSSConstants { 9 | 10 | public static final float UNDEFINED = Float.NaN; 11 | 12 | public static boolean isUndefined(float value) { 13 | return Float.compare(value, UNDEFINED) == 0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSDirection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSDirection { 9 | INHERIT, 10 | LTR, 11 | RTL, 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSFlexDirection.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSFlexDirection { 9 | COLUMN, 10 | COLUMN_REVERSE, 11 | ROW, 12 | ROW_REVERSE 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSJustify.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSJustify { 9 | FLEX_START, 10 | CENTER, 11 | FLEX_END, 12 | SPACE_BETWEEN, 13 | SPACE_AROUND, 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSLayoutContext.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | /** 9 | * A context for holding values local to a given instance of layout computation. 10 | * 11 | * This is necessary for making layout thread-safe. A separate instance should 12 | * be used when {@link CSSNode#calculateLayout} is called concurrently on 13 | * different node hierarchies. 14 | */ 15 | public class CSSLayoutContext { 16 | 17 | /*package*/ final MeasureOutput measureOutput = new MeasureOutput(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSPositionType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSPositionType { 9 | RELATIVE, 10 | ABSOLUTE, 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CSSWrap.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public enum CSSWrap { 9 | NOWRAP, 10 | WRAP, 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/CachedCSSLayout.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | /** 9 | * CSSLayout with additional information about the conditions under which it was generated. 10 | * {@link #requestedWidth} and {@link #requestedHeight} are the width and height the parent set on 11 | * this node before calling layout visited us. 12 | */ 13 | public class CachedCSSLayout extends CSSLayout { 14 | 15 | public float requestedWidth = CSSConstants.UNDEFINED; 16 | public float requestedHeight = CSSConstants.UNDEFINED; 17 | public float parentMaxWidth = CSSConstants.UNDEFINED; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/FloatUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | public class FloatUtil { 9 | 10 | private static final float EPSILON = .00001f; 11 | 12 | public static boolean floatsEqual(float f1, float f2) { 13 | if (Float.isNaN(f1) || Float.isNaN(f2)) { 14 | return Float.isNaN(f1) && Float.isNaN(f2); 15 | } 16 | return Math.abs(f2 - f1) < EPSILON; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/dom/flex/MeasureOutput.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014, Facebook, Inc. All rights reserved.

This source code is licensed under 3 | * the BSD-style license found in the LICENSE file in the root directory of this source tree. An 4 | * additional grant of patent rights can be found in the PATENTS file in the same directory. 5 | */ 6 | package com.taobao.weex.dom.flex; 7 | 8 | /** 9 | * POJO to hold the output of the measure function. 10 | */ 11 | public class MeasureOutput { 12 | 13 | public float width; 14 | public float height; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/el/parse/Symbol.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.el.parse; 20 | 21 | /** 22 | * Created by furture on 2017/8/29. 23 | */ 24 | 25 | public class Symbol { 26 | public final String op; 27 | public final int pos; 28 | public Symbol(String op, int pos) { 29 | this.op = op; 30 | this.pos = pos; 31 | } 32 | 33 | /** 34 | @Override 35 | public String toString() { 36 | return op; 37 | }*/ 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/ComponentCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.dom.WXDomObject; 23 | import com.taobao.weex.ui.component.WXComponent; 24 | import com.taobao.weex.ui.component.WXVContainer; 25 | 26 | import java.lang.reflect.InvocationTargetException; 27 | 28 | /** 29 | * Created by sospartan on 7/27/16. 30 | */ 31 | public interface ComponentCreator { 32 | WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent) throws IllegalAccessException, InvocationTargetException, InstantiationException; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/IExternalComponentGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.ui.component.WXComponent; 23 | 24 | /** 25 | * Created by zhengshihan on 16/8/25. 26 | */ 27 | public interface IExternalComponentGetter { 28 | Class getExternalComponentClass(String type, WXSDKInstance instance); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/IExternalModuleGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import android.content.Context; 22 | 23 | import com.taobao.weex.common.WXModule; 24 | 25 | /** 26 | * Created by zhengshihan on 16/8/25. 27 | */ 28 | public interface IExternalModuleGetter { 29 | Class getExternalModuleClass(String type, Context context); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/IExternalMoudleGetter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.common.WXModule; 23 | 24 | /** 25 | * Created by zhengshihan on 16/8/25. 26 | */ 27 | public interface IExternalMoudleGetter { 28 | Class getExternalMoudleClass(String type, WXSDKInstance instance); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/IFComponentHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import com.taobao.weex.bridge.Invoker; 22 | import com.taobao.weex.bridge.JavascriptInvokable; 23 | 24 | /** 25 | * Created by sospartan on 6/23/16. 26 | */ 27 | public interface IFComponentHolder extends ComponentCreator,JavascriptInvokable { 28 | 29 | /** Prepare component if not a lazy load componnet.**/ 30 | void loadIfNonLazy(); 31 | 32 | Invoker getPropertyInvoker(String name); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/IWXRenderTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import com.taobao.weex.common.IWXTask; 22 | 23 | public interface IWXRenderTask extends IWXTask { 24 | 25 | void execute(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/WXRenderHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui; 20 | 21 | import android.os.Handler; 22 | import android.os.Looper; 23 | import android.os.Message; 24 | 25 | class WXRenderHandler extends Handler { 26 | 27 | public WXRenderHandler() { 28 | super(Looper.getMainLooper()); 29 | } 30 | 31 | @Override 32 | public void handleMessage(Message msg) { 33 | super.handleMessage(msg); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/animation/CameraDistanceProperty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.animation; 20 | 21 | import android.os.Build.VERSION; 22 | import android.os.Build.VERSION_CODES; 23 | import android.util.Property; 24 | import android.view.View; 25 | 26 | 27 | class CameraDistanceProperty extends Property { 28 | 29 | private final static String TAG = "CameraDistance"; 30 | private static CameraDistanceProperty instance; 31 | 32 | static Property getInstance(){ 33 | return instance; 34 | } 35 | 36 | private CameraDistanceProperty() { 37 | super(Float.class, TAG); 38 | } 39 | 40 | @Override 41 | public Float get(View view) { 42 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { 43 | return view.getCameraDistance(); 44 | } 45 | else{ 46 | return Float.NaN; 47 | } 48 | } 49 | 50 | @Override 51 | public void set(View object, Float value) { 52 | object.setCameraDistance(value); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/animation/HeightProperty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.animation; 20 | 21 | 22 | import android.view.ViewGroup.LayoutParams; 23 | 24 | public class HeightProperty extends LayoutParamsProperty { 25 | 26 | @Override 27 | protected Integer getProperty(LayoutParams layoutParams) { 28 | return layoutParams.height; 29 | } 30 | 31 | @Override 32 | protected void setProperty(LayoutParams layoutParams, Integer expected) { 33 | layoutParams.height = expected; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/animation/WidthProperty.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.animation; 20 | 21 | 22 | import android.view.ViewGroup.LayoutParams; 23 | 24 | public class WidthProperty extends LayoutParamsProperty { 25 | 26 | @Override 27 | protected Integer getProperty(LayoutParams layoutParams) { 28 | return layoutParams.width; 29 | } 30 | 31 | @Override 32 | protected void setProperty(LayoutParams layoutParams, Integer expected) { 33 | layoutParams.width = expected; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/NestedContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import android.view.ViewGroup; 22 | import com.taobao.weex.WXSDKInstance; 23 | 24 | /** 25 | * Created by sospartan on 8/24/16. 26 | */ 27 | public interface NestedContainer { 28 | void setOnNestEventListener(OnNestedInstanceEventListener listener); 29 | 30 | ViewGroup getViewContainer(); 31 | 32 | void renderNewURL(String url); 33 | 34 | void reload(); 35 | 36 | interface OnNestedInstanceEventListener { 37 | void onException(NestedContainer comp, String errCode, String msg); 38 | 39 | /** 40 | * 41 | * @param comp 42 | * @param src 43 | * @return true if keep load 44 | */ 45 | boolean onPreCreate(NestedContainer comp, String src); 46 | 47 | String transformUrl(String origin); 48 | 49 | void onCreated(NestedContainer comp, WXSDKInstance nestedInstance); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/Scrollable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import android.view.ViewGroup; 22 | 23 | import java.util.Map; 24 | 25 | /** 26 | * Created by sospartan on 7/5/16. 27 | */ 28 | public interface Scrollable { 29 | 30 | void bindStickStyle(WXComponent component); 31 | 32 | void unbindStickStyle(WXComponent component); 33 | 34 | void bindAppearEvent(WXComponent component); 35 | 36 | void bindDisappearEvent(WXComponent component); 37 | 38 | void unbindAppearEvent(WXComponent component); 39 | 40 | void unbindDisappearEvent(WXComponent component); 41 | 42 | ViewGroup getView(); 43 | 44 | void scrollTo(WXComponent component, Map options); 45 | 46 | String getRef(); 47 | 48 | int getScrollY(); 49 | 50 | int getScrollX(); 51 | 52 | /** 53 | * 54 | * @return {@link com.taobao.weex.common.Constants.Orientation#HORIZONTAL} or {@link com.taobao.weex.common.Constants.Orientation#VERTICAL} 55 | */ 56 | int getOrientation(); 57 | 58 | boolean isScrollable(); 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/WXComponentProp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 26 | 27 | @Retention(RUNTIME) 28 | @Target(ElementType.METHOD) 29 | public @interface WXComponentProp { 30 | 31 | String name(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/WXTextDecoration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | public enum WXTextDecoration { 22 | INVALID, 23 | NONE, 24 | UNDERLINE, 25 | LINETHROUGH, 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/EventTrigger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list; 20 | 21 | import java.util.Map; 22 | 23 | interface EventTrigger { 24 | void triggerEvent(String type, Map args); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/HorizontalListComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list; 20 | 21 | import com.taobao.weex.WXSDKInstance; 22 | import com.taobao.weex.annotation.Component; 23 | import com.taobao.weex.common.Constants; 24 | import com.taobao.weex.dom.WXDomObject; 25 | import com.taobao.weex.ui.component.WXVContainer; 26 | 27 | /** 28 | * Created by sospartan on 6/2/16. 29 | */ 30 | @Component(lazyload = false) 31 | 32 | public class HorizontalListComponent extends WXListComponent { 33 | public HorizontalListComponent(WXSDKInstance instance, WXDomObject node, WXVContainer parent, boolean lazy) { 34 | super(instance, node, parent, lazy); 35 | } 36 | 37 | @Override 38 | public int getOrientation() { 39 | return Constants.Orientation.HORIZONTAL; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/ListComponentView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list; 20 | 21 | import com.taobao.weex.ui.view.listview.WXRecyclerView; 22 | import com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter; 23 | 24 | /** 25 | * Created by sospartan on 13/12/2016. 26 | */ 27 | 28 | public interface ListComponentView { 29 | WXRecyclerView getInnerView(); 30 | void setRecyclerViewBaseAdapter(RecyclerViewBaseAdapter adapter); 31 | void notifyStickyShow(WXCell component); 32 | void notifyStickyRemove(WXCell component); 33 | void updateStickyView(int currentStickyPos); 34 | RecyclerViewBaseAdapter getRecyclerViewBaseAdapter(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/SimpleListComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list; 20 | 21 | import android.content.Context; 22 | 23 | import com.taobao.weex.WXSDKInstance; 24 | import com.taobao.weex.dom.WXDomObject; 25 | import com.taobao.weex.ui.component.WXVContainer; 26 | import com.taobao.weex.ui.view.listview.WXRecyclerView; 27 | 28 | /** 29 | * A simple list component based on regular recyclerview, do not support refreshing and loading. 30 | * Created by sospartan on 13/12/2016. 31 | * 32 | */ 33 | public class SimpleListComponent extends BasicListComponent{ 34 | 35 | public SimpleListComponent(WXSDKInstance instance, WXDomObject node, WXVContainer parent) { 36 | super(instance, node, parent); 37 | } 38 | 39 | @Override 40 | protected SimpleRecyclerView generateListView(Context context, int orientation) { 41 | SimpleRecyclerView view = new SimpleRecyclerView(context); 42 | view.initView(context, WXRecyclerView.TYPE_LINEAR_LAYOUT, orientation); 43 | return view; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/template/TemplateCache.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list.template; 20 | import com.taobao.weex.ui.component.list.WXCell; 21 | import java.util.concurrent.ConcurrentLinkedQueue; 22 | 23 | /** 24 | * preload cell cache 25 | * Created by furture on 2017/9/29. 26 | */ 27 | class TemplateCache { 28 | ConcurrentLinkedQueue cells = new ConcurrentLinkedQueue<>(); 29 | boolean isLoadIng = false; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/list/template/VirtualComponentLifecycle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.list.template; 20 | 21 | 22 | /** 23 | * Created by furture on 2018/2/1. 24 | */ 25 | 26 | public class VirtualComponentLifecycle { 27 | 28 | /** 29 | * lifecycle 30 | * */ 31 | public static final String LIFECYCLE = "lifecycle"; 32 | 33 | 34 | /** 35 | * virtual component lifecycle 36 | * */ 37 | public static final String CREATE = "create"; 38 | 39 | public static final String ATTACH = "attach"; 40 | 41 | public static final String SYNSTATE = "syncState"; 42 | 43 | public static final String DETACH = "detach"; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/component/pesudo/OnActivePseudoListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component.pesudo; 20 | 21 | /** 22 | * Created by sospartan on 05/01/2017. 23 | */ 24 | public interface OnActivePseudoListener { 25 | void updateActivePseudo(boolean isSet); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/flat/FlatComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.flat; 20 | 21 | 22 | import android.support.annotation.NonNull; 23 | import android.support.annotation.RestrictTo; 24 | import android.support.annotation.RestrictTo.Scope; 25 | import com.taobao.weex.ui.flat.widget.Widget; 26 | 27 | @RestrictTo(Scope.LIBRARY) 28 | public interface FlatComponent { 29 | 30 | boolean promoteToView(boolean checkAncestor); 31 | 32 | @NonNull T getOrCreateFlatWidget(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/flat/widget/TextWidget.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.flat.widget; 20 | 21 | 22 | import android.graphics.Canvas; 23 | import android.support.annotation.NonNull; 24 | import android.support.annotation.RestrictTo; 25 | import android.support.annotation.RestrictTo.Scope; 26 | import android.text.Layout; 27 | import com.taobao.weex.ui.flat.FlatGUIContext; 28 | 29 | @RestrictTo(Scope.LIBRARY) 30 | public class TextWidget extends BaseWidget { 31 | 32 | private Layout mLayout; 33 | 34 | public TextWidget(@NonNull FlatGUIContext context) { 35 | super(context); 36 | } 37 | 38 | @Override 39 | public void onDraw(@NonNull Canvas canvas) { 40 | if (mLayout != null) { 41 | mLayout.draw(canvas); 42 | } 43 | } 44 | 45 | public void updateTextDrawable(Layout layout) { 46 | this.mLayout = layout; 47 | invalidate(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/flat/widget/WidgetGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.flat.widget; 20 | 21 | 22 | import android.graphics.Canvas; 23 | import android.support.annotation.NonNull; 24 | import android.support.annotation.RestrictTo; 25 | import android.support.annotation.RestrictTo.Scope; 26 | import com.taobao.weex.ui.flat.FlatGUIContext; 27 | import java.util.LinkedList; 28 | import java.util.List; 29 | 30 | @RestrictTo(Scope.LIBRARY) 31 | public class WidgetGroup extends BaseWidget { 32 | 33 | private List mChildren = new LinkedList<>(); 34 | 35 | public WidgetGroup(@NonNull FlatGUIContext context) { 36 | super(context); 37 | } 38 | 39 | public void replaceAll(@NonNull List widgets) { 40 | mChildren = widgets; 41 | invalidate(); 42 | } 43 | 44 | public List getChildren() { 45 | return mChildren; 46 | } 47 | 48 | @Override 49 | public void onDraw(@NonNull Canvas canvas) { 50 | for (Widget child : mChildren) { 51 | child.draw(canvas); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/IRenderResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | 22 | import com.taobao.weex.ui.component.WXComponent; 23 | 24 | public interface IRenderResult { 25 | T getComponent(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/IRenderStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.ui.view; 21 | 22 | 23 | import com.taobao.weex.ui.component.WXComponent; 24 | 25 | public interface IRenderStatus { 26 | 27 | public void holdComponent(T component); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/IWXScroller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | public interface IWXScroller { 22 | 23 | void destroy(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/IWXTextView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | public interface IWXTextView { 22 | 23 | CharSequence getText(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/IWebView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.view.View; 22 | 23 | public interface IWebView { 24 | public View getView(); 25 | public void destroy(); 26 | public void loadUrl(String url); 27 | public void reload(); 28 | public void goBack(); 29 | public void goForward(); 30 | public void setShowLoading(boolean shown); 31 | public void setOnErrorListener(OnErrorListener listener); 32 | public void setOnPageListener(OnPageListener listener); 33 | 34 | public interface OnErrorListener { 35 | public void onError(String type, Object message); 36 | } 37 | 38 | public interface OnPageListener { 39 | public void onReceivedTitle(String title); 40 | public void onPageStart(String url); 41 | public void onPageFinish(String url, boolean canGoBack, boolean canGoForward); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/WXBaseRefreshLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.content.Context; 22 | 23 | public class WXBaseRefreshLayout extends WXFrameLayout { 24 | 25 | public WXBaseRefreshLayout(Context context) { 26 | super(context); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/WXCircleIndicator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.content.Context; 22 | 23 | public class WXCircleIndicator extends WXBaseCircleIndicator { 24 | 25 | public WXCircleIndicator(Context context) { 26 | super(context); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/WXLoadingLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.content.Context; 22 | 23 | /** 24 | * Created by lixinke on 16/9/19. 25 | */ 26 | public class WXLoadingLayout extends WXBaseRefreshLayout { 27 | 28 | public WXLoadingLayout(Context context) { 29 | super(context); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/WXRefreshLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.content.Context; 22 | 23 | /** 24 | * Created by lixinke on 16/9/19. 25 | */ 26 | public class WXRefreshLayout extends WXBaseRefreshLayout { 27 | 28 | public WXRefreshLayout(Context context) { 29 | super(context); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/WXSwitchView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view; 20 | 21 | import android.content.Context; 22 | import android.support.v7.widget.SwitchCompat; 23 | import android.view.Gravity; 24 | import android.view.MotionEvent; 25 | 26 | import com.taobao.weex.ui.view.gesture.WXGesture; 27 | import com.taobao.weex.ui.view.gesture.WXGestureObservable; 28 | 29 | public class WXSwitchView extends SwitchCompat implements WXGestureObservable { 30 | 31 | private WXGesture wxGesture; 32 | 33 | public WXSwitchView(Context context) { 34 | super(context); 35 | setShowText(false); 36 | setGravity(Gravity.CENTER_VERTICAL); 37 | } 38 | 39 | @Override 40 | public void registerGestureListener(WXGesture wxGesture) { 41 | this.wxGesture = wxGesture; 42 | } 43 | 44 | @Override 45 | public boolean onTouchEvent(MotionEvent event) { 46 | boolean result = super.onTouchEvent(event); 47 | if (wxGesture != null) { 48 | result |= wxGesture.onTouch(this, event); 49 | } 50 | return result; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/border/BorderRadiusType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.ui.view.border; 21 | 22 | import android.support.annotation.IntDef; 23 | 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | 27 | @Retention(RetentionPolicy.SOURCE) 28 | @IntDef({ 29 | BorderDrawable.BORDER_TOP_LEFT_RADIUS, 30 | BorderDrawable.BORDER_TOP_RIGHT_RADIUS, 31 | BorderDrawable.BORDER_BOTTOM_RIGHT_RADIUS, 32 | BorderDrawable.BORDER_BOTTOM_LEFT_RADIUS, 33 | BorderDrawable.BORDER_RADIUS_ALL}) 34 | public @interface BorderRadiusType { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/border/BorderWidthStyleColorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.ui.view.border; 21 | 22 | import android.support.annotation.IntDef; 23 | 24 | import com.taobao.weex.dom.flex.Spacing; 25 | 26 | import java.lang.annotation.Retention; 27 | import java.lang.annotation.RetentionPolicy; 28 | 29 | @Retention(RetentionPolicy.SOURCE) 30 | @IntDef({ 31 | Spacing.ALL, 32 | Spacing.TOP, 33 | Spacing.RIGHT, 34 | Spacing.BOTTOM, 35 | Spacing.LEFT}) 36 | public @interface BorderWidthStyleColorType { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/gesture/WXGestureObservable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view.gesture; 20 | 21 | import android.support.annotation.Nullable; 22 | import android.view.MotionEvent; 23 | import android.view.View; 24 | 25 | import com.taobao.weex.ui.view.WXFrameLayout; 26 | 27 | /** 28 | * Views that want to receive Gesture Event must implement this interface. Besides, 29 | * those view must override their {@link android.view.View#dispatchTouchEvent(MotionEvent)} 30 | * and add method invocation to {@link WXGesture#onTouch(View, MotionEvent)}. 31 | * Refer to {@link WXFrameLayout#dispatchTouchEvent(MotionEvent)}} for more info. 32 | * 33 | */ 34 | public interface WXGestureObservable { 35 | 36 | /** 37 | * Register a {@link WXGesture} for corresponding view. 38 | * @param wxGesture The Gesture to register, null for unregister. 39 | */ 40 | void registerGestureListener(@Nullable WXGesture wxGesture); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/listview/adapter/IOnLoadMoreListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view.listview.adapter; 20 | 21 | 22 | public interface IOnLoadMoreListener { 23 | 24 | void onLoadMore(int offScreenY); 25 | void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY); 26 | void onBeforeScroll(int dx, int dy); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/listview/adapter/IRecyclerAdapterListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view.listview.adapter; 20 | 21 | import android.support.v7.widget.RecyclerView; 22 | import android.view.ViewGroup; 23 | 24 | /** 25 | * Listener for recyclerView event 26 | */ 27 | public interface IRecyclerAdapterListener { 28 | 29 | void onViewRecycled(T holder); 30 | 31 | void onBindViewHolder(T holder, int position); 32 | 33 | T onCreateViewHolder(ViewGroup parent, int viewType); 34 | 35 | int getItemViewType(int position); 36 | 37 | int getItemCount(); 38 | 39 | boolean onFailedToRecycleView(T holder); 40 | 41 | long getItemId(int position); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.view.refresh.wrapper; 20 | 21 | import android.content.Context; 22 | 23 | import com.taobao.weex.ui.component.WXScroller; 24 | import com.taobao.weex.ui.view.WXScrollView; 25 | 26 | public class BounceScrollerView extends BaseBounceView { 27 | 28 | public BounceScrollerView(Context context, int orientation, WXScroller waScroller) { 29 | super(context,orientation); 30 | init(context); 31 | if (getInnerView() != null) 32 | getInnerView().setWAScroller(waScroller); 33 | } 34 | 35 | @Override 36 | public WXScrollView setInnerView(Context context) { 37 | return new WXScrollView(context); 38 | } 39 | 40 | @Override 41 | public void onRefreshingComplete() { 42 | //TODO update scroller dataset 43 | } 44 | 45 | @Override 46 | public void onLoadmoreComplete() { 47 | //TODO update scroller dataset 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/ATagUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.utils; 21 | 22 | import android.net.Uri; 23 | import android.view.View; 24 | 25 | import com.alibaba.fastjson.JSONArray; 26 | import com.taobao.weex.WXSDKInstance; 27 | import com.taobao.weex.WXSDKManager; 28 | import com.taobao.weex.adapter.URIAdapter; 29 | 30 | public class ATagUtil { 31 | public static void onClick(View widget, String instanceId, String url) { 32 | WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId); 33 | if (instance == null) { 34 | return; 35 | } 36 | String href = instance.rewriteUri(Uri.parse(url), URIAdapter.LINK).toString(); 37 | JSONArray array = new JSONArray(); 38 | array.add(href); 39 | WXSDKManager.getInstance().getWXBridgeManager(). 40 | callModuleMethod(instanceId, "event", "openURL", array); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/ImgURIUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package com.taobao.weex.utils; 21 | 22 | import android.content.Context; 23 | import android.content.res.Resources; 24 | import android.graphics.drawable.Drawable; 25 | import android.net.Uri; 26 | import android.support.v4.content.res.ResourcesCompat; 27 | 28 | import java.util.List; 29 | 30 | public class ImgURIUtil { 31 | 32 | public static Drawable getDrawableFromLoaclSrc(Context context, Uri rewrited) { 33 | Resources resources = context.getResources(); 34 | List segments = rewrited.getPathSegments(); 35 | if (segments.size() != 1) { 36 | WXLogUtils.e("Local src format is invalid."); 37 | return null; 38 | } 39 | int id = resources.getIdentifier(segments.get(0), "drawable", context.getPackageName()); 40 | return id == 0 ? null : ResourcesCompat.getDrawable(resources, id, null); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/LogLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.utils; 20 | 21 | import android.util.Log; 22 | 23 | /** 24 | * Created by lixinke on 16/5/11. 25 | */ 26 | public enum LogLevel { 27 | WTF("wtf", 0, Log.ASSERT), ERROR("error", 1, Log.ERROR), WARN("warn", 2,Log.WARN), INFO("info", 3,Log.INFO), 28 | DEBUG("debug", 4,Log.DEBUG), VERBOSE("verbose", 5, Log.VERBOSE), ALL("debug", 6,Log.DEBUG),OFF("off",7,Log.DEBUG),; 29 | String name; 30 | int value; 31 | int priority; 32 | 33 | LogLevel(String name, int value,int priority) { 34 | this.name = name; 35 | this.value = value; 36 | this.priority = priority; 37 | } 38 | public String getName(){ 39 | return name; 40 | } 41 | public int getValue(){ 42 | return value; 43 | } 44 | public int getPriority(){ 45 | return priority; 46 | } 47 | public int compare(LogLevel level){ 48 | return value-level.value; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/OsVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.utils; 20 | 21 | /** 22 | * Android OS version utilities. 23 | */ 24 | public class OsVersion { 25 | private static boolean sIsAtLeastJB_MR2; 26 | 27 | 28 | static { 29 | final int v = getApiVersion(); 30 | sIsAtLeastJB_MR2 = v >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; 31 | } 32 | 33 | /** 34 | * @return True if the version of Android that we're running on is at 35 | * least Jelly Bean MR2(API level 18). 36 | */ 37 | public static boolean isAtLeastJB_MR2() { 38 | return sIsAtLeastJB_MR2; 39 | } 40 | 41 | /** 42 | * @return The Android API version of the running OS. 43 | */ 44 | public static int getApiVersion() { 45 | return android.os.Build.VERSION.SDK_INT; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/batch/BactchExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.utils.batch; 20 | 21 | /** 22 | * Created by sospartan on 8/24/16. 23 | */ 24 | public interface BactchExecutor { 25 | void post(Runnable runnable); 26 | 27 | void setInterceptor(Interceptor interceptor); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/taobao/weex/utils/batch/Interceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.utils.batch; 20 | 21 | /** 22 | * Created by sospartan on 8/24/16. 23 | */ 24 | public interface Interceptor { 25 | boolean take(Runnable runnable); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/icon_delete_32dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/icon_delete_32dp.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/icon_enter_32dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/icon_enter_32dp.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/icon_hide_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/icon_hide_keyboard.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/img_keyboard_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/img_keyboard_normal.9.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/img_keyboard_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/img_keyboard_pressed.9.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0001.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0002.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0003.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0004.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0005.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0006.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0007.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0008.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0009.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0010.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0011.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0012.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0013.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0014.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0015.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0016.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0017.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0018.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0019.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0020.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0021.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0022.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0023.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0024.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0025.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0026.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0027.png -------------------------------------------------------------------------------- /src/main/res/drawable-xhdpi/loadding0028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable-xhdpi/loadding0028.png -------------------------------------------------------------------------------- /src/main/res/drawable/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable/error.png -------------------------------------------------------------------------------- /src/main/res/drawable/weexerror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bmfe/WeexSDK/798585dec5168299e3d6e4c4cfaad89dce23af63/src/main/res/drawable/weexerror.png -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/TestActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import android.app.Activity; 22 | /** 23 | * Created by sospartan on 7/27/16. 24 | */ 25 | public class TestActivity extends Activity { 26 | public void test(){ 27 | // 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/TestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import android.app.Application; 22 | 23 | /** 24 | * Created by sospartan on 7/21/16. 25 | */ 26 | public class TestApplication extends Application { 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/WXSDKManagerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex; 20 | 21 | import com.taobao.weex.ui.WXRenderManager; 22 | import org.junit.After; 23 | import org.junit.Before; 24 | 25 | import static org.junit.Assert.*; 26 | 27 | /** 28 | * Created by sospartan on 8/30/16. 29 | */ 30 | public class WXSDKManagerTest { 31 | 32 | public static void setRenderManager(WXRenderManager rm){ 33 | WXSDKManager.initInstance(rm); 34 | } 35 | 36 | public static void setInstance(WXSDKManager m){ 37 | WXSDKManager.setInstance(m); 38 | } 39 | 40 | @Before 41 | public void setUp() throws Exception { 42 | 43 | } 44 | 45 | @After 46 | public void tearDown() throws Exception { 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/common/TestModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import com.taobao.weex.WXSDKEngine; 22 | import com.taobao.weex.annotation.JSMethod; 23 | import com.taobao.weex.bridge.JSCallback; 24 | 25 | /** 26 | * Created by sospartan on 7/27/16. 27 | */ 28 | public class TestModule extends WXSDKEngine.DestroyableModule { 29 | 30 | @JSMethod 31 | public void testMethod(String arg){ 32 | 33 | } 34 | 35 | @JSMethod(uiThread=true) 36 | public void testCallbackMethod(String arg, JSCallback callback){ 37 | 38 | } 39 | 40 | @Override 41 | public void destroy() { 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/common/TestModuleFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import com.taobao.weex.WXSDKEngine; 22 | import com.taobao.weex.bridge.Invoker; 23 | import com.taobao.weex.bridge.ModuleFactory; 24 | 25 | import java.util.ArrayList; 26 | import java.util.Map; 27 | 28 | /** 29 | * Created by sospartan on 7/27/16. 30 | */ 31 | public class TestModuleFactory extends WXSDKEngine.DestroyableModuleFactory { 32 | 33 | 34 | public TestModuleFactory(Class clz) { 35 | super(clz); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/common/WXModuleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.common; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | /** 24 | * Created by sospartan on 7/27/16. 25 | */ 26 | public class WXModuleTest { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/el/FailedCaseTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.el; 20 | 21 | import com.alibaba.fastjson.JSONObject; 22 | import com.taobao.weex.el.parse.ArrayStack; 23 | import com.taobao.weex.el.parse.Parser; 24 | import com.taobao.weex.el.parse.Token; 25 | 26 | import junit.framework.TestCase; 27 | 28 | /** 29 | * Created by furture on 2018/1/25. 30 | */ 31 | 32 | public class FailedCaseTest extends TestCase { 33 | 34 | 35 | public void testVElseIf0(){ 36 | JSONObject data = new JSONObject(); 37 | JSONObject item = new JSONObject(); 38 | item.put("number", 0.0); 39 | data.put("item", item); 40 | ArrayStack stack = new ArrayStack(); 41 | stack.push(data); 42 | 43 | Token token = Parser.parse("!(item.number%3 === 0) && (item.number%3 === 1)"); 44 | 45 | System.out.println(token.toString() + " " + token.execute(stack)); 46 | 47 | Token if2 = Parser.parse("!(!(item.number%3 === 0) && (item.number%3 === 1))"); 48 | System.out.println(if2 + " " + if2.execute(stack)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/ui/animation/TransformParserTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.animation; 20 | 21 | import android.util.Property; 22 | import android.view.View; 23 | 24 | import junit.framework.TestCase; 25 | 26 | import java.util.Map; 27 | 28 | /** 29 | * Created by furture on 2017/10/24. 30 | */ 31 | 32 | public class TransformParserTest extends TestCase { 33 | 34 | public void testParseTransform(){ 35 | Map, Float> transforms = TransformParser.parseTransForm("rotate(7deg) translate(1, 2)", 100, 100, 750); 36 | System.out.println(transforms.size()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/ui/component/PriorityQueueTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import junit.framework.TestCase; 22 | 23 | import org.junit.Test; 24 | 25 | import java.util.Comparator; 26 | import java.util.PriorityQueue; 27 | 28 | /** 29 | * Created by furture on 2018/1/3. 30 | */ 31 | 32 | public class PriorityQueueTest extends TestCase { 33 | 34 | 35 | @Test 36 | public void testPriority(){ 37 | PriorityQueue embeds = new PriorityQueue<>(8, new Comparator() { 38 | @Override 39 | public int compare(Integer o1, Integer o2) { 40 | return o1 - o2; 41 | } 42 | }); 43 | 44 | 45 | embeds.add(10); 46 | embeds.add(9); 47 | embeds.offer(1); 48 | 49 | embeds.offer(2); 50 | embeds.add(11); 51 | 52 | System.out.println(embeds.peek() + " " + embeds.size()); 53 | 54 | System.out.println(embeds.poll() + " " + embeds.size()); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/ui/component/TestComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import android.view.View; 22 | import com.taobao.weex.WXSDKInstance; 23 | import com.taobao.weex.dom.WXDomObject; 24 | 25 | import java.lang.reflect.InvocationTargetException; 26 | 27 | /** 28 | * Created by sospartan on 7/27/16. 29 | */ 30 | public class TestComponent extends WXDiv{ 31 | public TestComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy) { 32 | super(instance, dom, parent, instanceId, isLazy); 33 | } 34 | 35 | public TestComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) { 36 | super(instance, dom, parent); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/ui/component/TestConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import com.taobao.weex.common.Constants; 22 | 23 | /** 24 | * Created by sospartan on 8/9/16. 25 | */ 26 | public class TestConstants { 27 | public static final String Events[] = {"", null, 28 | Constants.Event.INPUT, 29 | Constants.Event.APPEAR, 30 | Constants.Event.BLUR, 31 | Constants.Event.CLICK, 32 | Constants.Event.CHANGE, 33 | Constants.Event.FOCUS, 34 | Constants.Event.DISAPPEAR, 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/ui/component/WXHeaderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.ui.component; 20 | 21 | import com.taobao.weex.WXSDKInstanceTest; 22 | import com.taobao.weex.dom.TestDomObject; 23 | import com.taobao.weex.ui.SimpleComponentHolder; 24 | import com.taobao.weex.ui.component.list.WXListComponent; 25 | 26 | import java.lang.reflect.InvocationTargetException; 27 | 28 | import static org.junit.Assert.*; 29 | 30 | /** 31 | * Created by sospartan on 8/29/16. 32 | */ 33 | public class WXHeaderTest { 34 | 35 | public static WXHeader create(WXVContainer parent) throws IllegalAccessException, InstantiationException, InvocationTargetException { 36 | return (WXHeader) new SimpleComponentHolder(WXHeader.class).createInstance(WXSDKInstanceTest.createInstance(), new TestDomObject(), parent); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/com/taobao/weex/utils/FunctionParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package com.taobao.weex.utils; 20 | 21 | import org.junit.Test; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * Created by sospartan on 27/09/2016. 27 | */ 28 | public class FunctionParserTest { 29 | 30 | @Test 31 | public void testParse() throws Exception { 32 | List s = new SingleFunctionParser<>("blur(5px)", new SingleFunctionParser.FlatMapper() { 33 | @Override 34 | public Integer map(String raw) { 35 | return WXUtils.getInteger(raw,0); 36 | } 37 | }).parse("blur"); 38 | System.out.println(s); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/mockito/configuration/MockitoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.mockito.configuration; 20 | 21 | /** 22 | * Created by sospartan on 7/28/16. 23 | */ 24 | public class MockitoConfiguration extends DefaultMockitoConfiguration { 25 | @Override 26 | public boolean enableClassCache() { 27 | return false; 28 | } 29 | } 30 | --------------------------------------------------------------------------------