more headline display margin adjustments

remove condensed font option
This commit is contained in:
Andrew Dolgov 2015-02-12 15:17:11 +03:00
parent f88e647b40
commit ad2c6eb999
14 changed files with 46 additions and 42 deletions

View File

@ -4,7 +4,6 @@ import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -31,7 +30,6 @@ import com.shamanland.fab.ShowHideOnScroll;
import org.fox.ttrss.types.Article; import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.Attachment; import org.fox.ttrss.types.Attachment;
import org.fox.ttrss.util.TypefaceCache;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URI; import java.net.URI;
@ -201,7 +199,7 @@ public class ArticleFragment extends Fragment {
if (title != null) { if (title != null) {
if (m_prefs.getBoolean("enable_condensed_fonts", false)) { /* if (m_prefs.getBoolean("enable_condensed_fonts", false)) {
Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", Typeface.NORMAL); Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", Typeface.NORMAL);
if (tf != null && !tf.equals(title.getTypeface())) { if (tf != null && !tf.equals(title.getTypeface())) {
@ -211,7 +209,9 @@ public class ArticleFragment extends Fragment {
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 5)); title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 5));
} else { } else {
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3)); title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3));
} } */
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3));
String titleStr; String titleStr;

View File

@ -9,7 +9,6 @@ import android.content.SharedPreferences;
import android.content.res.Resources.Theme; import android.content.res.Resources.Theme;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Typeface;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -61,7 +60,6 @@ import org.fox.ttrss.types.Article;
import org.fox.ttrss.types.ArticleList; import org.fox.ttrss.types.ArticleList;
import org.fox.ttrss.types.Feed; import org.fox.ttrss.types.Feed;
import org.fox.ttrss.util.HeadlinesRequest; import org.fox.ttrss.util.HeadlinesRequest;
import org.fox.ttrss.util.TypefaceCache;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
@ -794,7 +792,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (holder.titleView != null) { if (holder.titleView != null) {
holder.titleView.setText(Html.fromHtml(article.title)); holder.titleView.setText(Html.fromHtml(article.title));
if (m_prefs.getBoolean("enable_condensed_fonts", false)) { /* if (m_prefs.getBoolean("enable_condensed_fonts", false)) {
Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", article.unread ? Typeface.BOLD : Typeface.NORMAL); Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", article.unread ? Typeface.BOLD : Typeface.NORMAL);
if (tf != null && !tf.equals(holder.titleView.getTypeface())) { if (tf != null && !tf.equals(holder.titleView.getTypeface())) {
@ -804,7 +802,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5)); holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5));
} else { } 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));
} } */
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
adjustTitleTextView(article.score, holder.titleView, position); adjustTitleTextView(article.score, holder.titleView, position);
} }

View File

@ -19,9 +19,9 @@ public class PreferencesActivity extends PreferenceActivity {
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) { /* if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
findPreference("enable_condensed_fonts").setEnabled(false); findPreference("enable_condensed_fonts").setEnabled(false);
} } */
String version = "?"; String version = "?";
int versionCode = -1; int versionCode = -1;

View File

@ -5,7 +5,6 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Typeface;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -29,7 +28,6 @@ import com.shamanland.fab.ShowHideOnScroll;
import org.fox.ttrss.R; import org.fox.ttrss.R;
import org.fox.ttrss.util.ImageCacheService; import org.fox.ttrss.util.ImageCacheService;
import org.fox.ttrss.util.TypefaceCache;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
@ -166,7 +164,7 @@ public class OfflineArticleFragment extends Fragment {
if (title != null) { if (title != null) {
if (m_prefs.getBoolean("enable_condensed_fonts", false)) { /* if (m_prefs.getBoolean("enable_condensed_fonts", false)) {
Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", Typeface.NORMAL); Typeface tf = TypefaceCache.get(m_activity, "sans-serif-condensed", Typeface.NORMAL);
if (tf != null && !tf.equals(title.getTypeface())) { if (tf != null && !tf.equals(title.getTypeface())) {
@ -176,7 +174,9 @@ public class OfflineArticleFragment extends Fragment {
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 5)); title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 5));
} else { } else {
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3)); title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3));
} } */
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, articleFontSize + 3));
String titleStr; String titleStr;

View File

@ -7,7 +7,6 @@ import android.content.res.Resources.Theme;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteStatement; import android.database.sqlite.SQLiteStatement;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.provider.BaseColumns; import android.provider.BaseColumns;
@ -42,7 +41,6 @@ import com.amulyakhare.textdrawable.util.ColorGenerator;
import org.fox.ttrss.CommonActivity; import org.fox.ttrss.CommonActivity;
import org.fox.ttrss.GlobalState; import org.fox.ttrss.GlobalState;
import org.fox.ttrss.R; import org.fox.ttrss.R;
import org.fox.ttrss.util.TypefaceCache;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import java.text.DateFormat; import java.text.DateFormat;
@ -614,7 +612,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
holder.titleView.setText(Html.fromHtml(article.getString(article.getColumnIndex("title")))); holder.titleView.setText(Html.fromHtml(article.getString(article.getColumnIndex("title"))));
if (m_prefs.getBoolean("enable_condensed_fonts", false)) { /* 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); 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())) { if (tf != null && !tf.equals(holder.titleView.getTypeface())) {
@ -624,7 +622,9 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5)); holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 5));
} else { } 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));
} } */
holder.titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, Math.min(21, headlineFontSize + 3));
int scoreIndex = article.getColumnIndex("score"); int scoreIndex = article.getColumnIndex("score");
if (scoreIndex >= 0) if (scoreIndex >= 0)

View File

@ -49,7 +49,7 @@
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="24 comments" android:text="24 comments"
android:textColor="?articleHeaderTextColor" android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" /> android:textSize="12sp" />
<LinearLayout <LinearLayout
@ -67,7 +67,7 @@
android:singleLine="true" android:singleLine="true"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:text="Example Feed" android:text="Example Feed"
android:textColor="?articleHeaderTextColor" android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
@ -80,7 +80,7 @@
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:text="Jan 01, 12:00" android:text="Jan 01, 12:00"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?articleHeaderTextColor" android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>

View File

@ -14,7 +14,7 @@
<TableLayout <TableLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:padding="16dp"
android:baselineAligned="false" android:baselineAligned="false"
android:shrinkColumns="0,1" android:shrinkColumns="0,1"
android:stretchColumns="0,1"> android:stretchColumns="0,1">

View File

@ -58,10 +58,10 @@
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="13sp" android:textSize="13sp"
android:layout_span="2" /> android:layout_span="2"
android:paddingTop="8dp" />
<LinearLayout <LinearLayout
android:paddingTop="2dp"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
@ -77,7 +77,8 @@
android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA"
android:textColor="?headlineSecondaryTextColor" android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" android:textSize="12sp"
android:layout_weight="0.5" /> android:layout_weight="0.5"
android:paddingTop="8dp" />
</LinearLayout> </LinearLayout>

View File

@ -5,7 +5,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?headlineNormalBackground" android:background="?headlineNormalBackground"
android:gravity="center" android:gravity="center"
android:padding="5dp" android:padding="16dp"
android:orientation="horizontal" > android:orientation="horizontal" >

View File

@ -58,10 +58,10 @@
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineSelectedExcerptTextColor"
android:textSize="13sp" android:textSize="13sp"
android:layout_span="2" /> android:layout_span="2"
android:paddingTop="8dp" />
<LinearLayout <LinearLayout
android:paddingTop="2dp"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
@ -77,7 +77,8 @@
android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA"
android:textColor="?headlineSelectedSecondaryTextColor" android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" android:textSize="12sp"
android:layout_weight="0.5" /> android:layout_weight="0.5"
android:paddingTop="8dp" />
</LinearLayout> </LinearLayout>

View File

@ -59,10 +59,10 @@
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineSelectedExcerptTextColor"
android:textSize="13sp" android:textSize="13sp"
android:layout_span="2" /> android:layout_span="2"
android:paddingTop="8dp" />
<LinearLayout <LinearLayout
android:paddingTop="2dp"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
@ -78,7 +78,8 @@
android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA"
android:textColor="?headlineSelectedSecondaryTextColor" android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="12sp" android:textSize="12sp"
android:layout_weight="0.5" /> android:layout_weight="0.5"
android:paddingTop="8dp" />
</LinearLayout> </LinearLayout>

View File

@ -14,7 +14,7 @@
<TableLayout <TableLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:padding="16dp"
android:baselineAligned="false" android:baselineAligned="false"
android:shrinkColumns="0,1" android:shrinkColumns="0,1"
android:stretchColumns="0,1"> android:stretchColumns="0,1">
@ -33,7 +33,7 @@
android:text="Sample entry title" android:text="Sample entry title"
android:textColor="?headlineUnreadTextColor" android:textColor="?headlineUnreadTextColor"
android:textSize="18sp" android:textSize="18sp"
android:fontFamily="sans-serif-medium" android:textStyle="bold"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:layout_span="2" /> android:layout_span="2" />
</TableRow> </TableRow>

View File

@ -59,10 +59,10 @@
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="13sp" android:textSize="13sp"
android:layout_span="2" /> android:layout_span="2"
android:paddingTop="8dp" />
<LinearLayout <LinearLayout
android:paddingTop="2dp"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"> android:layout_height="fill_parent">
@ -78,7 +78,8 @@
android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA" android:text="Example Feed AAA AAA AAAAAA AAAA AAAAA AA A A AA AA"
android:textColor="?headlineSecondaryTextColor" android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" android:textSize="12sp"
android:layout_weight="0.5" /> android:layout_weight="0.5"
android:paddingTop="8dp" />
</LinearLayout> </LinearLayout>

View File

@ -102,11 +102,11 @@
android:summary="@string/pref_headlines_mark_read_scroll_long" android:summary="@string/pref_headlines_mark_read_scroll_long"
android:title="@string/pref_headlines_mark_read_scroll" /> android:title="@string/pref_headlines_mark_read_scroll" />
<CheckBoxPreference <!-- <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="enable_condensed_fonts" android:key="enable_condensed_fonts"
android:summary="@string/pref_headlines_use_condensed_fonts_long" android:summary="@string/pref_headlines_use_condensed_fonts_long"
android:title="@string/pref_headlines_use_condensed_fonts" /> android:title="@string/pref_headlines_use_condensed_fonts" /> -->
<org.fox.ttrss.util.FontSizeDialogPreference <org.fox.ttrss.util.FontSizeDialogPreference
android:defaultValue="13" android:defaultValue="13"