You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/03/27 16:41:33 UTC

[01/11] incubator-weex git commit: * [test] add recycler test

Repository: incubator-weex
Updated Branches:
  refs/heads/0.11-dev 20ee5866d -> 0dc2daadc


* [test] add recycler test


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/670d001c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/670d001c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/670d001c

Branch: refs/heads/0.11-dev
Commit: 670d001cf9792a886b6af0ba1d0aa5998721857e
Parents: e5e8deb
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 21 21:36:00 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 21 21:36:00 2017 +0800

----------------------------------------------------------------------
 build/webpack.macacatest.config.js       |   6 +-
 test/pages/components/recycler.vue       | 482 ++++++++++++++++++++++++++
 test/scripts/components/recycler.test.js | 119 +++++++
 3 files changed, 602 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/670d001c/build/webpack.macacatest.config.js
----------------------------------------------------------------------
diff --git a/build/webpack.macacatest.config.js b/build/webpack.macacatest.config.js
index ba154a8..30d5359 100644
--- a/build/webpack.macacatest.config.js
+++ b/build/webpack.macacatest.config.js
@@ -44,12 +44,8 @@ module.exports = {
   module: {
     loaders: [
       {
-        test: /\.we(\?[^?]+)?$/,
+        test: /\.(we|vue)(\?[^?]+)?$/,
         loader: 'weex'
-      },
-      {
-        test: /\.vue(\?[^?]+)?$/,
-        loader: 'weex-vue-loader'
       }
     ]
   },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/670d001c/test/pages/components/recycler.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/recycler.vue b/test/pages/components/recycler.vue
new file mode 100644
index 0000000..3ad313e
--- /dev/null
+++ b/test/pages/components/recycler.vue
@@ -0,0 +1,482 @@
+<template>
+  <waterfall class="page" ref="waterfall"
+  v-bind:style="{padding:padding}"
+  :column-width="columnWidth" :column-count="columnCount" :column-gap="columnGap"
+  :show-scrollbar="showScrollbar" :scrollable="scrollable"
+  @scroll="recylerScroll" @loadmore="loadmore" loadmoreoffset=3000
+  >
+    <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
+      <loading-indicator class="indicator"></loading-indicator>
+      <text class="refreshText">{{refreshText}}</text>
+    </refresh>
+    <header class="header" ref="header" v-if="showHeader">
+      <image class="banner" src="https://gw.alicdn.com/tps/TB1ESN1PFXXXXX1apXXXXXXXXXX-1000-600.jpg" resize="cover">
+        <div class="bannerInfo">
+          <image class="avatar" src="https://gw.alicdn.com/tps/TB1EP9bPFXXXXbpXVXXXXXXXXXX-150-110.jpg" resize="cover"></image>
+          <text class="name">Adam Cat</text>
+          <div class="titleWrap">
+            <text class="title">Genius</text>
+          </div>
+        </div>
+        <div class="bannerPhotoWrap">
+          <image class="bannerPhoto" v-for="photo in banner.photos" :src="photo.src"></image>
+        </div>
+      </image>
+    </header>
+    <header class="stickyHeader" @click="showOrRemoveHeader">
+      <div v-if="stickyHeaderType === 'none'" class="stickyWrapper">
+        <text class="stickyText">Sticky Header</text>
+      </div>
+      <div v-if="stickyHeaderType === 'appear'" class="stickyWrapper">
+        <div class="stickyTextImageWrapper">
+          <text class="stickyText">Last Appear:</text>
+          <image class="stickyImage" :src="appearImage"></image>
+        </div>
+        <div class="stickyTextImageWrapper">
+          <text class="stickyText">Last Disappear:</text>
+          <image class="stickyImage" :src="disappearImage"></image>
+        </div>
+      </div>
+      <div v-if="stickyHeaderType === 'scroll'" class="stickyWrapper">
+        <text class="stickyText">Content Offset:{{contentOffset}}</text>
+      </div>
+    </header>
+    <cell v-for="(item, index) in items" :key="item.src" class="cell" ref="index">
+      <div class="item" @click="onItemclick(item.behaviour, index)" @appear="itemAppear(item.src)" @disappear="itemDisappear(item.src)">
+        <text v-if="item.name" class="itemName">{{item.name}}</text>
+        <image class="itemPhoto" :src="item.src"></image>
+        <text v-if="item.desc" class="itemDesc">{{item.desc}}</text>
+        <text v-if="item.behaviourName" class="itemClickBehaviour"> {{item.behaviourName}}</text>
+      </div>
+    </cell>
+    <header class="footer">
+      <text class="stickyText">Footer</text>
+    </header>
+    <div ref="fixed" class="fixedItem" @click="scrollToTop">
+      <text class="fixedText">Top</text>
+    </div>
+  </waterfall>
+</template>
+
+<style>
+  .page {
+    background-color: #EFEFEF;
+  }
+  .refresh {
+    height: 128;
+    width: 750;
+    flex-direction: row;
+    align-items: center;
+    justify-content: center;
+  }
+  .refreshText {
+    color: #888888;
+    font-weight: bold;
+  }
+  .indicator {
+    color: #888888;
+    height: 40;
+    width: 40;
+    margin-right: 30;
+  }
+  .header {
+  }
+  .banner {
+    height: 377;
+    flex-direction: row;
+  }
+  .bannerInfo {
+    width:270;
+    align-items: center;
+    justify-content: center;
+  }
+  .avatar {
+    width: 148;
+    height: 108;
+    border-radius: 54;
+    border-width: 4;
+    border-color: #FFFFFF;
+    margin-bottom: 14;
+  }
+  .name {
+    font-weight: bold;
+    font-size:32;
+    color:#ffffff;
+    line-height:32;
+    text-align:center;
+    margin-bottom: 16;
+  }
+  .titleWrap {
+    width: 100;
+    height: 24;
+    margin-bottom: 10;
+    background-color: rgba(255,255,255,0.80);
+    border-radius: 12;
+    justify-content: center;
+    align-items: center;
+  }
+  .title {
+    font-size: 20;
+    color: #000000;
+  }
+  .bannerPhotoWrap {
+    width: 449;
+    height: 305;
+    background-color: #FFFFFF;
+    border-radius: 12;
+    margin-top: 35;
+    padding: 12;
+    flex-direction: row;
+    justify-content: space-between;
+    flex-wrap:wrap;
+  }
+  .bannerPhoto {
+    width: 137;
+    height: 137;
+    margin-bottom: 6;
+  }
+  .stickyHeader {
+    position: sticky;
+    height: 94;
+    flex-direction: row;
+    padding-bottom:6;
+  }
+  .stickyWrapper {
+    flex-direction: row;
+    background-color:#00cc99;
+    justify-content: center;
+    align-items: center;
+    flex:1;
+  }
+  .stickyTextImageWrapper {
+    flex:1;
+    justify-content: center;
+    align-items: center;
+    flex-direction: row;
+  }
+  .stickyText {
+    color: #FFFFFF;
+    font-weight: bold;
+    font-size:32;
+    margin-right: 12;
+  }
+  .stickyImage {
+    width: 64;
+    height: 64;
+    border-radius: 32;
+  }
+
+  .cell {
+    padding-top: 6;
+    padding-bottom: 6;
+  }
+  .item {
+    background-color: #FFFFFF;
+    align-items: center;
+  }
+  .itemName {
+    font-size:28;
+    color:#333333;
+    line-height:42;
+    text-align:left;
+    margin-top: 24;
+  }
+  .itemPhoto {
+    margin-top: 18;
+    width: 220;
+    height: 220;
+    margin-bottom: 18;
+  }
+  .itemDesc {
+    font-size:24;
+    margin:12;
+    color:#999999;
+    line-height:36;
+    text-align:left;
+  }
+  .itemClickBehaviour {
+    font-size:36;
+    color:#00cc99;
+    line-height:36;
+    text-align:center;
+    margin-top: 6;
+    margin-left: 24;
+    margin-right: 24;
+    margin-bottom: 30;
+  }
+  .footer {
+    height: 94;
+    justify-content: center;
+    align-items: center;
+    background-color: #00cc99;
+  }
+
+  .fixedItem {
+    position: fixed;
+    width:78;
+    height:78;
+    background-color:#00cc99;
+    right: 32;
+    bottom: 32;
+    border-radius: 39;
+    align-items: center;
+    justify-content: center;
+  }
+  .fixedText {
+    font-size: 36;
+    color: white;
+    line-height: 36;
+  }
+
+</style>
+
+<script>
+  export default {
+    data: function() {
+      const items = [
+        {
+          src:'https://gw.alicdn.com/tps/TB1Jl1CPFXXXXcJXXXXXXXXXXXX-370-370.jpg',
+          name: 'Thomas Carlyle',
+          desc:'Genius only means hard-working all one\'s life',
+          behaviourName: 'Change count',
+          behaviour: 'changeColumnCount'
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1Hv1JPFXXXXa3XXXXXXXXXXXX-370-370.jpg',
+          desc:'The man who has made up his mind to win will never say "impossible "',
+          behaviourName: 'Change gap',
+          behaviour: 'changeColumnGap'
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1eNKuPFXXXXc_XpXXXXXXXXXX-370-370.jpg',
+          desc:'There is no such thing as a great talent without great will - power',
+          behaviourName: 'Show scrollbar',
+          behaviour: 'showScrollbar',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1DCh8PFXXXXX7aXXXXXXXXXXX-370-370.jpg',
+          name:'Addison',
+          desc:'Cease to struggle and you cease to live',
+          behaviourName: 'Change width',
+          behaviour: 'changeColumnWidth',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1ACygPFXXXXXwXVXXXXXXXXXX-370-370.jpg',
+          desc:'A strong man will struggle with the storms of fate',
+          behaviourName: 'Listen appear',
+          behaviour: 'listenAppear',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1IGShPFXXXXaqXVXXXXXXXXXX-370-370.jpg',
+          name:'Ruskin',
+          desc:'Living without an aim is like sailing without a compass',
+          behaviourName: 'Set scrollable',
+          behaviour: 'setScrollable',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1xU93PFXXXXXHaXXXXXXXXXXX-240-240.jpg',
+          behaviourName: 'waterfall padding',
+          behaviour: 'setPadding',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB19hu0PFXXXXaXaXXXXXXXXXXX-240-240.jpg',
+          name:'Balzac',
+          desc:'There is no such thing as a great talent without great will - power',
+          behaviourName: 'listen scroll',
+          behaviour: 'listenScroll',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1ux2vPFXXXXbkXXXXXXXXXXXX-240-240.jpg',
+          behaviourName: 'Remove cell',
+          behaviour: 'removeCell',
+        },
+        {
+          src:'https://gw.alicdn.com/tps/TB1tCCWPFXXXXa7aXXXXXXXXXXX-240-240.jpg',
+          behaviourName: 'Move cell',
+          behaviour: 'moveCell',
+        }
+      ]
+
+      let repeatItems = [];
+      for (let i = 0; i < 3; i++) {
+        repeatItems.push(...items)
+      }
+
+      return {
+        padding: 0,
+        refreshing: false,
+        refreshText: '\u2193   pull to refresh...',
+        columnCount: 2,
+        columnGap: 12,
+        columnWidth: 'auto',
+        contentOffset: '0',
+        showHeader: true,
+        showScrollbar: false,
+        scrollable: true,
+        showStickyHeader: false,
+        appearImage: null,
+        disappearImage: null,
+        stickyHeaderType: 'none',
+        // fixedRect:'',
+        banner: {
+          photos: [
+            {src:'https://gw.alicdn.com/tps/TB1JyaCPFXXXXc9XXXXXXXXXXXX-140-140.jpg'},
+            {src:'https://gw.alicdn.com/tps/TB1MwSFPFXXXXbdXXXXXXXXXXXX-140-140.jpg'},
+            {src:'https://gw.alicdn.com/tps/TB1U8avPFXXXXaDXpXXXXXXXXXX-140-140.jpg'},
+            {src:'https://gw.alicdn.com/tps/TB17Xh8PFXXXXbkaXXXXXXXXXXX-140-140.jpg'},
+            {src:'https://gw.alicdn.com/tps/TB1cTmLPFXXXXXRXXXXXXXXXXXX-140-140.jpg'},
+            {src:'https://gw.alicdn.com/tps/TB1oCefPFXXXXbVXVXXXXXXXXXX-140-140.jpg'}
+          ]
+        },
+        items: repeatItems
+      }
+    },
+
+    created() {
+      // let self = this
+      // setTimeout(()=>{
+      //   weex.requireModule('dom').getComponentRect(this.$refs.fixed, result=>{
+      //     const x = result.size.left
+      //     const y = result.size.top
+      //     const width = result.size.width
+      //     const height = result.size.height
+      //     self.fixedRect = `${x}|${y}|${width}|${height}`
+      //   })
+      // }, 3000)
+    },
+
+    methods: {
+      recylerScroll: function(e) {
+        this.contentOffset = e.contentOffset.y
+      },
+      loadmore: function(e) {
+        console.log('receive loadmore event')
+        // this.$refs.waterfall.resetLoadmore()
+      },
+      showOrRemoveHeader: function() {
+        this.showHeader = !this.showHeader
+      },
+      onItemclick: function (behaviour, index) {
+        console.log(`click...${behaviour} at index ${index}`)
+        switch (behaviour) {
+          case 'changeColumnCount':
+            this.changeColumnCount()
+            break
+          case 'changeColumnGap':
+            this.changeColumnGap()
+            break
+          case 'changeColumnWidth':
+            this.changeColumnWidth()
+            break
+          case 'showScrollbar':
+            this.showOrHideScrollbar()
+            break
+          case 'listenAppear':
+            this.listenAppearAndDisappear()
+            break
+          case 'setScrollable':
+            this.setScrollable()
+            break
+          case 'setPadding':
+            this.setRecyclerPadding()
+            break
+          case 'listenScroll':
+            this.listenScrollEvent()
+            break
+          case 'removeCell':
+            this.removeCell(index)
+            break
+          case 'moveCell':
+            this.moveCell(index)
+            break
+        }
+      },
+
+      itemAppear: function(src) {
+        this.appearImage = src;
+      },
+
+      itemDisappear: function(src) {
+        this.disappearImage = src;
+      },
+
+      changeColumnCount: function() {
+        if (this.columnCount === 2) {
+          this.columnCount = 3
+        } else {
+          this.columnCount = 2
+        }
+      },
+
+      changeColumnGap: function() {
+        if (this.columnGap === 12) {
+          this.columnGap = 'normal'
+        } else {
+          this.columnGap = 12
+        }
+      },
+
+      changeColumnWidth: function() {
+        if (this.columnWidth === 'auto') {
+          this.columnWidth = 600
+        } else {
+          this.columnWidth = 'auto'
+        }
+      },
+
+      showOrHideScrollbar: function() {
+        this.showScrollbar = !this.showScrollbar
+      },
+
+      setScrollable: function() {
+        this.scrollable = !this.scrollable
+      },
+
+      listenAppearAndDisappear: function() {
+        this.stickyHeaderType = (this.stickyHeaderType === 'appear' ? 'none' : 'appear')
+      },
+
+      listenScrollEvent: function() {
+        this.stickyHeaderType = (this.stickyHeaderType === 'scroll' ? 'none' : 'scroll')
+      },
+
+      scrollToTop: function() {
+        weex.requireModule('dom').scrollToElement(this.$refs.header)
+      },
+
+      setRecyclerPadding: function() {
+        this.padding = (this.padding == 0 ? 12 : 0);
+      },
+
+      removeCell: function(index) {
+        this.items.splice(index, 1)
+      },
+
+      moveCell: function(index) {
+        if (index == 0) {
+          this.items.splice(this.items.length - 1, 0, this.items.splice(index, 1)[0]);
+        } else {
+          this.items.splice(0, 0, this.items.splice(index, 1)[0]);
+        }
+      },
+
+      onrefresh (event) {
+        this.refreshing = true
+        this.refreshText = "loading..."
+        setTimeout(() => {
+          this.refreshing = false
+          this.refreshText = '\u2193   pull to refresh...'
+        }, 2000)
+      },
+
+      onpullingdown (event) {
+        // console.log(`${event.pullingDistance}`)
+        if (event.pullingDistance < -64) {
+          this.refreshText = '\u2191   release to refresh...'
+        } else {
+          this.refreshText = '\u2193   pull to refresh...'
+        }
+      }
+    }
+  }
+</script>

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/670d001c/test/scripts/components/recycler.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js
new file mode 100644
index 0000000..c134b67
--- /dev/null
+++ b/test/scripts/components/recycler.test.js
@@ -0,0 +1,119 @@
+'use strict';
+
+var _ = require('macaca-utils');
+var assert = require('chai').assert
+var wd = require('weex-wd')
+var path = require('path');
+var os = require('os');
+var util = require("../util.js");
+
+const isApproximate = (x, y) =>  {
+  return Math.abs(x - y) < 0.1
+}
+
+describe('recycler', function () {
+  this.timeout(util.getTimeoutMills())
+  const driver = util.createDriver(wd)
+
+  before(function () {
+    return util.init(driver)
+      .get('wxpage://' + util.getDeviceHost() +'/components/recycler.js')
+      .waitForElementByXPath('//div[1]/text[1]',util.getGETActionWaitTimeMills(),1000)
+  });
+
+  after(function () {
+      return util.quit(driver);
+  })
+
+  let scaleFactor = 0
+  let screenHeight = 0
+  let navBarHeight = 0
+  it('#1 test recyler layout', () => {
+    return driver
+    .getWindowSize()
+    .then(size=>{
+      scaleFactor = size.width / 750
+      screenHeight = size.height
+    })
+    .sleep(2000)
+    .elementByXPath('//recycler[1]')
+    .getRect()
+    .then((rect)=>{
+      console.log(`scale factor:${scaleFactor}`)
+      console.log(`recycler rect:${JSON.stringify(rect)}`)
+      navBarHeight = rect.y
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, screenHeight - navBarHeight))
+    })
+  })
+
+  it('#2 test header 1 layout', () => {
+    return driver
+    .elementByXPath('//recycler[1]/div[1]/')
+    .getRect()
+    .then((rect)=>{
+      console.log(`header 1 rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight))
+      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 377 * scaleFactor))
+    })
+  })
+
+  it('#3 test header 2 layout', () => {
+    return driver
+    .elementByXPath('//recycler[1]/div[2]/')
+    .getRect()
+    .then((rect)=>{
+      console.log(`header 2 rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 377 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
+    })
+  })
+
+  it('#4 test cell 1 layout', () => {
+    return driver
+    .elementByXPath('//recycler[1]/cell[1]/')
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 1 rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 502 * scaleFactor))
+    })
+  })
+
+  it('#5 test cell 2 layout', () => {
+    return driver
+    .elementByXPath('//recycler[1]/cell[2]/')
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 2 rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 381 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 472 * scaleFactor))
+    })
+  })
+
+  it('#10 test fixed', () => {
+    return driver
+    .elementByXPath('//div[1]')
+    .getRect()
+    .then((rect)=>{
+      console.log(`scale factor:${scaleFactor}`)
+      console.log(`fixed rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 640 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, screenHeight - 110 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 78 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 78 * scaleFactor))
+    })
+  })
+
+});
+
+


[09/11] incubator-weex git commit: * [android] bugfix recycler getrealPxByWidth

Posted by cx...@apache.org.
* [android] bugfix recycler getrealPxByWidth


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/be02dec7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/be02dec7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/be02dec7

Branch: refs/heads/0.11-dev
Commit: be02dec7268d320f1f36c67a0de3b6cc4c938c5c
Parents: 9486b66
Author: zshshr <zh...@gmail.com>
Authored: Mon Mar 27 16:44:08 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Mon Mar 27 16:44:08 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/be02dec7/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
index 3ee0e06..049f47f 100644
--- a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
+++ b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
@@ -230,7 +230,7 @@ public class WXRecyclerDomObject extends WXDomObject{
     }
 
     public float getColumnGap() {
-        return mColumnGap;
+        return WXViewUtils.getRealPxByWidth(mColumnGap,getViewPortWidth());
     }
 
     public int getColumnCount() {
@@ -238,7 +238,7 @@ public class WXRecyclerDomObject extends WXDomObject{
     }
 
     public float getColumnWidth() {
-        return mColumnWidth;
+        return WXViewUtils.getRealPxByWidth(mColumnWidth,getViewPortWidth());
     }
     @Override
     public void add(WXDomObject child, int index) {


[06/11] incubator-weex git commit: * [ios] fix issue that recycler can not scroll to header

Posted by cx...@apache.org.
* [ios] fix issue that recycler can not scroll to header


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/df102473
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/df102473
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/df102473

Branch: refs/heads/0.11-dev
Commit: df102473aa7122ba16b619d64d4fe5f84ccfdfce
Parents: 1a37093
Author: \u9690\u98ce <cx...@apache.org>
Authored: Mon Mar 27 15:28:55 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Mon Mar 27 15:28:55 2017 +0800

----------------------------------------------------------------------
 .../Component/Recycler/WXRecyclerDataController.h       |  2 ++
 .../Component/Recycler/WXRecyclerDataController.m       | 12 ++++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/df102473/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
index 3b85155..34e8a10 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
@@ -31,4 +31,6 @@
 
 - (NSIndexPath *)indexPathForCell:(WXCellComponent *)cell;
 
+- (NSUInteger)indexForHeader:(WXHeaderComponent *)header;
+
 @end

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/df102473/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
index aa5732d..2031837 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
@@ -15,6 +15,7 @@
 
 @property (nonatomic, strong, readwrite) NSArray<WXSectionDataController *> *sections;
 @property (nonatomic, strong, readonly) NSMapTable<WXCellComponent *, NSIndexPath*> *cellToIndexPathTable;
+@property (nonatomic, strong, readonly) NSMapTable<WXCellComponent *, NSIndexPath*> *headerToIndexTable;
 
 @end
 
@@ -25,6 +26,7 @@
     if (self = [super init]) {
         _sections = [NSArray new];
         _cellToIndexPathTable = [NSMapTable weakToStrongObjectsMapTable];
+        _headerToIndexTable = [NSMapTable weakToStrongObjectsMapTable];
     }
     
     return self;
@@ -44,6 +46,9 @@
             NSIndexPath *indexPath = [NSIndexPath indexPathForItem:idx2 inSection:idx];
             [_cellToIndexPathTable setObject:indexPath forKey:obj];
         }];
+        if (controller.headerComponent) {
+            [_headerToIndexTable setObject:@(idx) forKey:controller.headerComponent];
+        }
     }];
 }
 
@@ -98,6 +103,12 @@
     return [_cellToIndexPathTable objectForKey:cell];
 }
 
+- (NSUInteger)indexForHeader:(WXHeaderComponent *)header
+{
+    NSNumber *index = [_headerToIndexTable objectForKey:header];
+    return [index unsignedIntegerValue];
+}
+
 #pragma mark - Private
 
 - (WXSectionDataController *)dataControllerForSection:(NSInteger)section
@@ -109,6 +120,7 @@
 - (void)cleanup
 {
     [_cellToIndexPathTable removeAllObjects];
+    [_headerToIndexTable removeAllObjects];
 }
 
 @end


[03/11] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev

Posted by cx...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b7835c19
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b7835c19
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b7835c19

Branch: refs/heads/0.11-dev
Commit: b7835c19cac503bd9b6093e8c1f8239c9be458bf
Parents: 1d9fbd6 1ce479e
Author: \u9690\u98ce <cx...@apache.org>
Authored: Thu Mar 23 16:58:04 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Thu Mar 23 16:58:04 2017 +0800

----------------------------------------------------------------------
 android/sdk/assets/main.js                      |  14 +-
 .../taobao/weex/ui/component/WXComponent.java   |   6 +-
 .../com/taobao/weex/ui/component/WXHeader.java  |   5 +
 .../com/taobao/weex/ui/component/WXLoading.java |   5 +
 .../com/taobao/weex/ui/component/WXRefresh.java |   5 +
 .../ui/component/list/BasicListComponent.java   |  31 +-
 .../ui/component/list/ListComponentView.java    |   2 +-
 .../ui/component/list/SimpleRecyclerView.java   |  80 +----
 .../ui/component/list/StickyHeaderHelper.java   | 337 +++++++++++++++++++
 .../taobao/weex/ui/component/list/WXCell.java   |  11 +
 .../refresh/wrapper/BounceRecyclerView.java     | 118 +------
 html5/frameworks/legacy/app/ctrl/init.js        |   2 +
 html5/shared/freeze.js                          |  47 ++-
 ios/sdk/WeexSDK.podspec                         |   2 +-
 ios/sdk/WeexSDK/Resources/main.js               |  14 +-
 .../Component/Recycler/WXRecyclerComponent.m    |  23 ++
 .../Sources/Component/WXRefreshComponent.m      |   6 -
 .../WeexSDK/Sources/Module/WXNavigatorModule.m  |   5 +-
 ios/sdk/WeexSDK/Sources/Utility/WXDefine.h      |   2 +-
 package.json                                    |   2 +-
 20 files changed, 477 insertions(+), 240 deletions(-)
----------------------------------------------------------------------



[05/11] incubator-weex git commit: * [ios] fix issue that recycler can not scroll to header

Posted by cx...@apache.org.
* [ios] fix issue that recycler can not scroll to header


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1a370931
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1a370931
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1a370931

Branch: refs/heads/0.11-dev
Commit: 1a370931d18091baa10ebc72fe203c3dedf2d9de
Parents: 08930c2
Author: \u9690\u98ce <cx...@apache.org>
Authored: Mon Mar 27 15:28:12 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Mon Mar 27 15:28:12 2017 +0800

----------------------------------------------------------------------
 .../Component/Recycler/WXRecyclerComponent.m    | 40 +++++++++++++++++++-
 1 file changed, 38 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1a370931/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
index 073e878..91f3d12 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
@@ -96,7 +96,7 @@ typedef enum : NSUInteger {
             layout.columnWidth = [WXConvert WXLength:attributes[@"columnWidth"] isFloat:YES scaleFactor:scaleFactor] ? : [WXLength lengthWithFloat:0.0 type:WXLengthTypeAuto];
             layout.columnCount = [WXConvert WXLength:attributes[@"columnCount"] isFloat:NO scaleFactor:1.0] ? : [WXLength lengthWithInt:1 type:WXLengthTypeFixed];
             layout.columnGap = [self _floatValueForColumnGap:([WXConvert WXLength:attributes[@"columnGap"] isFloat:YES scaleFactor:scaleFactor] ? : [WXLength lengthWithFloat:0.0 type:WXLengthTypeNormal])];
-            
+
             layout.delegate = self;
         } else {
             _collectionViewlayout = [UICollectionViewLayout new];
@@ -211,7 +211,43 @@ typedef enum : NSUInteger {
 
 - (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
 {
-    [super scrollToComponent:component withOffset:offset animated:animated];
+    if (_collectionView.contentSize.height <= _collectionView.frame.size.height) {
+        // can not scroll
+        return;
+    }
+    
+    CGPoint contentOffset = _collectionView.contentOffset;
+    CGFloat contentOffsetY = 0;
+    
+    CGRect rect;
+    while (component) {
+        if ([component isKindOfClass:[WXCellComponent class]]) {
+            NSIndexPath *toIndexPath = [self.dataController indexPathForCell:component];
+            UICollectionViewLayoutAttributes *attributes = [_collectionView layoutAttributesForItemAtIndexPath:toIndexPath];
+            rect = attributes.frame;
+            break;
+        }
+        if ([component isKindOfClass:[WXHeaderComponent class]]) {
+            NSUInteger toIndex = [self.dataController indexForHeader:component];
+            UICollectionViewLayoutAttributes *attributes = [_collectionView layoutAttributesForSupplementaryElementOfKind:kCollectionSupplementaryViewKindHeader atIndexPath:[NSIndexPath indexPathWithIndex:toIndex]];
+            rect = attributes.frame;
+            break;
+        }
+        contentOffsetY += component.calculatedFrame.origin.y;
+        component = component.supercomponent;
+    }
+    
+    contentOffsetY += rect.origin.y;
+    contentOffsetY += offset * self.weexInstance.pixelScaleFactor;
+    
+    if (contentOffsetY > _collectionView.contentSize.height - _collectionView.frame.size.height) {
+        contentOffset.y = _collectionView.contentSize.height - _collectionView.frame.size.height;
+    } else {
+        contentOffset.y = contentOffsetY;
+    }
+    
+    [_collectionView setContentOffset:contentOffset animated:animated];
+
 }
 
 - (void)performUpdatesWithCompletion:(void (^)(BOOL finished))completion


[02/11] incubator-weex git commit: * [test] add recycler test

Posted by cx...@apache.org.
* [test] add recycler test


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1d9fbd6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1d9fbd6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1d9fbd6d

Branch: refs/heads/0.11-dev
Commit: 1d9fbd6dc59d312eb8608af84400e48c35c03eec
Parents: 670d001
Author: \u9690\u98ce <cx...@apache.org>
Authored: Thu Mar 23 16:32:45 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Thu Mar 23 16:32:45 2017 +0800

----------------------------------------------------------------------
 test/scripts/components/recycler.test.js | 77 +++++++++++++++------------
 1 file changed, 44 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1d9fbd6d/test/scripts/components/recycler.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js
index c134b67..f091e1f 100644
--- a/test/scripts/components/recycler.test.js
+++ b/test/scripts/components/recycler.test.js
@@ -7,105 +7,116 @@ var path = require('path');
 var os = require('os');
 var util = require("../util.js");
 
+
+const platform = process.env.platform.toLowerCase() || 'android';
+const isAndroid = platform === 'android';
+
+let cell1Path = isAndroid ? '//recycler[1]/div[3]/' : '//recycler[1]/cell[1]/'
+let cell2Path = isAndroid ? '//recycler[1]/div[4]/' : '//recycler[1]/cell[2]/'
+let cell3Path = isAndroid ? '//recycler[1]/div[5]/' : '//recycler[1]/cell[3]/'
+let cell4Path = isAndroid ? '//recycler[1]/div[6]/' : '//recycler[1]/cell[4]/'
+
 const isApproximate = (x, y) =>  {
-  return Math.abs(x - y) < 0.1
+  return Math.abs(x - y) <= 1
 }
 
+
 describe('recycler', function () {
   this.timeout(util.getTimeoutMills())
   const driver = util.createDriver(wd)
 
   before(function () {
+    console.log('wxpage://' + util.getDeviceHost() +'/components/recycler.js')
     return util.init(driver)
       .get('wxpage://' + util.getDeviceHost() +'/components/recycler.js')
-      .waitForElementByXPath('//div[1]/text[1]',util.getGETActionWaitTimeMills(),1000)
+      .waitForElementByXPath('//recycler[1]',util.getGETActionWaitTimeMills(),1000)
   });
 
   after(function () {
-      return util.quit(driver);
+      // return util.quit(driver);
   })
 
   let scaleFactor = 0
   let screenHeight = 0
+  let recyclerWidth = 0
   let navBarHeight = 0
+  let cell1Height = 0
+  let cell2Height = 0
   it('#1 test recyler layout', () => {
     return driver
     .getWindowSize()
     .then(size=>{
       scaleFactor = size.width / 750
       screenHeight = size.height
+      recyclerWidth = isAndroid ? (size.width + 12) : 750 * scaleFactor
+      console.log(`screen size:${JSON.stringify(size)}`)
+      console.log(`scale factor:${scaleFactor}`)
     })
     .sleep(2000)
     .elementByXPath('//recycler[1]')
     .getRect()
     .then((rect)=>{
-      console.log(`scale factor:${scaleFactor}`)
       console.log(`recycler rect:${JSON.stringify(rect)}`)
       navBarHeight = rect.y
       assert.isOk(isApproximate(rect.x, 0))
-      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
       assert.isOk(isApproximate(rect.height, screenHeight - navBarHeight))
     })
-  })
-
-  it('#2 test header 1 layout', () => {
-    return driver
     .elementByXPath('//recycler[1]/div[1]/')
     .getRect()
     .then((rect)=>{
       console.log(`header 1 rect:${JSON.stringify(rect)}`)
       assert.isOk(isApproximate(rect.x, 0))
       assert.isOk(isApproximate(rect.y, navBarHeight))
-      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
       assert.isOk(isApproximate(rect.height, 377 * scaleFactor))
     })
-  })
-
-  it('#3 test header 2 layout', () => {
-    return driver
     .elementByXPath('//recycler[1]/div[2]/')
     .getRect()
     .then((rect)=>{
       console.log(`header 2 rect:${JSON.stringify(rect)}`)
       assert.isOk(isApproximate(rect.x, 0))
       assert.isOk(isApproximate(rect.y, navBarHeight + 377 * scaleFactor))
-      assert.isOk(isApproximate(rect.width, 750 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
       assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
     })
-  })
-
-  it('#4 test cell 1 layout', () => {
-    return driver
-    .elementByXPath('//recycler[1]/cell[1]/')
+    .elementByXPath(cell1Path)
     .getRect()
     .then((rect)=>{
       console.log(`cell 1 rect:${JSON.stringify(rect)}`)
+      cell1Height = rect.height
       assert.isOk(isApproximate(rect.x, 0))
       assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
       assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
-      assert.isOk(isApproximate(rect.height, 502 * scaleFactor))
     })
-  })
-
-  it('#5 test cell 2 layout', () => {
-    return driver
-    .elementByXPath('//recycler[1]/cell[2]/')
+    .elementByXPath(cell2Path)
     .getRect()
     .then((rect)=>{
       console.log(`cell 2 rect:${JSON.stringify(rect)}`)
+      cell2Height = rect.height
+      assert.isOk(isApproximate(rect.x, 381 * scaleFactor), 'x not approximate:' + 381 * scaleFactor)
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor), 'y not approximate:' + (navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+    })
+    .elementByXPath(cell3Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 3 rect:${JSON.stringify(rect)}`)
       assert.isOk(isApproximate(rect.x, 381 * scaleFactor))
-      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell2Height))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+    })
+    .elementByXPath(cell4Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 4 rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell1Height))
       assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
