support different article text sizes
This commit is contained in:
parent
9b637ba139
commit
feefd1fd9a
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="63"
|
||||
android:versionName="0.5.0" >
|
||||
android:versionCode="64"
|
||||
android:versionName="0.5.1" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="7" />
|
||||
|
||||
|
@ -48,6 +48,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/linearLayout3"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:textSize="15sp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_weight="1"
|
||||
android:text="There are many variations of passages of Lorem Ipsum available" />
|
||||
|
@ -1,12 +1,21 @@
|
||||
<resources>
|
||||
<string-array name="pref_theme_names">
|
||||
<item>@string/theme_dark</item>
|
||||
<item>@string/theme_light</item>
|
||||
</string-array>
|
||||
<string-array name="pref_theme_values">
|
||||
<item>THEME_DARK</item>
|
||||
<item>THEME_LIGHT</item>
|
||||
</string-array>
|
||||
<string-array name="pref_font_size_names">
|
||||
<item>@string/font_size_small</item>
|
||||
<item>@string/font_size_medium</item>
|
||||
<item>@string/font_size_large</item>
|
||||
</string-array>
|
||||
<string-array name="pref_font_size_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<resources>
|
||||
<string-array name="pref_theme_names">
|
||||
<item>@string/theme_dark</item>
|
||||
<item>@string/theme_light</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_theme_values">
|
||||
<item>THEME_DARK</item>
|
||||
<item>THEME_LIGHT</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
</resources>
|
@ -118,4 +118,8 @@
|
||||
<string name="search">Search</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="attachments">Attachments:</string>
|
||||
<string name="font_size_small">Small</string>
|
||||
<string name="font_size_medium">Medium</string>
|
||||
<string name="font_size_large">Large</string>
|
||||
<string name="pref_font_size">Article text size</string>
|
||||
</resources>
|
@ -19,10 +19,10 @@
|
||||
|
||||
<EditTextPreference
|
||||
android:hint="@string/default_url"
|
||||
android:inputType="textUri"
|
||||
android:key="ttrss_url"
|
||||
android:singleLine="true"
|
||||
android:summary="@string/ttrss_url_summary"
|
||||
android:inputType="textUri"
|
||||
android:title="@string/ttrss_url" >
|
||||
</EditTextPreference>
|
||||
|
||||
@ -59,6 +59,13 @@
|
||||
android:summary="@string/pref_theme_long"
|
||||
android:title="@string/pref_theme" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/pref_font_size_names"
|
||||
android:entryValues="@array/pref_font_size_values"
|
||||
android:key="font_size"
|
||||
android:title="@string/pref_font_size" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="sort_feeds_by_unread"
|
||||
|
@ -138,6 +138,18 @@ public class ArticleFragment extends Fragment {
|
||||
articleContent = doc.toString();
|
||||
}
|
||||
|
||||
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
|
||||
case 0:
|
||||
cssOverride += "body { text-align : justify; font-size : 14px; } ";
|
||||
break;
|
||||
case 1:
|
||||
cssOverride += "body { text-align : justify; font-size : 18px; } ";
|
||||
break;
|
||||
case 2:
|
||||
cssOverride += "body { text-align : justify; font-size : 21px; } ";
|
||||
break;
|
||||
}
|
||||
|
||||
content =
|
||||
"<html>" +
|
||||
"<head>" +
|
||||
@ -147,7 +159,6 @@ public class ArticleFragment extends Fragment {
|
||||
cssOverride +
|
||||
"div.attachments { font-size : 70%; margin-top : 1em; }" +
|
||||
"img { max-width : 98%; height : auto; }" +
|
||||
"body { text-align : justify; }" +
|
||||
"</style>" +
|
||||
"</head>" +
|
||||
"<body>" + articleContent;
|
||||
|
@ -469,11 +469,24 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
}
|
||||
articleContent += attachments.replaceAll(", $", "");
|
||||
articleContent += "</div>";
|
||||
|
||||
}
|
||||
|
||||
//content.setText(Html.fromHtml(article.content, new URLImageGetter(content, getActivity()), null));
|
||||
content.setText(Html.fromHtml(articleContent, m_dummyGetter, null));
|
||||
|
||||
|
||||
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
|
||||
case 0:
|
||||
content.setTextSize(15F);
|
||||
break;
|
||||
case 1:
|
||||
content.setTextSize(18F);
|
||||
break;
|
||||
case 2:
|
||||
content.setTextSize(21F);
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
content.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -151,6 +151,18 @@ public class OfflineArticleFragment extends Fragment {
|
||||
articleContent = doc.toString();
|
||||
}
|
||||
|
||||
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
|
||||
case 0:
|
||||
cssOverride += "body { text-align : justify; font-size : 14px; } ";
|
||||
break;
|
||||
case 1:
|
||||
cssOverride += "body { text-align : justify; font-size : 18px; } ";
|
||||
break;
|
||||
case 2:
|
||||
cssOverride += "body { text-align : justify; font-size : 21px; } ";
|
||||
break;
|
||||
}
|
||||
|
||||
content =
|
||||
"<html>" +
|
||||
"<head>" +
|
||||
@ -159,7 +171,6 @@ public class OfflineArticleFragment extends Fragment {
|
||||
"<style type=\"text/css\">" +
|
||||
cssOverride +
|
||||
"img { max-width : 98%; height : auto; }" +
|
||||
"body { text-align : justify; }" +
|
||||
"</style>" +
|
||||
"</head>" +
|
||||
"<body>" + articleContent + "</body></html>";
|
||||
|
@ -357,6 +357,17 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
|
||||
content.setText(Html.fromHtml(article.getString(article.getColumnIndex("content")), m_dummyGetter, null));
|
||||
|
||||
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
|
||||
case 0:
|
||||
content.setTextSize(15F);
|
||||
break;
|
||||
case 1:
|
||||
content.setTextSize(18F);
|
||||
break;
|
||||
case 2:
|
||||
content.setTextSize(21F);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
content.setVisibility(View.GONE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user