├── MyApplication ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── dist │ │ │ └── home │ │ │ └── home-live.js │ │ ├── java │ │ └── com │ │ │ └── test │ │ │ └── www │ │ │ └── myapplication │ │ │ ├── ContextUtil.java │ │ │ ├── WeexConstants.java │ │ │ ├── ZhiboApplication.java │ │ │ ├── adapter │ │ │ ├── FrescoImageAdapter.java │ │ │ ├── PlayDebugAdapter.java │ │ │ └── WXOkHttpAdapter.java │ │ │ ├── component │ │ │ ├── FrescoImageComponent.java │ │ │ ├── RichTextview.java │ │ │ ├── WXNewSlider.java │ │ │ └── view │ │ │ │ ├── FrescoImageView.java │ │ │ │ └── WXSwipeRefreshView.java │ │ │ ├── event │ │ │ └── WXRefreshEvent.java │ │ │ ├── manager │ │ │ └── WeexConfigManager.java │ │ │ ├── module │ │ │ ├── IWXEventModule.java │ │ │ └── impl │ │ │ │ └── WXEventModule.java │ │ │ ├── network │ │ │ ├── BaseNetworkEvent.java │ │ │ ├── HttpConnector.java │ │ │ └── retrofit │ │ │ │ ├── ByteArrayConverterFactory.java │ │ │ │ └── StringConverterFactory.java │ │ │ ├── util │ │ │ └── WeexFileUtil.java │ │ │ └── view │ │ │ ├── FirstActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── PageActivity.java │ │ │ └── base │ │ │ └── WXBaseActivity.java │ │ └── res │ │ ├── layout │ │ ├── activity_first.xml │ │ ├── activity_main.xml │ │ └── activity_page.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── assets.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib_ui │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── eastmoney │ │ │ └── live │ │ │ └── ui │ │ │ ├── CircleImageView.java │ │ │ ├── CircularCoverView.java │ │ │ ├── ContextUtil.java │ │ │ ├── DensityUtil.java │ │ │ ├── ThemeUtils.java │ │ │ ├── ToastUtil.java │ │ │ └── refreshlayout │ │ │ ├── LionRefreshDrawable.java │ │ │ ├── PullRefreshLayout.java │ │ │ └── RefreshDrawable.java │ │ └── res │ │ ├── anim │ │ ├── activity_tobottom.xml │ │ ├── activity_totop.xml │ │ ├── slide_in_bottom.xml │ │ ├── slide_out_bottom.xml │ │ ├── swipeback_activity_close_enter.xml │ │ ├── swipeback_activity_close_exit.xml │ │ ├── swipeback_activity_open_enter.xml │ │ └── swipeback_activity_open_exit.xml │ │ ├── drawable-xhdpi │ │ ├── avatar_default.png │ │ ├── icon_frame_vip.png │ │ └── img_me_circle.png │ │ ├── drawable-xxhdpi │ │ ├── avatar_default.png │ │ ├── btn_minus_click.png │ │ ├── btn_minus_disable.png │ │ ├── btn_minus_normal.png │ │ ├── btn_plus_click.png │ │ ├── btn_plus_disable.png │ │ ├── btn_plus_normal.png │ │ ├── icon_circle_frame_arrow_normal.png │ │ ├── icon_discover_vip_border.png │ │ ├── icon_frame_vip.png │ │ ├── icon_level_crown_high_02.png │ │ ├── icon_level_crown_high_03.png │ │ ├── icon_level_crown_high_04.png │ │ ├── icon_level_crown_high_05.png │ │ ├── icon_level_crown_high_circle.png │ │ ├── icon_level_crown_low_circle.png │ │ ├── icon_level_crown_middle_circle.png │ │ ├── icon_level_luna_circle.png │ │ ├── icon_level_star_circle.png │ │ ├── icon_level_sun_circle.png │ │ ├── icon_live_message_alert_arrow.png │ │ ├── icon_live_no1.png │ │ ├── icon_live_no2.png │ │ ├── icon_live_no3.png │ │ ├── icon_pic_vip.png │ │ ├── icon_vip_outline.png │ │ ├── img_me_circle.png │ │ ├── lion_anim_frame_001.png │ │ ├── lion_anim_frame_002.png │ │ ├── lion_anim_frame_003.png │ │ ├── lion_anim_frame_004.png │ │ ├── lion_anim_frame_005.png │ │ ├── lion_anim_frame_006.png │ │ ├── lion_anim_frame_007.png │ │ ├── lion_anim_frame_008.png │ │ ├── lion_anim_frame_009.png │ │ ├── lion_anim_frame_010.png │ │ ├── lion_redpacket.png │ │ └── selector_pickerview_btn.xml │ │ ├── drawable │ │ ├── backgroud_grey_corner.xml │ │ ├── badgeview_red_background.xml │ │ ├── bg_item_edit_text_view.xml │ │ ├── btn_minus.xml │ │ ├── btn_plus.xml │ │ └── lion_anim.xml │ │ ├── layout │ │ ├── bg_blur_image.xml │ │ ├── comui_tab_view.xml │ │ ├── header_toast.xml │ │ ├── include_pickerview_topbar.xml │ │ ├── item_edit_text_view.xml │ │ ├── kprogresshud_hud.xml │ │ ├── layout_basepickerview.xml │ │ ├── layout_live_message.xml │ │ ├── layout_plus_minus_btn.xml │ │ ├── pickerview_options.xml │ │ ├── pickerview_time.xml │ │ └── tab_top.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── bools.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── integers.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── themes.xml ├── settings.gradle └── weex_sdk │ ├── .gitignore │ ├── NOTICE │ ├── README.md │ ├── assets │ ├── .gitkeep │ ├── .gitkeeper │ └── main.js │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ ├── libs │ ├── armeabi │ │ └── libweexv8.so │ └── x86 │ │ └── libweexv8.so │ ├── license │ ├── LICENSE │ ├── license-gradle-plugin-0.12.1.jar │ ├── maven-license-plugin-1.10.b1.jar │ └── plexus-utils-3.0.24.jar │ ├── proguard-rules.pro │ ├── publish.sh │ └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── taobao │ │ └── weex │ │ ├── IWXActivityStateListener.java │ │ ├── IWXRenderListener.java │ │ ├── InitConfig.java │ │ ├── RenderContainer.java │ │ ├── WXEnvironment.java │ │ ├── WXGlobalEventModule.java │ │ ├── WXGlobalEventReceiver.java │ │ ├── WXRenderErrorCode.java │ │ ├── WXSDKEngine.java │ │ ├── WXSDKInstance.java │ │ ├── WXSDKManager.java │ │ ├── adapter │ │ ├── DefaultUriAdapter.java │ │ ├── DefaultWXHttpAdapter.java │ │ ├── DrawableStrategy.java │ │ ├── IDrawableLoader.java │ │ ├── IWXDebugAdapter.java │ │ ├── IWXHttpAdapter.java │ │ ├── IWXImgLoaderAdapter.java │ │ ├── IWXJSExceptionAdapter.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 │ │ ├── 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 │ │ ├── common │ │ ├── Constants.java │ │ ├── Destroyable.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 │ │ ├── WXModule.java │ │ ├── WXModuleAnno.java │ │ ├── WXPerformance.java │ │ ├── WXRefreshData.java │ │ ├── WXRenderStrategy.java │ │ ├── WXRequest.java │ │ ├── WXRequestListener.java │ │ ├── WXResponse.java │ │ ├── WXRuntimeException.java │ │ └── WXThread.java │ │ ├── dom │ │ ├── BasicEditTextDomObject.java │ │ ├── CSSAlignConvert.java │ │ ├── CSSFlexDirectionConvert.java │ │ ├── CSSJustifyConvert.java │ │ ├── CSSPositionTypeConvert.java │ │ ├── CSSWrapConvert.java │ │ ├── DomContext.java │ │ ├── ImmutableDomObject.java │ │ ├── SafePutConcurrentHashMap.java │ │ ├── TextAreaEditTextDomObject.java │ │ ├── WXAttr.java │ │ ├── WXCustomStyleSpan.java │ │ ├── WXDomHandler.java │ │ ├── WXDomManager.java │ │ ├── WXDomModule.java │ │ ├── WXDomObject.java │ │ ├── WXDomObjectFactory.java │ │ ├── WXDomRegistry.java │ │ ├── WXDomStatement.java │ │ ├── WXDomTask.java │ │ ├── WXEvent.java │ │ ├── WXImageQuality.java │ │ ├── WXLineHeightSpan.java │ │ ├── WXListDomObject.java │ │ ├── WXScrollerDomObject.java │ │ ├── WXStyle.java │ │ ├── WXSwitchDomObject.java │ │ ├── WXTextDomObject.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 │ │ ├── http │ │ ├── Options.java │ │ ├── Status.java │ │ ├── WXHttpUtil.java │ │ └── WXStreamModule.java │ │ ├── ui │ │ ├── ComponentCreator.java │ │ ├── ExternalLoaderComponentHolder.java │ │ ├── IExternalComponentGetter.java │ │ ├── IFComponentHolder.java │ │ ├── IWXRenderTask.java │ │ ├── SimpleComponentHolder.java │ │ ├── WXComponentRegistry.java │ │ ├── WXRenderHandler.java │ │ ├── WXRenderManager.java │ │ ├── WXRenderStatement.java │ │ ├── animation │ │ │ ├── DimensionUpdateListener.java │ │ │ ├── WXAnimationBean.java │ │ │ └── WXAnimationModule.java │ │ ├── component │ │ │ ├── AbstractEditComponent.java │ │ │ ├── AppearanceHelper.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 │ │ │ ├── helper │ │ │ │ ├── WXStickyHelper.java │ │ │ │ └── WXTimeInputHelper.java │ │ │ ├── list │ │ │ │ ├── BasicListComponent.java │ │ │ │ ├── HorizontalListComponent.java │ │ │ │ ├── ListComponentView.java │ │ │ │ ├── SimpleListComponent.java │ │ │ │ ├── SimpleRecyclerView.java │ │ │ │ ├── WXCell.java │ │ │ │ └── WXListComponent.java │ │ │ └── pesudo │ │ │ │ ├── OnActivePseudoListner.java │ │ │ │ ├── PesudoStatus.java │ │ │ │ └── TouchActivePseudoListener.java │ │ ├── module │ │ │ ├── WXMetaModule.java │ │ │ ├── WXModalUIModule.java │ │ │ ├── WXTimerModule.java │ │ │ └── WXWebViewModule.java │ │ └── view │ │ │ ├── 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 │ │ │ ├── BorderStyle.java │ │ │ ├── BorderUtil.java │ │ │ ├── BottomLeftCorner.java │ │ │ ├── BottomRightCorner.java │ │ │ ├── TopLeftCorner.java │ │ │ └── TopRightCorner.java │ │ │ ├── gesture │ │ │ ├── WXGesture.java │ │ │ ├── WXGestureObservable.java │ │ │ └── WXGestureType.java │ │ │ ├── listview │ │ │ ├── WXRecyclerView.java │ │ │ └── adapter │ │ │ │ ├── IOnLoadMoreListener.java │ │ │ │ ├── IRecyclerAdapterListener.java │ │ │ │ ├── ListBaseViewHolder.java │ │ │ │ ├── RecyclerViewBaseAdapter.java │ │ │ │ ├── TransformItemDecoration.java │ │ │ │ └── WXRecyclerViewOnScrollListener.java │ │ │ └── refresh │ │ │ ├── circlebar │ │ │ ├── CircleProgressBar.java │ │ │ └── MaterialProgressDrawable.java │ │ │ ├── core │ │ │ ├── WXRefreshView.java │ │ │ └── WXSwipeLayout.java │ │ │ └── wrapper │ │ │ ├── BaseBounceView.java │ │ │ ├── BounceRecyclerView.java │ │ │ └── BounceScrollerView.java │ │ └── utils │ │ ├── ATagUtil.java │ │ ├── FontDO.java │ │ ├── FunctionParser.java │ │ ├── ImageDrawable.java │ │ ├── ImgURIUtil.java │ │ ├── LogLevel.java │ │ ├── SingleFunctionParser.java │ │ ├── TypefaceUtil.java │ │ ├── WXDataStructureUtil.java │ │ ├── WXDomUtils.java │ │ ├── WXFileUtils.java │ │ ├── WXHack.java │ │ ├── WXInterception.java │ │ ├── WXJsonUtils.java │ │ ├── WXLogUtils.java │ │ ├── WXReflectionUtils.java │ │ ├── WXResourceUtils.java │ │ ├── WXSoInstallMgrSdk.java │ │ ├── WXUtils.java │ │ ├── WXViewUtils.java │ │ └── batch │ │ ├── BactchExecutor.java │ │ ├── BatchOperationHelper.java │ │ └── Interceptor.java │ └── res │ ├── drawable │ └── error.png │ ├── layout │ └── item_load.xml │ └── values │ ├── colors.xml │ └── strings.xml ├── README.md ├── Weex.pptx ├── apk └── release-700000.apk ├── photo ├── app_pro.png ├── page1.jpg ├── page2.jpg └── weexfeed_pro.png └── weexfeed ├── README.md ├── dist ├── home │ ├── home-live.js │ └── view │ │ ├── banner-view.js │ │ ├── channel-item.js │ │ ├── home-live-page.js │ │ ├── page-ad.js │ │ └── page-item.js ├── me │ └── loading-button.js └── weexfeed.js ├── index.html ├── package.json ├── src ├── common │ ├── api.js │ └── base64.js ├── home │ ├── home-live.we │ ├── homeConstants.js │ └── view │ │ ├── banner-view.we │ │ ├── channel-item.we │ │ ├── home-live-page.we │ │ ├── page-ad.we │ │ └── page-item.we ├── me │ └── loading-button.we └── weexfeed.we └── webpack.config.js /MyApplication/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /MyApplication/.idea/.name: -------------------------------------------------------------------------------- 1 | MyApplication -------------------------------------------------------------------------------- /MyApplication/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /MyApplication/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MyApplication/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MyApplication/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 26 | 27 | -------------------------------------------------------------------------------- /MyApplication/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Class structureJava 12 | 13 | 14 | Code maturity issuesJava 15 | 16 | 17 | Java 18 | 19 | 20 | Java language level migration aidsJava 21 | 22 | 23 | Javadoc issuesJava 24 | 25 | 26 | Performance issuesJava 27 | 28 | 29 | TestNGJava 30 | 31 | 32 | Threading issuesJava 33 | 34 | 35 | 36 | 37 | Android 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 1.8 64 | 65 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MyApplication/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyApplication/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MyApplication/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion parent.ext.compileSdkVersion 5 | buildToolsVersion parent.ext.buildToolsVersion 6 | 7 | defaultConfig { 8 | applicationId parent.ext.applicationId 9 | minSdkVersion parent.ext.minSdkVersion 10 | targetSdkVersion parent.ext.targetSdkVersion 11 | versionCode parent.ext.versionCode 12 | versionName parent.ext.versionName 13 | 14 | ndk { 15 | abiFilters "armeabi" 16 | } 17 | 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | lintOptions { 27 | abortOnError false 28 | ignoreWarnings true 29 | } 30 | } 31 | 32 | repositories { 33 | flatDir { 34 | dirs 'libs' 35 | } 36 | } 37 | 38 | dependencies { 39 | compile fileTree(dir: 'libs', include: ['*.jar']) 40 | compile project(':weex_sdk') 41 | 42 | compile parent.ext.libRetrofit 43 | compile parent.ext.libRetrofitGsonConverter 44 | compile parent.ext.libOkHttp3LogInterceptor 45 | compile parent.ext.libIo 46 | 47 | compile parent.ext.libV7 48 | compile parent.ext.libDesign 49 | compile parent.ext.libRecyclerview 50 | compile parent.ext.libEventBus 51 | compile parent.ext.libCardView 52 | compile parent.ext.libGridLayout 53 | compile parent.ext.libGson 54 | compile parent.ext.libIo 55 | compile parent.ext.libRecyclerViewAnimator 56 | compile parent.ext.libGridLayout 57 | compile parent.ext.libProgress 58 | compile parent.ext.libFresco 59 | compile parent.ext.libFrescoOkHttp 60 | } 61 | -------------------------------------------------------------------------------- /MyApplication/app/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/alexwangweiqi/Library/Android/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 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | //Normal Permissions users cannnot revoke these permissions 6 | 7 | 8 | 9 | 10 | 11 | //Special Permissions must send an intent requesting user's authorization 12 | 13 | 14 | // 15 | 16 | //Dangerous Permissions needs to check whether our app has the permissions every time it runs 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | //bugly need 31 | 32 | // 悬浮窗 33 | 34 | 35 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/ContextUtil.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * ContextUtil,为Android程序提供全局Context对象,要在Application.onCreate中初始化。 7 | */ 8 | public class ContextUtil { 9 | private static Context context; 10 | 11 | public static void init(Context appContext) { 12 | context = appContext.getApplicationContext(); 13 | } 14 | 15 | public static Context getContext() { 16 | return context; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/WeexConstants.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication; 2 | 3 | /** 4 | * 常量配置 5 | * Created by alexwangweiqi on 16/11/14. 6 | */ 7 | public class WeexConstants { 8 | 9 | /** 10 | * js链接最大缓存时间 11 | */ 12 | public static final int JS_MAX_STALE_YEAR = 60 * 60 * 24 * 365; 13 | 14 | public static final String ENDPOINT_SNS_CDN_OFFICIAL = "official"; 15 | public static final String ENDPOINT_SNS_CDN_TEST = "test"; 16 | public static String ENDPOINT_SNS_CDN = ENDPOINT_SNS_CDN_TEST;//weex为线上环境 17 | 18 | public static final String HTTPS = "https"; 19 | public static final String HTTP = "http"; 20 | public static final String FILE = "file"; 21 | public static final String EMLIVE = "emlive"; 22 | 23 | public static final String BUNDLE_URL = "bundleUrl"; 24 | public static final String TITLE = "title"; 25 | public static final String JS_FILE_PATH = "jsFilePath"; 26 | public static final String CONTENT_HEIGHT = "contentHeight"; 27 | public static final String ENDPOINT_CDN = "endPointCdn"; 28 | public static final String PARAMS = "params"; 29 | 30 | // 页面自定义 params keys 31 | public static final String UID = "uid"; 32 | public static final String PID = "pid"; 33 | 34 | 35 | //hot refresh 36 | public static final int HOT_REFRESH_CONNECT = 0x111; 37 | public static final int HOT_REFRESH_DISCONNECT = 0x112; 38 | public static final int HOT_REFRESH_REFRESH = 0x113; 39 | public static final int HOT_REFRESH_CONNECT_ERROR = 0x114; 40 | 41 | //weex js file download 42 | public static final String PATH_DOWNLOADER_WEEX_JS = "/api/GetWeex"; 43 | 44 | public static class KEY { 45 | public static final String CODE = "code"; 46 | public static final String RESULT = "result"; 47 | public static final String DATA = "data"; 48 | public static final String INDEX = "index"; 49 | } 50 | 51 | public static class VALUE { 52 | public static final int FAILURE = 0x0; 53 | public static final int SUCCESS = 0x01; 54 | public static final int CANCEL = 0x02; 55 | } 56 | 57 | public static class KEY_PAY { 58 | public static final String IS_TEST = "is_test"; 59 | public static final String COIN_NUMBER = "coin_number"; 60 | public static final String CTOKEN = "ctoken"; 61 | public static final String UTOKEN = "utoken"; 62 | public static final String NETWORK = "network"; 63 | public static final String VERSION = "version"; 64 | public static final String DEVICE_ID = "device_id"; 65 | } 66 | 67 | public static class KEY_PAY_RESULT { 68 | public static final String RESULT = "result"; 69 | public static final String PAY_RESULT_STATUS = "payResultStatus"; 70 | public static final String ORDR_NO = "ordr_no"; 71 | 72 | public static final String CALL_BACK_CODE = "callBackCode"; 73 | } 74 | 75 | // params keys 76 | public static final String PLAT = "plat"; 77 | public static final String PRODUCT = "product"; 78 | public static final String DEVICE_ID = "device_id"; 79 | public static final String VERSION = "version"; 80 | public static final String UTOKEN = "utoken"; 81 | public static final String CTOKEN = "ctoken"; 82 | public static final String NETWORK = "network"; 83 | public static final String MODEL = "model"; 84 | public static final String OS_VERSION = "osversion"; 85 | public static final String IS_TEST = "is_test"; 86 | public static final String END_POINT_CDN = "endPointCdn"; 87 | } 88 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/ZhiboApplication.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.facebook.drawee.backends.pipeline.Fresco; 7 | import com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory; 8 | import com.facebook.imagepipeline.core.ImagePipelineConfig; 9 | import com.facebook.imagepipeline.listener.RequestListener; 10 | import com.facebook.imagepipeline.listener.RequestLoggingListener; 11 | import com.test.www.myapplication.network.HttpConnector; 12 | 13 | import java.util.HashSet; 14 | import java.util.Set; 15 | 16 | 17 | /** 18 | * Application 19 | * Created by fengshzh on 4/22/16. 20 | */ 21 | public class ZhiboApplication extends Application { 22 | 23 | private static final String TAG = ZhiboApplication.class.getSimpleName(); 24 | 25 | @Override 26 | protected void attachBaseContext(Context base) { 27 | super.attachBaseContext(base); 28 | } 29 | 30 | @Override 31 | public void onCreate() { 32 | super.onCreate(); 33 | 34 | 35 | boolean debug = BuildConfig.DEBUG; 36 | 37 | ContextUtil.init(this.getApplicationContext()); 38 | HttpConnector.initNetworkConnector(this, debug); 39 | 40 | Set requestListeners = new HashSet<>(); 41 | requestListeners.add(new RequestLoggingListener()); 42 | ImagePipelineConfig config = 43 | OkHttpImagePipelineConfigFactory.newBuilder(this, HttpConnector.getHttpClient()) 44 | .setDownsampleEnabled(true) 45 | .setRequestListeners(requestListeners) 46 | .build(); 47 | Fresco.initialize(this, config); 48 | 49 | // WeexConfigManager.initSdk(debug, this); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/adapter/PlayDebugAdapter.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.adapter; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import com.taobao.weex.IWXActivityStateListener; 9 | import com.taobao.weex.WXSDKInstance; 10 | import com.taobao.weex.WXSDKManager; 11 | import com.taobao.weex.adapter.IWXDebugAdapter; 12 | import com.taobao.weex.utils.WXLogUtils; 13 | 14 | import java.lang.reflect.Constructor; 15 | import java.lang.reflect.Method; 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | /** 20 | * Created by lixinke on 16/6/15. 21 | */ 22 | public class PlayDebugAdapter implements IWXDebugAdapter { 23 | 24 | public static final String SHOW_3D_LAYER = "show_3d_layer"; 25 | private Map options; 26 | 27 | 28 | @Override 29 | public void initDebug(final Application application) { 30 | WXSDKManager.getInstance().postOnUiThread(new Runnable() { 31 | @Override 32 | public void run() { 33 | try { 34 | Class cls = Class.forName("com.taobao.weex.WXPrettyFish"); 35 | Method m = cls.getMethod("init", new Class[]{Application.class}); 36 | m.invoke(cls, new Object[]{application}); 37 | } catch (Exception e) { 38 | WXLogUtils.d("weex", "WXPrettyFish not found!"); 39 | } 40 | putDebugOptions(SHOW_3D_LAYER, "true"); 41 | } 42 | }, 0); 43 | } 44 | 45 | @Override 46 | public View wrapContainer(WXSDKInstance instance, View wxView) { 47 | try { 48 | Class scalpelClas = Class.forName("com.taobao.weex.scalpel.ScalpelFrameLayout"); 49 | Constructor constructor = scalpelClas.getConstructor(new Class[]{Context.class}); 50 | ViewGroup container = (ViewGroup) constructor.newInstance(wxView.getContext()); 51 | if (container != null) { 52 | container.addView(wxView); 53 | Class cls = Class.forName("com.taobao.weex.WXDebugTool"); 54 | Method m = cls.getMethod("updateScapleView", new Class[]{Object.class}); 55 | m.invoke(null, new Object[]{container}); 56 | instance.registerActivityStateListener(new DebugActivityState(wxView)); 57 | return container; 58 | } 59 | } catch (Exception e) { 60 | } 61 | 62 | return wxView; 63 | } 64 | 65 | @Override 66 | public void putDebugOptions(String key, String value) { 67 | if (options == null) { 68 | options = new HashMap<>(); 69 | } 70 | options.put(key, value); 71 | } 72 | @Override 73 | public String getDebugOptions(String key) { 74 | if (options != null) { 75 | return options.get(key); 76 | } 77 | return null; 78 | } 79 | 80 | static class DebugActivityState implements IWXActivityStateListener { 81 | 82 | private View mWXView; 83 | 84 | public DebugActivityState(View wxView) { 85 | mWXView = wxView; 86 | } 87 | 88 | @Override 89 | public void onActivityCreate() { 90 | 91 | } 92 | 93 | @Override 94 | public void onActivityStart() { 95 | 96 | } 97 | 98 | @Override 99 | public void onActivityPause() { 100 | try { 101 | Class cls = Class.forName("com.taobao.weex.WXDebugTool"); 102 | Method m = cls.getMethod("updateScapleView", new Class[]{Object.class}); 103 | m.invoke(null, new Object[]{}); 104 | } catch (Exception e){ 105 | } 106 | } 107 | 108 | @Override 109 | public void onActivityResume() { 110 | if (mWXView != null && mWXView.getParent()!=null && mWXView.getParent().getClass().getName().equals("com.taobao.weex.scalpel.ScalpelFrameLayout")) { 111 | try { 112 | Class cls = Class.forName("com.taobao.weex.WXDebugTool"); 113 | Method m = cls.getMethod("updateScapleView", new Class[]{Object.class}); 114 | m.invoke(null, new Object[]{mWXView.getParent()}); 115 | } catch (Exception e) { 116 | e.printStackTrace(); 117 | } 118 | } 119 | } 120 | 121 | @Override 122 | public void onActivityStop() { 123 | 124 | } 125 | 126 | @Override 127 | public void onActivityDestroy() { 128 | 129 | } 130 | 131 | @Override 132 | public boolean onActivityBack() { 133 | return false; 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/adapter/WXOkHttpAdapter.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.adapter; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import com.taobao.weex.adapter.IWXHttpAdapter; 6 | import com.taobao.weex.common.WXRequest; 7 | import com.taobao.weex.common.WXResponse; 8 | import com.test.www.myapplication.network.HttpConnector; 9 | 10 | import java.io.IOException; 11 | 12 | import okhttp3.Call; 13 | import okhttp3.Callback; 14 | import okhttp3.MediaType; 15 | import okhttp3.Request; 16 | import okhttp3.RequestBody; 17 | import okhttp3.Response; 18 | 19 | /** 20 | * weex 网络接口处理 21 | * Created by alexwangweiqi on 16/12/21. 22 | */ 23 | public class WXOkHttpAdapter implements IWXHttpAdapter { 24 | 25 | private static final String METHOD_GET = "GET"; 26 | private static final String METHOD_POST = "POST"; 27 | 28 | private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); 29 | 30 | public static final int REQUEST_FAILURE = -100; 31 | 32 | @Override 33 | public void sendRequest(@NonNull final WXRequest request, final OnHttpListener listener) { 34 | if (listener != null) { 35 | listener.onHttpStart(); 36 | } 37 | 38 | if (METHOD_GET.equalsIgnoreCase(request.method)) { 39 | Request.Builder builder = new Request.Builder().url(request.url); 40 | Request okHttpRequest = builder.build(); 41 | HttpConnector.getHttpClient().newCall(okHttpRequest).enqueue(new Callback() { 42 | @Override 43 | public void onFailure(Call call, IOException e) { 44 | if (listener != null) { 45 | WXResponse wxResponse = new WXResponse(); 46 | wxResponse.errorCode = String.valueOf(REQUEST_FAILURE); 47 | wxResponse.statusCode = String.valueOf(REQUEST_FAILURE); 48 | wxResponse.errorMsg = e.getMessage(); 49 | 50 | listener.onHttpFinish(wxResponse); 51 | } 52 | } 53 | 54 | @Override 55 | public void onResponse(Call call, Response response) throws IOException { 56 | if (listener != null) { 57 | 58 | WXResponse wxResponse = new WXResponse(); 59 | wxResponse.statusCode = String.valueOf(response.code()); 60 | if (requestSuccess(Integer.parseInt(wxResponse.statusCode))) { 61 | wxResponse.originalData = response.body() != null ? response.body() 62 | .bytes() : null; 63 | } else { 64 | wxResponse.errorCode = String.valueOf(response.code()); 65 | wxResponse.errorMsg = response.body() != null ? response.body() 66 | .string() : null; 67 | } 68 | 69 | listener.onHttpFinish(wxResponse); 70 | } 71 | } 72 | }); 73 | } else if (METHOD_POST.equalsIgnoreCase(request.method)) { 74 | Request okHttpRequest = new Request.Builder() 75 | .url(request.url) 76 | .post(RequestBody.create(JSON, request.body)) 77 | .build(); 78 | 79 | HttpConnector.getHttpClient().newCall(okHttpRequest).enqueue(new Callback() { 80 | @Override 81 | public void onFailure(Call call, IOException e) { 82 | if (listener != null) { 83 | WXResponse wxResponse = new WXResponse(); 84 | wxResponse.errorCode = String.valueOf(REQUEST_FAILURE); 85 | wxResponse.statusCode = String.valueOf(REQUEST_FAILURE); 86 | wxResponse.errorMsg = e.getMessage(); 87 | 88 | listener.onHttpFinish(wxResponse); 89 | } 90 | } 91 | 92 | @Override 93 | public void onResponse(Call call, Response response) throws IOException { 94 | if (listener != null) { 95 | 96 | WXResponse wxResponse = new WXResponse(); 97 | wxResponse.statusCode = String.valueOf(response.code()); 98 | if (requestSuccess(Integer.parseInt(wxResponse.statusCode))) { 99 | wxResponse.originalData = response.body() != null ? response.body() 100 | .bytes() : null; 101 | } else { 102 | wxResponse.errorCode = String.valueOf(response.code()); 103 | wxResponse.errorMsg = response.body() != null ? response.body() 104 | .string() : null; 105 | } 106 | 107 | listener.onHttpFinish(wxResponse); 108 | } 109 | } 110 | }); 111 | } 112 | } 113 | 114 | private boolean requestSuccess(int statusCode) { 115 | return statusCode >= 200 && statusCode <= 299; 116 | } 117 | } -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/component/RichTextview.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.component; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.text.SpannableString; 6 | import android.text.Spanned; 7 | import android.text.method.LinkMovementMethod; 8 | import android.text.style.URLSpan; 9 | import android.widget.TextView; 10 | 11 | import com.taobao.weex.WXSDKInstance; 12 | import com.taobao.weex.dom.WXDomObject; 13 | import com.taobao.weex.ui.component.WXComponent; 14 | import com.taobao.weex.ui.component.WXComponentProp; 15 | import com.taobao.weex.ui.component.WXVContainer; 16 | 17 | /** 18 | * 自定义 富文本 19 | * Created by alexwangweiqi on 16/11/15. 20 | */ 21 | public class RichTextview extends WXComponent { 22 | 23 | public RichTextview(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, boolean isLazy) { 24 | super(instance, dom, parent, isLazy); 25 | } 26 | 27 | @Override 28 | protected TextView initComponentHostView(@NonNull Context context) { 29 | TextView view = new TextView(context); 30 | 31 | view.setMovementMethod(LinkMovementMethod.getInstance()); 32 | return view; 33 | } 34 | 35 | @WXComponentProp(name = "tel") 36 | public void setTelLink(String tel){ 37 | SpannableString spannable=new SpannableString(tel); 38 | spannable.setSpan(new URLSpan("tel:"+tel),0,tel.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 39 | ((TextView)getHostView()).setText(spannable); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/component/WXNewSlider.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.component; 2 | 3 | import com.taobao.weex.WXSDKInstance; 4 | import com.taobao.weex.dom.WXDomObject; 5 | import com.taobao.weex.ui.component.WXSlider; 6 | import com.taobao.weex.ui.component.WXVContainer; 7 | 8 | /** 9 | * Created by alexwangweiqi on 16/12/7. 10 | */ 11 | public class WXNewSlider extends WXSlider { 12 | 13 | @Deprecated 14 | public WXNewSlider(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId) { 15 | this(instance, dom, parent); 16 | } 17 | 18 | public WXNewSlider(WXSDKInstance instance, WXDomObject node, WXVContainer parent) { 19 | super(instance, node, parent); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/component/view/WXSwipeRefreshView.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.component.view; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.v4.widget.SwipeRefreshLayout; 6 | import android.view.ViewGroup; 7 | import android.widget.ScrollView; 8 | 9 | import com.taobao.weex.WXSDKInstance; 10 | import com.taobao.weex.common.Constants; 11 | import com.taobao.weex.dom.WXDomObject; 12 | import com.taobao.weex.ui.component.WXComponentProp; 13 | import com.taobao.weex.ui.component.WXVContainer; 14 | import com.test.www.myapplication.R; 15 | import com.test.www.myapplication.event.WXRefreshEvent; 16 | 17 | import de.greenrobot.event.EventBus; 18 | 19 | 20 | /** 21 | * Created by cxy on 2016/12/16. 22 | */ 23 | public class WXSwipeRefreshView extends WXVContainer { 24 | 25 | private SwipeRefreshLayout mSwipeRefreshLayout; 26 | private ScrollView mScrollView; 27 | 28 | private String eventName; 29 | 30 | 31 | public WXSwipeRefreshView(WXSDKInstance instance, WXDomObject node, WXVContainer parent, boolean lazy) { 32 | super(instance, node, parent, lazy); 33 | } 34 | 35 | @Override 36 | protected SwipeRefreshLayout initComponentHostView(@NonNull Context context) { 37 | mSwipeRefreshLayout = new SwipeRefreshLayout(context); 38 | mSwipeRefreshLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 39 | ViewGroup.LayoutParams.MATCH_PARENT)); 40 | mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent); 41 | mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { 42 | @Override 43 | public void onRefresh() { 44 | EventBus.getDefault().post(new WXRefreshEvent() 45 | .type(WXRefreshEvent.TYPE.PAY_REFRESH) 46 | .success() 47 | .data(eventName)); 48 | } 49 | }); 50 | 51 | // mScrollView = new ScrollView(context); 52 | // mScrollView .setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 53 | // ViewGroup.LayoutParams.MATCH_PARENT)); 54 | // 55 | // mSwipeRefreshLayout.addView(mScrollView); 56 | 57 | return mSwipeRefreshLayout; 58 | } 59 | 60 | @WXComponentProp(name = Constants.Name.COLOR) 61 | public void setColor(String color) { 62 | 63 | switch (color) { 64 | case "blue": 65 | mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent); 66 | break; 67 | case "black": 68 | mSwipeRefreshLayout.setColorSchemeResources(R.color.black); 69 | default: 70 | if (color.contains("#")) { 71 | String colorStr = color.substring(color.indexOf("#")); 72 | int colorHex; 73 | try { 74 | colorHex = Integer.parseInt(colorStr, 16); 75 | mSwipeRefreshLayout.setColorSchemeColors(colorHex); 76 | } catch (NumberFormatException e) { 77 | e.printStackTrace(); 78 | } 79 | } 80 | } 81 | } 82 | 83 | @WXComponentProp(name = "eventname") 84 | public void setEventName(String name) { 85 | eventName = name; 86 | } 87 | 88 | @WXComponentProp(name = "refreshing") 89 | public void setRefreshing(String isRefreshing) { 90 | // LogUtil.d("WXSwipe", "refreshing " + isRefreshing); 91 | switch (isRefreshing){ 92 | case "true": 93 | mSwipeRefreshLayout.setRefreshing(true); 94 | break; 95 | case "false": 96 | mSwipeRefreshLayout.setRefreshing(false); 97 | break; 98 | default: 99 | mSwipeRefreshLayout.setRefreshing(false); 100 | } 101 | 102 | } 103 | 104 | 105 | } 106 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/event/WXRefreshEvent.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.event; 2 | 3 | 4 | import com.test.www.myapplication.network.BaseNetworkEvent; 5 | 6 | /** 7 | * Created by cxy on 2016/12/16. 8 | */ 9 | public class WXRefreshEvent extends BaseNetworkEvent { 10 | 11 | public static class TYPE { 12 | public static final int PAY_REFRESH = 0; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/manager/WeexConfigManager.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.manager; 2 | 3 | import android.app.Application; 4 | 5 | import com.taobao.weex.InitConfig; 6 | import com.taobao.weex.WXSDKEngine; 7 | import com.taobao.weex.common.WXException; 8 | import com.test.www.myapplication.adapter.FrescoImageAdapter; 9 | import com.test.www.myapplication.adapter.PlayDebugAdapter; 10 | import com.test.www.myapplication.adapter.WXOkHttpAdapter; 11 | import com.test.www.myapplication.component.WXNewSlider; 12 | import com.test.www.myapplication.component.view.WXSwipeRefreshView; 13 | import com.test.www.myapplication.module.impl.WXEventModule; 14 | 15 | /** 16 | * weex 管理类 17 | * Created by alexwangweiqi on 16/11/28. 18 | */ 19 | public class WeexConfigManager { 20 | 21 | 22 | public static void initSdk(boolean debug, Application context) { 23 | InitConfig weexConfig = new InitConfig.Builder() 24 | .setHttpAdapter(new WXOkHttpAdapter()) 25 | .setImgAdapter(new FrescoImageAdapter()) 26 | .setDebugAdapter(new PlayDebugAdapter()) 27 | .build(); 28 | WXSDKEngine.initialize(debug, context, weexConfig); 29 | try { 30 | WXSDKEngine.registerModule("event", WXEventModule.class); 31 | // WXSDKEngine.registerModule("payModule", WXPayModule.class); 32 | // WXSDKEngine.registerModule("utilModule", WXUtilModule.class); 33 | // WXSDKEngine.registerComponent("image", FrescoImageComponent.class); 34 | // WXSDKEngine.registerComponent("clickview", ClickView.class); 35 | WXSDKEngine.registerComponent("slider", WXNewSlider.class); 36 | // WXSDKEngine.registerComponent("loadingbutton", WXLoadingButton.class); 37 | // WXSDKEngine.registerComponent("progresswheel", WXProgressWheel.class); 38 | WXSDKEngine.registerComponent("swiperefresh", WXSwipeRefreshView.class); 39 | } catch (WXException e) { 40 | e.printStackTrace(); 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/module/IWXEventModule.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.module; 2 | 3 | import com.taobao.weex.bridge.JSCallback; 4 | 5 | /** 6 | * Created by alexwangweiqi on 16/11/15. 7 | */ 8 | public interface IWXEventModule { 9 | 10 | /** 11 | * 打开具体页面 12 | * 规则如下: 13 | * 1、使用emlive: 打开本地页面 14 | * 2、使用file:XXX 加载本地页面 15 | * @param url 16 | */ 17 | void openSpecifiedPage(String url); 18 | 19 | void openSpecifiedPage(String url, JSCallback callback); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/module/impl/WXEventModule.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.module.impl; 2 | 3 | import android.content.Intent; 4 | import android.text.TextUtils; 5 | 6 | import com.taobao.weex.annotation.JSMethod; 7 | import com.taobao.weex.bridge.JSCallback; 8 | import com.taobao.weex.common.WXModule; 9 | import com.test.www.myapplication.WeexConstants; 10 | import com.test.www.myapplication.module.IWXEventModule; 11 | import com.test.www.myapplication.view.PageActivity; 12 | 13 | import java.util.HashMap; 14 | import java.util.Map; 15 | 16 | 17 | /** 18 | * 交互接口类 19 | */ 20 | public class WXEventModule extends WXModule implements IWXEventModule { 21 | 22 | private static final String TAG = WXEventModule.class.getSimpleName(); 23 | private static final String WEEX_CATEGORY = "com.eastmoney.android.intent.category.WEEXFEED"; 24 | 25 | boolean isPhotoCrop; 26 | 27 | @JSMethod(uiThread = true) 28 | public void openSpecifiedPage(String url) { 29 | // LogUtil.d(TAG, "openSpecifiedPage url:" + url); 30 | openSpecifiedPage(url, null); 31 | } 32 | 33 | @JSMethod(uiThread = true) 34 | public void openSpecifiedPage(String url, JSCallback callback) { 35 | // LogUtil.d(TAG, "openSpecifiedPage callback url:" + url); 36 | int returnCode = WeexConstants.VALUE.FAILURE; 37 | if (!TextUtils.isEmpty(url)) { 38 | mWXSDKInstance.getContext().startActivity(new Intent(mWXSDKInstance.getContext(), 39 | PageActivity.class)); 40 | } 41 | callJsBack(callback, returnCode); 42 | } 43 | 44 | 45 | private void callJsBack(JSCallback callback, int code) { 46 | if (callback != null) { 47 | Map resp = new HashMap(); 48 | resp.put(WeexConstants.KEY.CODE, code); 49 | callback.invoke(resp); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/network/BaseNetworkEvent.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.network; 2 | 3 | /** 4 | * EventBus的基本事件定义,其他业务事件都继承该类进行拓展 5 | *

