Code example for ForegroundColorSpan

import java.util.concurrent.atomic.AtomicReference; 
public class FileViewHolder implements ViewHolder<FilePath> { 
    private static ForegroundColorSpan highlightStyle = new ForegroundColorSpan(0x880000ff);
    private final TextView detail;
    private final AtomicReference<FilePathMatcher> filePathMatcher;
    public FileViewHolder(View v, AtomicReference<FilePathMatcher> filePathMatcher) {
        this.filePathMatcher = filePathMatcher;
        detail = (TextView) v.findViewById(commit_subject);
    public void updateViewFor(FilePath filePath) {
        CharSequence fileName = filePath.getPath();
        FilePathMatcher currentFPM = filePathMatcher.get();
        if (currentFPM != null) {
            fileName = highlightFilePath(filePath, currentFPM);
Connect your IDE to all the code out there  Get Codota for Java