remove typeface cache

This commit is contained in:
Andrew Dolgov 2015-06-10 19:45:32 +03:00
parent 0dde302a73
commit 449ac639e3
3 changed files with 0 additions and 55 deletions

View File

@ -816,19 +816,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (holder.titleView != null) {
holder.titleView.setText(Html.fromHtml(article.title));
/* if (m_prefs.getBoolean("enable_condensed_fonts", false)) {
Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", article.unread ? Typeface.BOLD : Typeface.NORMAL);
if (tf != null && !tf.equals(holder.titleView.getTypeface())) {
holder.titleView.setTypeface(tf);
}
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5));
} else {
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
} */
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
adjustTitleTextView(article.score, holder.titleView, position);

View File

@ -616,19 +616,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
if (holder.titleView != null) {
holder.titleView.setText(Html.fromHtml(article.getString(article.getColumnIndex("title"))));
/* if (m_prefs.getBoolean("enable_condensed_fonts", false)) {
Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", article.getInt(article.getColumnIndex("unread")) == 1 ? Typeface.BOLD : Typeface.NORMAL);
if (tf != null && !tf.equals(holder.titleView.getTypeface())) {
holder.titleView.setTypeface(tf);
}
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5));
} else {
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
} */
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
int scoreIndex = article.getColumnIndex("score");

View File

@ -1,29 +0,0 @@
package org.fox.ttrss.util;
import java.util.Hashtable;
import android.content.Context;
import android.graphics.Typeface;
import android.util.Log;
public class TypefaceCache {
private static final String TAG = "TypefaceCache";
private static final Hashtable<String, Typeface> cache = new Hashtable<String, Typeface>();
public static Typeface get(Context c, String typefaceName, int style) {
synchronized (cache) {
String key = typefaceName + ":" + style;
if (!cache.containsKey(key)) {
try {
Typeface t = Typeface.create(typefaceName, style);
cache.put(key, t);
} catch (Exception e) {
Log.e(TAG, "Could not get typeface '" + typefaceName + "' because " + e.getMessage());
return null;
}
}
return cache.get(key);
}
}
}