6 | * Created by fengshzh on 15/7/29. 7 | */ 8 | public class BaseNetworkEvent { 9 | 10 | // Socket请求和类Socket请求的三种结果状态:成功、异常和网络错误 11 | public static final int NETWORK_SUCCESS = 0; 12 | public static final int NETWORK_DATA_EXCEPTION = -1; 13 | public static final int NETWORK_ERROR = -2; 14 | public int status = NETWORK_ERROR; 15 | 16 | 17 | public int requestId; // 请求Id,全局唯一 18 | public int type; // 请求类型,见EventType 19 | 20 | public boolean success = false; // Http请求的两种结果状态:成功、失败,默认失败 21 | private boolean isCache = false; // 是否缓存数据 22 | public int code; // 网络请求返回码,对应网络请求里rc,网络请求不成功返回-1 23 | public String msg; // 返回消息,对应网络请求里me 24 | public Object data; // 返回数据 25 | public Object ext; // 扩展字段,若有多个扩展字段使用数组或者list 26 | 27 | public BaseNetworkEvent id(int id) { 28 | requestId = id; 29 | return this; 30 | } 31 | 32 | public BaseNetworkEvent type(int type) { 33 | this.type = type; 34 | return this; 35 | } 36 | 37 | public BaseNetworkEvent success() { 38 | success = true; 39 | return this; 40 | } 41 | 42 | public BaseNetworkEvent code(int code) { 43 | this.code = code; 44 | return this; 45 | } 46 | 47 | public BaseNetworkEvent msg(String msg) { 48 | this.msg = msg; 49 | return this; 50 | } 51 | 52 | public BaseNetworkEvent data(Object data) { 53 | this.data = data; 54 | return this; 55 | } 56 | 57 | public BaseNetworkEvent ext(Object ext) { 58 | this.ext = ext; 59 | return this; 60 | } 61 | 62 | public BaseNetworkEvent setCache(boolean isCache) { 63 | this.isCache = isCache; 64 | return this; 65 | } 66 | 67 | public boolean isCache() { 68 | return isCache; 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return success + ", " + requestId + ", " + type + ", " + code + ", " + msg + ", " + data + ", " + ext; 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/network/HttpConnector.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.network; 2 | 3 | import android.content.Context; 4 | 5 | import com.test.www.myapplication.ContextUtil; 6 | import com.test.www.myapplication.network.retrofit.ByteArrayConverterFactory; 7 | import com.test.www.myapplication.network.retrofit.StringConverterFactory; 8 | 9 | import okhttp3.Cache; 10 | import okhttp3.OkHttpClient; 11 | import retrofit2.Retrofit; 12 | import retrofit2.converter.gson.GsonConverterFactory; 13 | 14 | 15 | /** 16 | * HTTP网络连接器,初始化Context和创建网络栈 17 | *

18 | * Created by fengshzh on 15/7/29. 19 | */ 20 | public class HttpConnector { 21 | 22 | private static boolean sDebug; 23 | 24 | public static void initNetworkConnector(Context context, boolean debug) { 25 | // init FiDu, FiDu与Retrofit共用同一个OkHttp线程池 26 | sDebug = debug; 27 | } 28 | 29 | // 静态内部类实现单例 30 | public static class InstanceHolder { 31 | 32 | 33 | 34 | private static final OkHttpClient httpClient = new OkHttpClient.Builder() 35 | .cache(new Cache(ContextUtil.getContext().getCacheDir(), 10 * 1024 * 1024)) 36 | .build(); 37 | 38 | public static final Retrofit retrofit = new Retrofit.Builder() 39 | .baseUrl("http://eastmoney.com") 40 | .addConverterFactory(new StringConverterFactory()) 41 | .addConverterFactory(new ByteArrayConverterFactory()) 42 | .addConverterFactory(GsonConverterFactory.create()) 43 | .client(httpClient) 44 | .build(); 45 | 46 | } 47 | 48 | /** 49 | * 获取网络库使用的OkHttpClient 50 | */ 51 | public static OkHttpClient getHttpClient() { 52 | return InstanceHolder.httpClient; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/network/retrofit/ByteArrayConverterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.test.www.myapplication.network.retrofit; 17 | 18 | import java.io.IOException; 19 | import java.lang.annotation.Annotation; 20 | import java.lang.reflect.Type; 21 | 22 | import okhttp3.MediaType; 23 | import okhttp3.RequestBody; 24 | import okhttp3.ResponseBody; 25 | import retrofit2.Converter; 26 | import retrofit2.Retrofit; 27 | 28 | /** 29 | * Response body为byte[]时用 30 | */ 31 | public class ByteArrayConverterFactory extends Converter.Factory { 32 | static final MediaType MEDIA_TYPE = MediaType.parse("text/plain"); 33 | 34 | @Override 35 | public Converter responseBodyConverter(Type type, Annotation[] annotations, 36 | Retrofit retrofit) { 37 | if ("byte[]".equals(type.toString())) { 38 | return new Converter() { 39 | @Override 40 | public byte[] convert(ResponseBody value) throws IOException { 41 | return value.source().readByteArray(); 42 | } 43 | }; 44 | } 45 | return null; 46 | } 47 | 48 | @Override 49 | public Converter requestBodyConverter(Type type, 50 | Annotation[] parameterAnnotations, 51 | Annotation[] methodAnnotations, 52 | Retrofit retrofit) { 53 | if ("byte[]".equals(type.toString())) { 54 | return new Converter() { 55 | @Override 56 | public RequestBody convert(byte[] value) throws IOException { 57 | return RequestBody.create(MEDIA_TYPE, value); 58 | } 59 | }; 60 | } 61 | return null; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/network/retrofit/StringConverterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.test.www.myapplication.network.retrofit; 17 | 18 | import java.io.IOException; 19 | import java.lang.annotation.Annotation; 20 | import java.lang.reflect.Type; 21 | 22 | import okhttp3.MediaType; 23 | import okhttp3.RequestBody; 24 | import okhttp3.ResponseBody; 25 | import retrofit2.Converter; 26 | import retrofit2.Retrofit; 27 | 28 | /** 29 | * POST Body为raw string时用 30 | */ 31 | public class StringConverterFactory extends Converter.Factory { 32 | static final MediaType MEDIA_TYPE = MediaType.parse("text/plain"); 33 | 34 | @Override 35 | public Converter responseBodyConverter(Type type, Annotation[] annotations, 36 | Retrofit retrofit) { 37 | if (String.class.equals(type)) { 38 | return new Converter() { 39 | @Override 40 | public String convert(ResponseBody value) throws IOException { 41 | return value.string(); 42 | } 43 | }; 44 | } 45 | return null; 46 | } 47 | 48 | @Override 49 | public Converter requestBodyConverter(Type type, 50 | Annotation[] parameterAnnotations, 51 | Annotation[] methodAnnotations, 52 | Retrofit retrofit) { 53 | if (String.class.equals(type)) { 54 | return new Converter() { 55 | @Override 56 | public RequestBody convert(String value) throws IOException { 57 | return RequestBody.create(MEDIA_TYPE, value); 58 | } 59 | }; 60 | } 61 | return null; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/util/WeexFileUtil.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.util; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.text.TextUtils; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.File; 9 | import java.io.FileReader; 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | import java.io.InputStreamReader; 13 | 14 | /** 15 | * 文件处理 16 | * Created by alexwangweiqi on 16/11/29. 17 | */ 18 | public class WeexFileUtil { 19 | private static final String TAG = WeexFileUtil.class.getSimpleName(); 20 | 21 | public static String loadWeexJs(String path, Context context) { 22 | if (TextUtils.isEmpty(path) || context == null) { 23 | return null; 24 | } 25 | if (path.startsWith("assets/dist/")) { 26 | return loadAsset(path, context); 27 | } else { 28 | return loadSdCard(path); 29 | } 30 | } 31 | 32 | /** 33 | * 读取sd卡文件 34 | * 35 | * @param filePath 36 | * @return 37 | */ 38 | private static String loadSdCard(String filePath) { 39 | // LogUtil.d(TAG, "loadSdCard:" + filePath); 40 | 41 | StringBuilder builder; 42 | BufferedReader bufferedReader = null; 43 | 44 | try { 45 | builder = new StringBuilder(); 46 | 47 | File file = new File(filePath); 48 | bufferedReader = new BufferedReader(new FileReader(file)); 49 | char[] data = new char[2048]; 50 | int len = -1; 51 | while ((len = bufferedReader.read(data)) > 0) { 52 | builder.append(data, 0, len); 53 | } 54 | return builder.toString(); 55 | } catch (IOException e) { 56 | e.printStackTrace(); 57 | } finally { 58 | try { 59 | if (bufferedReader != null) { 60 | bufferedReader.close(); 61 | } 62 | } catch (IOException e) { 63 | e.printStackTrace(); 64 | } 65 | } 66 | 67 | return ""; 68 | } 69 | 70 | /** 71 | * 读取assets文件 72 | * 73 | * @param filePath 74 | * @param context 75 | * @return 76 | */ 77 | private static String loadAsset(String filePath, Context context) { 78 | // LogUtil.d(TAG, "loadAsset:" + filePath); 79 | 80 | StringBuilder builder; 81 | InputStream in = null; 82 | BufferedReader bufferedReader = null; 83 | try { 84 | in = context.getClassLoader().getResourceAsStream(filePath); 85 | builder = new StringBuilder(in.available() + 10); 86 | 87 | bufferedReader = new BufferedReader(new InputStreamReader(in, "UTF-8")); 88 | char[] data = new char[2048]; 89 | int len = -1; 90 | while ((len = bufferedReader.read(data)) > 0) { 91 | builder.append(data, 0, len); 92 | } 93 | return builder.toString(); 94 | } catch (IOException e) { 95 | e.printStackTrace(); 96 | } finally { 97 | try { 98 | if (bufferedReader != null) { 99 | bufferedReader.close(); 100 | } 101 | if (in != null) { 102 | in.close(); 103 | } 104 | } catch (IOException e) { 105 | e.printStackTrace(); 106 | } 107 | } 108 | return ""; 109 | } 110 | 111 | public static void deleteFile(File file) { 112 | if (file.isFile()) { 113 | file.delete(); 114 | return; 115 | } 116 | if (file.isDirectory()) { 117 | File[] childFile = file.listFiles(); 118 | if (childFile == null || childFile.length == 0) { 119 | file.delete(); 120 | return; 121 | } 122 | for (File f : childFile) { 123 | deleteFile(f); 124 | } 125 | file.delete(); 126 | } 127 | } 128 | 129 | /** 130 | * 判断文件或目录是否存在. 131 | * 132 | * @param filePath 路径 133 | * @return true - 存在,false - 不存在 134 | */ 135 | public static boolean isExist(@NonNull String filePath) { 136 | if (filePath.startsWith("assets/dist/")) { 137 | return true; 138 | } else { 139 | File file = new File(filePath); 140 | return file.exists(); 141 | } 142 | } 143 | 144 | /** 145 | * 判断地址是否为assets 146 | * 147 | * @param filePath 路径 148 | */ 149 | public static boolean isAssets(@NonNull String filePath) { 150 | if (filePath != null && filePath.startsWith("assets")) { 151 | return true; 152 | } else { 153 | return false; 154 | } 155 | } 156 | 157 | /** 158 | * 判断地址是否为http https 159 | * 160 | * @param filePath 路径 161 | */ 162 | public static boolean isHttp(@NonNull String filePath) { 163 | if (filePath != null && (filePath.startsWith("https") || filePath.startsWith("http"))) { 164 | return true; 165 | } else { 166 | return false; 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/view/FirstActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.view; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.widget.Button; 8 | 9 | import com.test.www.myapplication.R; 10 | import com.test.www.myapplication.manager.WeexConfigManager; 11 | 12 | public class FirstActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_first); 18 | ((Button) findViewById(R.id.btn_next)).setOnClickListener(new View.OnClickListener() { 19 | @Override 20 | public void onClick(View v) { 21 | WeexConfigManager.initSdk(true, FirstActivity.this.getApplication()); 22 | FirstActivity.this.startActivity(new Intent(FirstActivity.this, MainActivity 23 | .class)); 24 | } 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/view/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.view; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.FrameLayout; 7 | import android.widget.ProgressBar; 8 | 9 | import com.taobao.weex.WXSDKInstance; 10 | import com.test.www.myapplication.R; 11 | import com.test.www.myapplication.view.base.WXBaseActivity; 12 | 13 | public class MainActivity extends WXBaseActivity { 14 | 15 | private static final String TAG = MainActivity.class.getSimpleName(); 16 | private static final String JS_PATH = "assets/dist/home/home-live.js"; 17 | 18 | private FrameLayout mContainer; 19 | private ProgressBar mProgressBar; 20 | private View mWAView; 21 | 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_main); 27 | findView(); 28 | } 29 | 30 | @Override 31 | protected String getPageName() { 32 | return TAG; 33 | } 34 | 35 | @Override 36 | protected String getAssembleFilePath() { 37 | return JS_PATH; 38 | } 39 | 40 | @Override 41 | protected void refreshWithJsFile(String filePath) { 42 | 43 | } 44 | 45 | @Override 46 | protected ViewGroup getContainerLayout() { 47 | return mContainer; 48 | } 49 | 50 | @Override 51 | public void onViewCreated(WXSDKInstance instance, View view) { 52 | // LogUtil.i(TAG, "weex onViewCreated"); 53 | if (mWAView != null && mContainer != null && mWAView.getParent() == mContainer) { 54 | mContainer.removeView(mWAView); 55 | } 56 | 57 | if (mContainer != null) { 58 | mWAView = view; 59 | mContainer.removeAllViews(); 60 | mContainer.addView(view); 61 | mContainer.requestLayout(); 62 | // LogUtil.i(TAG, "weex renderSuccess"); 63 | } 64 | } 65 | 66 | @Override 67 | public void onRenderSuccess(WXSDKInstance instance, int width, int height) { 68 | mProgressBar.setVisibility(View.INVISIBLE); 69 | } 70 | 71 | @Override 72 | public void onRefreshSuccess(WXSDKInstance instance, int width, int height) { 73 | mProgressBar.setVisibility(View.GONE); 74 | } 75 | 76 | @Override 77 | public void onException(WXSDKInstance instance, String errCode, 78 | String msg) { 79 | super.onException(instance, errCode, msg); 80 | mProgressBar.setVisibility(View.GONE); 81 | } 82 | 83 | // @Override 84 | // protected Map getPageParams() { 85 | // Map params = new HashMap<>(); 86 | // params.put(WeexConstants.KEY.INDEX, 0); 87 | // 88 | // return params; 89 | // } 90 | 91 | public void findView() { 92 | mContainer = (FrameLayout) findViewById(R.id.container); 93 | mProgressBar = (ProgressBar) findViewById(R.id.progress); 94 | 95 | setView(); 96 | } 97 | 98 | private void setView() { 99 | setViewGlobalLayoutListener(mContainer); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/com/test/www/myapplication/view/PageActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.www.myapplication.view; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | import com.test.www.myapplication.R; 7 | 8 | public class PageActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_page); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/activity_first.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 18 | 19 |