Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from walfud/master
Compile & Memory Optimization
- Loading branch information
Showing
3 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/com/mattkula/secrettextview/MutableForegroundColorSpan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.mattkula.secrettextview; | ||
|
||
import android.text.TextPaint; | ||
import android.text.style.CharacterStyle; | ||
import android.text.style.UpdateAppearance; | ||
|
||
/** | ||
* Created by walfud on 2015/5/29. | ||
*/ | ||
public class MutableForegroundColorSpan extends CharacterStyle | ||
implements UpdateAppearance { | ||
|
||
public static final String TAG = "MutableForegroundColorSpan"; | ||
|
||
private int mColor; | ||
|
||
@Override | ||
public void updateDrawState(TextPaint tp) { | ||
tp.setColor(mColor); | ||
} | ||
|
||
public int getColor() { | ||
return mColor; | ||
} | ||
|
||
public void setColor(int color) { | ||
this.mColor = color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters