├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README-ch.md ├── README.md ├── build.gradle ├── docs ├── Tutorial-ch.md ├── Tutorial.md └── images │ └── tangramdemo.gif ├── examples ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ ├── AndroidManifest.xml │ ├── assets │ │ └── testdata.json │ ├── java │ │ └── com │ │ │ └── tmall │ │ │ └── wireless │ │ │ └── tangram │ │ │ ├── ApplicationTest.java │ │ │ ├── BannerTestActivity.java │ │ │ ├── CellBindLFEvent.java │ │ │ ├── LifeCycleHelperTest.java │ │ │ ├── RxBannerSupportTest.java │ │ │ ├── RxClickSupportTest.java │ │ │ ├── RxExposureSupportTest.java │ │ │ └── RxTimerSupportTest.java │ └── res │ │ └── layout │ │ └── test_main_activity.xml │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── data.json │ ├── data3.0.json │ ├── data_third.json │ └── vvtest.xml │ ├── java │ └── com │ │ ├── alibaba │ │ └── android │ │ │ └── rx │ │ │ ├── JSONArrayObservable.java │ │ │ ├── ViewClickObservable.java │ │ │ └── lifecycle │ │ │ ├── ActivityLFEvent.java │ │ │ ├── LFEvent.java │ │ │ ├── LifeCycleHelper.java │ │ │ ├── LifeCycleProvider.java │ │ │ ├── LifeCycleProviderImpl.java │ │ │ └── LifecycleTransformer.java │ │ └── tmall │ │ └── wireless │ │ └── tangram │ │ └── example │ │ ├── DemoListActivity.java │ │ ├── RxTangramActivity.java │ │ ├── TangramActivity.java │ │ ├── TangramApplication.java │ │ ├── TangramDataParserActivity.java │ │ ├── data │ │ ├── DEBUG.java │ │ ├── FloatView.java │ │ ├── RatioImageView.java │ │ ├── RatioTextView.java │ │ ├── SimpleImgView.java │ │ ├── SingleImageView.java │ │ ├── TestView.java │ │ ├── TestViewHolder.java │ │ ├── TestViewHolderCell.java │ │ └── VVTEST.java │ │ ├── dataparser │ │ └── SampleDataParser.java │ │ ├── support │ │ ├── SampleClickSupport.java │ │ ├── SampleErrorSupport.java │ │ └── SampleScrollSupport.java │ │ └── tangram3 │ │ ├── Tangram3Activity.java │ │ ├── TestBlockView.java │ │ ├── TestImageView.java │ │ └── VirtualViewRenderService.java │ └── res │ ├── drawable │ └── item_background.xml │ ├── layout │ ├── event_bus_activity.xml │ ├── item.xml │ ├── item_holder.xml │ ├── main_activity.xml │ ├── nested_activity.xml │ └── tabs.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jcenterDeploy.gradle ├── jcenterInstall.gradle ├── settings.gradle ├── tangram ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── tmall │ │ └── wireless │ │ └── tangram │ │ ├── BaseTangramEngine.java │ │ ├── DefaultResolverRegistry.java │ │ ├── Engine.java │ │ ├── MVHelper.java │ │ ├── MVResolver.java │ │ ├── TangramBuilder.java │ │ ├── TangramEngine.java │ │ ├── core │ │ ├── adapter │ │ │ ├── BinderViewHolder.java │ │ │ ├── CacheItem.java │ │ │ ├── GroupBasicAdapter.java │ │ │ └── WrapAdapter.java │ │ ├── protocol │ │ │ ├── ControlBinder.java │ │ │ ├── ControlBinderResolver.java │ │ │ ├── LayoutBinder.java │ │ │ ├── LayoutBinderResolver.java │ │ │ ├── ViewCreator.java │ │ │ └── ViewMounter.java │ │ ├── resolver │ │ │ ├── BaseResolver.java │ │ │ ├── ClassResolver.java │ │ │ ├── InstanceResolver.java │ │ │ └── Resolver.java │ │ └── service │ │ │ └── ServiceManager.java │ │ ├── dataparser │ │ ├── DataParser.java │ │ ├── IAdapterBuilder.java │ │ └── concrete │ │ │ ├── BaseCardBinderResolver.java │ │ │ ├── BaseCellBinder.java │ │ │ ├── BaseCellBinderResolver.java │ │ │ ├── BaseLayoutBinder.java │ │ │ ├── Card.java │ │ │ ├── CardResolver.java │ │ │ ├── Cell.java │ │ │ ├── ComponentLifecycle.java │ │ │ ├── IDelegateCard.java │ │ │ ├── PojoAdapterBuilder.java │ │ │ ├── PojoDataParser.java │ │ │ ├── PojoGroupBasicAdapter.java │ │ │ ├── Style.java │ │ │ └── WrapperCard.java │ │ ├── eventbus │ │ ├── BusSupport.java │ │ ├── Dispatcher.java │ │ ├── Event.java │ │ ├── EventContext.java │ │ ├── EventHandlerWrapper.java │ │ ├── EventPool.java │ │ ├── IDispatcher.java │ │ ├── IDispatcherDelegate.java │ │ └── ReflectedActionFinder.java │ │ ├── ext │ │ ├── BannerListener.java │ │ ├── PullFromEndListener.java │ │ └── SwipeItemTouchListener.java │ │ ├── op │ │ ├── AppendGroupOp.java │ │ ├── AppendGroupsOp.java │ │ ├── ClickExposureCellOp.java │ │ ├── InsertCellOp.java │ │ ├── InsertCellsOp.java │ │ ├── InsertGroupOp.java │ │ ├── InsertGroupsOp.java │ │ ├── LoadGroupOp.java │ │ ├── LoadMoreOp.java │ │ ├── ParseComponentsOp.java │ │ ├── ParseGroupsOp.java │ │ ├── ParseSingleComponentOp.java │ │ ├── ParseSingleGroupOp.java │ │ ├── RemoveCellOp.java │ │ ├── RemoveCellPositionOp.java │ │ ├── RemoveGroupIdxOp.java │ │ ├── RemoveGroupOp.java │ │ ├── ReplaceCellOp.java │ │ ├── ReplaceGroupContentOp.java │ │ ├── ReplaceGroupOp.java │ │ ├── TangramOp1.java │ │ ├── TangramOp2.java │ │ ├── TangramOp3.java │ │ └── UpdateCellOp.java │ │ ├── structure │ │ ├── BaseCell.java │ │ ├── CellRender.java │ │ ├── ViewCreator.java │ │ ├── card │ │ │ ├── BannerCard.java │ │ │ ├── ColumnCard.java │ │ │ ├── DoubleColumnCard.java │ │ │ ├── FiveColumnCard.java │ │ │ ├── FixCard.java │ │ │ ├── FixLinearScrollCard.java │ │ │ ├── FloatCard.java │ │ │ ├── FlowCard.java │ │ │ ├── FourColumnCard.java │ │ │ ├── FusionCard.java │ │ │ ├── GridCard.java │ │ │ ├── LinearCard.java │ │ │ ├── LinearScrollCard.java │ │ │ ├── OneItemCard.java │ │ │ ├── OnePlusNCard.java │ │ │ ├── PinBottomCard.java │ │ │ ├── PinTopCard.java │ │ │ ├── ScrollFixCard.java │ │ │ ├── SingleColumnCard.java │ │ │ ├── SlideCard.java │ │ │ ├── StaggeredCard.java │ │ │ ├── StickyCard.java │ │ │ ├── StickyEndCard.java │ │ │ ├── SwipeCard.java │ │ │ ├── TripleColumnCard.java │ │ │ ├── VVCard.java │ │ │ └── WrapCellCard.java │ │ ├── cell │ │ │ ├── BannerCell.java │ │ │ └── LinearScrollCell.java │ │ ├── style │ │ │ ├── ColumnStyle.java │ │ │ └── DelegateStyle.java │ │ ├── view │ │ │ ├── ITangramViewLifeCycle.java │ │ │ └── SimpleEmptyView.java │ │ └── viewcreator │ │ │ └── ViewHolderCreator.java │ │ ├── support │ │ ├── BannerScrollStateChangedObservable.java │ │ ├── BannerScrolledObservable.java │ │ ├── BannerSelectedObservable.java │ │ ├── BannerSupport.java │ │ ├── CardSupport.java │ │ ├── CellClickObservable.java │ │ ├── CellExposureObservable.java │ │ ├── CellSupport.java │ │ ├── ExposureSupport.java │ │ ├── HandlerTimer.java │ │ ├── ITimer.java │ │ ├── InternalErrorSupport.java │ │ ├── PageDetectorSupport.java │ │ ├── RxBannerListener.java │ │ ├── RxBannerScrollStateChangedListener.java │ │ ├── RxBannerScrolledListener.java │ │ ├── RxBannerSelectedListener.java │ │ ├── RxClickListener.java │ │ ├── RxTimer.java │ │ ├── SimpleClickSupport.java │ │ ├── TimerSupport.java │ │ └── async │ │ │ ├── AsyncLoader.java │ │ │ ├── AsyncPageLoader.java │ │ │ └── CardLoadSupport.java │ │ ├── util │ │ ├── BDE.java │ │ ├── IInnerImageSetter.java │ │ ├── ImageUtils.java │ │ ├── LifeCycleHelper.java │ │ ├── LifeCycleProviderImpl.java │ │ ├── LifecycleTransformer.java │ │ ├── LogUtils.java │ │ ├── Preconditions.java │ │ ├── Predicate.java │ │ ├── TangramViewMetrics.java │ │ └── Utils.java │ │ └── view │ │ ├── BannerView.java │ │ ├── BannerViewPager.java │ │ ├── HorizontalScrollViewExt.java │ │ └── LinearScrollView.java │ └── res │ ├── drawable │ ├── tangram_linearscrollview_indicator.xml │ └── tangram_linearscrollview_indicator_bg.xml │ ├── layout │ ├── tangram_linearscrollview.xml │ └── tangram_linearscrollview_parent.xml │ └── values │ └── ids.xml └── tangram3 ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src └── main ├── AndroidManifest.xml ├── java └── com │ └── tmall │ └── wireless │ └── tangram3 │ ├── BaseTangramEngine.java │ ├── ComponentRenderManager.java │ ├── DefaultResolverRegistry.java │ ├── Engine.java │ ├── MVHelper.java │ ├── MVResolver.java │ ├── TangramBuilder.java │ ├── TangramEngine.java │ ├── core │ ├── adapter │ │ ├── BinderViewHolder.java │ │ ├── CacheItem.java │ │ ├── GroupBasicAdapter.java │ │ └── WrapAdapter.java │ ├── protocol │ │ ├── ControlBinder.java │ │ ├── ControlBinderResolver.java │ │ ├── ElementRenderService.java │ │ ├── LayoutBinder.java │ │ ├── LayoutBinderResolver.java │ │ ├── ViewCreator.java │ │ └── ViewMounter.java │ ├── resolver │ │ ├── BaseResolver.java │ │ ├── ClassResolver.java │ │ ├── InstanceResolver.java │ │ └── Resolver.java │ └── service │ │ └── ServiceManager.java │ ├── dataparser │ ├── DataParser.java │ ├── IAdapterBuilder.java │ └── concrete │ │ ├── BaseCardBinderResolver.java │ │ ├── BaseCellBinder.java │ │ ├── BaseCellBinderResolver.java │ │ ├── BaseLayoutBinder.java │ │ ├── Card.java │ │ ├── CardResolver.java │ │ ├── Cell.java │ │ ├── ComponentInfo.java │ │ ├── ComponentLifecycle.java │ │ ├── IDelegateCard.java │ │ ├── PojoAdapterBuilder.java │ │ ├── PojoDataParser.java │ │ ├── PojoGroupBasicAdapter.java │ │ ├── Style.java │ │ └── WrapperCard.java │ ├── eventbus │ ├── BusSupport.java │ ├── Dispatcher.java │ ├── Event.java │ ├── EventContext.java │ ├── EventHandlerWrapper.java │ ├── EventPool.java │ ├── IDispatcher.java │ ├── IDispatcherDelegate.java │ ├── IEventHandlerReceiver.java │ └── ReflectedActionFinder.java │ ├── ext │ ├── BannerListener.java │ ├── PullFromEndListener.java │ └── SwipeItemTouchListener.java │ ├── structure │ ├── BaseCell.java │ ├── TemplateInfo.java │ ├── ViewCreator.java │ ├── card │ │ ├── BannerCard.java │ │ ├── ColumnCard.java │ │ ├── DoubleColumnCard.java │ │ ├── FiveColumnCard.java │ │ ├── FixCard.java │ │ ├── FixLinearScrollCard.java │ │ ├── FloatCard.java │ │ ├── FlowCard.java │ │ ├── FourColumnCard.java │ │ ├── GridCard.java │ │ ├── LinearCard.java │ │ ├── LinearScrollCard.java │ │ ├── OnePlusNCard.java │ │ ├── PinBottomCard.java │ │ ├── PinTopCard.java │ │ ├── ScrollFixCard.java │ │ ├── SingleColumnCard.java │ │ ├── SlideCard.java │ │ ├── StaggeredCard.java │ │ ├── StickyCard.java │ │ ├── StickyEndCard.java │ │ ├── SwipeCard.java │ │ ├── TripleColumnCard.java │ │ ├── VVCard.java │ │ └── WrapCellCard.java │ ├── cell │ │ ├── BannerCell.java │ │ └── LinearScrollCell.java │ ├── style │ │ └── ColumnStyle.java │ ├── view │ │ ├── ITangramViewLifeCycle.java │ │ └── SimpleEmptyView.java │ └── viewcreator │ │ └── ViewHolderCreator.java │ ├── support │ ├── BannerSupport.java │ ├── CardSupport.java │ ├── CellSupport.java │ ├── ExposureSupport.java │ ├── HandlerTimer.java │ ├── ITimer.java │ ├── InternalErrorSupport.java │ ├── PageDetectorSupport.java │ ├── SimpleClickSupport.java │ ├── TemplateUpdateSupport.java │ ├── TimerSupport.java │ └── async │ │ ├── AsyncLoader.java │ │ ├── AsyncPageLoader.java │ │ └── CardLoadSupport.java │ ├── util │ ├── BDE.java │ ├── IInnerImageSetter.java │ ├── ImageUtils.java │ ├── LifeCycleHelper.java │ ├── LifeCycleProviderImpl.java │ ├── LifecycleTransformer.java │ ├── LogUtils.java │ ├── Preconditions.java │ ├── Predicate.java │ ├── TangramViewMetrics.java │ └── Utils.java │ └── view │ ├── BannerView.java │ ├── BannerViewPager.java │ ├── HorizontalScrollViewExt.java │ └── LinearScrollView.java └── res ├── drawable ├── tangram_linearscrollview_indicator.xml └── tangram_linearscrollview_indicator_bg.xml ├── layout ├── tangram_linearscrollview.xml └── tangram_linearscrollview_parent.xml └── values └── ids.xml /.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 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | .classpath 22 | .project 23 | .settings/ 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | #Log Files 29 | *.log 30 | 31 | # OS X 32 | .DS_Store 33 | 34 | # Mobile Tools for Java (J2ME) 35 | .mtj.tmp/ 36 | 37 | # Package Files # 38 | *.war 39 | *.ear 40 | *.iml 41 | 42 | # IDEA Files 43 | .idea/ 44 | out/ 45 | 46 | # MAVEN COMPILE Files 47 | target/ 48 | lint.xml 49 | .idea/misc.xml 50 | 51 | captures/ 52 | 53 | config.gradle 54 | 55 | deploy.gradle 56 | 57 | #jcenterDeploy.gradle 58 | #jcenterInstall.gradle -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /docs/images/tangramdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/docs/images/tangramdemo.gif -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /examples/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/villadora/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -dontwarn com.squareup.okhttp.** 20 | -dontwarn com.squareup.picasso.** 21 | 22 | -keep class com.tmall.wireless.tangram.** { *;} 23 | 24 | -keepattributes InnerClasses 25 | -keep class com.alibaba.android.vlayout.ExposeLinearLayoutManagerEx { *; } 26 | -keep class android.support.v7.widget.RecyclerView$LayoutParams { *; } 27 | -keep class android.support.v7.widget.RecyclerView$ViewHolder { *; } 28 | -keep class android.support.v7.widget.ChildHelper { *; } 29 | -keep class android.support.v7.widget.ChildHelper$Bucket { *; } 30 | -keep class android.support.v7.widget.RecyclerView$LayoutManager { *; } -------------------------------------------------------------------------------- /examples/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/src/androidTest/java/com/tmall/wireless/tangram/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.tangram; 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 | 38 | } -------------------------------------------------------------------------------- /examples/src/main/assets/data_third.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "items": [ 4 | { 5 | "msg": "banner item 0", 6 | "type": 110 7 | }, 8 | { 9 | "msg": "banner item 1", 10 | "type": 110 11 | } 12 | ], 13 | "type": 1000 14 | }, 15 | { 16 | "iconList": [ 17 | { 18 | "subTitle": "测试内容10jm", 19 | "title": "测试内容7774", 20 | "type": 1 21 | }, 22 | { 23 | "subTitle": "测试内容10jm", 24 | "title": "测试内容7774", 25 | "type": 1 26 | }, 27 | { 28 | "subTitle": "测试内容10jm", 29 | "title": "测试内容7774", 30 | "type": 1 31 | }, 32 | { 33 | "subTitle": "测试内容10jm", 34 | "title": "测试内容7774", 35 | "type": 1 36 | } 37 | ], 38 | "type": 2000 39 | }, 40 | { 41 | "centerBannerList": [ 42 | { 43 | "msg": "centerBannerList 0", 44 | "type": 110 45 | }, 46 | { 47 | "msg": "centerBannerList 1", 48 | "type": 110 49 | } 50 | ], 51 | "type": 1000 52 | } 53 | ] -------------------------------------------------------------------------------- /examples/src/main/java/com/alibaba/android/rx/lifecycle/LFEvent.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.alibaba.android.rx.lifecycle; 26 | 27 | /** 28 | * Created by longerian on 2018/4/4. 29 | * 30 | * @author longerian 31 | * @date 2018/04/04 32 | */ 33 | 34 | abstract public class LFEvent { 35 | 36 | final protected String name; 37 | 38 | protected LFEvent(String name) { 39 | this.name = name; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "LFEvent{" + 45 | "name='" + name + '\'' + 46 | '}'; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/src/main/java/com/alibaba/android/rx/lifecycle/LifeCycleProvider.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.alibaba.android.rx.lifecycle; 26 | 27 | /** 28 | * Created by longerian on 2018/4/4. 29 | * 30 | * @author longerian 31 | * @date 2018/04/04 32 | */ 33 | 34 | public interface LifeCycleProvider { 35 | 36 | void emitNext(E event); 37 | 38 | LifecycleTransformer bindUntil(E event); 39 | 40 | LifecycleTransformer bindToLifecycle(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /examples/src/main/java/com/tmall/wireless/tangram/example/TangramApplication.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.tangram.example; 26 | 27 | import android.app.Application; 28 | import com.squareup.picasso.Picasso; 29 | 30 | /** 31 | * Created by longerian on 2018/3/14. 32 | * 33 | * @author longerian 34 | * @date 2018/03/14 35 | */ 36 | 37 | public class TangramApplication extends Application { 38 | 39 | @Override 40 | public void onCreate() { 41 | super.onCreate(); 42 | Picasso.setSingletonInstance(new Picasso.Builder(this).loggingEnabled(true).build()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/src/main/java/com/tmall/wireless/tangram/example/data/FloatView.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.tangram.example.data; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | import com.tmall.wireless.tangram.structure.CellRender; 29 | 30 | import android.content.Context; 31 | import android.widget.ImageView; 32 | 33 | /** 34 | * Created by villadora on 15/8/24. 35 | */ 36 | public class FloatView extends ImageView { 37 | 38 | public FloatView(Context context) { 39 | super(context); 40 | setBackgroundColor(0xffffff00); 41 | } 42 | 43 | @CellRender 44 | public void cellInited(BaseCell cell) { 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/src/main/java/com/tmall/wireless/tangram/example/data/TestViewHolder.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.tangram.example.data; 26 | 27 | import android.content.Context; 28 | import android.view.View; 29 | import android.widget.TextView; 30 | 31 | import com.tmall.wireless.tangram.structure.viewcreator.ViewHolderCreator; 32 | 33 | /** 34 | * Created by mikeafc on 16/5/26. 35 | */ 36 | public class TestViewHolder extends ViewHolderCreator.ViewHolder { 37 | public TextView textView; 38 | 39 | public TestViewHolder(Context context) { 40 | super(context); 41 | } 42 | 43 | @Override 44 | protected void onRootViewCreated(View view) { 45 | textView = (TextView) view; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/src/main/java/com/tmall/wireless/tangram/example/support/SampleErrorSupport.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.example.support; 2 | 3 | import com.tmall.wireless.tangram.dataparser.concrete.BaseCellBinderResolver; 4 | import com.tmall.wireless.tangram.support.InternalErrorSupport; 5 | 6 | import java.util.Map; 7 | 8 | public class SampleErrorSupport extends InternalErrorSupport { 9 | @Override 10 | public void onError(int code, String msg, Map relativeInfoMap) { 11 | 12 | 13 | super.onError(code, msg, relativeInfoMap); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/src/main/java/com/tmall/wireless/tangram/example/support/SampleScrollSupport.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.example.support; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.support.v7.widget.RecyclerView.OnScrollListener; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class SampleScrollSupport { 10 | public interface IScrollListener { 11 | public void onScrollStateChanged(RecyclerView recyclerView, int newState); 12 | 13 | public void onScrolled(RecyclerView recyclerView, int dx, int dy); 14 | } 15 | 16 | private RecyclerView recyclerView; 17 | 18 | private List scrollListeners = new ArrayList<>(); 19 | 20 | public SampleScrollSupport(RecyclerView recyclerView) { 21 | this.recyclerView = recyclerView; 22 | recyclerView.addOnScrollListener(new OnScrollListener() { 23 | @Override 24 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) { 25 | for (IScrollListener listener : scrollListeners) { 26 | listener.onScrollStateChanged(recyclerView, newState); 27 | } 28 | } 29 | 30 | @Override 31 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 32 | for (IScrollListener listener : scrollListeners) { 33 | listener.onScrolled(recyclerView, dx, dy); 34 | } 35 | } 36 | }); 37 | } 38 | 39 | public void register(IScrollListener scrollListener) { 40 | if (!scrollListeners.contains(scrollListener)) { 41 | scrollListeners.add(scrollListener); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/src/main/res/drawable/item_background.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 28 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/src/main/res/layout/item.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | 37 | -------------------------------------------------------------------------------- /examples/src/main/res/layout/item_holder.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 35 | -------------------------------------------------------------------------------- /examples/src/main/res/layout/nested_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 30 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/examples/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/examples/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/examples/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/examples/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | #666666 29 | #EEEEEE 30 | #CCCCCC 31 | #77CEEE 32 | 33 | -------------------------------------------------------------------------------- /examples/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | Example for Tangram 27 | 28 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/Tangram-Android/e8fe44d8aa0fd124afaefe945e65da3df9c9244c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # MIT License 3 | # 4 | # Copyright (c) 2017 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 | #Tue Nov 29 17:56:28 CST 2016 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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2017 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 ':tangram' 26 | include ':tangram3' 27 | include ':examples' 28 | 29 | File configFile = file('./config.gradle') 30 | if (configFile.exists()) { 31 | apply from: './config.gradle' 32 | } -------------------------------------------------------------------------------- /tangram/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /tangram/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/longerian/Documents/devtools/android-sdk-macosx/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 | -------------------------------------------------------------------------------- /tangram/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 27 | 28 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/adapter/CacheItem.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.tangram.core.adapter; 26 | 27 | /** 28 | * Created by villadora on 16/3/10. 29 | */ 30 | public interface CacheItem { 31 | 32 | boolean isStableCache(); 33 | } 34 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/adapter/WrapAdapter.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.tangram.core.adapter; 26 | 27 | import android.support.v7.widget.RecyclerView; 28 | import android.view.ViewGroup; 29 | 30 | /** 31 | * Created by villadora on 15/12/15. 32 | */ 33 | public class WrapAdapter extends RecyclerView.Adapter { 34 | @Override 35 | public VH onCreateViewHolder(ViewGroup parent, int viewType) { 36 | return null; 37 | } 38 | 39 | @Override 40 | public void onBindViewHolder(VH holder, int position) { 41 | 42 | } 43 | 44 | @Override 45 | public int getItemCount() { 46 | return 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/ControlBinder.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.tangram.core.protocol; 26 | 27 | import android.view.View; 28 | 29 | /** 30 | * @author villadora 31 | */ 32 | public interface ControlBinder extends ViewMounter, ViewCreator { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/ControlBinderResolver.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.tangram.core.protocol; 26 | 27 | import android.view.View; 28 | 29 | import com.tmall.wireless.tangram.core.resolver.InstanceResolver; 30 | 31 | /** 32 | */ 33 | public class ControlBinderResolver> extends InstanceResolver { 34 | } 35 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/LayoutBinder.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.tangram.core.protocol; 26 | 27 | import android.support.annotation.Nullable; 28 | 29 | import com.alibaba.android.vlayout.LayoutHelper; 30 | 31 | /** 32 | * Created by villadora on 15/8/23. 33 | */ 34 | public interface LayoutBinder { 35 | 36 | @Nullable 37 | LayoutHelper getHelper(String type, L data); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/LayoutBinderResolver.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.tangram.core.protocol; 26 | 27 | import com.tmall.wireless.tangram.core.resolver.InstanceResolver; 28 | 29 | /** 30 | * Created by villadora on 15/8/23. 31 | */ 32 | public class LayoutBinderResolver> extends InstanceResolver { 33 | } 34 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/ViewCreator.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.tangram.core.protocol; 26 | 27 | import android.content.Context; 28 | import android.support.annotation.NonNull; 29 | import android.view.View; 30 | import android.view.ViewGroup; 31 | 32 | /** 33 | * Created by villadora on 15/12/8. 34 | */ 35 | public interface ViewCreator { 36 | @NonNull 37 | V createView(Context context, ViewGroup parent); 38 | } 39 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/protocol/ViewMounter.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.tangram.core.protocol; 26 | 27 | import android.support.annotation.NonNull; 28 | import android.view.View; 29 | 30 | /** 31 | * Created by villadora on 15/12/8. 32 | */ 33 | public interface ViewMounter { 34 | 35 | void mountView(@NonNull DT data, @NonNull V view); 36 | 37 | void unmountView(@NonNull DT data, @NonNull V view); 38 | } 39 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/resolver/InstanceResolver.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.tangram.core.resolver; 26 | 27 | /** 28 | * @author villadora 29 | */ 30 | public abstract class InstanceResolver extends BaseResolver { 31 | 32 | @Override 33 | public T create(String type) { 34 | return mSparseArray.get(type); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/core/resolver/Resolver.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.tangram.core.resolver; 26 | 27 | /** 28 | * Created by villadora on 15/8/23. 29 | */ 30 | public interface Resolver { 31 | 32 | String UNKNOWN = "unknown"; 33 | 34 | int size(); 35 | 36 | String type(T gen); 37 | 38 | O create(String type); 39 | 40 | void register(String type, T gen); 41 | 42 | boolean has(String type); 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/BaseCellBinderResolver.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.tangram.dataparser.concrete; 26 | 27 | import android.view.View; 28 | 29 | import com.tmall.wireless.tangram.core.protocol.ControlBinderResolver; 30 | import com.tmall.wireless.tangram.structure.viewcreator.ViewHolderCreator; 31 | 32 | /** 33 | * 34 | */ 35 | public class BaseCellBinderResolver extends ControlBinderResolver> { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/BaseLayoutBinder.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.tangram.dataparser.concrete; 26 | 27 | import android.support.annotation.Nullable; 28 | 29 | import com.alibaba.android.vlayout.LayoutHelper; 30 | import com.tmall.wireless.tangram.core.protocol.LayoutBinder; 31 | 32 | /** 33 | * Created by villadora on 15/8/24. 34 | */ 35 | public class BaseLayoutBinder implements LayoutBinder { 36 | 37 | 38 | @Nullable 39 | @Override 40 | public LayoutHelper getHelper(String type, Card data) { 41 | if (data == null) return null; 42 | return data.getLayoutHelper(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/CardResolver.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.tangram.dataparser.concrete; 26 | 27 | import com.tmall.wireless.tangram.core.resolver.ClassResolver; 28 | 29 | /** 30 | * Created by villadora on 15/8/23. 31 | */ 32 | public class CardResolver extends ClassResolver { 33 | public boolean hasType(String type) { 34 | return mSparseArray.get(type) != null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/Cell.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.tangram.dataparser.concrete; 26 | 27 | 28 | import android.view.View; 29 | 30 | import com.tmall.wireless.tangram.structure.BaseCell; 31 | 32 | /** 33 | * Created by mikeafc on 16/5/20. 34 | */ 35 | 36 | public class Cell extends BaseCell { 37 | } 38 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/dataparser/concrete/IDelegateCard.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.tangram.dataparser.concrete; 26 | 27 | import java.util.List; 28 | 29 | /** 30 | * Created by villadora on 15/8/31. 31 | */ 32 | public interface IDelegateCard { 33 | 34 | List getCards(CardResolver resolver); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/eventbus/EventContext.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.tangram.eventbus; 26 | 27 | import com.tmall.wireless.tangram.BaseTangramEngine; 28 | 29 | /** 30 | * Created by longerian on 16/4/26. 31 | */ 32 | public class EventContext { 33 | 34 | public Object producer; 35 | 36 | public BaseTangramEngine tangramCore; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/eventbus/IDispatcher.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.tangram.eventbus; 26 | 27 | import android.support.annotation.NonNull; 28 | 29 | import java.util.List; 30 | 31 | /** 32 | * Created by longerian on 16/4/27. 33 | */ 34 | public interface IDispatcher { 35 | 36 | void start(); 37 | 38 | boolean enqueue(@NonNull Event event); 39 | 40 | boolean enqueue(@NonNull List eventList); 41 | 42 | void stopSelf(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/eventbus/IDispatcherDelegate.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.tangram.eventbus; 26 | 27 | import android.support.annotation.NonNull; 28 | 29 | /** 30 | * Created by longerian on 16/4/27. 31 | */ 32 | public interface IDispatcherDelegate { 33 | 34 | void dispatch(@NonNull Event event); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/ext/BannerListener.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.tangram.ext; 26 | 27 | /** 28 | * Created by mikeafc on 17/4/10. 29 | */ 30 | 31 | public interface BannerListener { 32 | void onPageScrolled(int position, float positionOffset, int positionOffsetPixels, int direction); 33 | 34 | void onPageSelected(int position); 35 | 36 | void onPageScrollStateChanged(int state); 37 | 38 | void onItemPositionInBanner(int position); 39 | } -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/ext/PullFromEndListener.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.tangram.ext; 26 | 27 | /** 28 | * Created by mikeafc on 17/2/13. 29 | */ 30 | 31 | public interface PullFromEndListener { 32 | boolean isReadyToPull(); 33 | 34 | int getPullEdge(); 35 | 36 | void onPull(float x, float y); 37 | 38 | void onReleaseToAction(float x, float y); 39 | 40 | void onAction(); 41 | 42 | void onReset(); 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class AppendGroupOp extends TangramOp1 { 37 | public AppendGroupOp(Card arg1) { 38 | super(arg1); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupsOp.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.tangram.op; 26 | 27 | import java.util.List; 28 | 29 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 30 | 31 | /** 32 | * Created by longerian on 2018/3/23. 33 | * 34 | * @author longerian 35 | * @date 2018/03/23 36 | */ 37 | 38 | public class AppendGroupsOp extends TangramOp1> { 39 | public AppendGroupsOp(List arg1) { 40 | super(arg1); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ClickExposureCellOp.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.tangram.op; 26 | 27 | import android.view.View; 28 | import com.tmall.wireless.tangram.structure.BaseCell; 29 | 30 | /** 31 | * Created by longerian on 2018/3/29. 32 | * 33 | * @author longerian 34 | * @date 2018/03/29 35 | */ 36 | 37 | public class ClickExposureCellOp extends TangramOp3 { 38 | 39 | public ClickExposureCellOp(View arg1, BaseCell arg2, Integer arg3) { 40 | super(arg1, arg2, arg3); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class InsertCellOp extends TangramOp2 { 37 | 38 | public InsertCellOp(int arg1, BaseCell arg2) { 39 | super(arg1, arg2); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellsOp.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.tangram.op; 26 | 27 | import java.util.List; 28 | 29 | import com.tmall.wireless.tangram.structure.BaseCell; 30 | 31 | /** 32 | * Created by longerian on 2018/3/23. 33 | * 34 | * @author longerian 35 | * @date 2018/03/23 36 | */ 37 | 38 | public class InsertCellsOp extends TangramOp2> { 39 | public InsertCellsOp(Integer arg1, List arg2) { 40 | super(arg1, arg2); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class InsertGroupOp extends TangramOp2 { 37 | public InsertGroupOp(Integer arg1, Card arg2) { 38 | super(arg1, arg2); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupsOp.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.tangram.op; 26 | 27 | import java.util.List; 28 | 29 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 30 | 31 | /** 32 | * Created by longerian on 2018/3/23. 33 | * 34 | * @author longerian 35 | * @date 2018/03/23 36 | */ 37 | 38 | public class InsertGroupsOp extends TangramOp2> { 39 | public InsertGroupsOp(Integer arg1, List arg2) { 40 | super(arg1, arg2); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/LoadGroupOp.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.op; 2 | 3 | import java.util.List; 4 | 5 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 6 | import com.tmall.wireless.tangram.structure.BaseCell; 7 | 8 | /** 9 | * Created by longerian on 2018/3/26. 10 | * 11 | * @author longerian 12 | * @date 2018/03/26 13 | */ 14 | 15 | public class LoadGroupOp extends TangramOp2> { 16 | public LoadGroupOp(Card arg1, List arg2) { 17 | super(arg1, arg2); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/LoadMoreOp.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.op; 2 | 3 | import java.util.List; 4 | 5 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 6 | import com.tmall.wireless.tangram.structure.BaseCell; 7 | 8 | /** 9 | * Created by longerian on 2018/3/26. 10 | * 11 | * @author longerian 12 | * @date 2018/03/26 13 | */ 14 | 15 | public class LoadMoreOp extends TangramOp3, Boolean> { 16 | 17 | public LoadMoreOp(Card arg1, List arg2, Boolean arg3) { 18 | super(arg1, arg2, arg3); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ParseComponentsOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.core.service.ServiceManager; 28 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 29 | import org.json.JSONArray; 30 | 31 | /** 32 | * Created by longerian on 2018/3/28. 33 | * 34 | * @author longerian 35 | * @date 2018/03/28 36 | */ 37 | 38 | public class ParseComponentsOp extends TangramOp3 { 39 | public ParseComponentsOp(JSONArray arg1, Card arg2, ServiceManager arg3) { 40 | super(arg1, arg2, arg3); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ParseGroupsOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.core.service.ServiceManager; 28 | import org.json.JSONArray; 29 | 30 | /** 31 | * Created by longerian on 2018/3/28. 32 | * 33 | * @author longerian 34 | * @date 2018/03/28 35 | */ 36 | 37 | public class ParseGroupsOp extends TangramOp2 { 38 | public ParseGroupsOp(JSONArray arg1, ServiceManager arg2) { 39 | super(arg1, arg2); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ParseSingleComponentOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.core.service.ServiceManager; 28 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 29 | import org.json.JSONObject; 30 | 31 | /** 32 | * Created by longerian on 2018/3/28. 33 | * 34 | * @author longerian 35 | * @date 2018/03/28 36 | */ 37 | 38 | public class ParseSingleComponentOp extends TangramOp3 { 39 | public ParseSingleComponentOp(JSONObject arg1, Card arg2, ServiceManager arg3) { 40 | super(arg1, arg2, arg3); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ParseSingleGroupOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.core.service.ServiceManager; 28 | import org.json.JSONObject; 29 | 30 | /** 31 | * Created by longerian on 2018/3/28. 32 | * 33 | * @author longerian 34 | * @date 2018/03/28 35 | */ 36 | 37 | public class ParseSingleGroupOp extends TangramOp2 { 38 | public ParseSingleGroupOp(JSONObject arg1, ServiceManager arg2) { 39 | super(arg1, arg2); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class RemoveCellOp extends TangramOp1 { 37 | public RemoveCellOp(BaseCell arg1) { 38 | super(arg1); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellPositionOp.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.tangram.op; 26 | 27 | /** 28 | * Created by longerian on 2018/3/23. 29 | * 30 | * @author longerian 31 | * @date 2018/03/23 32 | */ 33 | 34 | public class RemoveCellPositionOp extends TangramOp1 { 35 | public RemoveCellPositionOp(Integer arg1) { 36 | super(arg1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupIdxOp.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.tangram.op; 26 | 27 | /** 28 | * Created by longerian on 2018/3/23. 29 | * 30 | * @author longerian 31 | * @date 2018/03/23 32 | */ 33 | 34 | public class RemoveGroupIdxOp extends TangramOp1 { 35 | public RemoveGroupIdxOp(Integer arg1) { 36 | super(arg1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class RemoveGroupOp extends TangramOp1 { 37 | public RemoveGroupOp(Card arg1) { 38 | super(arg1); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceCellOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class ReplaceCellOp extends TangramOp2 { 37 | public ReplaceCellOp(BaseCell arg1, BaseCell arg2) { 38 | super(arg1, arg2); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupContentOp.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.tangram.op; 26 | 27 | import java.util.List; 28 | 29 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 30 | import com.tmall.wireless.tangram.structure.BaseCell; 31 | 32 | /** 33 | * Created by longerian on 2018/3/23. 34 | * 35 | * @author longerian 36 | * @date 2018/03/23 37 | */ 38 | 39 | public class ReplaceGroupContentOp extends TangramOp2> { 40 | public ReplaceGroupContentOp(Card arg1, List arg2) { 41 | super(arg1, arg2); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class ReplaceGroupOp extends TangramOp2 { 37 | public ReplaceGroupOp(Card arg1, Card arg2) { 38 | super(arg1, arg2); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp1.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.tangram.op; 26 | 27 | /** 28 | * Created by longerian on 2018/3/23. 29 | * 30 | * @author longerian 31 | * @date 2018/03/23 32 | */ 33 | 34 | public class TangramOp1 { 35 | 36 | public TangramOp1(V1 arg1) { 37 | this.arg1 = arg1; 38 | } 39 | 40 | private V1 arg1; 41 | 42 | public V1 getArg1() { 43 | return arg1; 44 | } 45 | 46 | public void setArg1(V1 arg1) { 47 | this.arg1 = arg1; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp2.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.tangram.op; 26 | 27 | /** 28 | * Created by longerian on 2018/3/23. 29 | * 30 | * @author longerian 31 | * @date 2018/03/23 32 | */ 33 | 34 | public class TangramOp2 extends TangramOp1 { 35 | 36 | private V2 arg2; 37 | 38 | public TangramOp2(V1 arg1, V2 arg2) { 39 | super(arg1); 40 | this.arg2 = arg2; 41 | } 42 | 43 | public V2 getArg2() { 44 | return arg2; 45 | } 46 | 47 | public void setArg2(V2 arg2) { 48 | this.arg2 = arg2; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp3.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.op; 2 | 3 | /** 4 | * Created by longerian on 2018/3/26. 5 | * 6 | * @author longerian 7 | * @date 2018/03/26 8 | */ 9 | 10 | public class TangramOp3 extends TangramOp2 { 11 | 12 | private V3 arg3; 13 | 14 | public TangramOp3(V1 arg1, V2 arg2, V3 arg3) { 15 | super(arg1, arg2); 16 | this.arg3 = arg3; 17 | } 18 | 19 | public V3 getArg3() { 20 | return arg3; 21 | } 22 | 23 | public void setArg3(V3 arg3) { 24 | this.arg3 = arg3; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/op/UpdateCellOp.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.tangram.op; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | 29 | /** 30 | * Created by longerian on 2018/3/23. 31 | * 32 | * @author longerian 33 | * @date 2018/03/23 34 | */ 35 | 36 | public class UpdateCellOp extends TangramOp1 { 37 | public UpdateCellOp(BaseCell arg1) { 38 | super(arg1); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/CellRender.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.tangram.structure; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | /** 33 | * Created by mikeafc on 16/4/28. 34 | */ 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target(ElementType.METHOD) 37 | public @interface CellRender { 38 | String key() default ""; 39 | } 40 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/ColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Card perform column layout 29 | */ 30 | public abstract class ColumnCard extends GridCard { 31 | 32 | public ColumnCard(int column) { 33 | super(column); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/DoubleColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class DoubleColumnCard extends ColumnCard { 31 | public DoubleColumnCard() { 32 | super(2); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/FiveColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class FiveColumnCard extends ColumnCard { 31 | public FiveColumnCard() { 32 | super(5); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/FlowCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Created by longerian on 17/2/13. 29 | */ 30 | 31 | public class FlowCard extends GridCard { 32 | 33 | public FlowCard() { 34 | super(1); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/FourColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * @author villadora 29 | * @since 1.0.0 30 | */ 31 | public class FourColumnCard extends ColumnCard { 32 | public FourColumnCard() { 33 | super(4); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/OneItemCard.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.tangram.structure.card; 26 | 27 | import android.support.annotation.NonNull; 28 | 29 | import com.tmall.wireless.tangram.MVHelper; 30 | import com.tmall.wireless.tangram.dataparser.concrete.Card; 31 | 32 | import org.json.JSONObject; 33 | 34 | /** 35 | * Created by villadora on 15/8/25. 36 | */ 37 | public abstract class OneItemCard extends Card { 38 | @Override 39 | public void parseWith(@NonNull JSONObject data, @NonNull MVHelper resolver) { 40 | maxChildren = 1; 41 | super.parseWith(data, resolver); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SingleColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/11/21. 29 | */ 30 | public class SingleColumnCard extends ColumnCard { 31 | 32 | public SingleColumnCard() { 33 | super(1); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/StickyEndCard.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.tangram.structure.card; 26 | 27 | import org.json.JSONObject; 28 | 29 | /** 30 | * Created by villadora on 15/11/24. 31 | */ 32 | public class StickyEndCard extends StickyCard { 33 | @Override 34 | public void parseStyle(JSONObject data) { 35 | this.style = new StickyStyle(false); 36 | if (data != null) 37 | style.parseWith(data); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/SwipeCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Card that can swipe horizontally 29 | */ 30 | public interface SwipeCard { 31 | /** 32 | * Get current index of page for swipe card 33 | * 34 | * @return the index of page for this card 35 | */ 36 | int getCurrentIndex(); 37 | 38 | /** 39 | * @return total pages that this card can be swiped 40 | */ 41 | int getTotalPage(); 42 | 43 | /** 44 | * Switch to another page card with index 45 | * 46 | * @param index the index of page 47 | */ 48 | void switchTo(int index); 49 | } 50 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/card/TripleColumnCard.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.tangram.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class TripleColumnCard extends ColumnCard { 31 | public TripleColumnCard() { 32 | super(3); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/structure/view/ITangramViewLifeCycle.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.tangram.structure.view; 26 | 27 | import com.tmall.wireless.tangram.structure.BaseCell; 28 | 29 | /** 30 | * The {@link android.view.View} of component with universal model {@link BaseCell} is recommended to implement this interface. These view life cycler method will be called directly instead of reflection. 31 | *
32 | * Created by longerian on 16/8/29. 33 | */ 34 | public interface ITangramViewLifeCycle { 35 | 36 | void cellInited(BaseCell cell); 37 | 38 | void postBindView(BaseCell cell); 39 | 40 | void postUnBindView(BaseCell cell); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/support/InternalErrorSupport.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram.support; 2 | 3 | import java.util.Map; 4 | 5 | public class InternalErrorSupport { 6 | public static final int ERROR_CREATE_VIEWHOLDER_NOT_FOUND_TYPE = 0; 7 | 8 | public void onError(int code, String msg, Map relativeInfoMap) { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/support/RxBannerScrollStateChangedListener.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.tangram.support; 26 | 27 | /** 28 | * Created by longerian on 2018/3/9. 29 | * 30 | * @author longerian 31 | * @date 2018/03/09 32 | */ 33 | 34 | public class RxBannerScrollStateChangedListener extends RxBannerListener { 35 | 36 | @Override 37 | public void onPageScrollStateChanged(final int state) { 38 | if (!isDisposed()) { 39 | mObserver.onNext(state); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/support/RxBannerSelectedListener.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.tangram.support; 26 | 27 | /** 28 | * Created by longerian on 2018/3/9. 29 | * 30 | * @author longerian 31 | * @date 2018/03/09 32 | */ 33 | 34 | public class RxBannerSelectedListener extends RxBannerListener { 35 | 36 | @Override 37 | public void onPageSelected(final int position) { 38 | if (!isDisposed()) { 39 | mObserver.onNext(position); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/util/BDE.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.tangram.util; 26 | 27 | /** 28 | * Created by longerian on 2018/4/9. 29 | * 30 | * @author longerian 31 | * @date 2018/04/09 32 | */ 33 | 34 | public class BDE { 35 | 36 | public static final BDE BIND = new BDE("bind"); 37 | public static final BDE UNBIND = new BDE("unbind"); 38 | 39 | final protected String name; 40 | 41 | public BDE(String name) {this.name = name;} 42 | 43 | @Override 44 | public String toString() { 45 | return "BDE{" + 46 | "name='" + name + '\'' + 47 | '}'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/util/IInnerImageSetter.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.tangram.util; 26 | 27 | import android.support.annotation.NonNull; 28 | import android.support.annotation.Nullable; 29 | import android.widget.ImageView; 30 | 31 | 32 | /** 33 | * Provide a universal image load api for Tangram, users should implement it and provide it to Tangram framework during init phase. 34 | */ 35 | public interface IInnerImageSetter { 36 | void doLoadImageUrl(@NonNull IMAGE view, @Nullable String url); 37 | } 38 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/util/LifeCycleHelper.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.tangram.util; 26 | 27 | import io.reactivex.Observable; 28 | 29 | /** 30 | * Created by longerian on 2018/4/9. 31 | * 32 | * @author longerian 33 | * @date 2018/04/09 34 | */ 35 | 36 | public class LifeCycleHelper { 37 | 38 | public static LifecycleTransformer bindUntilEvent(Observable lifecycle, final E event) { 39 | return new LifecycleTransformer<>(lifecycle.filter(new io.reactivex.functions.Predicate() { 40 | @Override 41 | public boolean test(E e) throws Exception { 42 | return e.equals(event); 43 | } 44 | })); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /tangram/src/main/java/com/tmall/wireless/tangram/util/Predicate.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.tangram.util; 26 | 27 | /** 28 | * Created by villadora on 15/11/17. 29 | */ 30 | public interface Predicate { 31 | 32 | boolean isMatch(T data); 33 | } 34 | -------------------------------------------------------------------------------- /tangram/src/main/res/drawable/tangram_linearscrollview_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /tangram/src/main/res/drawable/tangram_linearscrollview_indicator_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /tangram/src/main/res/layout/tangram_linearscrollview_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tangram/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tangram3/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /tangram3/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/longerian/Documents/devtools/android-sdk-macosx/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 | -------------------------------------------------------------------------------- /tangram3/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 27 | 28 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/adapter/CacheItem.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.tangram3.core.adapter; 26 | 27 | /** 28 | * Created by villadora on 16/3/10. 29 | */ 30 | public interface CacheItem { 31 | 32 | boolean isStableCache(); 33 | } 34 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/adapter/WrapAdapter.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.tangram3.core.adapter; 26 | 27 | import android.support.v7.widget.RecyclerView; 28 | import android.view.ViewGroup; 29 | 30 | /** 31 | * Created by villadora on 15/12/15. 32 | */ 33 | public class WrapAdapter extends RecyclerView.Adapter { 34 | @Override 35 | public VH onCreateViewHolder(ViewGroup parent, int viewType) { 36 | return null; 37 | } 38 | 39 | @Override 40 | public void onBindViewHolder(VH holder, int position) { 41 | 42 | } 43 | 44 | @Override 45 | public int getItemCount() { 46 | return 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/ControlBinder.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.tangram3.core.protocol; 26 | 27 | import android.view.View; 28 | 29 | /** 30 | * @author villadora 31 | */ 32 | public interface ControlBinder extends ViewMounter, ViewCreator { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/ControlBinderResolver.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.tangram3.core.protocol; 26 | 27 | import android.view.View; 28 | 29 | import com.tmall.wireless.tangram3.core.resolver.InstanceResolver; 30 | 31 | /** 32 | */ 33 | public class ControlBinderResolver> extends InstanceResolver { 34 | } 35 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/ElementRenderService.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram3.core.protocol; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | import com.alibaba.fastjson.JSONObject; 8 | import com.tmall.wireless.tangram3.TangramEngine; 9 | import com.tmall.wireless.tangram3.dataparser.concrete.ComponentInfo; 10 | 11 | import java.util.List; 12 | 13 | public abstract class ElementRenderService { 14 | 15 | abstract public void init(TangramEngine tangramEngine); 16 | 17 | abstract public View createView(Context context, ViewGroup parent, ComponentInfo info); 18 | 19 | abstract public boolean mountView(JSONObject json, View view); 20 | 21 | abstract public void unmountView(JSONObject json, View view); 22 | 23 | /** 24 | * Tangram would call this method to ask renderService supple component info 25 | * when the data json does not have a component info. 26 | * 27 | * @param cellType 28 | * @return 29 | */ 30 | public ComponentInfo supplementComponentInfo(String cellType) { 31 | return null; 32 | } 33 | 34 | abstract public void destroy(); 35 | 36 | abstract public String getSDKBizName(); 37 | 38 | abstract public ComponentInfo onParseComponentInfo(ComponentInfo info); 39 | 40 | abstract public void onDownloadComponentInfo(List componentInfoList); 41 | 42 | public String getItemViewType(String type, ComponentInfo componentInfo) { 43 | return null; 44 | } 45 | } -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/LayoutBinder.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.tangram3.core.protocol; 26 | 27 | import android.support.annotation.Nullable; 28 | 29 | import com.alibaba.android.vlayout.LayoutHelper; 30 | 31 | /** 32 | * Created by villadora on 15/8/23. 33 | */ 34 | public interface LayoutBinder { 35 | 36 | @Nullable 37 | LayoutHelper getHelper(String type, L data); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/LayoutBinderResolver.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.tangram3.core.protocol; 26 | 27 | import com.tmall.wireless.tangram3.core.resolver.InstanceResolver; 28 | 29 | /** 30 | * Created by villadora on 15/8/23. 31 | */ 32 | public class LayoutBinderResolver> extends InstanceResolver { 33 | } 34 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/ViewCreator.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.tangram3.core.protocol; 26 | 27 | import android.content.Context; 28 | import android.support.annotation.NonNull; 29 | import android.view.View; 30 | import android.view.ViewGroup; 31 | 32 | import com.tmall.wireless.tangram3.dataparser.concrete.ComponentInfo; 33 | 34 | /** 35 | * Created by villadora on 15/12/8. 36 | */ 37 | public interface ViewCreator { 38 | @NonNull 39 | V createView(Context context, ViewGroup parent, ComponentInfo componentInfo); 40 | } 41 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/protocol/ViewMounter.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.tangram3.core.protocol; 26 | 27 | import android.support.annotation.NonNull; 28 | import android.view.View; 29 | 30 | /** 31 | * Created by villadora on 15/12/8. 32 | */ 33 | public interface ViewMounter { 34 | 35 | void mountView(@NonNull DT data, @NonNull V view); 36 | 37 | void unmountView(@NonNull DT data, @NonNull V view); 38 | } 39 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/resolver/InstanceResolver.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.tangram3.core.resolver; 26 | 27 | /** 28 | * @author villadora 29 | */ 30 | public abstract class InstanceResolver extends BaseResolver { 31 | 32 | @Override 33 | public T create(String type) { 34 | return mSparseArray.get(type); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/core/resolver/Resolver.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.tangram3.core.resolver; 26 | 27 | /** 28 | * Created by villadora on 15/8/23. 29 | */ 30 | public interface Resolver { 31 | 32 | String UNKNOWN = "unknown"; 33 | 34 | int size(); 35 | 36 | String type(T gen); 37 | 38 | O create(String type); 39 | 40 | void register(String type, T gen); 41 | 42 | boolean has(String type); 43 | } 44 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/BaseCellBinderResolver.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.tangram3.dataparser.concrete; 26 | 27 | import android.view.View; 28 | 29 | import com.tmall.wireless.tangram3.core.protocol.ControlBinderResolver; 30 | import com.tmall.wireless.tangram3.structure.viewcreator.ViewHolderCreator; 31 | 32 | /** 33 | * 34 | */ 35 | public class BaseCellBinderResolver extends ControlBinderResolver> { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/BaseLayoutBinder.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.tangram3.dataparser.concrete; 26 | 27 | import android.support.annotation.Nullable; 28 | 29 | import com.alibaba.android.vlayout.LayoutHelper; 30 | import com.tmall.wireless.tangram3.core.protocol.LayoutBinder; 31 | 32 | /** 33 | * Created by villadora on 15/8/24. 34 | */ 35 | public class BaseLayoutBinder implements LayoutBinder { 36 | 37 | 38 | @Nullable 39 | @Override 40 | public LayoutHelper getHelper(String type, Card data) { 41 | if (data == null) return null; 42 | return data.getLayoutHelper(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/CardResolver.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.tangram3.dataparser.concrete; 26 | 27 | import com.tmall.wireless.tangram3.core.resolver.ClassResolver; 28 | 29 | /** 30 | * Created by villadora on 15/8/23. 31 | */ 32 | public class CardResolver extends ClassResolver { 33 | public boolean hasType(String type) { 34 | return mSparseArray.get(type) != null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/Cell.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.tangram3.dataparser.concrete; 26 | 27 | 28 | import android.view.View; 29 | 30 | import com.tmall.wireless.tangram3.structure.BaseCell; 31 | 32 | /** 33 | * Created by mikeafc on 16/5/20. 34 | */ 35 | 36 | public class Cell extends BaseCell { 37 | } 38 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/ComponentInfo.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram3.dataparser.concrete; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | 5 | public class ComponentInfo { 6 | public static final String NAME = "name"; 7 | 8 | public static final String ID = "id"; 9 | 10 | public static final String TYPE = "type"; 11 | 12 | public static final String VERSION = "version"; 13 | 14 | public static final String URL = "url"; 15 | 16 | private String name; 17 | 18 | private String id; 19 | 20 | private String type; 21 | 22 | private long version; 23 | 24 | private String url; 25 | 26 | public ComponentInfo() { 27 | } 28 | 29 | public ComponentInfo(JSONObject json) { 30 | this.name = json.getString(NAME); 31 | this.id = json.getString(ID); 32 | this.type = json.getString(TYPE); 33 | this.version = json.getLongValue(VERSION); 34 | this.url = json.getString(URL); 35 | } 36 | 37 | public String getId() { 38 | return id; 39 | } 40 | 41 | public void setId(String id) { 42 | this.id = id; 43 | } 44 | 45 | public String getType() { 46 | return type; 47 | } 48 | 49 | public void setType(String type) { 50 | this.type = type; 51 | } 52 | 53 | public long getVersion() { 54 | return version; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public void setName(String name) { 62 | this.name = name; 63 | } 64 | 65 | public void setVersion(long version) { 66 | this.version = version; 67 | } 68 | 69 | public String getUrl() { 70 | return url; 71 | } 72 | 73 | public void setUrl(String url) { 74 | this.url = url; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/dataparser/concrete/IDelegateCard.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.tangram3.dataparser.concrete; 26 | 27 | import java.util.List; 28 | 29 | /** 30 | * Created by villadora on 15/8/31. 31 | */ 32 | public interface IDelegateCard { 33 | 34 | List getCards(CardResolver resolver); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/eventbus/EventContext.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.tangram3.eventbus; 26 | 27 | import com.tmall.wireless.tangram3.BaseTangramEngine; 28 | 29 | /** 30 | * Created by longerian on 16/4/26. 31 | */ 32 | public class EventContext { 33 | 34 | public Object producer; 35 | 36 | public BaseTangramEngine tangramCore; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/eventbus/IDispatcher.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.tangram3.eventbus; 26 | 27 | import android.support.annotation.NonNull; 28 | 29 | import java.util.List; 30 | 31 | /** 32 | * Created by longerian on 16/4/27. 33 | */ 34 | public interface IDispatcher { 35 | 36 | void start(); 37 | 38 | boolean enqueue(@NonNull Event event); 39 | 40 | boolean enqueue(@NonNull List eventList); 41 | 42 | void stopSelf(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/eventbus/IDispatcherDelegate.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.tangram3.eventbus; 26 | 27 | import android.support.annotation.NonNull; 28 | 29 | /** 30 | * Created by longerian on 16/4/27. 31 | */ 32 | public interface IDispatcherDelegate { 33 | 34 | void dispatch(@NonNull Event event); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/eventbus/IEventHandlerReceiver.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram3.eventbus; 2 | 3 | public interface IEventHandlerReceiver { 4 | void handleEvent(Event event); 5 | } 6 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/ext/BannerListener.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.tangram3.ext; 26 | 27 | /** 28 | * Created by mikeafc on 17/4/10. 29 | */ 30 | 31 | public interface BannerListener { 32 | void onPageScrolled(int position, float positionOffset, int positionOffsetPixels, int direction); 33 | 34 | void onPageSelected(int position); 35 | 36 | void onPageScrollStateChanged(int state); 37 | 38 | void onItemPositionInBanner(int position); 39 | } -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/ext/PullFromEndListener.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.tangram3.ext; 26 | 27 | /** 28 | * Created by mikeafc on 17/2/13. 29 | */ 30 | 31 | public interface PullFromEndListener { 32 | boolean isReadyToPull(); 33 | 34 | int getPullEdge(); 35 | 36 | void onPull(float x, float y); 37 | 38 | void onReleaseToAction(float x, float y); 39 | 40 | void onAction(); 41 | 42 | void onReset(); 43 | } 44 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/ColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Card perform column layout 29 | */ 30 | public abstract class ColumnCard extends GridCard { 31 | 32 | public ColumnCard(int column) { 33 | super(column); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/DoubleColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class DoubleColumnCard extends ColumnCard { 31 | public DoubleColumnCard() { 32 | super(2); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/FiveColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class FiveColumnCard extends ColumnCard { 31 | public FiveColumnCard() { 32 | super(5); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/FlowCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by longerian on 17/2/13. 29 | */ 30 | 31 | public class FlowCard extends GridCard { 32 | 33 | public FlowCard() { 34 | super(1); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/FourColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * @author villadora 29 | * @since 1.0.0 30 | */ 31 | public class FourColumnCard extends ColumnCard { 32 | public FourColumnCard() { 33 | super(4); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/SingleColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/11/21. 29 | */ 30 | public class SingleColumnCard extends ColumnCard { 31 | 32 | public SingleColumnCard() { 33 | super(1); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/StickyEndCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/11/24. 29 | */ 30 | public class StickyEndCard extends StickyCard { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/SwipeCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Card that can swipe horizontally 29 | */ 30 | public interface SwipeCard { 31 | /** 32 | * Get current index of page for swipe card 33 | * 34 | * @return the index of page for this card 35 | */ 36 | int getCurrentIndex(); 37 | 38 | /** 39 | * @return total pages that this card can be swiped 40 | */ 41 | int getTotalPage(); 42 | 43 | /** 44 | * Switch to another page card with index 45 | * 46 | * @param index the index of page 47 | */ 48 | void switchTo(int index); 49 | } 50 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/TripleColumnCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by villadora on 15/8/31. 29 | */ 30 | public class TripleColumnCard extends ColumnCard { 31 | public TripleColumnCard() { 32 | super(3); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/card/WrapCellCard.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.tangram3.structure.card; 26 | 27 | /** 28 | * Created by longerian on 17/4/10. 29 | * 30 | * @author longerian 31 | * @date 2017/04/10 32 | */ 33 | 34 | public class WrapCellCard extends GridCard { 35 | 36 | public WrapCellCard() { 37 | super(1); 38 | } 39 | } -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/style/ColumnStyle.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.tangram3.structure.style; 26 | 27 | import android.support.annotation.Nullable; 28 | 29 | import com.tmall.wireless.tangram3.dataparser.concrete.Style; 30 | 31 | import org.json.JSONArray; 32 | import org.json.JSONObject; 33 | 34 | /** 35 | * Created by huifeng.hxl on 2015/1/15. 36 | */ 37 | public class ColumnStyle extends Style { 38 | 39 | @Nullable 40 | public float[] cols; 41 | 42 | @Nullable 43 | public float[] rows; 44 | } 45 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/structure/view/ITangramViewLifeCycle.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.tangram3.structure.view; 26 | 27 | import com.tmall.wireless.tangram3.structure.BaseCell; 28 | 29 | /** 30 | * The {@link android.view.View} of component with universal model {@link BaseCell} is recommended to implement this interface. These view life cycler method will be called directly instead of reflection. 31 | *
32 | * Created by longerian on 16/8/29. 33 | */ 34 | public interface ITangramViewLifeCycle { 35 | 36 | void cellInited(BaseCell cell); 37 | 38 | void postBindView(BaseCell cell); 39 | 40 | void postUnBindView(BaseCell cell); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/support/InternalErrorSupport.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram3.support; 2 | 3 | import java.util.Map; 4 | 5 | public class InternalErrorSupport { 6 | public static final int ERROR_CREATE_VIEWHOLDER_NOT_FOUND_TYPE = 0; 7 | 8 | public static final int ERROR_PARSE_CARDS_ERROR = 1; 9 | 10 | public void onError(int code, String msg, Map relativeInfoMap) { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/support/TemplateUpdateSupport.java: -------------------------------------------------------------------------------- 1 | package com.tmall.wireless.tangram3.support; 2 | 3 | import com.tmall.wireless.tangram3.structure.TemplateInfo; 4 | 5 | public class TemplateUpdateSupport { 6 | public void onUpdate(TemplateInfo templateInfo) { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/util/BDE.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.tangram3.util; 26 | 27 | /** 28 | * Created by longerian on 2018/4/9. 29 | * 30 | * @author longerian 31 | * @date 2018/04/09 32 | */ 33 | 34 | public class BDE { 35 | 36 | public static final BDE BIND = new BDE("bind"); 37 | public static final BDE UNBIND = new BDE("unbind"); 38 | 39 | final protected String name; 40 | 41 | public BDE(String name) {this.name = name;} 42 | 43 | @Override 44 | public String toString() { 45 | return "BDE{" + 46 | "name='" + name + '\'' + 47 | '}'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/util/IInnerImageSetter.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.tangram3.util; 26 | 27 | import android.support.annotation.NonNull; 28 | import android.support.annotation.Nullable; 29 | import android.widget.ImageView; 30 | 31 | 32 | /** 33 | * Provide a universal image load api for Tangram, users should implement it and provide it to Tangram framework during init phase. 34 | */ 35 | public interface IInnerImageSetter { 36 | void doLoadImageUrl(@NonNull IMAGE view, @Nullable String url); 37 | } 38 | -------------------------------------------------------------------------------- /tangram3/src/main/java/com/tmall/wireless/tangram3/util/Predicate.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.tangram3.util; 26 | 27 | /** 28 | * Created by villadora on 15/11/17. 29 | */ 30 | public interface Predicate { 31 | 32 | boolean isMatch(T data); 33 | } 34 | -------------------------------------------------------------------------------- /tangram3/src/main/res/drawable/tangram_linearscrollview_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /tangram3/src/main/res/drawable/tangram_linearscrollview_indicator_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /tangram3/src/main/res/layout/tangram_linearscrollview_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tangram3/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | --------------------------------------------------------------------------------