You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by kf...@apache.org on 2017/07/12 02:09:52 UTC
[1/2] incubator-weex git commit: [iOS] WXCycleSliderComponent initial
index
Repository: incubator-weex
Updated Branches:
refs/heads/0.15-dev 7f247fc4e -> 7d1602bcb
[iOS] WXCycleSliderComponent initial index
bug fix: initial index of WXCycleSliderComponent may be incorrect if
inserting subviews after layoutDidFinish (occurs when creating
time-consuming subview/components)
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3d7a9004
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3d7a9004
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3d7a9004
Branch: refs/heads/0.15-dev
Commit: 3d7a90049195b1ad906163767647089665ecd33e
Parents: 7f247fc
Author: 徐嘉宏 <ji...@alibaba-inc.com>
Authored: Mon Jul 10 16:40:25 2017 +0800
Committer: 徐嘉宏 <ji...@alibaba-inc.com>
Committed: Mon Jul 10 16:40:25 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3d7a9004/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index 7c7fbd0..1fb8fd6 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -460,6 +460,12 @@ typedef NS_ENUM(NSInteger, Direction) {
}
}
[recycleSliderView insertItemView:view atIndex:index - offset];
+
+ // check if should apply current contentOffset
+ // in case inserting subviews after layoutDidFinish
+ if (index-offset == _index) {
+ recycleSliderView.currentIndex = _index;
+ }
}
[recycleSliderView layoutSubviews];
}
[2/2] incubator-weex git commit: Modified condition
Posted by kf...@apache.org.
Modified condition
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7d1602bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7d1602bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7d1602bc
Branch: refs/heads/0.15-dev
Commit: 7d1602bcbf56384a2e251f3d7468ff3f71a2ffbb
Parents: 3d7a900
Author: 徐嘉宏 <ji...@alibaba-inc.com>
Authored: Mon Jul 10 19:26:10 2017 +0800
Committer: 徐嘉宏 <ji...@alibaba-inc.com>
Committed: Mon Jul 10 19:26:10 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7d1602bc/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index 1fb8fd6..7a7dc9d 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -463,7 +463,7 @@ typedef NS_ENUM(NSInteger, Direction) {
// check if should apply current contentOffset
// in case inserting subviews after layoutDidFinish
- if (index-offset == _index) {
+ if (index-offset == _index && _index>0) {
recycleSliderView.currentIndex = _index;
}
}