Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 339456a

Browse files
committed
Treat text color in view class
1 parent 18526a3 commit 339456a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

magic/src/main/java/br/com/bloder/magic/view/MagicButton.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class MagicButton extends FrameLayout {
3232
private String buttonText;
3333
private int expandableButtonColor;
3434
private int iconButtonColor;
35+
private int textColor;
3536
private OnClickListener onClickListener;
3637

3738
public MagicButton(Context context) {
@@ -46,6 +47,7 @@ public MagicButton(Context context, AttributeSet attrs) {
4647
buttonText = typedArray.getString(R.styleable.MagicButton_hide_text);
4748
expandableButtonColor = typedArray.getColor(R.styleable.MagicButton_expandable_area_color, Color.parseColor("#FFE6E4E4"));
4849
iconButtonColor = typedArray.getColor(R.styleable.MagicButton_icon_button_color, Color.parseColor("#FFE6E4E4"));
50+
textColor = typedArray.getColor(R.styleable.MagicButton_hide_text_color, Color.parseColor("#FFE6E4E4"));
4951
drawable = typedArray.getDrawable(R.styleable.MagicButton_button_icon);
5052
}
5153
initView(context);
@@ -72,6 +74,7 @@ private void setButtonContent() {
7274
((GradientDrawable) button.getBackground()).setColor(expandableButtonColor);
7375
((GradientDrawable) buttonIcon.getBackground()).setColor(iconButtonColor);
7476
text.setText(buttonText);
77+
text.setTextColor(textColor);
7578
setSizes();
7679
}
7780

0 commit comments

Comments
 (0)