-      assert.isOk(isApproximate(rect.height, 472 * scaleFactor))
     })
-  })
-
-  it('#10 test fixed', () => {
-    return driver
     .elementByXPath('//div[1]')
     .getRect()
     .then((rect)=>{
-      console.log(`scale factor:${scaleFactor}`)
       console.log(`fixed rect:${JSON.stringify(rect)}`)
       assert.isOk(isApproximate(rect.x, 640 * scaleFactor))
       assert.isOk(isApproximate(rect.y, screenHeight - 110 * scaleFactor))


[11/11] incubator-weex git commit: * [ios] fix issue that recycle will crash if header height is zero (no layout attribute but has header will cause crash)

Posted by cx...@apache.org.
* [ios] fix issue that recycle will crash if header height is zero (no layout attribute but has header will cause crash)


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0dc2daad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0dc2daad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0dc2daad

Branch: refs/heads/0.11-dev
Commit: 0dc2daadcc252cd3be890361cd052640e76ac3a8
Parents: 014cfc1
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 28 00:36:55 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 28 00:36:55 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h   | 2 ++
 .../WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m   | 5 +++--
 .../WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m   | 5 +++++
 .../Sources/Component/Recycler/WXRecyclerDataController.h      | 2 ++
 .../Sources/Component/Recycler/WXRecyclerDataController.m      | 6 ++++++
 5 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0dc2daad/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
index f107db0..34b1f6a 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.h
@@ -21,6 +21,8 @@ extern NSString * const kCollectionSupplementaryViewKindHeader;
 
 - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout heightForHeaderInSection:(NSInteger)section;
 
+- (BOOL)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout hasHeaderInSection:(NSInteger)section;
+
 - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout isNeedStickyForHeaderInSection:(NSInteger)section;
 
 @end

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0dc2daad/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
index a959ddc..9a56502 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXMultiColumnLayout.m
@@ -156,9 +156,10 @@ NSString * const kMultiColumnLayoutCell = @"WXMultiColumnLayoutCell";
     }
     
     for (NSInteger section = 0; section < numberOfSections; section++) {
-        CGFloat headerHeight = [self.delegate collectionView:self.collectionView layout:self heightForHeaderInSection:section];
+        BOOL hasHeader = [self.delegate collectionView:self.collectionView layout:self hasHeaderInSection:section];
         // header
-        if (headerHeight > 0) {
+        if (hasHeader) {
+            CGFloat headerHeight = [self.delegate collectionView:self.collectionView layout:self heightForHeaderInSection:section];
             WXMultiColumnLayoutHeaderAttributes *headerAttributes = [WXMultiColumnLayoutHeaderAttributes layoutAttributesForSupplementaryViewOfKind:kCollectionSupplementaryViewKindHeader withIndexPath:[NSIndexPath indexPathForItem:0 inSection:section]];
             headerAttributes.frame = CGRectMake(insets.left, currentHeight, self.contentWidth - (insets.left + insets.right), headerHeight);
             headerAttributes.isSticky = [self.delegate collectionView:self.collectionView layout:self isNeedStickyForHeaderInSection:section];

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0dc2daad/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
index 91f3d12..b5b5ac8 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
@@ -406,6 +406,11 @@ typedef enum : NSUInteger {
     return headerSize.height;
 }
 
+- (BOOL)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout hasHeaderInSection:(NSInteger)section
+{
+    return [self.dataController hasHeaderInSection:section];
+}
+
 - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout isNeedStickyForHeaderInSection:(NSInteger)section
 {
     return [self.dataController isStickyForHeaderAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:section]];

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0dc2daad/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
index 34e8a10..63391d1 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.h
@@ -29,6 +29,8 @@
 
 - (BOOL)isStickyForHeaderAtIndexPath:(NSIndexPath *)indexPath;
 
+- (BOOL)hasHeaderInSection:(NSInteger)section;
+
 - (NSIndexPath *)indexPathForCell:(WXCellComponent *)cell;
 
 - (NSUInteger)indexForHeader:(WXHeaderComponent *)header;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0dc2daad/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
index 2031837..92875ce 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerDataController.m
@@ -92,6 +92,12 @@
     return [sectionController sizeForHeaderAtIndex:indexPath.item];
 }
 
+- (BOOL)hasHeaderInSection:(NSInteger)section
+{
+    WXSectionDataController *sectionController = [self dataControllerForSection:section];
+    return sectionController.headerComponent != nil;
+}
+
 - (BOOL)isStickyForHeaderAtIndexPath:(NSIndexPath *)indexPath
 {
     WXSectionDataController *sectionController = [self dataControllerForSection:indexPath.section];


[07/11] incubator-weex git commit: * [test] Add recycler tests.

Posted by cx...@apache.org.
* [test] Add recycler tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/20f0dc1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/20f0dc1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/20f0dc1d

Branch: refs/heads/0.11-dev
Commit: 20f0dc1d690f1bbf1d46d2f976194d6595e8e9aa
Parents: df10247
Author: \u9690\u98ce <cx...@apache.org>
Authored: Mon Mar 27 15:29:56 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Mon Mar 27 15:29:56 2017 +0800

----------------------------------------------------------------------
 test/pages/components/recycler.vue       |  28 ++-
 test/scripts/components/recycler.test.js | 302 +++++++++++++++++++++++++-
 2 files changed, 305 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/20f0dc1d/test/pages/components/recycler.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/recycler.vue b/test/pages/components/recycler.vue
index 3ad313e..12ca01c 100644
--- a/test/pages/components/recycler.vue
+++ b/test/pages/components/recycler.vue
@@ -49,11 +49,11 @@
         <text v-if="item.behaviourName" class="itemClickBehaviour"> {{item.behaviourName}}</text>
       </div>
     </cell>
-    <header class="footer">
+    <header class="footer" ref="footer">
       <text class="stickyText">Footer</text>
     </header>
-    <div ref="fixed" class="fixedItem" @click="scrollToTop">
-      <text class="fixedText">Top</text>
+    <div ref="fixed" class="fixedItem" @click="scrollToNext">
+      <text class="fixedText">bot</text>
     </div>
   </waterfall>
 </template>
@@ -79,8 +79,6 @@
     width: 40;
     margin-right: 30;
   }
-  .header {
-  }
   .banner {
     height: 377;
     flex-direction: row;
@@ -223,9 +221,9 @@
     justify-content: center;
   }
   .fixedText {
-    font-size: 36;
+    font-size: 32;
     color: white;
-    line-height: 36;
+    line-height: 32;
   }
 
 </style>
@@ -238,8 +236,8 @@
           src:'https://gw.alicdn.com/tps/TB1Jl1CPFXXXXcJXXXXXXXXXXXX-370-370.jpg',
           name: 'Thomas Carlyle',
           desc:'Genius only means hard-working all one\'s life',
-          behaviourName: 'Change count',
-          behaviour: 'changeColumnCount'
+          behaviourName: 'Change width',
+          behaviour: 'changeColumnWidth',
         },
         {
           src:'https://gw.alicdn.com/tps/TB1Hv1JPFXXXXa3XXXXXXXXXXXX-370-370.jpg',
@@ -250,15 +248,15 @@
         {
           src:'https://gw.alicdn.com/tps/TB1eNKuPFXXXXc_XpXXXXXXXXXX-370-370.jpg',
           desc:'There is no such thing as a great talent without great will - power',
-          behaviourName: 'Show scrollbar',
-          behaviour: 'showScrollbar',
+          behaviourName: 'Change count',
+          behaviour: 'changeColumnCount'
         },
         {
           src:'https://gw.alicdn.com/tps/TB1DCh8PFXXXXX7aXXXXXXXXXXX-370-370.jpg',
           name:'Addison',
           desc:'Cease to struggle and you cease to live',
-          behaviourName: 'Change width',
-          behaviour: 'changeColumnWidth',
+          behaviourName: 'Show scrollbar',
+          behaviour: 'showScrollbar',
         },
         {
           src:'https://gw.alicdn.com/tps/TB1ACygPFXXXXXwXVXXXXXXXXXX-370-370.jpg',
@@ -440,8 +438,8 @@
         this.stickyHeaderType = (this.stickyHeaderType === 'scroll' ? 'none' : 'scroll')
       },
 
-      scrollToTop: function() {
-        weex.requireModule('dom').scrollToElement(this.$refs.header)
+      scrollToNext: function() {
+        weex.requireModule('dom').scrollToElement(this.$refs.footer)
       },
 
       setRecyclerPadding: function() {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/20f0dc1d/test/scripts/components/recycler.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js
index f091e1f..19f0ad3 100644
--- a/test/scripts/components/recycler.test.js
+++ b/test/scripts/components/recycler.test.js
@@ -11,15 +11,26 @@ var util = require("../util.js");
 const platform = process.env.platform.toLowerCase() || 'android';
 const isAndroid = platform === 'android';
 
-let cell1Path = isAndroid ? '//recycler[1]/div[3]/' : '//recycler[1]/cell[1]/'
-let cell2Path = isAndroid ? '//recycler[1]/div[4]/' : '//recycler[1]/cell[2]/'
-let cell3Path = isAndroid ? '//recycler[1]/div[5]/' : '//recycler[1]/cell[3]/'
-let cell4Path = isAndroid ? '//recycler[1]/div[6]/' : '//recycler[1]/cell[4]/'
+const fixedPath = '//div[1]'
+const header1Path = '//recycler[1]/div[1]/'
+const header2Path = '//recycler[1]/div[2]/'
+const cell1Path = isAndroid ? '//recycler[1]/div[3]/' : '//recycler[1]/cell[1]/'
+const cell2Path = isAndroid ? '//recycler[1]/div[4]/' : '//recycler[1]/cell[2]/'
+const cell3Path = isAndroid ? '//recycler[1]/div[5]/' : '//recycler[1]/cell[3]/'
+const cell4Path = isAndroid ? '//recycler[1]/div[6]/' : '//recycler[1]/cell[4]/'
+const cell27Path = isAndroid ? '//recycler[1]/div[29]/' : '//recycler[1]/cell[27]/'
+const cell28Path = isAndroid ? '//recycler[1]/div[30]/' : '//recycler[1]/cell[28]/'
+const cell29Path = isAndroid ? '//recycler[1]/div[31]/' : '//recycler[1]/cell[29]/'
+const cell30Path = isAndroid ? '//recycler[1]/div[32]/' : '//recycler[1]/cell[30]/'
+const footerPath = '//recycler[1]/div[1]'
 
 const isApproximate = (x, y) =>  {
   return Math.abs(x - y) <= 1
 }
 
+if (isAndroid) {
+  return;
+}
 
 describe('recycler', function () {
   this.timeout(util.getTimeoutMills())
@@ -33,7 +44,7 @@ describe('recycler', function () {
   });
 
   after(function () {
-      // return util.quit(driver);
+      return util.quit(driver); 
   })
 
   let scaleFactor = 0
@@ -62,7 +73,7 @@ describe('recycler', function () {
       assert.isOk(isApproximate(rect.width, recyclerWidth))
       assert.isOk(isApproximate(rect.height, screenHeight - navBarHeight))
     })
-    .elementByXPath('//recycler[1]/div[1]/')
+    .elementByXPath(header1Path)
     .getRect()
     .then((rect)=>{
       console.log(`header 1 rect:${JSON.stringify(rect)}`)
@@ -71,7 +82,7 @@ describe('recycler', function () {
       assert.isOk(isApproximate(rect.width, recyclerWidth))
       assert.isOk(isApproximate(rect.height, 377 * scaleFactor))
     })
-    .elementByXPath('//recycler[1]/div[2]/')
+    .elementByXPath(header2Path)
     .getRect()
     .then((rect)=>{
       console.log(`header 2 rect:${JSON.stringify(rect)}`)
@@ -94,8 +105,8 @@ describe('recycler', function () {
     .then((rect)=>{
       console.log(`cell 2 rect:${JSON.stringify(rect)}`)
       cell2Height = rect.height
-      assert.isOk(isApproximate(rect.x, 381 * scaleFactor), 'x not approximate:' + 381 * scaleFactor)
-      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor), 'y not approximate:' + (navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.x, 381 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
       assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
     })
     .elementByXPath(cell3Path)
@@ -114,7 +125,152 @@ describe('recycler', function () {
       assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell1Height))
       assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
     })
-    .elementByXPath('//div[1]')
+  })
+
+  it('#2 test column count', () => {
+    return driver
+    .elementByXPath(cell3Path)
+    .click()
+    .elementByXPath(cell1Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 1 rect after changing column count to 3:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 242 * scaleFactor))
+    })
+    .elementByXPath(cell2Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 2 rect after changing column count to 3:${JSON.stringify(rect)}`)
+      cell2Height = rect.height
+      assert.isOk(isApproximate(rect.x, 254 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 242 * scaleFactor))
+    })
+    .elementByXPath(cell3Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 3 rect after changing column count to 3:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 508 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 242 * scaleFactor))
+    })
+    .elementByXPath(cell4Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 4 rect after changing column count to 3:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 254 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell2Height))
+      assert.isOk(isApproximate(rect.width, 242 * scaleFactor))
+    })
+    .elementByXPath(cell3Path)
+    .click()
+  })
+
+  it('#3 test column gap', () => {
+    return driver
+    .elementByXPath(cell2Path)
+    .click()
+    .elementByXPath(cell1Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 1 rect after changing column gap to normal:${JSON.stringify(rect)}`)
+      cell1Height = rect.height
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell2Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 2 rect after changing column gap to normal:${JSON.stringify(rect)}`)
+      cell2Height = rect.height
+      assert.isOk(isApproximate(rect.x, 393 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell3Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 3 rect after changing column gap to normal:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 393 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell2Height))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell4Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 4 rect after changing column gap to normal:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell1Height))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell2Path)
+    .click()
+  })
+
+  it('#4 test column width', () => {
+    return driver
+    .elementByXPath(cell1Path)
+    .click()
+    .elementByXPath(cell1Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 1 rect after changing column width to 600:${JSON.stringify(rect)}`)
+      cell1Height = rect.height
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
+    })
+    .elementByXPath(cell2Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 2 rect after changing column width to 600:${JSON.stringify(rect)}`)
+      cell2Height = rect.height
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight + 471 * scaleFactor + cell1Height))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
+    })
+    .elementByXPath(cell1Path)
+    .click()
+  })
+
+  it('#5 test deleting header', () => {
+    return driver
+    .elementByXPath(header2Path)
+    .click()
+    .elementByXPath(header1Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`header 2 rect after deleting header 1:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
+    })
+    .elementByXPath(header2Path)
+    .click()
+  })
+
+  it('#6 test footer', () => {
+    return driver
+    .elementByXPath(fixedPath)
+    .click()
+    .sleep(500)
+    .elementByXPath(footerPath)
+    .getRect()
+    .then((rect)=>{
+      console.log(`footer rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, screenHeight - 94 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
+      assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
+    })
+  })
+
+  it('#7 test sticky and fixed', () => {
+    return driver
+    .elementByXPath(fixedPath)
     .getRect()
     .then((rect)=>{
       console.log(`fixed rect:${JSON.stringify(rect)}`)
@@ -123,8 +279,134 @@ describe('recycler', function () {
       assert.isOk(isApproximate(rect.width, 78 * scaleFactor))
       assert.isOk(isApproximate(rect.height, 78 * scaleFactor))
     })
+    .elementByXPath(header2Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`sticky header rect:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, navBarHeight))
+      assert.isOk(isApproximate(rect.width, recyclerWidth))
+      assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
+    })
+  })
+
+  it('#8 test removing cell', () => {
+    return driver
+    .elementByXPath(cell29Path)
+    .click()
+    .elementByXPath(cell28Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 28 rect after removing cell 29:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 0))
+      assert.isOk(isApproximate(rect.y, screenHeight - 94 * scaleFactor - rect.height))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+    })
+  })
+
+  it('#9 test moving cell', () => {
+    return driver
+    .elementByXPath(cell29Path)
+    .click()
+    .elementByXPath(fixedPath)
+    .click()
+    .elementByXPath(cell29Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 28 rect after moving cell 29 to 1:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 381 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, screenHeight - 94 * scaleFactor - rect.height))
+      assert.isOk(isApproximate(rect.width, 369 * scaleFactor))
+    })
+  })
+
+  it('#10 test recycler padding', () => {
+    return driver
+    .elementByXPath(cell28Path)
+    .click()
+    .elementByXPath(fixedPath)
+    .click()
+    .elementByXPath(header2Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`sticking header rect after setting padding to 12:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 12 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight))
+      assert.isOk(isApproximate(rect.width, recyclerWidth - 24 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
+    })
+    .elementByXPath(footerPath)
+    .getRect()
+    .then((rect)=>{
+      console.log(`footer rect after setting padding to 12:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 12 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, screenHeight - 106 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, recyclerWidth - 24 * scaleFactor))
+      assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
+    })
+    .elementByXPath(cell28Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 28 rect after setting padding to 12:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 12 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell29Path)
+    .getRect()
+    .then((rect)=>{
+      console.log(`cell 29 rect after setting padding to 12:${JSON.stringify(rect)}`)
+      assert.isOk(isApproximate(rect.x, 381 * scaleFactor))
+      assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
+    })
+    .elementByXPath(cell28Path)
+    .click()
   })
 
