├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README-ch.md
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── tmall
│ │ └── wireless
│ │ └── virtualviewdemo
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── component_demo
│ │ │ ├── click_script.xml
│ │ │ ├── frame_style.json
│ │ │ ├── framelayout.xml
│ │ │ ├── grid.xml
│ │ │ ├── grid_item.json
│ │ │ ├── grid_item.xml
│ │ │ ├── gridlayout.xml
│ │ │ ├── nframelayout.xml
│ │ │ ├── ngridlayout.xml
│ │ │ ├── nimage.xml
│ │ │ ├── nline.xml
│ │ │ ├── nratiolayout.xml
│ │ │ ├── ntext.xml
│ │ │ ├── ntext_style.json
│ │ │ ├── nvh2layout.xml
│ │ │ ├── nvhlayout.xml
│ │ │ ├── page.xml
│ │ │ ├── page_item.json
│ │ │ ├── page_item.xml
│ │ │ ├── page_script.xml
│ │ │ ├── picasso.json
│ │ │ ├── progress.xml
│ │ │ ├── ratiolayout.xml
│ │ │ ├── scroll_h.xml
│ │ │ ├── scroll_vl.xml
│ │ │ ├── scroll_vs.xml
│ │ │ ├── slider.xml
│ │ │ ├── slider_item.json
│ │ │ ├── slider_item.xml
│ │ │ ├── tmall_component_1.json
│ │ │ ├── tmall_component_1.xml
│ │ │ ├── tmall_component_2.json
│ │ │ ├── tmall_component_2.xml
│ │ │ ├── tmall_component_3.json
│ │ │ ├── tmall_component_3.xml
│ │ │ ├── tmall_component_4.json
│ │ │ ├── tmall_component_4.xml
│ │ │ ├── tmall_component_5.json
│ │ │ ├── tmall_component_5.xml
│ │ │ ├── tmall_component_6.json
│ │ │ ├── tmall_component_6.xml
│ │ │ ├── tmall_component_7.json
│ │ │ ├── tmall_component_7.xml
│ │ │ ├── tmall_component_8.json
│ │ │ ├── tmall_component_8.xml
│ │ │ ├── total_container.json
│ │ │ ├── totalcontainer.xml
│ │ │ ├── vgraph.xml
│ │ │ ├── vh.xml
│ │ │ ├── vh2layout.xml
│ │ │ ├── vh_item.json
│ │ │ ├── vhlayout.xml
│ │ │ ├── vimage.xml
│ │ │ ├── virtualview.json
│ │ │ ├── virtualview.xml
│ │ │ ├── vline.xml
│ │ │ └── vtext.xml
│ │ └── config.properties
│ ├── java
│ │ └── com
│ │ │ └── tmall
│ │ │ └── wireless
│ │ │ └── virtualviewdemo
│ │ │ ├── ComponentActivity.java
│ │ │ ├── ComponentListActivity.java
│ │ │ ├── DemoListActivity.java
│ │ │ ├── LocalPreviewActivity.java
│ │ │ ├── ParserDemoActivity.java
│ │ │ ├── ScriptListActivity.java
│ │ │ ├── ScrollerListActivity.java
│ │ │ ├── TmallComponentListActivity.java
│ │ │ ├── ViewServer.java
│ │ │ ├── VirtualViewApplication.java
│ │ │ ├── bytes
│ │ │ ├── CLICKSCRIPT.java
│ │ │ ├── FRAMELAYOUT.java
│ │ │ ├── GRID.java
│ │ │ ├── GRIDITEM.java
│ │ │ ├── GRIDLAYOUT.java
│ │ │ ├── NFRAMELAYOUT.java
│ │ │ ├── NGRIDLAYOUT.java
│ │ │ ├── NIMAGE.java
│ │ │ ├── NLINE.java
│ │ │ ├── NRATIOLAYOUT.java
│ │ │ ├── NTEXT.java
│ │ │ ├── NVH2LAYOUT.java
│ │ │ ├── NVHLAYOUT.java
│ │ │ ├── PAGE.java
│ │ │ ├── PAGEITEM.java
│ │ │ ├── PAGESCROLLSCRIPT.java
│ │ │ ├── PICASSO.java
│ │ │ ├── PROGRESS.java
│ │ │ ├── RATIOLAYOUT.java
│ │ │ ├── SCROLLERH.java
│ │ │ ├── SCROLLERVL.java
│ │ │ ├── SCROLLERVS.java
│ │ │ ├── SLIDER.java
│ │ │ ├── SLIDERITEM.java
│ │ │ ├── TMALLCOMPONENT1.java
│ │ │ ├── TMALLCOMPONENT2.java
│ │ │ ├── TMALLCOMPONENT3.java
│ │ │ ├── TMALLCOMPONENT4.java
│ │ │ ├── TMALLCOMPONENT5.java
│ │ │ ├── TMALLCOMPONENT6.java
│ │ │ ├── TMALLCOMPONENT7.java
│ │ │ ├── TMALLCOMPONENT8.java
│ │ │ ├── TOTALCONTAINER.java
│ │ │ ├── VGRAPH.java
│ │ │ ├── VH.java
│ │ │ ├── VH2LAYOUT.java
│ │ │ ├── VHLAYOUT.java
│ │ │ ├── VIMAGE.java
│ │ │ ├── VLINE.java
│ │ │ └── VTEXT.java
│ │ │ ├── custom
│ │ │ ├── ClickProcessorImpl.java
│ │ │ ├── CustomParser.java
│ │ │ ├── CustomView.java
│ │ │ ├── ExposureProcessorImpl.java
│ │ │ ├── IViewInterface.java
│ │ │ ├── PicassoImage.java
│ │ │ ├── PicassoImageView.java
│ │ │ ├── TMReminderTagsView.java
│ │ │ └── TotalContainer.java
│ │ │ ├── page
│ │ │ ├── Page.java
│ │ │ └── PageManager.java
│ │ │ ├── preview
│ │ │ ├── PreviewActivity.java
│ │ │ ├── PreviewData.java
│ │ │ ├── PreviewListActivity.java
│ │ │ └── util
│ │ │ │ └── HttpUtil.java
│ │ │ └── vs
│ │ │ ├── Context.java
│ │ │ ├── Module.java
│ │ │ ├── StringSupportImp.java
│ │ │ └── VSEngine.java
│ └── res
│ │ ├── anim
│ │ └── anim.xml
│ │ ├── drawable-xhdpi
│ │ ├── tm_homepage_goumai.png
│ │ └── tm_homepage_shopping_cart.png
│ │ ├── drawable
│ │ ├── a1.png
│ │ ├── a2.png
│ │ ├── arrow.png
│ │ ├── icon1.jpg
│ │ ├── icon2.jpg
│ │ ├── icon3.jpg
│ │ ├── icon4.jpg
│ │ ├── icon5.jpg
│ │ ├── icon6.jpg
│ │ ├── image1.png
│ │ ├── image2.png
│ │ ├── r1.png
│ │ ├── r2.png
│ │ ├── r3.png
│ │ ├── rr.png
│ │ ├── rs.png
│ │ ├── t9.png
│ │ └── ta.png
│ │ ├── layout
│ │ ├── activity.xml
│ │ ├── activity_component.xml
│ │ ├── activity_main.xml
│ │ ├── activity_parse_xml.xml
│ │ └── activity_preview.xml
│ │ ├── menu
│ │ └── menu_preview.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── tm_biz_tangram_calendar.png
│ │ ├── tm_homepage_goumai.png
│ │ └── tm_homepage_shopping_cart.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── tmall
│ └── wireless
│ └── virtualviewdemo
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── jcenterDeploy.gradle
├── jcenterInstall.gradle
├── settings.gradle
└── virtualview
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── tmall
│ └── wireless
│ └── virtualview
│ └── ApplicationTest.java
├── main
├── AndroidManifest.xml
└── java
│ └── com
│ └── tmall
│ └── wireless
│ └── vaf
│ ├── expr
│ └── engine
│ │ ├── CodeReader.java
│ │ ├── DataManager.java
│ │ ├── EngineContext.java
│ │ ├── ExprEngine.java
│ │ ├── NativeObjectManager.java
│ │ ├── RegisterManager.java
│ │ ├── data
│ │ ├── Data.java
│ │ ├── FloatValue.java
│ │ ├── IntValue.java
│ │ ├── ObjValue.java
│ │ ├── StrValue.java
│ │ ├── Value.java
│ │ └── ValueCache.java
│ │ ├── executor
│ │ ├── AddEqExecutor.java
│ │ ├── AddExecutor.java
│ │ ├── AndExecutor.java
│ │ ├── ArithExecutor.java
│ │ ├── ArrayExecutor.java
│ │ ├── BinExecutor.java
│ │ ├── CompositeEqExecutor.java
│ │ ├── DivEqExecutor.java
│ │ ├── DivExecutor.java
│ │ ├── EqEqExecutor.java
│ │ ├── EqualExecutor.java
│ │ ├── Executor.java
│ │ ├── FunExecutor.java
│ │ ├── GEExecutor.java
│ │ ├── GTExecutor.java
│ │ ├── JmpExecutor.java
│ │ ├── JmpcExecutor.java
│ │ ├── LEExecutor.java
│ │ ├── LTExecutor.java
│ │ ├── MinusExecutor.java
│ │ ├── ModEqExecutor.java
│ │ ├── ModExecutor.java
│ │ ├── MulEqExecutor.java
│ │ ├── MulExecutor.java
│ │ ├── NotEqExecutor.java
│ │ ├── NotExecutor.java
│ │ ├── OrExecutor.java
│ │ ├── SubEqExecutor.java
│ │ ├── SubExecutor.java
│ │ └── TerExecutor.java
│ │ └── finder
│ │ ├── ObjectFinder.java
│ │ └── ObjectFinderManager.java
│ ├── framework
│ ├── UserData.java
│ ├── VafContext.java
│ ├── ViewManager.java
│ └── cm
│ │ ├── ComContainerTypeMap.java
│ │ ├── ContainerMrg.java
│ │ ├── ContainerService.java
│ │ └── NormalManager.java
│ └── virtualview
│ ├── Helper
│ ├── BeanManager.java
│ ├── DataOpt.java
│ ├── ImageLoader.java
│ ├── NativeViewManager.java
│ ├── RtlHelper.java
│ ├── ServiceManager.java
│ ├── VVFeatureConfig.java
│ ├── VerificationUtil.java
│ └── VirtualViewUtils.java
│ ├── ViewFactory.java
│ ├── container
│ ├── ClickHelper.java
│ └── Container.java
│ ├── core
│ ├── Adapter.java
│ ├── ArrayAdapter.java
│ ├── IBean.java
│ ├── IContainer.java
│ ├── IView.java
│ ├── Layout.java
│ ├── NativeViewBase.java
│ ├── ViewBase.java
│ ├── ViewCache.java
│ └── VirtualViewBase.java
│ ├── event
│ ├── ClickProcessorManager.java
│ ├── EventData.java
│ ├── EventManager.java
│ ├── IClickProcessor.java
│ └── IEventProcessor.java
│ ├── layout
│ ├── FlexLayout.java
│ ├── FlexLine.java
│ ├── FrameLayout.java
│ ├── GridLayout.java
│ ├── RatioLayout.java
│ ├── VH2Layout.java
│ └── VHLayout.java
│ ├── listener
│ └── MonitorListener.java
│ ├── loader
│ ├── BinaryLoader.java
│ ├── CodeReader.java
│ ├── ExprCodeLoader.java
│ ├── StringLoader.java
│ └── UiCodeLoader.java
│ └── view
│ ├── VirtualContainer.java
│ ├── VirtualGraph.java
│ ├── VirtualTime.java
│ ├── grid
│ ├── Grid.java
│ ├── GridImp.java
│ └── GridView.java
│ ├── image
│ ├── ImageBase.java
│ ├── NativeImage.java
│ ├── NativeImageImp.java
│ └── VirtualImage.java
│ ├── line
│ ├── LineBase.java
│ ├── NativeLine.java
│ ├── NativeLineImp.java
│ └── VirtualLine.java
│ ├── nlayout
│ ├── INativeLayout.java
│ ├── INativeLayoutImpl.java
│ ├── NFrameLayout.java
│ ├── NGridLayout.java
│ ├── NRatioLayout.java
│ ├── NVH2Layout.java
│ ├── NVHLayout.java
│ └── NativeLayoutImpl.java
│ ├── page
│ ├── Page.java
│ ├── PageImp.java
│ └── PageView.java
│ ├── progress
│ └── VirtualProgress.java
│ ├── scroller
│ ├── Scroller.java
│ ├── ScrollerImp.java
│ ├── ScrollerRecyclerViewAdapter.java
│ └── ScrollerStickyParent.java
│ ├── slider
│ ├── Slider.java
│ ├── SliderCompact.java
│ ├── SliderCompactImp.java
│ └── SliderView.java
│ ├── text
│ ├── NativeText.java
│ ├── NativeTextImp.java
│ ├── TextBase.java
│ └── VirtualText.java
│ └── vh
│ ├── VH.java
│ ├── VHImp.java
│ └── VHView.java
└── test
└── java
└── com
└── tmall
└── wireless
└── virtualview
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | native-libs/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 | #gradle/
20 | #gradlew
21 | #gradlew.bat
22 |
23 | # Local configuration file (sdk path, etc)
24 | local.properties
25 | .classpath
26 | .project
27 | .settings/
28 |
29 | # Proguard folder generated by Eclipse
30 | proguard/
31 |
32 | #Log Files
33 | *.log
34 |
35 | # OS X
36 | .DS_Store
37 |
38 | *.class
39 |
40 | # Mobile Tools for Java (J2ME)
41 | .mtj.tmp/
42 |
43 | # Package Files #
44 | *.war
45 | *.ear
46 | *.iml
47 |
48 | # IDEA Files
49 | .idea/
50 | .settings/
51 | out/
52 |
53 | # MAVEN COMPILE Files
54 | target/
55 |
56 | project.properties
57 |
58 | dependencies.gradle
59 | #dependencies_login.gradle
60 |
61 | captures/
62 |
63 | #jcenterDeploy.gradle
64 | #jcenterInstall.gradle
65 | deploy.gradle
66 |
67 | freeline.py
68 | freeline_project_description.json
69 | freeline
70 |
71 | build.sh
72 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Alibaba Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/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/gujicheng/Workspace/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 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/tmall/wireless/virtualviewdemo/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo;
26 |
27 | import android.app.Application;
28 | import android.test.ApplicationTestCase;
29 |
30 | /**
31 | * Testing Fundamentals
32 | */
33 | public class ApplicationTest extends ApplicationTestCase {
34 | public ApplicationTest() {
35 | super(Application.class);
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/frame_style.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": {
3 | "hGap": "12.5",
4 | "bgColor": "#FFFFFF",
5 | "vGap": "12.5",
6 | "padding": "[15,15,15,15]"
7 | },
8 | "items": [
9 | {
10 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2HWVhppXXXXc8XXXXXXXXXXXX_!!655983464.png",
11 | "title": "家有萌娃",
12 | "waterfall": "1",
13 | "type": "SliderItem"
14 | },
15 | {
16 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2tDyXnwNlpuFjy0FfXXX3CpXa_!!0-juitemmedia.jpg",
17 | "title": "囤货小当家",
18 | "waterfall": "1",
19 | "type": "SliderItem"
20 | },
21 | {
22 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2M3.FmNxmpuFjSZFNXXXrRXXa_!!2368290057-0-beehive-scenes.jpg",
23 | "title": "养生达人",
24 | "waterfall": "1",
25 | "type": "SliderItem"
26 | },
27 | {
28 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2RShWdiBnpuFjSZFzXXaSrpXa_!!0-juitemmedia.jpg",
29 | "title": "吃货的后裔",
30 | "waterfall": "1",
31 | "type": "SliderItem"
32 | },
33 | {
34 | "imgUrl": "https://gw.alicdn.com/tfscom///img.alicdn.com/bao/uploaded/TB1h3f5LFXXXXc.XXXXSutbFXXX.jpg",
35 | "title": "想要瘦瘦瘦",
36 | "waterfall": "1",
37 | "type": "SliderItem"
38 | },
39 | {
40 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hmEYJVXXXXaLXXXXwu0bFXXX.png",
41 | "title": "萌宠大作战",
42 | "type": "SliderItem"
43 | },
44 | {
45 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2XJF3jHXlpuFjSszfXXcSGXXa_!!0-juitemmedia.jpg",
46 | "title": "新时代主妇",
47 | "type": "SliderItem"
48 | },
49 | {
50 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1Q9OYRpXXXXaoXFXXSutbFXXX.jpg",
51 | "title": "健身狂人",
52 | "type": "SliderItem"
53 | },
54 | {
55 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1ChWzJXXXXXc2XFXXXXXXXXXX_!!0-item_pic.jpg",
56 | "title": "火锅爱好者",
57 | "type": "SliderItem"
58 | },
59 | {
60 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hXx6LpXXXXaMXFXXSutbFXXX.jpg",
61 | "title": "女神范",
62 | "type": "SliderItem"
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
39 |
40 |
46 |
47 |
48 |
49 |
56 |
57 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/grid_item.json:
--------------------------------------------------------------------------------
1 | {
2 | "items": [
3 | {
4 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2HWVhppXXXXc8XXXXXXXXXXXX_!!655983464.png",
5 | "title": "家有萌娃",
6 | "type": "GridItem"
7 | },
8 | {
9 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2tDyXnwNlpuFjy0FfXXX3CpXa_!!0-juitemmedia.jpg",
10 | "title": "囤货小当家",
11 | "type": "GridItem"
12 | },
13 | {
14 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2M3.FmNxmpuFjSZFNXXXrRXXa_!!2368290057-0-beehive-scenes.jpg",
15 | "title": "养生达人",
16 | "type": "GridItem"
17 | },
18 | {
19 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2RShWdiBnpuFjSZFzXXaSrpXa_!!0-juitemmedia.jpg",
20 | "title": "吃货的后裔",
21 | "type": "GridItem"
22 | },
23 | {
24 | "imgUrl": "https://gw.alicdn.com/tfscom///img.alicdn.com/bao/uploaded/TB1h3f5LFXXXXc.XXXXSutbFXXX.jpg",
25 | "title": "想要瘦瘦瘦",
26 | "type": "GridItem"
27 | },
28 | {
29 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hmEYJVXXXXaLXXXXwu0bFXXX.png",
30 | "title": "萌宠大作战",
31 | "type": "GridItem"
32 | },
33 | {
34 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2XJF3jHXlpuFjSszfXXcSGXXa_!!0-juitemmedia.jpg",
35 | "title": "新时代主妇",
36 | "type": "GridItem"
37 | },
38 | {
39 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1Q9OYRpXXXXaoXFXXSutbFXXX.jpg",
40 | "title": "健身狂人",
41 | "type": "GridItem"
42 | },
43 | {
44 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1ChWzJXXXXXc2XFXXXXXXXXXX_!!0-item_pic.jpg",
45 | "title": "火锅爱好者",
46 | "type": "GridItem"
47 | },
48 | {
49 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hXx6LpXXXXaMXFXXSutbFXXX.jpg",
50 | "title": "女神范",
51 | "type": "GridItem"
52 | }
53 | ]
54 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/grid_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 |
27 |
33 |
40 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/ntext_style.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": {
3 | "text-style": "bold|italic"
4 | }
5 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/page_item.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": {
3 | "scrollInterval": 5000,
4 | "background-color": "#ffffff"
5 | },
6 | "color": [
7 | -16777216,
8 | -65281,
9 | -16711936
10 | ],
11 | "data": [
12 | {
13 | "type": "PageItem",
14 | "title1": "1 Xiaomi Xiaomi",
15 | "title2": "1 Xiaomi in on Top 10"
16 | },
17 | {
18 | "type": "PageItem",
19 | "title1": "2NASA NASA",
20 | "title2": "2NASA is on the way"
21 | },
22 | {
23 | "type": "PageItem",
24 | "title1": "3Sales Sales",
25 | "title2": "3 70% off"
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/page_script.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
40 |
41 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/picasso.json:
--------------------------------------------------------------------------------
1 | {
2 | "url": "https://gw.alicdn.com/tfs/TB1l0HSgvxNTKJjy0FjXXX6yVXa-200-200.png"
3 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/scroll_h.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
39 |
40 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/scroll_vl.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
39 |
40 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/scroll_vs.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
39 |
40 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/slider.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
54 |
55 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/slider_item.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": {
3 | "hGap": "12.5",
4 | "bgColor": "#FFFFFF",
5 | "vGap": "12.5",
6 | "padding": "[15,15,15,15]"
7 | },
8 | "items": [
9 | {
10 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2HWVhppXXXXc8XXXXXXXXXXXX_!!655983464.png",
11 | "title": "家有萌娃",
12 | "waterfall": "1",
13 | "type": "SliderItem"
14 | },
15 | {
16 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2tDyXnwNlpuFjy0FfXXX3CpXa_!!0-juitemmedia.jpg",
17 | "title": "囤货小当家",
18 | "waterfall": "1",
19 | "type": "SliderItem"
20 | },
21 | {
22 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2M3.FmNxmpuFjSZFNXXXrRXXa_!!2368290057-0-beehive-scenes.jpg",
23 | "title": "养生达人",
24 | "waterfall": "1",
25 | "type": "SliderItem"
26 | },
27 | {
28 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2RShWdiBnpuFjSZFzXXaSrpXa_!!0-juitemmedia.jpg",
29 | "title": "吃货的后裔",
30 | "waterfall": "1",
31 | "type": "SliderItem"
32 | },
33 | {
34 | "imgUrl": "https://gw.alicdn.com/tfscom///img.alicdn.com/bao/uploaded/TB1h3f5LFXXXXc.XXXXSutbFXXX.jpg",
35 | "title": "想要瘦瘦瘦",
36 | "waterfall": "1",
37 | "type": "SliderItem"
38 | },
39 | {
40 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hmEYJVXXXXaLXXXXwu0bFXXX.png",
41 | "title": "萌宠大作战",
42 | "type": "SliderItem"
43 | },
44 | {
45 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2XJF3jHXlpuFjSszfXXcSGXXa_!!0-juitemmedia.jpg",
46 | "title": "新时代主妇",
47 | "type": "SliderItem"
48 | },
49 | {
50 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1Q9OYRpXXXXaoXFXXSutbFXXX.jpg",
51 | "title": "健身狂人",
52 | "type": "SliderItem"
53 | },
54 | {
55 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1ChWzJXXXXXc2XFXXXXXXXXXX_!!0-item_pic.jpg",
56 | "title": "火锅爱好者",
57 | "type": "SliderItem"
58 | },
59 | {
60 | "imgUrl": "https://gw.alicdn.com/tfscom/TB1hXx6LpXXXXaMXFXXSutbFXXX.jpg",
61 | "title": "女神范",
62 | "type": "SliderItem"
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_1.json:
--------------------------------------------------------------------------------
1 | {
2 | "titleImgUrl" : "https://gw.alicdn.com/tfs/TB1DlkbSFXXXXaPXXXXXXXXXXXX-320-44.png",
3 | "leftImgUrl" : "https://img.alicdn.com/bao/uploaded/i3/725677994/TB127CMRXXXXXaaXpXXXXXXXXXX_!!0-item_pic.jpg",
4 | "subTitleImgUrl" : "https://gw.alicdn.com/tfs/TB1ZwKHSFXXXXbMXFXXXXXXXXXX-215-43.png",
5 | "rightImgUrl" : "https://img.alicdn.com/bao/uploaded/i1/725677994/TB2h8kaaXXXXXa4XXXXXXXXXXXX_!!725677994.jpg"
6 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_1.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
35 |
43 |
51 |
59 |
67 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_2.json:
--------------------------------------------------------------------------------
1 | {
2 | "imgUrl": "https://gw.alicdn.com/tfs/TB1HnbORXXXXXbWaFXXXXXXXXXX-230-230.png",
3 | "title": "会员积分",
4 | "titleColor": "#FF1234"
5 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
38 |
46 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_3.json:
--------------------------------------------------------------------------------
1 | {
2 | "logoUrl": "https://gw.alicdn.com/tfs/TB1IoTCSpXXXXajXFXXXXXXXXXX-100-50.png",
3 | "imgUrl": "https://gw.alicdn.com/tfs/TB1Yf2iSpXXXXcmaXXXXXXXXXXX-130-130.png",
4 | "tagUrl":"https://gw.alicdn.com/tfs/TB1Zru_SpXXXXcaapXXXXXXXXXX-76-76.png",
5 | "hasImgPadding": "false"
6 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_4.json:
--------------------------------------------------------------------------------
1 | {
2 | "imgUrl": "https://gw.alicdn.com/tfs/TB1rLhpSpXXXXcOaFXXXXXXXXXX-160-156.png",
3 | "hasImgPadding": "false",
4 | "price": "89.88",
5 | "priceBgColor": "#002D2D2D",
6 | "title": "仅剩5件",
7 | "titleBgColor": "#FF0036"
8 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_5.json:
--------------------------------------------------------------------------------
1 | {
2 | "bgImgUrl": "https://img.alicdn.com/tfs/TB11mGXRpXXXXcAXpXXXXXXXXXX-782-610.png",
3 | "data": [
4 | {
5 | "imgUrl": "https://img.alicdn.com/tfs/TB1ZdpvRpXXXXX9aFXXXXXXXXXX-134-176.png",
6 | "hasImgPadding": "true",
7 | "price": "¥99.5",
8 | "title": "商品标题如果很长的话怎么办",
9 | "titleColor": "#ff00ff",
10 | "benefitColor": "#00ff00",
11 | "benefitTitle": "利益标",
12 | "type": "TmallComponent6"
13 | },
14 | {
15 | "imgUrl": "https://img.alicdn.com/tfs/TB1CS1nRpXXXXauXXXXXXXXXXXX-215-215.png",
16 | "hasImgPadding": "false",
17 | "price": "¥199",
18 | "title": "花美男",
19 | "titleColor": "#000000",
20 | "benefitColor": "#ff0000",
21 | "benefitTitle": "一起来",
22 | "type": "TmallComponent6"
23 | },
24 | {
25 | "imgUrl": "https://img.alicdn.com/tfs/TB1eYKVPpXXXXa3XVXXXXXXXXXX-244-196.png",
26 | "price": "¥9.9",
27 | "hasImgPadding": "9.9",
28 | "title": "高跟美鞋",
29 | "titleColor": "#000000",
30 | "benefitColor": "#0000ff",
31 | "benefitTitle": "",
32 | "type": "TmallComponent6"
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
33 |
34 |
41 |
42 |
54 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_6.json:
--------------------------------------------------------------------------------
1 | {
2 | "imgUrl": "https://img.alicdn.com/imgextra/i1/2136360376/TB2MJDiwrRkpuFjSspmXXc.9XXa_!!2136360376.jpg",
3 | "style": {
4 | "onePlusThreetextColor": "#9863AF"
5 | },
6 | "hasImgPadding": "true",
7 | "price": "¥99.5",
8 | "title": "商品标题",
9 | "titleColor": "#ff00ff",
10 | "benefitColor": "#00ff00",
11 | "benefitTitle": "利益标",
12 | "type": "TmallComponent6"
13 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_6.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
37 |
38 |
44 |
49 |
50 |
59 |
60 |
69 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_7.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "发现更多",
3 | "item1Title": "国际大牌耳机",
4 | "item1Action": "https://detail.tmall.com/item.htm?id=544674265120",
5 | "item2Title": "降噪无线耳机",
6 | "item2Action": "https://detail.tmall.com/item.htm?id=547072201901",
7 | "item3Title": "3D声效耳机",
8 | "item3Action": "https://detail.tmall.com/item.htm?id=544674265120",
9 | "item4Title": "耳机包",
10 | "item4Action": "https://detail.tmall.com/item.htm?id=547072201901",
11 | "item5Title": "蓝牙音箱",
12 | "item5Action": "https://detail.tmall.com/item.htm?id=544674265120"
13 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/tmall_component_8.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "超高性能的随身本99.9%的用户觉得很快",
3 | "subTitle": "查看所有20款商品",
4 | "logoUrl": "https://gw.alicdn.com/tfs/TB1PCmzSpXXXXacXFXXXXXXXXXX-71-109.png",
5 | "data": [
6 | "https://gw.alicdn.com/tfs/TB1P7CBSpXXXXc5XpXXXXXXXXXX-142-140.png",
7 | "https://gw.alicdn.com/tfs/TB1PH9DSpXXXXcpXpXXXXXXXXXX-142-140.png",
8 | "https://gw.alicdn.com/tfs/TB1p7ubSpXXXXXCapXXXXXXXXXX-142-140.png",
9 | "https://gw.alicdn.com/tfs/TB17hqzSpXXXXXBXFXXXXXXXXXX-142-140.png",
10 | "https://img.alicdn.com/imgextra/i1/2136360376/TB2MJDiwrRkpuFjSspmXXc.9XXa_!!2136360376.jpg",
11 | "https://img.alicdn.com/bao/uploaded/i4/2136360376/TB1s07USXXXXXXNaVXXXXXXXXXX_!!0-item_pic.jpg_180x180.jpg"
12 | ]
13 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/total_container.json:
--------------------------------------------------------------------------------
1 | {
2 | "tags": [
3 | "家有萌娃",
4 | "囤货小当家",
5 | "养生达人"
6 | ]
7 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/totalcontainer.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
32 |
39 |
40 |
44 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/vh_item.json:
--------------------------------------------------------------------------------
1 | {
2 | "items": [
3 | {
4 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2HWVhppXXXXc8XXXXXXXXXXXX_!!655983464.png",
5 | "title": "家有萌娃",
6 | "type": "GridItem"
7 | },
8 | {
9 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2tDyXnwNlpuFjy0FfXXX3CpXa_!!0-juitemmedia.jpg",
10 | "title": "囤货小当家",
11 | "type": "GridItem"
12 | },
13 | {
14 | "imgUrl": "https://gw.alicdn.com/tfscom/TB2M3.FmNxmpuFjSZFNXXXrRXXa_!!2368290057-0-beehive-scenes.jpg",
15 | "title": "养生达人",
16 | "type": "GridItem"
17 | }
18 | ]
19 | }
--------------------------------------------------------------------------------
/app/src/main/assets/component_demo/virtualview.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": {
3 | "text-align": "h_center",
4 | "font-size": "20",
5 | "color": "#FF5000"
6 | },
7 | "title": "超高性 99.9% 的用户觉得很快",
8 | "logoUrl": "https://gw.alicdn.com/tfs/TB1yGIdkb_I8KJjy1XaXXbsxpXa-72-72.png"
9 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/GRIDITEM.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class GRIDITEM{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -55, 0, 0, 0, -8, 0, 0, 0, 29, 0, 0, 1, 25, 0, 0, 0, 0, 0, 0, 1, 29, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 8, 71, 114, 105, 100, 73, 116, 101, 109, 0, -71, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, 0, 0, 0, -76, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 1, -85, 47, 126, 54, -85, 47, 126, 54, 0, 0, 0, 0, 9, 5, 30, -57, 11, -60, 0, 0, 0, 36, 92, -43, -16, -15, 0, 0, 0, -106, -112, 17, 87, -92, 0, 0, 0, 6, 0, 0, 13, 27, 0, 0, 0, 5, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 1, 0, 1, -67, -28, 53, 18, -122, -102, 0, 0, 1, 0, 0, 8, 7, 30, -57, 11, -60, 0, 0, 0, 36, -60, 45, 58, -50, 0, 0, 0, 14, 92, -43, -16, -15, 0, 0, 0, 30, 16, -72, 114, 78, 0, 0, 0, 36, 0, 0, 13, 27, 0, 0, 0, 4, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 0, 0, 0, 0, 0, 0, 1, 0, 54, 69, 45, -46, 56, -16, -68, 0, 0, 1, 1, 0, 0, 0, 2, -46, 56, -16, -68, 0, 8, 36, 123, 116, 105, 116, 108, 101, 125, 53, 18, -122, -102, 0, 9, 36, 123, 105, 109, 103, 85, 114, 108, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/PICASSO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class PICASSO{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -96, 0, 0, 0, -49, 0, 0, 0, 72, 0, 0, 1, 27, 0, 0, 0, 0, 0, 0, 1, 31, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 7, 80, 105, 99, 97, 115, 115, 111, 0, -111, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, -124, 10, 35, 69, 0, 0, 1, 0, 3, -10, 2, 92, -43, -16, -15, 0, 0, 1, 44, 119, 112, -84, -68, -1, -1, -1, -1, 0, 1, -80, 100, 110, -52, 66, -76, 0, 0, 0, 1, 0, 1, -59, 111, 68, 106, -86, 69, 0, 0, 1, 1, 0, 0, 0, 4, -80, 100, 110, -52, 0, 6, 100, 101, 103, 114, 101, 101, 0, 1, -59, 111, 0, 3, 117, 114, 108, -124, 10, 35, 69, 0, 33, 84, 105, 116, 108, 101, 58, 32, 76, 111, 97, 100, 105, 110, 103, 32, 73, 109, 97, 103, 101, 32, 119, 105, 116, 104, 32, 80, 105, 99, 97, 115, 115, 111, 68, 106, -86, 69, 0, 6, 36, 123, 117, 114, 108, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/SCROLLERH.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class SCROLLERH{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -62, 0, 0, 0, -15, 0, 0, 0, 81, 0, 0, 1, 70, 0, 0, 0, 0, 0, 0, 1, 74, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 9, 83, 99, 114, 111, 108, 108, 101, 114, 72, 0, -79, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, -55, -3, 19, -105, 0, 0, 1, 0, 0, 15, 2, -86, 50, -11, -48, 0, 0, 0, 1, 119, 112, -84, -68, -1, -1, -1, -1, 5, 92, -43, -16, -15, 0, 0, 1, 29, 119, 85, -100, 16, 0, 0, 0, 10, -108, 71, 41, 114, 0, 0, 0, 10, -11, -65, 92, 54, 0, 0, 0, 10, 0, 53, -9, 74, 0, 0, 0, 5, 0, 0, 1, 86, 5, 63, -112, -64, 7, -40, 84, 0, 0, 1, 1, 0, 0, 0, 2, -55, -3, 19, -105, 0, 61, 84, 105, 116, 108, 101, 58, 32, 111, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 32, 61, 32, 72, 32, 124, 32, 102, 105, 114, 115, 116, 83, 112, 97, 99, 101, 32, 61, 32, 49, 48, 114, 112, 32, 124, 32, 108, 97, 115, 116, 83, 112, 97, 99, 101, 32, 61, 32, 49, 48, 114, 112, -64, 7, -40, 84, 0, 8, 36, 123, 105, 116, 101, 109, 115, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/SCROLLERVL.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class SCROLLERVL{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -53, 0, 0, 0, -6, 0, 0, 0, 58, 0, 0, 1, 56, 0, 0, 0, 0, 0, 0, 1, 60, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 10, 83, 99, 114, 111, 108, 108, 101, 114, 86, 76, 0, -71, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, -103, -89, 67, 70, 0, 0, 1, 0, 0, 15, 3, 0, 51, 57, -93, 0, 0, 0, 1, -86, 50, -11, -48, 0, 0, 0, 0, 119, 112, -84, -68, -1, -1, -1, -1, 5, 92, -43, -16, -15, 0, 0, 3, 32, 119, 85, -100, 16, 0, 0, 0, 10, -108, 71, 41, 114, 0, 0, 0, 10, -11, -65, 92, 54, 0, 0, 0, 10, 0, 53, -9, 74, 0, 0, 0, 5, 0, 0, 1, 86, 5, 63, -112, -64, 7, -40, 84, 0, 0, 1, 1, 0, 0, 0, 2, -103, -89, 67, 70, 0, 38, 84, 105, 116, 108, 101, 58, 32, 111, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 32, 61, 32, 86, 32, 124, 32, 109, 111, 100, 101, 32, 61, 32, 108, 105, 110, 101, 97, 114, -64, 7, -40, 84, 0, 8, 36, 123, 105, 116, 101, 109, 115, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/SCROLLERVS.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class SCROLLERVS{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -53, 0, 0, 0, -6, 0, 0, 0, 61, 0, 0, 1, 59, 0, 0, 0, 0, 0, 0, 1, 63, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 10, 83, 99, 114, 111, 108, 108, 101, 114, 86, 83, 0, -71, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, -88, 34, -79, 75, 0, 0, 1, 0, 0, 15, 3, 0, 51, 57, -93, 0, 0, 0, 2, -86, 50, -11, -48, 0, 0, 0, 0, 119, 112, -84, -68, -1, -1, -1, -1, 5, 92, -43, -16, -15, 0, 0, 3, 32, 119, 85, -100, 16, 0, 0, 0, 10, -108, 71, 41, 114, 0, 0, 0, 10, -11, -65, 92, 54, 0, 0, 0, 10, 0, 53, -9, 74, 0, 0, 0, 5, 0, 0, 1, 86, 5, 63, -112, -64, 7, -40, 84, 0, 0, 1, 1, 0, 0, 0, 2, -88, 34, -79, 75, 0, 41, 84, 105, 116, 108, 101, 58, 32, 111, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 32, 61, 32, 86, 32, 124, 32, 109, 111, 100, 101, 32, 61, 32, 115, 116, 97, 103, 103, 101, 114, 101, 100, -64, 7, -40, 84, 0, 8, 36, 123, 105, 116, 101, 109, 115, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/SLIDER.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class SLIDER{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -81, 0, 0, 0, -34, 0, 0, 0, 42, 0, 0, 1, 12, 0, 0, 0, 0, 0, 0, 1, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 6, 83, 108, 105, 100, 101, 114, 0, -95, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, -41, 77, -113, -73, 0, 0, 1, 0, 0, 19, 2, -86, 50, -11, -48, 0, 0, 0, 1, 119, 112, -84, -68, -1, -1, -1, -1, 3, 92, -43, -16, -15, 0, 0, 1, 29, 127, -22, -74, 115, 0, 0, 0, -29, 0, 53, -9, 74, 0, 0, 0, 10, 0, 0, 1, 86, 5, 63, -112, -64, 7, -40, 84, 0, 0, 1, 1, 0, 0, 0, 2, -64, 7, -40, 84, 0, 8, 36, 123, 105, 116, 101, 109, 115, 125, -41, 77, -113, -73, 0, 22, 84, 105, 116, 108, 101, 58, 32, 111, 114, 105, 101, 110, 116, 97, 116, 105, 111, 110, 32, 61, 32, 72, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/TMALLCOMPONENT5.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class TMALLCOMPONENT5{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -16, 0, 0, 1, 31, 0, 0, 0, 45, 0, 0, 1, 80, 0, 0, 0, 0, 0, 0, 1, 84, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 15, 84, 109, 97, 108, 108, 67, 111, 109, 112, 111, 110, 101, 110, 116, 53, 0, -39, 0, 0, 1, 5, 92, -43, -16, -15, -1, -1, -1, -2, -85, 48, 95, 38, 0, 0, 0, 1, 85, -71, -17, 31, 0, 0, 2, -18, 85, -71, -17, 32, 0, 0, 2, 78, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 1, 86, 5, 63, -112, -25, -127, 76, -127, 0, 0, 0, 0, 9, 4, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 0, 0, 13, 27, 0, 0, 0, 1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 2, 0, 1, -67, -28, -78, -72, -4, 85, -85, 47, 126, 54, -85, 47, 126, 54, 0, 0, 1, 0, 0, 17, 7, 30, -57, 11, -60, 0, 0, 0, 16, 0, 47, -1, 108, 0, 0, 0, 1, 92, -43, -16, -15, -1, -1, -1, -2, -40, 23, -49, 111, 0, 0, 0, 3, 0, 0, 13, 27, 0, 0, 0, 2, 119, 112, -84, -68, -1, -1, -1, -1, 126, -23, -116, 37, 0, 0, 0, 2, 3, 74, 110, 125, -97, 0, 0, 0, 25, 3, -73, -105, -124, 0, 0, 0, 25, 88, 72, 113, -61, 0, 0, 0, 25, 0, 0, 1, 86, 5, 63, -112, 71, -13, 111, -100, 0, 0, 1, 1, 0, 0, 0, 3, -25, -127, 76, -127, 0, 9, 99, 111, 110, 116, 97, 105, 110, 101, 114, -78, -72, -4, 85, 0, 11, 36, 123, 98, 103, 73, 109, 103, 85, 114, 108, 125, 71, -13, 111, -100, 0, 7, 36, 123, 100, 97, 116, 97, 125, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/bytes/TOTALCONTAINER.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.bytes;
26 |
27 | public class TOTALCONTAINER{
28 | public static final byte[] BIN = new byte[] {
29 | 65, 76, 73, 86, 86, 0, 1, 0, 0, 0, 1, 0, 0, 0, 47, 0, 0, 0, -62, 0, 0, 0, -15, 0, 0, 0, 64, 0, 0, 1, 53, 0, 0, 0, 0, 0, 0, 1, 57, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 14, 84, 111, 116, 97, 108, 67, 111, 110, 116, 97, 105, 110, 101, 114, 0, -84, 0, 0, 2, 4, -86, 50, -11, -48, 0, 0, 0, 0, 0, 47, -1, 108, 0, 0, 0, 48, 92, -43, -16, -15, -1, -1, -1, -1, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 5, -60, 45, 58, -50, 0, 0, 0, 12, 92, -43, -16, -15, 0, 0, 0, 20, -80, -104, 85, 46, -1, 0, -120, -103, 119, 112, -84, -68, -1, -1, -1, -1, -64, -101, 46, 54, -1, 51, 51, 51, 0, 0, 0, 1, 0, 54, 69, 45, 82, 72, 100, -109, 0, 0, 1, 0, 0, 1, 2, 92, -43, -16, -15, 0, 0, 0, 20, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 3, -14, 2, 92, -43, -16, -15, -1, -1, -1, -2, 119, 112, -84, -68, -1, -1, -1, -1, 0, 0, 0, 2, -63, 66, 80, 23, -109, -69, -50, 50, 86, 5, 63, -112, 72, -44, -71, 13, 0, 0, 1, 1, 1, 0, 0, 0, 4, -109, -69, -50, 50, 0, 6, 84, 77, 84, 97, 103, 115, -63, 66, 80, 23, 0, 6, 110, 97, 116, 105, 118, 101, 72, -44, -71, 13, 0, 7, 36, 123, 116, 97, 103, 115, 125, 82, 72, 100, -109, 0, 21, 84, 105, 116, 108, 101, 58, 32, 110, 97, 116, 105, 118, 101, 32, 61, 32, 84, 77, 84, 97, 103, 0, 0, 0, 0,
30 | };
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/custom/ClickProcessorImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.custom;
26 |
27 | import android.util.Log;
28 | import com.tmall.wireless.vaf.virtualview.event.EventData;
29 | import com.tmall.wireless.vaf.virtualview.event.IEventProcessor;
30 |
31 | /**
32 | * Created by longerian on 2017/12/15.
33 | *
34 | * @author longerian
35 | * @date 2017/12/15
36 | */
37 |
38 | public class ClickProcessorImpl implements IEventProcessor {
39 |
40 | @Override
41 | public boolean process(EventData data) {
42 | Log.d("ClickProcessorImpl", "event " + data.mVB + " " + data.mVB.getAction() + " " + data.mVB.getId());
43 | return true;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/custom/ExposureProcessorImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.custom;
26 |
27 | import android.util.Log;
28 | import com.tmall.wireless.vaf.virtualview.event.EventData;
29 | import com.tmall.wireless.vaf.virtualview.event.IEventProcessor;
30 |
31 | /**
32 | * Created by longerian on 2018/3/19.
33 | *
34 | * @author longerian
35 | * @date 2018/03/19
36 | */
37 |
38 | public class ExposureProcessorImpl implements IEventProcessor {
39 |
40 | @Override
41 | public boolean process(EventData data) {
42 | Log.d("ExposureProcessorImpl", "event " + data.mVB + " " + data.mVB.getAction());
43 | return true;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/custom/IViewInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.custom;
26 |
27 | /**
28 | * Created by longerian on 2017/7/12.
29 | *
30 | * @author longerian
31 | * @date 2017/07/12
32 | */
33 |
34 | public interface IViewInterface {
35 |
36 | void onBind(Object object);
37 |
38 | void onUnbind();
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/page/PageManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.page;
26 |
27 | /**
28 | * Created by gujicheng on 16/9/13.
29 | */
30 | public class PageManager {
31 | private final static String TAG = "PageManager_TMTEST";
32 |
33 | private String mName;
34 |
35 | public PageManager() {
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/preview/PreviewData.java:
--------------------------------------------------------------------------------
1 | package com.tmall.wireless.virtualviewdemo.preview;
2 |
3 | import com.google.gson.JsonObject;
4 |
5 | import java.io.Serializable;
6 | import java.util.ArrayList;
7 |
8 | /**
9 | * Created on 2018/1/6.
10 | * Description:
11 | *
12 | * @author bianyue
13 | */
14 | public class PreviewData implements Serializable {
15 |
16 | public ArrayList templates;
17 | public JsonObject data;
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/preview/util/HttpUtil.java:
--------------------------------------------------------------------------------
1 | package com.tmall.wireless.virtualviewdemo.preview.util;
2 |
3 | import android.text.TextUtils;
4 |
5 | import java.net.URI;
6 | import java.net.URISyntaxException;
7 |
8 | /**
9 | * Created on 2018/3/1.
10 | * Description:
11 | *
12 | * @author bianyue
13 | */
14 | public class HttpUtil {
15 |
16 | public static String getHostIp() {
17 | return "10.0.2.2";
18 | }
19 |
20 | public static String getHostUrl() {
21 | return "http://" + HttpUtil.getHostIp() + ":7788/";
22 | }
23 |
24 | public static String getFirstPath(String str) {
25 | URI uri = null;
26 | try {
27 | uri = new URI(str);
28 | } catch (URISyntaxException e) {
29 | e.printStackTrace();
30 | }
31 |
32 | if (uri != null) {
33 | String path = uri.getPath();
34 | if (!TextUtils.isEmpty(path)) {
35 | String[] pathes = path.split("/");
36 | if (pathes != null && pathes.length > 1) {
37 | return pathes[1];
38 | }
39 | }
40 | }
41 | return "";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/vs/Context.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.vs;
26 |
27 | import static android.R.attr.x;
28 |
29 | /**
30 | * Created by gujicheng on 17/3/27.
31 | */
32 |
33 | public class Context {
34 | private float aB = 3;
35 | private int bB = 5;
36 | private String name = "";
37 |
38 | public void setName(int s) {
39 | name = s + "";
40 | }
41 |
42 | public void setName(String s) {
43 | name = s;
44 | }
45 |
46 | public String getName() {
47 | return name;
48 | }
49 |
50 | public void setAB(int x) {
51 | aB = x;
52 | }
53 |
54 | public void setAB(float x) {
55 | aB = x;
56 | }
57 |
58 | public float getAB() {
59 | return aB;
60 | }
61 |
62 | public void setBB(int b) {
63 | bB = x;
64 | }
65 |
66 | public int getBB() {
67 | return bB;
68 | }
69 |
70 | public int callX(int a, int b) {
71 | return a + b;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tmall/wireless/virtualviewdemo/vs/Module.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo.vs;
26 |
27 | /**
28 | * Created by gujicheng on 17/3/27.
29 | */
30 |
31 | public class Module {
32 |
33 | public int value() {
34 | return 16;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/tm_homepage_goumai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable-xhdpi/tm_homepage_goumai.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/tm_homepage_shopping_cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable-xhdpi/tm_homepage_shopping_cart.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/a1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/a1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/a2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/a2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon4.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon5.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/icon6.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/image1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/image1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/image2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/image2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/r1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/r1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/r2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/r2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/r3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/r3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/rr.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/rs.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/t9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/t9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/drawable/ta.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_component.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
30 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_parse_xml.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
29 |
32 |
33 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tm_biz_tangram_calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xhdpi/tm_biz_tangram_calendar.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tm_homepage_goumai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xhdpi/tm_homepage_goumai.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tm_homepage_shopping_cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xhdpi/tm_homepage_shopping_cart.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
29 | 64dp
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 | #3F51B5
28 | #303F9F
29 | #FF4081
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 | 16dp
28 | 16dp
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 | VirtualViewDemo
27 |
28 | Refresh
29 | RTL
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 |
28 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/test/java/com/tmall/wireless/virtualviewdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualviewdemo;
26 |
27 | import org.junit.Test;
28 |
29 | import static org.junit.Assert.*;
30 |
31 | /**
32 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
33 | */
34 | public class ExampleUnitTest {
35 | @Test
36 | public void addition_isCorrect() throws Exception {
37 | assertEquals(4, 2 + 2);
38 | }
39 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
26 |
27 | buildscript {
28 | repositories {
29 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
30 | mavenCentral()
31 | jcenter()
32 | maven { url 'https://maven.google.com' }
33 | }
34 | dependencies {
35 | classpath 'com.android.tools.build:gradle:2.3.1'
36 | classpath 'com.github.xfumihiro.view-inspector:view-inspector-plugin:0.1.1'
37 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
38 | classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0'
39 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
40 | classpath 'com.antfortune.freeline:gradle:0.8.8'
41 | }
42 | }
43 |
44 |
45 | allprojects {
46 | repositories {
47 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
48 | mavenCentral()
49 | jcenter()
50 | maven { url 'https://maven.google.com' }
51 | }
52 | }
53 |
54 | task clean(type: Delete) {
55 | delete rootProject.buildDir
56 | }
57 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # MIT License
3 | #
4 | # Copyright (c) 2018 Alibaba Group
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in all
14 | # copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | # SOFTWARE.
23 | #
24 |
25 | # Project-wide Gradle settings.
26 |
27 | # IDE (e.g. Android Studio) users:
28 | # Gradle settings configured through the IDE *will override*
29 | # any settings specified in this file.
30 |
31 | # For more details on how to configure your build environment visit
32 | # http://www.gradle.org/docs/current/userguide/build_environment.html
33 |
34 | # Specifies the JVM arguments used for the daemon process.
35 | # The setting is particularly useful for tweaking memory settings.
36 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
37 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
38 |
39 | # When configured, Gradle will run in incubating parallel mode.
40 | # This option should only be used with decoupled projects. More details, visit
41 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
42 | # org.gradle.parallel=true
43 |
44 | org.gradle.jvmargs=-Xmx2048m
45 | GROUP=com.alibaba.android
46 | ARTIFACT=virtualview
47 | VERSION=1
48 | VERSION_NAME=1.4.9
49 | PACKAGING_TYPE=aar
50 | systemProp.compileSdkVersion=26
51 | systemProp.targetSdkVersion=26
52 | systemProp.buildToolsVersion=26.0.1
53 |
54 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alibaba/Virtualview-Android/ba54b7db02f13291b8c08200b202d56026c3fe8d/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #
2 | # MIT License
3 | #
4 | # Copyright (c) 2018 Alibaba Group
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 | #
13 | # The above copyright notice and this permission notice shall be included in all
14 | # copies or substantial portions of the Software.
15 | #
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | # SOFTWARE.
23 | #
24 |
25 | #Mon Jul 24 12:09:52 CST 2017
26 | distributionBase=GRADLE_USER_HOME
27 | distributionPath=wrapper/dists
28 | zipStoreBase=GRADLE_USER_HOME
29 | zipStorePath=wrapper/dists
30 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
31 |
--------------------------------------------------------------------------------
/jcenterInstall.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | apply plugin: 'com.github.dcendents.android-maven'
26 |
27 | group = GROUP
28 |
29 | install {
30 | repositories.mavenInstaller {
31 | // This generates POM.xml with proper parameters
32 | pom {
33 | project {
34 | packaging 'aar'
35 | groupId publishedGroupId
36 | artifactId artifact
37 |
38 | // Add your description here
39 | name libraryName
40 | description libraryDescription
41 | url siteUrl
42 |
43 | // Set your license
44 | licenses {
45 | license {
46 | name licenseName
47 | url licenseUrl
48 | }
49 | }
50 | developers {
51 | developer {
52 | id developerId
53 | name developerName
54 | email developerEmail
55 | }
56 | }
57 | scm {
58 | connection gitUrl
59 | developerConnection gitUrl
60 | url siteUrl
61 |
62 | }
63 | }
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | include ':app', ':virtualview'
26 |
--------------------------------------------------------------------------------
/virtualview/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/virtualview/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/gujicheng/Workspace/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 |
--------------------------------------------------------------------------------
/virtualview/src/androidTest/java/com/tmall/wireless/virtualview/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualview;
26 |
27 | import android.app.Application;
28 | import android.test.ApplicationTestCase;
29 |
30 | /**
31 | * Testing Fundamentals
32 | */
33 | public class ApplicationTest extends ApplicationTestCase {
34 | public ApplicationTest() {
35 | super(Application.class);
36 | }
37 | }
--------------------------------------------------------------------------------
/virtualview/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/RegisterManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/10.
31 | */
32 | public class RegisterManager {
33 | private final static String TAG = "RegisterManager_TMTEST";
34 |
35 | public final static int MAX_REGISTER_COUNT = 20;
36 |
37 | private Data[]mRegisters = new Data[MAX_REGISTER_COUNT];
38 |
39 | public void destroy() {
40 | mRegisters = null;
41 | }
42 |
43 | public RegisterManager() {
44 | for (int i = 0; i < MAX_REGISTER_COUNT; ++i) {
45 | mRegisters[i] = new Data();
46 | }
47 | }
48 |
49 | public Data get(int regId) {
50 | if (regId >= 0 && regId < MAX_REGISTER_COUNT) {
51 | return mRegisters[regId];
52 | } else {
53 | return null;
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/data/FloatValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.data;
26 |
27 | import android.util.Log;
28 |
29 | /**
30 | * Created by gujicheng on 16/12/14.
31 | */
32 |
33 | public class FloatValue extends Value {
34 | private final static String TAG = "FloatValue_TMTEST";
35 |
36 | public float mValue;
37 |
38 | public FloatValue(float v) {
39 | mValue = v;
40 | }
41 |
42 | @Override
43 | public void copy(Value v) {
44 | if (null != v) {
45 | mValue = ((FloatValue)v).mValue;
46 | } else {
47 | Log.e(TAG, "value is null");
48 | }
49 | }
50 |
51 | @Override
52 | public Value clone() {
53 | return sValueCache.mallocFloatValue(mValue);
54 | }
55 |
56 | @Override
57 | public Class> getValueClass() {
58 | return float.class;
59 | }
60 |
61 | @Override
62 | public Object getValue() {
63 | return mValue;
64 | }
65 |
66 | @Override
67 | public String toString() {
68 | return String.format("value type:float, value:%f", mValue);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/data/IntValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.data;
26 |
27 | import android.util.Log;
28 |
29 | /**
30 | * Created by gujicheng on 16/12/14.
31 | */
32 |
33 | public class IntValue extends Value {
34 | private final static String TAG = "IntValue_TMTEST";
35 | public int mValue;
36 |
37 | public IntValue(int v) {
38 | mValue = v;
39 | }
40 |
41 | @Override
42 | public void copy(Value v) {
43 | if (null != v) {
44 | mValue = ((IntValue)v).mValue;
45 | } else {
46 | Log.e(TAG, "value is null");
47 | }
48 | }
49 |
50 | @Override
51 | public Value clone() {
52 | return sValueCache.mallocIntValue(mValue);
53 | }
54 |
55 | @Override
56 | public Class> getValueClass() {
57 | return int.class;
58 | }
59 |
60 | @Override
61 | public Object getValue() {
62 | return mValue;
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | return String.format("value type:int, value:%d", mValue);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/data/ObjValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.data;
26 |
27 | import android.util.Log;
28 |
29 | /**
30 | * Created by gujicheng on 16/12/14.
31 | */
32 |
33 | public class ObjValue extends Value {
34 | private final static String TAG = "ObjValue_TMTEST";
35 | public Object mValue;
36 |
37 | public ObjValue(Object v) {
38 | mValue = v;
39 | }
40 |
41 | @Override
42 | public void copy(Value v) {
43 | if (null != v) {
44 | mValue = ((ObjValue)v).mValue;
45 | } else {
46 | Log.e(TAG, "value is null");
47 | }
48 | }
49 |
50 | @Override
51 | public Value clone() {
52 | return sValueCache.mallocObjValue(mValue);
53 | }
54 |
55 | @Override
56 | public Class> getValueClass() {
57 | return mValue.getClass();
58 | }
59 |
60 | @Override
61 | public Object getValue() {
62 | return mValue;
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | return "value type:object, value:" + mValue;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/data/StrValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.data;
26 |
27 | import android.util.Log;
28 |
29 | /**
30 | * Created by gujicheng on 16/12/14.
31 | */
32 |
33 | public class StrValue extends Value {
34 | private final static String TAG = "StrValue_TMTEST";
35 | public String mValue;
36 |
37 | public StrValue(String v) {
38 | mValue = v;
39 | }
40 |
41 | @Override
42 | public void copy(Value v) {
43 | if (null != v) {
44 | mValue = new String(((StrValue)v).mValue);
45 | } else {
46 | Log.e(TAG, "value is null");
47 | }
48 | }
49 |
50 | @Override
51 | public Value clone() {
52 | return sValueCache.mallocStrValue(mValue);
53 | }
54 |
55 | @Override
56 | public Class> getValueClass() {
57 | return String.class;
58 | }
59 |
60 | @Override
61 | public Object getValue() {
62 | return mValue;
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | return "value type:string, value:" + mValue;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/data/Value.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.data;
26 |
27 | /**
28 | * Created by gujicheng on 16/12/14.
29 | */
30 |
31 | public abstract class Value {
32 | protected static ValueCache sValueCache = ValueCache.getInstance();
33 |
34 | public abstract void copy(Value v);
35 | public abstract Value clone();
36 |
37 | public abstract Class> getValueClass();
38 |
39 | public abstract Object getValue();
40 | }
41 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/AndExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 17/3/27.
31 | */
32 |
33 | public class AndExecutor extends BinExecutor {
34 | private final static String TAG = "AndExecutor_TMTEST";
35 |
36 | @Override
37 | protected int calcIntInt(Data result, int l, int r) {
38 | result.setInt((1 == l && 1 == r) ? 1 : 0);
39 | // Log.d(TAG, "calcIntInt l:" + l + " r:" + r);
40 | return RESULT_STATE_SUCCESSFUL;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/DivEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import android.util.Log;
28 |
29 | import com.tmall.wireless.vaf.expr.engine.data.Data;
30 |
31 | /**
32 | * Created by gujicheng on 16/10/24.
33 | */
34 | public class DivEqExecutor extends CompositeEqExecutor {
35 | private final static String TAG = "DivEqExecutor";
36 |
37 | @Override
38 | protected void calcIntInt(Data result, int l, int r) {
39 | if (0 == r) {
40 | Log.e(TAG, "div zero");
41 | // return null;
42 | }
43 | result.setInt(l / r);
44 | }
45 |
46 | @Override
47 | protected void calcIntFloat(Data result, int l, float r) {
48 | result.setFloat(l / r);
49 | }
50 |
51 | @Override
52 | protected void calcFloatInt(Data result, float l, int r) {
53 | if (0 == r) {
54 | Log.e(TAG, "div zero");
55 | // return null;
56 | }
57 | result.setFloat(l / r);
58 | }
59 |
60 | @Override
61 | protected void calcFloatFloat(Data result, float l, float r) {
62 | result.setFloat(l / r);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/DivExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import android.util.Log;
28 |
29 | import com.tmall.wireless.vaf.expr.engine.data.Data;
30 |
31 | /**
32 | * Created by gujicheng on 16/9/12.
33 | */
34 | public class DivExecutor extends BinExecutor {
35 | private final static String TAG = "DivExecutor_TMTEST";
36 |
37 | @Override
38 | protected int calcIntInt(Data result, int l, int r) {
39 | if (0 == r) {
40 | Log.e(TAG, "div zero");
41 | return RESULT_STATE_ERROR;
42 | } else {
43 | result.setInt(l / r);
44 | return RESULT_STATE_SUCCESSFUL;
45 | }
46 | }
47 |
48 | @Override
49 | protected int calcIntFloat(Data result, int l, float r) {
50 | result.setFloat(l / r);
51 | return RESULT_STATE_SUCCESSFUL;
52 | }
53 |
54 | @Override
55 | protected int calcFloatInt(Data result, float l, int r) {
56 | if (0 == r) {
57 | Log.e(TAG, "div zero");
58 | return RESULT_STATE_ERROR;
59 | } else {
60 | result.setFloat(l / r);
61 | return RESULT_STATE_SUCCESSFUL;
62 | }
63 | }
64 |
65 | @Override
66 | protected int calcFloatFloat(Data result, float l, float r) {
67 | result.setFloat(l / r);
68 | return RESULT_STATE_SUCCESSFUL;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/EqEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | import android.text.TextUtils;
30 |
31 | /**
32 | * Created by gujicheng on 16/9/18.
33 | */
34 | public class EqEqExecutor extends BinExecutor {
35 | protected int calcStringString(Data result, String l, String r) {
36 | result.setInt((TextUtils.equals(l, r)) ? 1 : 0);
37 | return RESULT_STATE_SUCCESSFUL;
38 | }
39 |
40 | @Override
41 | protected int calcIntInt(Data result, int l, int r) {
42 | result.setInt((l == r) ? 1 : 0);
43 | return RESULT_STATE_SUCCESSFUL;
44 | }
45 |
46 | @Override
47 | protected int calcIntFloat(Data result, int l, float r) {
48 | result.setInt((l == r) ? 1 : 0);
49 | return RESULT_STATE_SUCCESSFUL;
50 | }
51 |
52 | @Override
53 | protected int calcFloatInt(Data result, float l, int r) {
54 | result.setInt((l == r) ? 1 : 0);
55 | return RESULT_STATE_SUCCESSFUL;
56 | }
57 |
58 | @Override
59 | protected int calcFloatFloat(Data result, float l, float r) {
60 | result.setInt((l == r) ? 1 : 0);
61 | return RESULT_STATE_SUCCESSFUL;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/GEExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/18.
31 | */
32 | public class GEExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt((l >= r) ? 1 : 0);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setInt((l >= r) ? 1 : 0);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setInt((l >= r) ? 1 : 0);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setInt((l >= r) ? 1 : 0);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/GTExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/18.
31 | */
32 | public class GTExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt((l > r) ? 1 : 0);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setInt((l > r) ? 1 : 0);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setInt((l > r) ? 1 : 0);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setInt((l > r) ? 1 : 0);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/JmpExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import android.util.Log;
28 |
29 | import com.tmall.wireless.vaf.virtualview.core.ViewBase;
30 |
31 | /**
32 | * Created by gujicheng on 16/12/13.
33 | */
34 |
35 | public class JmpExecutor extends ArithExecutor {
36 | private final static String TAG = "JmpExecutor_TMTEST";
37 |
38 | public int execute(Object com) {
39 | super.execute(com);
40 |
41 | int jmpPos = mCodeReader.readInt();
42 |
43 | // Log.d(TAG, "jmp pos:" + jmpPos);
44 | mCodeReader.setPos(jmpPos);
45 |
46 | return RESULT_STATE_SUCCESSFUL;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/LEExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/18.
31 | */
32 | public class LEExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt((l <= r) ? 1 : 0);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setInt((l <= r) ? 1 : 0);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setInt((l <= r) ? 1 : 0);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setInt((l <= r) ? 1 : 0);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/LTExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/18.
31 | */
32 | public class LTExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt((l < r) ? 1 : 0);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setInt((l < r) ? 1 : 0);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setInt((l < r) ? 1 : 0);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setInt((l < r) ? 1 : 0);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/ModEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import android.util.Log;
28 |
29 | import com.tmall.wireless.vaf.expr.engine.data.Data;
30 |
31 | /**
32 | * Created by gujicheng on 16/10/24.
33 | */
34 | public class ModEqExecutor extends CompositeEqExecutor {
35 | private final static String TAG = "DivEqExecutor_TMTEST";
36 |
37 | @Override
38 | protected void calcIntInt(Data result, int l, int r) {
39 | if (0 == r) {
40 | Log.e(TAG, "div zero");
41 | }
42 | result.setInt(l % r);
43 | }
44 |
45 | @Override
46 | protected void calcIntFloat(Data result, int l, float r) {
47 | result.setFloat(l % r);
48 | }
49 |
50 | @Override
51 | protected void calcFloatInt(Data result, float l, int r) {
52 | if (0 == r) {
53 | Log.e(TAG, "div zero");
54 | }
55 | result.setFloat(l % r);
56 | }
57 |
58 | @Override
59 | protected void calcFloatFloat(Data result, float l, float r) {
60 | result.setFloat(l % r);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/ModExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import android.util.Log;
28 |
29 | import com.tmall.wireless.vaf.expr.engine.data.Data;
30 |
31 | /**
32 | * Created by gujicheng on 16/9/12.
33 | */
34 | public class ModExecutor extends BinExecutor {
35 | private final static String TAG = "ModeExecutor_TMTEST";
36 |
37 | @Override
38 | protected int calcIntInt(Data result, int l, int r) {
39 | if (0 == r) {
40 | Log.e(TAG, "div zero");
41 | return RESULT_STATE_ERROR;
42 | } else {
43 | result.setInt(l % r);
44 | return RESULT_STATE_SUCCESSFUL;
45 | }
46 | }
47 |
48 | @Override
49 | protected int calcIntFloat(Data result, int l, float r) {
50 | result.setFloat(l % r);
51 | return RESULT_STATE_SUCCESSFUL;
52 | }
53 |
54 | @Override
55 | protected int calcFloatInt(Data result, float l, int r) {
56 | if (0 == r) {
57 | Log.e(TAG, "div zero");
58 | return RESULT_STATE_ERROR;
59 | } else {
60 | result.setFloat(l % r);
61 | return RESULT_STATE_SUCCESSFUL;
62 | }
63 | }
64 |
65 | @Override
66 | protected int calcFloatFloat(Data result, float l, float r) {
67 | result.setFloat(l % r);
68 | return RESULT_STATE_SUCCESSFUL;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/MulEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/10/24.
31 | */
32 | public class MulEqExecutor extends CompositeEqExecutor {
33 | @Override
34 | protected void calcIntInt(Data result, int l, int r) {
35 | result.setInt(l * r);
36 | }
37 |
38 | @Override
39 | protected void calcIntFloat(Data result, int l, float r) {
40 | result.setFloat(l * r);
41 | }
42 |
43 | @Override
44 | protected void calcFloatInt(Data result, float l, int r) {
45 | result.setFloat(l * r);
46 | }
47 |
48 | @Override
49 | protected void calcFloatFloat(Data result, float l, float r) {
50 | result.setFloat(l * r);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/MulExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/12.
31 | */
32 | public class MulExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt(l * r);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setFloat(l * r);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setFloat(l * r);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setFloat(l * r);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/NotEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/18.
31 | */
32 | public class NotEqExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt((l != r) ? 1 : 0);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setInt((l != r) ? 1 : 0);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setInt((l != r) ? 1 : 0);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setInt((l != r) ? 1 : 0);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/OrExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 17/3/27.
31 | */
32 |
33 | public class OrExecutor extends BinExecutor {
34 | @Override
35 | protected int calcIntInt(Data result, int l, int r) {
36 | result.setInt((1 == l || 1 == r) ? 1 : 0);
37 | return RESULT_STATE_SUCCESSFUL;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/SubEqExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/10/24.
31 | */
32 | public class SubEqExecutor extends CompositeEqExecutor {
33 | @Override
34 | protected void calcIntInt(Data result, int l, int r) {
35 | result.setInt(l - r);
36 | }
37 |
38 | @Override
39 | protected void calcIntFloat(Data result, int l, float r) {
40 | result.setFloat(l - r);
41 | }
42 |
43 | @Override
44 | protected void calcFloatInt(Data result, float l, int r) {
45 | result.setFloat(l - r);
46 | }
47 |
48 | @Override
49 | protected void calcFloatFloat(Data result, float l, float r) {
50 | result.setFloat(l - r);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/executor/SubExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.executor;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.data.Data;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/12.
31 | */
32 | public class SubExecutor extends BinExecutor {
33 | @Override
34 | protected int calcIntInt(Data result, int l, int r) {
35 | result.setInt(l - r);
36 | return RESULT_STATE_SUCCESSFUL;
37 | }
38 |
39 | @Override
40 | protected int calcIntFloat(Data result, int l, float r) {
41 | result.setFloat(l - r);
42 | return RESULT_STATE_SUCCESSFUL;
43 | }
44 |
45 | @Override
46 | protected int calcFloatInt(Data result, float l, int r) {
47 | result.setFloat(l - r);
48 | return RESULT_STATE_SUCCESSFUL;
49 | }
50 |
51 | @Override
52 | protected int calcFloatFloat(Data result, float l, float r) {
53 | result.setFloat(l - r);
54 | return RESULT_STATE_SUCCESSFUL;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/finder/ObjectFinder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.finder;
26 |
27 | import com.tmall.wireless.vaf.expr.engine.EngineContext;
28 |
29 | /**
30 | * Created by gujicheng on 17/3/28.
31 | */
32 |
33 | public interface ObjectFinder {
34 | boolean find(EngineContext context);
35 | }
36 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/expr/engine/finder/ObjectFinderManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.expr.engine.finder;
26 |
27 | import android.text.TextUtils;
28 |
29 | import java.util.HashMap;
30 | import java.util.Map;
31 |
32 | /**
33 | * Created by gujicheng on 17/3/28.
34 | */
35 |
36 | public class ObjectFinderManager {
37 | private final static String TAG = "ObjectFinderManager_TMTEST";
38 |
39 | private Map mDataMap = new HashMap<>();
40 |
41 | public void addFinder(String key, ObjectFinder of) {
42 | if (!TextUtils.isEmpty(key) && null != of) {
43 | mDataMap.put(key, of);
44 | }
45 | }
46 |
47 | public ObjectFinder getFinder(String key) {
48 | if (!TextUtils.isEmpty(key)) {
49 | return mDataMap.get(key);
50 | }
51 |
52 | return null;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/framework/UserData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.framework;
26 |
27 | import android.text.TextUtils;
28 |
29 | import java.util.HashMap;
30 | import java.util.Map;
31 |
32 | /**
33 | * Created by gujicheng on 17/1/17.
34 | */
35 |
36 | public class UserData {
37 | private Map mData = new HashMap();
38 |
39 | public void clear() {
40 | mData.clear();
41 | }
42 |
43 | public void put(String key, Object v) {
44 | if (!TextUtils.isEmpty(key) && null != v) {
45 | mData.put(key, v);
46 | }
47 | }
48 |
49 | public Object get(String key) {
50 | return mData.get(key);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/framework/cm/ComContainerTypeMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.framework.cm;
26 |
27 | import java.util.concurrent.ConcurrentHashMap;
28 |
29 | /**
30 | * Created by gujicheng on 17/4/10.
31 | */
32 |
33 | public class ComContainerTypeMap {
34 | private ConcurrentHashMap mMap = new ConcurrentHashMap();
35 |
36 | public void register(String comMap, int containerType) {
37 | if (comMap != null && containerType > -1) {
38 | mMap.put(comMap, containerType);
39 | }
40 | }
41 |
42 | public int getContainerMap(String comType) {
43 | int ret = -1;
44 |
45 | Integer r = mMap.get(comType);
46 | if (null != r) {
47 | ret = r;
48 | }
49 |
50 | return ret;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/framework/cm/ContainerMrg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.framework.cm;
26 |
27 | import com.tmall.wireless.vaf.framework.VafContext;
28 | import com.tmall.wireless.vaf.virtualview.core.IContainer;
29 |
30 | import java.util.LinkedList;
31 | import java.util.List;
32 |
33 | /**
34 | * Created by gujicheng on 16/12/12.
35 | */
36 |
37 | public abstract class ContainerMrg {
38 | protected List mContainers = new LinkedList<>();
39 |
40 | public abstract IContainer getContainer(VafContext context);
41 |
42 | public void recycle(IContainer c) {
43 | mContainers.add(c);
44 | }
45 |
46 | public void destroy() {
47 | for (IContainer c : mContainers) {
48 | c.destroy();
49 | }
50 | mContainers.clear();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/framework/cm/NormalManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.framework.cm;
26 |
27 | import com.tmall.wireless.vaf.framework.VafContext;
28 | import com.tmall.wireless.vaf.virtualview.container.Container;
29 | import com.tmall.wireless.vaf.virtualview.core.IContainer;
30 |
31 | /**
32 | * Created by gujicheng on 16/12/12.
33 | */
34 |
35 | public class NormalManager extends ContainerMrg {
36 | @Override
37 | public IContainer getContainer(VafContext context) {
38 | IContainer ret;
39 | if (mContainers.size() > 0) {
40 | ret = mContainers.remove(0);
41 | } else {
42 | ret = new Container(context.forViewConstruction());
43 | }
44 | return ret;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/Helper/BeanManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.Helper;
26 |
27 | import android.util.Log;
28 | import com.libra.TextUtils;
29 | import com.tmall.wireless.vaf.virtualview.core.IBean;
30 |
31 | import java.util.concurrent.ConcurrentHashMap;
32 |
33 | /**
34 | * Created by longerian on 2017/7/12.
35 | *
36 | * @author longerian
37 | * @date 2017/07/12
38 | */
39 |
40 | public class BeanManager {
41 |
42 | private final static String TAG = "BeanManager_TMTEST";
43 |
44 | private ConcurrentHashMap> mBeanArrayMap = new ConcurrentHashMap<>();
45 |
46 | public void register(String type, Class extends IBean> processor) {
47 | if (null != processor && !TextUtils.isEmpty(type)) {
48 | mBeanArrayMap.put(type, processor);
49 | } else {
50 | Log.e(TAG, "register failed type:" + type + " processor:" + processor);
51 | }
52 | }
53 |
54 | public void unregister(String type, Class extends IBean> processor) {
55 | if (null != processor && !TextUtils.isEmpty(type)) {
56 | mBeanArrayMap.remove(type);
57 | } else {
58 | Log.e(TAG, "unregister failed type:" + type + " processor:" + processor);
59 | }
60 | }
61 |
62 | public Class extends IBean> getBeanFor(String type) {
63 | return mBeanArrayMap.get(type);
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/Helper/NativeViewManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.Helper;
26 |
27 | import com.libra.TextUtils;
28 |
29 | import java.util.concurrent.ConcurrentHashMap;
30 |
31 | /**
32 | * Created by longerian on 2017/7/12.
33 | *
34 | * @author longerian
35 | * @date 2017/07/12
36 | */
37 |
38 | public class NativeViewManager {
39 |
40 | private final static String TAG = "CompactNativeManager_TMTEST";
41 |
42 | private ConcurrentHashMap> mBeanArrayMap = new ConcurrentHashMap<>();
43 |
44 | public void register(String type, Class> processor) {
45 | if (null != processor && !TextUtils.isEmpty(type)) {
46 | mBeanArrayMap.put(type, processor);
47 | }
48 | }
49 |
50 | public void unregister(String type, Class> processor) {
51 | if (null != processor && !TextUtils.isEmpty(type)) {
52 | mBeanArrayMap.remove(type);
53 | }
54 | }
55 |
56 | public Class> getNativeViewFor(String type) {
57 | return mBeanArrayMap.get(type);
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/Helper/RtlHelper.java:
--------------------------------------------------------------------------------
1 | package com.tmall.wireless.vaf.virtualview.Helper;
2 |
3 | import android.os.Build;
4 | import android.text.TextUtils;
5 | import android.view.View;
6 |
7 | import com.libra.virtualview.common.ViewBaseCommon;
8 |
9 | import java.util.Locale;
10 |
11 | /**
12 | * Created on 2018/3/27.
13 | * Description:
14 | *
15 | * @author bianyue
16 | */
17 | public class RtlHelper {
18 |
19 | private static boolean sEnable = true;
20 |
21 | public static boolean isEnable() {
22 | return sEnable;
23 | }
24 |
25 | public static void setEnable(boolean enable) {
26 | sEnable = enable;
27 | }
28 |
29 | /**
30 | * In Rtl env or not.
31 | * @return true if in Rtl env.
32 | */
33 | public static boolean isRtl() {
34 | if (sEnable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
35 | return View.LAYOUT_DIRECTION_RTL == TextUtils.getLayoutDirectionFromLocale(Locale.getDefault());
36 | }
37 |
38 | return false;
39 | }
40 |
41 | /**
42 | * Convert left to RTL left if need.
43 | * @param parentLeft parent's left
44 | * @param parentWidth parent's width
45 | * @param left self's left
46 | * @param width self's width
47 | * @return
48 | */
49 | public static int getRealLeft(boolean isRtl, int parentLeft, int parentWidth, int left, int width) {
50 | if (isRtl) {
51 | // 1, trim the parent's left.
52 | left -= parentLeft;
53 | // 2, calculate the RTL left.
54 | left = parentWidth - width - left;
55 | // 3, add the parent's left.
56 | left += parentLeft;
57 | }
58 | return left;
59 | }
60 |
61 | /**
62 | * Convert (left/right) gravity to (right/left).
63 | * @param gravity
64 | * @return rtl gravity
65 | */
66 | public static int resolveRtlGravity(int gravity) {
67 | if (0 != (gravity & ViewBaseCommon.RIGHT)) {
68 | gravity &= ~ViewBaseCommon.RIGHT;
69 | gravity |= ViewBaseCommon.LEFT;
70 | } else if (0 != (gravity & ViewBaseCommon.LEFT)) {
71 | gravity &= ~ViewBaseCommon.LEFT;
72 | gravity |= ViewBaseCommon.RIGHT;
73 | }
74 |
75 | return gravity;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/Helper/ServiceManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.Helper;
26 |
27 | import java.util.Map;
28 | import java.util.concurrent.ConcurrentHashMap;
29 |
30 | import android.support.annotation.NonNull;
31 |
32 | /**
33 | * Use for communicate with outside class.
34 | * Created by mikeafc on 2017/8/24.
35 | */
36 |
37 | public class ServiceManager {
38 | private Map, Object> mServices = new ConcurrentHashMap<>();
39 |
40 | public void register(@NonNull Class type, @NonNull S service) {
41 | mServices.put(type, type.cast(service));
42 | }
43 |
44 | public S getService(@NonNull Class type) {
45 | Object service = mServices.get(type);
46 | if (service == null) {
47 | return null;
48 | }
49 | return type.cast(service);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/Helper/VVFeatureConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.Helper;
26 |
27 | import com.tmall.wireless.vaf.framework.VafContext;
28 | import com.tmall.wireless.vaf.virtualview.view.slider.SliderCompact;
29 |
30 | /**
31 | * Created by longerian on 2018/3/30.
32 | *
33 | * @author longerian
34 | * @date 2018/03/30
35 | */
36 |
37 | public class VVFeatureConfig {
38 |
39 | private static boolean sliderCompat = false;
40 |
41 | /**
42 | * Call this before create {@link VafContext} instance.
43 | * @param enableBorderRadius true, enable border radius and clip view.
44 | */
45 | public static void setEnableBorderRadius(boolean enableBorderRadius) {
46 | VirtualViewUtils.setEnableBorderRadius(enableBorderRadius);
47 | }
48 |
49 | /**
50 | *
51 | * @param compat true, use {@link SliderCompact} to render slider, otherwise use {@link com.tmall.wireless.vaf.virtualview.view.slider.Slider}
52 | */
53 | public static void setSliderCompat(boolean compat) {
54 | sliderCompat = compat;
55 | }
56 |
57 | public static boolean isSliderCompat() {
58 | return sliderCompat;
59 | }
60 |
61 | /**
62 | * @param available true, enable rtl in layout duration.
63 | */
64 | public static void setRtlAvailable(boolean available) {
65 | RtlHelper.setEnable(available);
66 | }
67 |
68 | public static boolean isRtlAvailable() {
69 | return RtlHelper.isEnable();
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/core/IBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.core;
26 |
27 | import android.content.Context;
28 |
29 | /**
30 | * Created by gujicheng on 16/9/8.
31 | */
32 | public interface IBean {
33 | void init(Context context, ViewBase view);
34 | void uninit();
35 | void doEvent(int type, int param, Object objParam);
36 | void setData(Object data);
37 | void appendData(Object data);
38 | void click(int id, boolean isLong);
39 | }
40 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/core/IContainer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.core;
26 |
27 | import android.view.View;
28 |
29 | /**
30 | * Created by gujicheng on 16/8/24.
31 | */
32 | public interface IContainer {
33 | void attachViews();
34 | void setVirtualView(ViewBase view);
35 | ViewBase getVirtualView();
36 | View getHolderView();
37 | void destroy();
38 | int getType();
39 | }
40 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/core/IView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.core;
26 |
27 | /**
28 | * Created by gujicheng on 16/8/15.
29 | */
30 | public interface IView {
31 | void measureComponent(int widthMeasureSpec, int heightMeasureSpec);
32 |
33 | void comLayout(int l, int t, int r, int b);
34 |
35 | void onComMeasure(int widthMeasureSpec, int heightMeasureSpec);
36 |
37 | void onComLayout(boolean changed, int l, int t, int r, int b);
38 |
39 | int getComMeasuredWidth();
40 |
41 | int getComMeasuredHeight();
42 | }
43 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/core/VirtualViewBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.core;
26 |
27 | import com.tmall.wireless.vaf.framework.VafContext;
28 |
29 | /**
30 | * Created by gujicheng on 16/12/19.
31 | */
32 |
33 | public class VirtualViewBase extends ViewBase {
34 | protected VirtualViewImp mImp = new VirtualViewImp();
35 |
36 | public VirtualViewBase(VafContext context, ViewCache viewCache) {
37 | super(context, viewCache);
38 | mImp.setViewBase(this);
39 | }
40 |
41 | @Override
42 | public void onComMeasure(int widthMeasureSpec, int heightMeasureSpec) {
43 | mImp.onComMeasure(widthMeasureSpec, heightMeasureSpec);
44 | }
45 |
46 | @Override
47 | public void measureComponent(int widthMeasureSpec, int heightMeasureSpec) {
48 | mImp.measureComponent(widthMeasureSpec, heightMeasureSpec);
49 | }
50 |
51 | @Override
52 | public void onComLayout(boolean changed, int l, int t, int r, int b) {
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/event/IClickProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.event;
26 |
27 | /**
28 | * Created by gujicheng on 17/1/11.
29 | */
30 |
31 | public interface IClickProcessor {
32 | boolean process(EventData data);
33 | }
34 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/event/IEventProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.event;
26 |
27 | /**
28 | * Created by gujicheng on 16/12/28.
29 | */
30 |
31 | public interface IEventProcessor {
32 | boolean process(EventData data);
33 | }
34 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/listener/MonitorListener.java:
--------------------------------------------------------------------------------
1 | package com.tmall.wireless.vaf.virtualview.listener;
2 |
3 | public interface MonitorListener {
4 | void onTemplateNotFound(String type);
5 |
6 | /**
7 | * When a template be used, would invoke this method.
8 | *
9 | * @param type template name
10 | */
11 | void monitorUsage(String type);
12 | }
13 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/loader/ExprCodeLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.loader;
26 |
27 | import android.util.Log;
28 |
29 | import com.libra.expr.common.ExprCode;
30 |
31 | import java.util.concurrent.ConcurrentHashMap;
32 |
33 | /**
34 | * Created by gujicheng on 16/9/12.
35 | */
36 | public class ExprCodeLoader {
37 | private final static String TAG = "CodeManager_TMTEST";
38 |
39 | private ConcurrentHashMap mCodeMap = new ConcurrentHashMap();
40 |
41 | public void reset() {
42 | }
43 |
44 | public ExprCode get(int index) {
45 | return mCodeMap.get(index);
46 | }
47 |
48 | public boolean loadFromBuffer(CodeReader reader, int pageId) {
49 | boolean ret = true;
50 | int totalSize = reader.getMaxSize();
51 | int count = reader.readInt();
52 | for (int k = 0; k < count; ++k) {
53 | int index = reader.readInt();
54 | int len = reader.readShort();
55 | int pos = reader.getPos();
56 | if (pos + len <= totalSize) {
57 | byte[] codes = reader.getCode();
58 | ExprCode c = new ExprCode(codes, pos, len);
59 | mCodeMap.put(index, c);
60 | reader.seekBy(len);
61 | } else {
62 | Log.e(TAG, "read string over");
63 | ret = false;
64 | break;
65 | }
66 | }
67 | return ret;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/VirtualTime.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.view;
26 |
27 | import com.tmall.wireless.vaf.framework.VafContext;
28 | import com.tmall.wireless.vaf.virtualview.core.ViewBase;
29 | import com.tmall.wireless.vaf.virtualview.core.ViewCache;
30 |
31 | /**
32 | * Created by gujicheng on 16/12/9.
33 | */
34 | @Deprecated
35 | public class VirtualTime extends ViewBase {
36 | public VirtualTime(VafContext context, ViewCache viewCache) {
37 | super(context, viewCache);
38 | }
39 |
40 | @Override
41 | public void onComMeasure(int widthMeasureSpec, int heightMeasureSpec) {
42 | }
43 |
44 | @Override
45 | public void onComLayout(boolean changed, int l, int t, int r, int b) {
46 | }
47 |
48 | public static class Builder implements ViewBase.IBuilder {
49 | @Override
50 | public ViewBase build(VafContext context, ViewCache viewCache) {
51 | return new VirtualTime(context, viewCache);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/nlayout/INativeLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.view.nlayout;
26 |
27 | import android.graphics.Canvas;
28 |
29 | /**
30 | * Created by longerian on 2018/3/17.
31 | *
32 | * @author longerian
33 | * @date 2018/03/17
34 | */
35 |
36 | public interface INativeLayout {
37 |
38 | void onLayoutMeasure(int widthMeasureSpec, int heightMeasureSpec);
39 |
40 | void onLayoutLayout(boolean changed, int l, int t, int r, int b);
41 |
42 | void layoutDraw(Canvas canvas);
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/nlayout/INativeLayoutImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.view.nlayout;
26 |
27 | import android.view.View;
28 | import com.tmall.wireless.vaf.virtualview.core.ViewBase;
29 |
30 | /**
31 | * Created by longerian on 2018/3/27.
32 | *
33 | * @author longerian
34 | * @date 2018/03/27
35 | */
36 |
37 | public interface INativeLayoutImpl {
38 |
39 | void attachViews(ViewBase view, View displayViewHolder);
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/scroller/ScrollerStickyParent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.view.scroller;
26 |
27 | import android.content.Context;
28 | import android.widget.FrameLayout;
29 |
30 | import com.tmall.wireless.vaf.virtualview.core.IView;
31 |
32 | /**
33 | * Created by gujicheng on 16/11/4.
34 | */
35 |
36 | public class ScrollerStickyParent extends FrameLayout implements IView {
37 | private final static String TAG = "ScrollerSticky_TMTEST";
38 |
39 | public ScrollerStickyParent(Context context) {
40 | super(context);
41 | }
42 |
43 | @Override
44 | public void measureComponent(int widthMeasureSpec, int heightMeasureSpec) {
45 | this.measure(widthMeasureSpec, heightMeasureSpec);
46 | }
47 |
48 | @Override
49 | public void comLayout(int l, int t, int r, int b) {
50 | this.layout(l, t, r, b);
51 | }
52 |
53 | @Override
54 | public void onComMeasure(int widthMeasureSpec, int heightMeasureSpec) {
55 | this.onMeasure(widthMeasureSpec, heightMeasureSpec);
56 | }
57 |
58 | @Override
59 | public void onComLayout(boolean changed, int l, int t, int r, int b) {
60 | this.onLayout(changed, l, t, r, b);
61 | }
62 |
63 | @Override
64 | public int getComMeasuredWidth() {
65 | return this.getMeasuredWidth();
66 | }
67 |
68 | @Override
69 | public int getComMeasuredHeight() {
70 | return this.getMeasuredHeight();
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/virtualview/src/main/java/com/tmall/wireless/vaf/virtualview/view/slider/Slider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.vaf.virtualview.view.slider;
26 |
27 | import android.support.v7.widget.LinearSnapHelper;
28 |
29 | import com.tmall.wireless.vaf.framework.VafContext;
30 | import com.tmall.wireless.vaf.virtualview.core.ViewBase;
31 | import com.tmall.wireless.vaf.virtualview.core.ViewCache;
32 | import com.tmall.wireless.vaf.virtualview.view.scroller.Scroller;
33 |
34 | /**
35 | * Created by gujicheng on 16/12/15.
36 | */
37 |
38 | public class Slider extends Scroller {
39 |
40 | public Slider(VafContext context, ViewCache viewCache) {
41 | super(context, viewCache);
42 |
43 | LinearSnapHelper snapHelper = new LinearSnapHelper();
44 | snapHelper.attachToRecyclerView(mNative);
45 | }
46 |
47 | public static class Builder implements ViewBase.IBuilder {
48 | @Override
49 | public ViewBase build(VafContext context, ViewCache viewCache) {
50 | return new Slider(context, viewCache);
51 | }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/virtualview/src/test/java/com/tmall/wireless/virtualview/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (c) 2018 Alibaba Group
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | package com.tmall.wireless.virtualview;
26 |
27 | import org.junit.Test;
28 |
29 | import static org.junit.Assert.*;
30 |
31 | /**
32 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
33 | */
34 | public class ExampleUnitTest {
35 | @Test
36 | public void addition_isCorrect() throws Exception {
37 | assertEquals(4, 2 + 2);
38 | }
39 | }
--------------------------------------------------------------------------------