Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'apache/master' into release-0.19-quick-…
Browse files Browse the repository at this point in the history
…startup
  • Loading branch information
jianbai.gbj committed May 3, 2018
2 parents 440585a + 3366d33 commit cf531a1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
Expand Up @@ -337,7 +337,7 @@ public void onImageFinish(String url, ImageView imageView, boolean result, Map e
IWXImgLoaderAdapter imgLoaderAdapter = getInstance().getImgLoaderAdapter();
if (imgLoaderAdapter != null) {
imgLoaderAdapter.setImage(rewrited.toString(), getHostView(),
getDomObject().getAttrs().getImageQuality(), imageStrategy);
getAttrs().getImageQuality(), imageStrategy);
}
}

Expand Down
Expand Up @@ -26,14 +26,11 @@
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.common.Constants;
import com.taobao.weex.dom.CSSShorthand;
import com.taobao.weex.ui.action.BasicComponentData;
import com.taobao.weex.dom.WXDomObject;
import com.taobao.weex.dom.flex.Spacing;
import com.taobao.weex.ui.view.WXImageView;
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXUtils;
Expand Down Expand Up @@ -577,13 +574,13 @@ View getBoxShadowHost(boolean isClear) {
mBoxShadowHost = new BoxShadowHost(getContext());
WXViewUtils.setBackGround(mBoxShadowHost, null);

Spacing padding = this.getDomObject().getPadding();
Spacing border = this.getDomObject().getBorder();
CSSShorthand padding = this.getPadding();
CSSShorthand border = this.getBorder();

int left = (int) (padding.get(Spacing.LEFT) + border.get(Spacing.LEFT));
int top = (int) (padding.get(Spacing.TOP) + border.get(Spacing.TOP));
int right = (int) (padding.get(Spacing.RIGHT) + border.get(Spacing.RIGHT));
int bottom = (int) (padding.get(Spacing.BOTTOM) + border.get(Spacing.BOTTOM));
int left = (int) (padding.get(CSSShorthand.EDGE.LEFT) + border.get(CSSShorthand.EDGE.LEFT));
int top = (int) (padding.get(CSSShorthand.EDGE.TOP) + border.get(CSSShorthand.EDGE.TOP));
int right = (int) (padding.get(CSSShorthand.EDGE.RIGHT) + border.get(CSSShorthand.EDGE.RIGHT));
int bottom = (int) (padding.get(CSSShorthand.EDGE.BOTTOM) + border.get(CSSShorthand.EDGE.BOTTOM));

ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(hostView.getLayoutParams()) ;
layoutParams.setMargins(-left, -top, -right, -bottom);
Expand Down
Expand Up @@ -185,6 +185,7 @@ private static final int doRenderComponent(WXComponent component, CellRenderCont
if(map == null){
key = index;
value = item;
index++;
}else{
key = item;
value = map.get(item);
Expand Down
35 changes: 35 additions & 0 deletions ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
Expand Up @@ -620,6 +620,13 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
NSDictionary *contentOffsetData = @{@"x":[NSNumber numberWithFloat:-scrollView.contentOffset.x / scaleFactor],@"y":[NSNumber numberWithFloat:-scrollView.contentOffset.y / scaleFactor]};
[self fireEvent:@"scrollstart" params:@{@"contentSize":contentSizeData,@"contentOffset":contentOffsetData} domChanges:nil];
}

NSHashTable *delegates = [_delegates copy];
for (id<UIScrollViewDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]) {
[delegate scrollViewWillBeginDragging:scrollView];
}
}
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
Expand Down Expand Up @@ -705,6 +712,13 @@ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
inset.bottom = 0;
}
[scrollView setContentInset:inset];

NSHashTable *delegates = [_delegates copy];
for (id<UIScrollViewDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(scrollViewDidEndScrollingAnimation:)]) {
[delegate scrollViewDidEndScrollingAnimation:scrollView];
}
}
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
Expand All @@ -717,6 +731,13 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
[self fireEvent:@"scrollend" params:@{@"contentSize":contentSizeData,@"contentOffset":contentOffsetData} domChanges:nil];
}
}

NSHashTable *delegates = [_delegates copy];
for (id<UIScrollViewDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) {
[delegate scrollViewDidEndDecelerating:scrollView];
}
}
}

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
Expand All @@ -734,6 +755,13 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
// drop up
}
}

NSHashTable *delegates = [_delegates copy];
for (id<UIScrollViewDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) {
[delegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset];
}
}
}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
Expand All @@ -757,6 +785,13 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
_isScrolling = NO;
[self performSelector:@selector(scrollViewDidEndDecelerating:) withObject:nil afterDelay:0.1];
}

NSHashTable *delegates = [_delegates copy];
for (id<UIScrollViewDelegate> delegate in delegates) {
if ([delegate respondsToSelector:@selector(scrollViewDidEndDragging:willDecelerate:)]) {
[delegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate];
}
}
}

- (void)loadMoreIfNeed
Expand Down

0 comments on commit cf531a1

Please sign in to comment.