+  it('#11 test onscroll', () => {
+    let originContentOffset = 0
+    return driver
+    .elementByXPath(cell29Path)
+    .click()
+    .elementByXPath(header2Path + '/div[1]/div[1]/text[1]')
+    .text()
+    .then(text => {
+      console.log(text)
+      originContentOffset = Number.parseInt(text.replace('Content Offset:-',''))
+    })
+    .touch('drag', {fromX:recyclerWidth / 2, fromY:screenHeight / 5, toX:recyclerWidth / 2, toY: screenHeight * 4 / 5})
+    .sleep(1000)
+    .touch('drag', {fromX:recyclerWidth / 2, fromY:screenHeight / 5, toX:recyclerWidth / 2, toY: screenHeight * 4 / 5})
+    .elementByXPath(header2Path + '/div[1]/div[1]/text[1]')
+    .text()
+    .then(text => {
+      console.log(text)
+      const contentOffset = Number.parseInt(text.replace('Content Offset:-',''))
+      assert.isOk(originContentOffset - contentOffset > screenHeight / scaleFactor)
+    })
+    .elementByXPath(fixedPath)
+    .click()
+  })
+
+  it('#12 test scrollable', () => {
+    let originContentOffset = 0
+    return driver
+    .elementByXPath(cell27Path)
+    .click()
+    .elementByXPath(header2Path + '/div[1]/div[1]/text[1]')
+    .text()
+    .then(text => {
+      console.log(text)
+      originContentOffset = Number.parseInt(text.replace('Content Offset:-',''))
+    })
+    .touch('drag', {fromX:recyclerWidth / 2, fromY:screenHeight / 5, toX:recyclerWidth / 2, toY: screenHeight * 4 / 5})
+    .elementByXPath(header2Path + '/div[1]/div[1]/text[1]')
+    .text()
+    .then(text => {
+      console.log(text)
+      const contentOffset = Number.parseInt(text.replace('Content Offset:-',''))
+      assert.equal(contentOffset, originContentOffset)
+    })
+  })
 });
 
 


