You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by Rowandjj <gi...@git.apache.org> on 2017/03/10 02:54:22 UTC

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

GitHub user Rowandjj opened a pull request:

    https://github.com/apache/incubator-weex/pull/82

    bug fix. can't set blurRadius dynamic

    @sospartan 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Rowandjj/incubator-weex 0.11-bugfix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/82.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #82
    
----
commit fd7a85bd9596cc1ec492fa153b1d3765d6f0ff47
Author: chuyi <ji...@alibaba-inc.com>
Date:   2017-03-10T02:51:48Z

    bug fix. can't set blurRadius dynamic

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105324775
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java ---
    @@ -513,6 +513,28 @@ public static String getString(@Nullable Object value,@Nullable String df) {
         return originValue;
       }
     
    +  public static int getBlurRadius(@Nullable String blurRadius) {
    +    if(blurRadius == null || "".equals(blurRadius)) {
    +      return 0;
    +    }
    +    blurRadius = blurRadius.trim();
    --- End diff --
    
    \u4f7f\u7528\u5185\u7f6e\u7684[SingleFunctionParser](https://github.com/apache/incubator-weex/blob/0.11-dev/android/sdk/src/main/java/com/taobao/weex/utils/WXResourceUtils.java#L585-L591)\uff0c\u4e0d\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2aParser\u6d41\u7a0b


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105325865
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java ---
    @@ -291,10 +291,18 @@ protected boolean setProperty(String key, Object param) {
               String src = WXUtils.getString(param, null);
               if (src != null)
                 setSrc(src);
    +          this.mSrc = src;
               return true;
             case Constants.Name.IMAGE_QUALITY:
               return true;
             case Constants.Name.FILTER:
    +          int blurRadius = 0;
    +          if(param != null && param instanceof String) {
    +            blurRadius = WXUtils.getBlurRadius((String) param);
    +          }
    +          if(!TextUtils.isEmpty(this.mSrc)) {
    +            setBlurRadius(this.mSrc,blurRadius);
    --- End diff --
    
    \u8bbe\u7f6e\u6a21\u7cca\u6548\u679c\u65f6\uff0c\u4e0d\u8981\u518d\u6b21\u53d1\u7f51\u7edc\u8bf7\u6c42\uff0c\u91cd\u65b0\u4e0b\u8f7d\u56fe\u7247


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by Rowandjj <gi...@git.apache.org>.
Github user Rowandjj closed the pull request at:

    https://github.com/apache/incubator-weex/pull/82


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105325022
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java ---
    @@ -291,10 +291,18 @@ protected boolean setProperty(String key, Object param) {
               String src = WXUtils.getString(param, null);
               if (src != null)
                 setSrc(src);
    +          this.mSrc = src;
    --- End diff --
    
    \u5982\u679c\u60f3\u8bb0\u5f55url\uff0c\u5728`setSrc()`\u4e2d\u8bb0\u5f55\uff0c`setSrc()`\u9664\u4e86\u6b64\u5904\uff0c\u8fd8\u6709\u5176\u4ed6\u5165\u53e3\u3002


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex issue #82: bug fix. can't set blurRadius dynamic

Posted by weex-bot <gi...@git.apache.org>.
Github user weex-bot commented on the issue:

    https://github.com/apache/incubator-weex/pull/82
  
    <table>
      <thead>
        <tr>
          <th width="50"></th>
          <th width="100%" data-danger-table="true" data-kind="Error">
              1 Error
          </th>
         </tr>
      </thead>
      <tbody>
        <tr>
          <td>:no_entry_sign:</td>
          <td data-sticky="false">Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/dom/WXStyle.java without metion it in commit message.</td>
        </tr>
      </tbody>
    </table>
    
    <p align="right" data-meta="generated_by_danger">
      Generated by :no_entry_sign: <a href="http://danger.systems/">danger</a>
    </p>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105325478
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java ---
    @@ -381,17 +398,15 @@ public void recycled() {
         }
       }
     
    -  private void setRemoteSrc(Uri rewrited) {
    +  private void setRemoteSrc(Uri rewrited,int blurRadius) {
    --- End diff --
    
    \u5bf9\u4e8e\u4f7f\u7528\u4e86filter\u5c5e\u6027\u7684image\uff0c\u6bcf\u4e2aimage\u90fd\u7531\u4e8efilter\u548csrc\u88ab\u91cd\u590d\u4e0b\u8f7d&\u7ed8\u5236\u4e86\u4e24\u6b21\u3002\u52a0\u4e00\u4e9b\u903b\u8f91\u5224\u65ad\uff0c\u907f\u514d\u91cd\u590d\u52a0\u8f7d\u3002


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by Rowandjj <gi...@git.apache.org>.
Github user Rowandjj commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105328576
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java ---
    @@ -291,10 +291,18 @@ protected boolean setProperty(String key, Object param) {
               String src = WXUtils.getString(param, null);
               if (src != null)
                 setSrc(src);
    +          this.mSrc = src;
    --- End diff --
    
    ok


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex issue #82: bug fix. can't set blurRadius dynamic

Posted by weex-bot <gi...@git.apache.org>.
Github user weex-bot commented on the issue:

    https://github.com/apache/incubator-weex/pull/82
  
    <table>
      <thead>
        <tr>
          <th width="50"></th>
          <th width="100%" data-danger-table="true" data-kind="Warning">
              1 Warning
          </th>
         </tr>
      </thead>
      <tbody>
        <tr>
          <td>:warning:</td>
          <td data-sticky="false">Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/dom/WXStyle.java without metion it in commit message. You\u2019d better add \u2018break change\u2019 in your commit log.</td>
        </tr>
      </tbody>
    </table>
    
    <p align="right" data-meta="generated_by_danger">
      Generated by :no_entry_sign: <a href="http://danger.systems/">danger</a>
    </p>



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105327745
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java ---
    @@ -513,6 +513,28 @@ public static String getString(@Nullable Object value,@Nullable String df) {
         return originValue;
       }
     
    +  public static int getBlurRadius(@Nullable String blurRadius) {
    +    if(blurRadius == null || "".equals(blurRadius)) {
    +      return 0;
    +    }
    +    blurRadius = blurRadius.trim();
    +    try {
    +      int start = blurRadius.indexOf("blur(");
    +      int end = blurRadius.indexOf("px)");
    --- End diff --
    
    \u7528WXUtil.getInt, \u4e0d\u8981\u81ea\u884c\u5904\u7406px\u7b49\u5355\u4f4d\u8f6c\u6362


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #82: bug fix. can't set blurRadius dynamic

Posted by Rowandjj <gi...@git.apache.org>.
Github user Rowandjj commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/82#discussion_r105328773
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/component/WXImage.java ---
    @@ -291,10 +291,18 @@ protected boolean setProperty(String key, Object param) {
               String src = WXUtils.getString(param, null);
               if (src != null)
                 setSrc(src);
    +          this.mSrc = src;
               return true;
             case Constants.Name.IMAGE_QUALITY:
               return true;
             case Constants.Name.FILTER:
    +          int blurRadius = 0;
    +          if(param != null && param instanceof String) {
    +            blurRadius = WXUtils.getBlurRadius((String) param);
    +          }
    +          if(!TextUtils.isEmpty(this.mSrc)) {
    +            setBlurRadius(this.mSrc,blurRadius);
    --- End diff --
    
    1. \u73b0\u5728\u7684blur\u8ba1\u7b97\u662f\u4ea4\u7ed9ImageListener\u6765\u505a\u7684, weex sdk\u81ea\u8eab\u5e76\u6ca1\u6709blur\u7684\u80fd\u529b;
    2. \u56fe\u7247\u5e93\u81ea\u8eab\u4f1a\u6709\u7f13\u5b58\uff0c\u5e76\u4e0d\u4f1a\u91cd\u65b0\u4e0b\u8f7d\u56fe\u7247


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---