├── .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 extends K, ? extends V> m) {
33 | Iterator extends Entry extends K, ? extends V>> iterator = m.entrySet().iterator();
34 | while (iterator.hasNext()) {
35 | Entry extends K, ? extends V> 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