You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by zs...@apache.org on 2017/08/28 02:42:09 UTC
[1/3] incubator-weex git commit: fix 1px and scroll
Repository: incubator-weex
Updated Branches:
refs/heads/0.16-dev b9846b557 -> ca5250076
fix 1px and scroll
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/67c3dafd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/67c3dafd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/67c3dafd
Branch: refs/heads/0.16-dev
Commit: 67c3dafd9223e2a657b66fd8a24f5bd126c9c28d
Parents: d8273ab
Author: jianbai.gbj <ji...@alibaba-inc.com>
Authored: Wed Aug 23 16:12:28 2017 +0800
Committer: jianbai.gbj <ji...@alibaba-inc.com>
Committed: Wed Aug 23 16:12:28 2017 +0800
----------------------------------------------------------------------
.../ui/component/list/BasicListComponent.java | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/67c3dafd/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index c7c0bb6..5e50ca0 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -67,6 +67,7 @@ import com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter;
import com.taobao.weex.ui.view.listview.adapter.TransformItemDecoration;
import com.taobao.weex.ui.view.listview.adapter.WXRecyclerViewOnScrollListener;
import com.taobao.weex.utils.WXLogUtils;
+import com.taobao.weex.utils.WXResourceUtils;
import com.taobao.weex.utils.WXUtils;
import com.taobao.weex.utils.WXViewUtils;
@@ -858,6 +859,16 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "Bind WXRefresh & WXLoading " + holder);
}
+ if(component instanceof WXBaseRefresh
+ && holder.getView() != null
+ && component.getDomObject() != null
+ && (component.getDomObject().getAttrs().get("holderBackground") != null)){
+ Object holderBackground = component.getDomObject().getAttrs().get("holderBackground");
+ int color = WXResourceUtils.getColor(holderBackground.toString(), Color.WHITE);
+ holder.getView().setBackgroundColor(color);
+ holder.getView().setVisibility(View.VISIBLE);
+ holder.getView().postInvalidate();
+ }
return;
}
@@ -1239,9 +1250,7 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
private ListBaseViewHolder createVHForRefreshComponent(int viewType) {
FrameLayout view = new FrameLayout(getContext());
- view.setBackgroundColor(Color.WHITE);
- view.setLayoutParams(new FrameLayout.LayoutParams(1, 1));
- view.setVisibility(View.GONE);
+ view.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1));
return new ListBaseViewHolder(view, viewType);
}
@@ -1301,7 +1310,9 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
}
private void fireScrollEvent(RecyclerView recyclerView, int offsetX, int offsetY) {
- offsetY = - calcContentOffset(recyclerView);
+ if(getOrientation() == Constants.Orientation.VERTICAL){
+ offsetY = - calcContentOffset(recyclerView);
+ }
int contentWidth = recyclerView.getMeasuredWidth() + recyclerView.computeHorizontalScrollRange();
int contentHeight = calcContentSize();
[3/3] incubator-weex git commit: Merge branch
'0.16-dev-fix-1px-scroll' into 0.16-dev
Posted by zs...@apache.org.
Merge branch '0.16-dev-fix-1px-scroll' into 0.16-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/ca525007
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ca525007
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ca525007
Branch: refs/heads/0.16-dev
Commit: ca5250076917d2718f6070f1ecd6e016dc0fa290
Parents: b9846b5 d921e00
Author: zshshr <zh...@gmail.com>
Authored: Mon Aug 28 10:41:51 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Mon Aug 28 10:41:51 2017 +0800
----------------------------------------------------------------------
.../ui/component/list/BasicListComponent.java | 21 +++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ca525007/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --cc android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index a50fb45,c8411d6..e1d0196
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@@ -1279,15 -1310,11 +1288,17 @@@ public abstract class BasicListComponen
}
private void fireScrollEvent(RecyclerView recyclerView, int offsetX, int offsetY) {
- offsetY = - calcContentOffset(recyclerView);
+ if(getOrientation() == Constants.Orientation.VERTICAL){
+ offsetY = - calcContentOffset(recyclerView);
+ }
int contentWidth = recyclerView.getMeasuredWidth() + recyclerView.computeHorizontalScrollRange();
- int contentHeight = calcContentSize();
+ int contentHeight = 0;
+ for (int i = 0; i < getChildCount(); i++) {
+ WXComponent child = getChild(i);
+ if (child != null) {
+ contentHeight += child.getLayoutHeight();
+ }
+ }
Map<String, Object> event = new HashMap<>(2);
Map<String, Object> contentSize = new HashMap<>(2);
[2/3] incubator-weex git commit: load more offset bug fix
Posted by zs...@apache.org.
load more offset bug fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d921e009
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d921e009
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d921e009
Branch: refs/heads/0.16-dev
Commit: d921e009e81ccdea6abd39f1c96b08ca8d0f1e9e
Parents: 67c3daf
Author: jianbai.gbj <ji...@alibaba-inc.com>
Authored: Wed Aug 23 16:19:20 2017 +0800
Committer: jianbai.gbj <ji...@alibaba-inc.com>
Committed: Wed Aug 23 16:19:20 2017 +0800
----------------------------------------------------------------------
.../java/com/taobao/weex/ui/component/list/BasicListComponent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d921e009/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index 5e50ca0..c8411d6 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -1184,7 +1184,7 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
}
float offsetParsed = WXViewUtils.getRealPxByWidth(Integer.parseInt(offset),getInstance().getInstanceViewPortWidth());
- if (offScreenY < offsetParsed) {
+ if (offScreenY <= offsetParsed) {
if (mListCellCount != mChildren.size()
|| mForceLoadmoreNextTime) {