[
https://issues.apache.org/jira/browse/WEEX-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16589838#comment-16589838
]
ASF GitHub Bot commented on WEEX-576:
-------------------------------------
zshshr closed pull request #1452: [WEEX-576][Android] Add setTextColor for
WXTextView
URL: https://github.com/apache/incubator-weex/pull/1452
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/WXTextView.java
b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
index 59ed4ad0f3..f61adf1c52 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
@@ -22,6 +22,8 @@
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.Color;
+import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.support.v7.widget.PopupMenu;
import android.text.Layout;
@@ -117,6 +119,22 @@ public void setAriaLabel(String label){
}
+ /**
+ * Sets the text color for the text layout, it will be invalid
+ * when {@link #setTextLayout(Layout)} happens, and color has to be
+ * reset.
+ *
+ * @see #setTextLayout(Layout)
+ *
+ * @param color A color value in the form 0xAARRGGBB.
+ */
+ public void setTextColor(@ColorInt int color) {
+ Layout layout = getTextLayout();
+ if (layout != null) {
+ layout.getPaint().setColor(color);
+ }
+ }
+
@Override
public void holdComponent(WXText component) {
mWeakReference = new WeakReference<>(component);
----------------------------------------------------------------
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:
[email protected]
> [Android] Add setTextColor for WXTextView
> -----------------------------------------
>
> Key: WEEX-576
> URL: https://issues.apache.org/jira/browse/WEEX-576
> Project: Weex
> Issue Type: New Feature
> Reporter: yxp
> Assignee: Adam Feng
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)