import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.graphics.Color;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
-import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.BaseAdapter;
import android.widget.Button;
TextToSpeech textToSpeech;
volatile boolean ttsReady;
+
+ int textColorFg = Color.BLACK;
private final Executor searchExecutor = Executors.newSingleThreadExecutor(new ThreadFactory() {
@Override
application = (DictionaryApplication) getApplication();
theme = application.getSelectedTheme();
+ textColorFg = getResources().getColor(theme.tokenRowFgColor);
final Intent intent = getIntent();
dictFile = new File(intent.getStringExtra(C.DICT_FILE));
updateTTSLanuage();
}
});
-
+
try {
final String name = application.getDictionaryName(dictFile.getName());
this.setTitle("QuickDic: " + name);
}
static final Pattern CHAR_DASH = Pattern.compile("['\\p{L}\\p{M}\\p{N}]+");
-
+
private void createTokenLinkSpans(final TextView textView, final Spannable spannable,
final String text) {
// Saw from the source code that LinkMovementMethod sets the selection!
textView.setMovementMethod(LinkMovementMethod.getInstance());
final Matcher matcher = CHAR_DASH.matcher(text);
while (matcher.find()) {
- spannable.setSpan(new NonLinkClickableSpan(), matcher.start(), matcher.end(),
+ spannable.setSpan(new NonLinkClickableSpan(textColorFg), matcher.start(), matcher.end(),
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
}
}