diff --git a/src/de/danoeh/antennapod/activity/ItemviewActivity.java b/src/de/danoeh/antennapod/activity/ItemviewActivity.java index 58105554d..87685a552 100644 --- a/src/de/danoeh/antennapod/activity/ItemviewActivity.java +++ b/src/de/danoeh/antennapod/activity/ItemviewActivity.java @@ -93,7 +93,7 @@ public class ItemviewActivity extends SherlockFragmentActivity { FragmentTransaction fragmentTransaction = fragmentManager .beginTransaction(); ItemDescriptionFragment fragment = ItemDescriptionFragment.newInstance( - item, false); + item); fragmentTransaction.add(R.id.description_fragment, fragment); fragmentTransaction.commit(); } diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java index 272cd8b02..bb8d50f61 100644 --- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -706,7 +706,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements return activity.coverFragment; case POS_DESCR: activity.descriptionFragment = ItemDescriptionFragment - .newInstance(activity.media.getItem(), true); + .newInstance(activity.media.getItem()); return activity.descriptionFragment; case POS_CHAPTERS: sCChapterFragment = new SherlockListFragment() { diff --git a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index ef22e19cf..38b7a1343 100644 --- a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -28,23 +28,19 @@ public class ItemDescriptionFragment extends SherlockFragment { private static final String TAG = "ItemDescriptionFragment"; private static final String ARG_FEED_ID = "arg.feedId"; private static final String ARG_FEEDITEM_ID = "arg.feedItemId"; - private static final String ARG_SCROLLBAR_ENABLED = "arg.scrollbarEnabled"; private static final String WEBVIEW_STYLE = ""; - private boolean scrollbarEnabled; private WebView webvDescription; private FeedItem item; private AsyncTask webViewLoader; - public static ItemDescriptionFragment newInstance(FeedItem item, - boolean scrollbarEnabled) { + public static ItemDescriptionFragment newInstance(FeedItem item) { ItemDescriptionFragment f = new ItemDescriptionFragment(); Bundle args = new Bundle(); args.putLong(ARG_FEED_ID, item.getFeed().getId()); args.putLong(ARG_FEEDITEM_ID, item.getId()); - args.putBoolean(ARG_SCROLLBAR_ENABLED, scrollbarEnabled); f.setArguments(args); return f; } @@ -53,7 +49,8 @@ public class ItemDescriptionFragment extends SherlockFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { webvDescription = new WebView(getActivity()); - webvDescription.setHorizontalScrollBarEnabled(scrollbarEnabled); + webvDescription.getSettings().setUseWideViewPort(false); + return webvDescription; } @@ -87,6 +84,7 @@ public class ItemDescriptionFragment extends SherlockFragment { } } + @SuppressLint("NewApi") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -94,7 +92,6 @@ public class ItemDescriptionFragment extends SherlockFragment { Bundle args = getArguments(); long feedId = args.getLong(ARG_FEED_ID, -1); long itemId = args.getLong(ARG_FEEDITEM_ID, -1); - scrollbarEnabled = args.getBoolean(ARG_SCROLLBAR_ENABLED, true); if (feedId != -1 && itemId != -1) { Feed feed = manager.getFeed(feedId); item = manager.getFeedItem(itemId, feed); @@ -132,7 +129,8 @@ public class ItemDescriptionFragment extends SherlockFragment { "utf-8", "about:blank"); getSherlockActivity() .setSupportProgressBarIndeterminateVisibility(false); - if (AppConfig.DEBUG) Log.d(TAG, "Webview loaded"); + if (AppConfig.DEBUG) + Log.d(TAG, "Webview loaded"); webViewLoader = null; } @@ -145,7 +143,8 @@ public class ItemDescriptionFragment extends SherlockFragment { @Override protected Void doInBackground(Void... params) { - if (AppConfig.DEBUG) Log.d(TAG, "Loading Webview"); + if (AppConfig.DEBUG) + Log.d(TAG, "Loading Webview"); data = ""; if (item.getContentEncoded() == null && item.getDescription() != null) { @@ -156,10 +155,11 @@ public class ItemDescriptionFragment extends SherlockFragment { } data = WEBVIEW_STYLE + data; - return null; } + + }; } }