You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/27 08:52:46 UTC

[GitHub] YorkShen closed pull request #1287: [WEEX-475] fix Weex list component in the Android without scroll bars

YorkShen closed pull request #1287: [WEEX-475] fix Weex list component in the Android without scroll bars
URL: https://github.com/apache/incubator-weex/pull/1287
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
index 6f17584a18..4f771569e5 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
@@ -20,8 +20,11 @@
 
 import android.content.Context;
 import android.support.annotation.Nullable;
+import android.view.ContextThemeWrapper;
 import android.view.MotionEvent;
 
+import com.taobao.weex.R;
+import com.taobao.weex.common.Constants;
 import com.taobao.weex.ui.component.list.ListComponentView;
 import com.taobao.weex.ui.component.list.StickyHeaderHelper;
 import com.taobao.weex.ui.component.list.WXCell;
@@ -76,7 +79,7 @@ public boolean dispatchTouchEvent(MotionEvent event) {
 
   @Override
   public WXRecyclerView setInnerView(Context context) {
-    WXRecyclerView wxRecyclerView = new WXRecyclerView(context);
+    WXRecyclerView wxRecyclerView = new WXRecyclerView(new ContextThemeWrapper(context, getOrientation() == Constants.Orientation.HORIZONTAL ? R.style.WeexHorizontalRecyclerView : R.style.WeexVerticalRecyclerView));
     wxRecyclerView.initView(context, mLayoutType,mColumnCount,mColumnGap,getOrientation());
     return wxRecyclerView;
   }
diff --git a/android/sdk/src/main/res/values/styles.xml b/android/sdk/src/main/res/values/styles.xml
new file mode 100644
index 0000000000..63af0e02de
--- /dev/null
+++ b/android/sdk/src/main/res/values/styles.xml
@@ -0,0 +1,31 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<resources>
+
+    <style name="WeexVerticalRecyclerView" parent="android:Widget">
+        <item name="android:scrollbars">vertical</item>
+    </style>
+
+    <style name="WeexHorizontalRecyclerView" parent="android:Widget">
+        <item name="android:scrollbars">horizontal</item>
+    </style>
+
+</resources>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services