alibaba / Tangram-Android

Tangram is a modular UI solution for building native page dynamically including Tangram for Android, Tangram for iOS and even backend CMS. This project provides the sdk on Android.
http://tangram.pingguohe.net/
MIT License
4.11k stars 526 forks source link

内置的Type10 banner有bug #9

Closed KarasJoker closed 7 years ago

KarasJoker commented 7 years ago
longerian commented 7 years ago

卡顿重置具体是什么表现 还有日志呢

maolubin commented 7 years ago

@longerian 就是比如我5张图片轮播,本来应该很顺畅的一张一张播,现在会出现播完最后一张时,会出现一卡快速滚动第一张播,还有我手动拖动时,轮播还在自动滚动,还有我页面刚进去的时候,轮播图没有显示,我滚动下面的列表(都用这个框架拼的),轮播才显示

maolubin commented 7 years ago

轮播图怎么把自图片撑满屏幕宽度

KarasJoker commented 7 years ago

@maolubin 这个轮播确实会出现问题,暂不知道原因。刚进页面轮播不显示,看一下Json配置对不对(Type、属性)。取值是否有问题。

"pageRatio": 0.5这个属性是设置item占页面的比例的。(全屏应去掉)。 "scrollMarginLeft": 20,距离左边item的距离(全屏应去掉)。 "scrollMarginRight": 20,距离右边item的距离(全屏应去掉)。

maolubin commented 7 years ago

@longerian 全屏解决了,但是那个显示问题,我是拷贝你的代码弄的, "indicatorImg1": "https://img.alicdn.com/tps/TB16i4qNXXXXXbBXFXXXXXXXXXX-32-4.png", "indicatorImg2": "https://img.alicdn.com/tps/TB1XRNFNXXXXXXKXXXXXXXXXXXX-32-4.png" ,还有这个本地图片能搞吗

KarasJoker commented 7 years ago

@maolubin "indicatorImg1"、"indicatorImg2"那是指示器的图片,这个可以用颜色来代替的。http://tangram.pingguohe.net/docs/basic-concept/history 这里有内置Card的简要使用,当然略有不同。具体属性名要看源码的XXStyle、Style文件说给的字段名来进行配置。你说的问题,我还是没太懂。能把你的json文件和录屏发给我看看么

longerian commented 7 years ago

@maolubin 本地图片不支持,考虑需要变化,我们的资源都是用远程的。

longerian commented 7 years ago

@maolubin

就是比如我5张图片轮播,本来应该很顺畅的一张一张播,现在会出现播完最后一张时,会出现一卡快速滚动第一张播,还有我手动拖动时,轮播还在自动滚动,还有我页面刚进去的时候,轮播图没有显示,我滚动下面的列表(都用这个框架拼的),轮播才显示

关于这个,自动滚动的时候,轮播控件就是快速回调第一张显示,这个是内置BannerView的效果。

另外你说的图片没显示,需要你自己调试一下,比如看一下图片库的加载问题。我们没有复现这个问题。可以使用以下测试数据:

{
      "type": "10",
      "id": "banner1",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1xpcLKFXXXXXSXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1XIwbKFXXXXauXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://gw.alicdn.com/mt/TB1R9NpKVXXXXc1XFXXXXXXXXXX-1125-280.jpg"
        }]
    },
    {
      "type": "10",
      "id": "banner2",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1LslCKVXXXXcGXXXXSutbFXXX.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1GTSsKVXXXXadXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1mocFKFXXXXclXFXXSutbFXXX.jpg"
      }]
    },
    {
      "type": "10",
      "id": "banner3",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1hfMpKFXXXXbJaXXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB10Z69KFXXXXXLXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB17ftEKVXXXXcLXXXXXXXXXXXX-1125-280.jpg"
      }]
    },{
      "type": "10",
      "id": "banner1",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1xpcLKFXXXXXSXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1XIwbKFXXXXauXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://gw.alicdn.com/mt/TB1R9NpKVXXXXc1XFXXXXXXXXXX-1125-280.jpg"
        }]
    },
    {
      "type": "10",
      "id": "banner2",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1LslCKVXXXXcGXXXXSutbFXXX.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1GTSsKVXXXXadXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1mocFKFXXXXclXFXXSutbFXXX.jpg"
      }]
    },
    {
      "type": "10",
      "id": "banner3",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1hfMpKFXXXXbJaXXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB10Z69KFXXXXXLXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB17ftEKVXXXXcLXXXXXXXXXXXX-1125-280.jpg"
      }]
    },{
      "type": "10",
      "id": "banner1",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1xpcLKFXXXXXSXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1XIwbKFXXXXauXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://gw.alicdn.com/mt/TB1R9NpKVXXXXc1XFXXXXXXXXXX-1125-280.jpg"
        }]
    },
    {
      "type": "10",
      "id": "banner2",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1LslCKVXXXXcGXXXXSutbFXXX.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1GTSsKVXXXXadXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1mocFKFXXXXclXFXXSutbFXXX.jpg"
      }]
    },
    {
      "type": "10",
      "id": "banner3",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1hfMpKFXXXXbJaXXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB10Z69KFXXXXXLXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB17ftEKVXXXXcLXXXXXXXXXXXX-1125-280.jpg"
      }]
    },{
      "type": "10",
      "id": "banner1",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1xpcLKFXXXXXSXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1XIwbKFXXXXauXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://gw.alicdn.com/mt/TB1R9NpKVXXXXc1XFXXXXXXXXXX-1125-280.jpg"
        }]
    },
    {
      "type": "10",
      "id": "banner2",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1LslCKVXXXXcGXXXXSutbFXXX.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1GTSsKVXXXXadXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/i4/TB1mocFKFXXXXclXFXXSutbFXXX.jpg"
      }]
    },
    {
      "type": "10",
      "id": "banner3",
      "style": {
        "align": "center",
        "indicatorRadius": "3",
        "indicatorStyle": "dot",
        "indicatorAutoHide": "false",
        "aspectRatio": 4.018,
        "indicatorColor": "#FFFFFF",
        "hasIndicator": "true",
        "defaultIndicatorColor": "#888888",
        "indicatorPosition": "inside",
        "autoScroll": 4000,
        "infinite": true,
        "infiniteMinCount": 2
      },
      "items": [{
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB1hfMpKFXXXXbJaXXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB10Z69KFXXXXXLXpXXXXXXXXXX-1125-280.jpg"
      }, {
        "type": "1",
        "imgUrl": "http://img.alicdn.com/tps/TB17ftEKVXXXXcLXXXXXXXXXXXX-1125-280.jpg"
      }]
    }
maolubin commented 7 years ago

@longerian 回弹第一张,这样体验不好把

longerian commented 7 years ago

体验上稍微差一些,我们支持覆盖掉这个实现,你有更好的库,可以实现然后自己注册进去使用,这个是开放的。

maolubin commented 7 years ago

@longerian 不懂

longerian commented 7 years ago

@maolubin 意思是说可以提供自定义的轮播卡片,注册到tangram里,不一定要用框架内置组件或者卡片。

maolubin commented 7 years ago

@longerian 这回弹你们能解决吗

longerian commented 7 years ago

可以提个bug到UltraViewPager工程里,抽空看一下。

maolubin commented 7 years ago

我换成最新的了,compile ('com.alibaba.android:ultraviewpager:1.0.4@aar') { transitive = true } 回弹修复了他

KarasJoker commented 7 years ago

@longerian 内置的这个轮播,轮播bug,大神什么时候提上议程啊。

maolubin commented 7 years ago

@KarasJoker 看上面,换最新的

KarasJoker commented 7 years ago

好尴尬,没注意看