diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-02-21 17:01:55 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-02-21 17:01:55 +0100 |
commit | 50104ff6f69131fe9bdf62d9c3d90e2a1a9c8034 (patch) | |
tree | d68e454ffa85b73b48ac20f07137717395a24c5e /src/de | |
parent | 51a06ef9e7ddcbca6ee92cc9cfcfe417a50fdd20 (diff) | |
download | AntennaPod-50104ff6f69131fe9bdf62d9c3d90e2a1a9c8034.zip |
Added margin to shownotes. Closes #80
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 387823348..687c2582a 100644 --- a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -9,11 +9,14 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.util.Log; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebView; +import android.widget.FrameLayout; +import android.widget.LinearLayout; import com.actionbarsherlock.app.SherlockFragment; @@ -64,7 +67,8 @@ public class ItemDescriptionFragment extends SherlockFragment { webvDescription.setBackgroundColor(0); } webvDescription.getSettings().setUseWideViewPort(false); - webvDescription.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); + webvDescription.getSettings().setLayoutAlgorithm( + LayoutAlgorithm.SINGLE_COLUMN); return webvDescription; } @@ -122,6 +126,17 @@ public class ItemDescriptionFragment extends SherlockFragment { @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + + if (webvDescription.getLayoutParams() != null + && webvDescription.getLayoutParams() instanceof FrameLayout.LayoutParams) { + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) webvDescription + .getLayoutParams(); + layoutParams.leftMargin = layoutParams.rightMargin = (int) TypedValue + .applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, + getResources().getDisplayMetrics()); + webvDescription.setLayoutParams(layoutParams); + } + if (item != null) { if (item.getDescription() == null || item.getContentEncoded() == null) { @@ -176,7 +191,7 @@ public class ItemDescriptionFragment extends SherlockFragment { * value is inserted directly into the CSS String. * */ private String getWebViewStyle(String textColor) { - final String WEBVIEW_STYLE = "<head><style type=\"text/css\"> * { color: %s; font-family: Helvetica; line-height: 1.5em; font-size: 12pt; } a { font-style: normal; text-decoration: none; font-weight: normal; color: #00A8DF; }</style></head>"; + final String WEBVIEW_STYLE = "<head><style type=\"text/css\"> * { color: %s; font-family: Helvetica; line-height: 1.5em; font-size: 11pt; } a { font-style: normal; text-decoration: none; font-weight: normal; color: #00A8DF; }</style></head>"; return String.format(WEBVIEW_STYLE, textColor); } |