[04/11] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev

Posted by cx...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/08930c2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/08930c2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/08930c2c

Branch: refs/heads/0.11-dev
Commit: 08930c2c09fccb7fad4c30d77353d1bb8bd23522
Parents: b7835c1 373ae38
Author: \u9690\u98ce <cx...@apache.org>
Authored: Sat Mar 25 17:07:34 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Sat Mar 25 17:07:34 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/component/list/BasicListComponent.java  | 2 +-
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.h                | 2 +-
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.m                | 2 +-
 ios/sdk/WeexSDK/Sources/Component/WXListComponent.m            | 4 ++++
 ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.m         | 2 +-
 ios/sdk/WeexSDK/Sources/Component/WXSliderComponent.m          | 6 +++---
 6 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[10/11] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev

Posted by cx...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' into 0.11-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/014cfc1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/014cfc1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/014cfc1f

Branch: refs/heads/0.11-dev
Commit: 014cfc1fa658c8d661ca888bc8310f76df27d0c8
Parents: be02dec 20ee586
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 28 00:34:55 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 28 00:34:55 2017 +0800

----------------------------------------------------------------------
 .../bundlejs/vue/components/waterfall.js        | 873 +++++++++++++++++++
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m   |  40 +-
 2 files changed, 910 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[08/11] incubator-weex git commit: Merge branch '0.11-dev' of https://github.com/cxfeng1/incubator-weex into 0.11-dev

Posted by cx...@apache.org.
Merge branch '0.11-dev' of https://github.com/cxfeng1/incubator-weex into 0.11-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9486b663
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9486b663
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9486b663

Branch: refs/heads/0.11-dev
Commit: 9486b663ffc6a4522554f8b6c33f7ca7ddbce7d7
Parents: 5cb0819 20f0dc1
Author: zshshr <zh...@gmail.com>
Authored: Mon Mar 27 16:42:28 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Mon Mar 27 16:42:28 2017 +0800

----------------------------------------------------------------------
 build/webpack.macacatest.config.js              |   6 +-
 .../Component/Recycler/WXRecyclerComponent.m    |  40 +-
 .../Recycler/WXRecyclerDataController.h         |   2 +
 .../Recycler/WXRecyclerDataController.m         |  12 +
 test/pages/components/recycler.vue              | 480 +++++++++++++++++++
 test/scripts/components/recycler.test.js        | 412 ++++++++++++++++
 6 files changed, 945 insertions(+), 7 deletions(-)
----------------------------------------------------------------------