diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-07-12 22:27:34 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-07-12 22:27:34 +0200 |
commit | 1ae00a0f2531fdb05a44877dda88ee2300e3ffec (patch) | |
tree | b957f110a51f9a8e45c8507a47faf6aa778c1341 | |
parent | bf1d4cb2488a194fe3cf60cad5fde62a29688d65 (diff) | |
download | AntennaPod-1ae00a0f2531fdb05a44877dda88ee2300e3ffec.zip |
Improved layout and behaviour of itemview
-rw-r--r-- | res/layout/feeditemview.xml | 46 | ||||
-rw-r--r-- | src/de/podfetcher/activity/ItemviewActivity.java | 5 | ||||
-rw-r--r-- | src/de/podfetcher/activity/MediaplayerActivity.java | 2 | ||||
-rw-r--r-- | src/de/podfetcher/fragment/ItemDescriptionFragment.java | 7 |
4 files changed, 34 insertions, 26 deletions
diff --git a/res/layout/feeditemview.xml b/res/layout/feeditemview.xml index c16cd5762..b54665d90 100644 --- a/res/layout/feeditemview.xml +++ b/res/layout/feeditemview.xml @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" > + android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" @@ -13,29 +12,32 @@ android:id="@+id/txtvItemname" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:textSize="16dp" /> + android:layout_margin="8dp" + android:textSize="18dp" /> <TextView android:id="@+id/txtvPublished" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:textStyle="italic" - android:textColor="@color/gray" /> - </LinearLayout> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:background="@color/gray" - android:textColor="@color/white" - android:textStyle="bold" - android:gravity="center_horizontal" - android:text="@string/description_label"/> + android:layout_marginBottom="8dp" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:textColor="@color/gray" + android:textStyle="italic" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginBottom="8dp" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:background="@color/ics_gray" /> - <FrameLayout - android:id="@+id/description_fragment" - android:layout_width="match_parent" - android:layout_height="wrap_content" > - </FrameLayout> + <FrameLayout + android:id="@+id/description_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" > + </FrameLayout> + </LinearLayout> -</LinearLayout>
\ No newline at end of file +</ScrollView>
\ No newline at end of file diff --git a/src/de/podfetcher/activity/ItemviewActivity.java b/src/de/podfetcher/activity/ItemviewActivity.java index f98196a46..931ba9f7c 100644 --- a/src/de/podfetcher/activity/ItemviewActivity.java +++ b/src/de/podfetcher/activity/ItemviewActivity.java @@ -43,6 +43,7 @@ public class ItemviewActivity extends SherlockFragmentActivity { StorageUtils.checkStorageAvailability(this); manager = FeedManager.getInstance(); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + getSupportActionBar().setDisplayShowTitleEnabled(false); extractFeeditem(); populateUI(); } @@ -90,8 +91,8 @@ public class ItemviewActivity extends SherlockFragmentActivity { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager .beginTransaction(); - ItemDescriptionFragment fragment = ItemDescriptionFragment - .newInstance(item); + ItemDescriptionFragment fragment = ItemDescriptionFragment.newInstance( + item, false); fragmentTransaction.add(R.id.description_fragment, fragment); fragmentTransaction.commit(); } diff --git a/src/de/podfetcher/activity/MediaplayerActivity.java b/src/de/podfetcher/activity/MediaplayerActivity.java index dc3d5aeff..655a12182 100644 --- a/src/de/podfetcher/activity/MediaplayerActivity.java +++ b/src/de/podfetcher/activity/MediaplayerActivity.java @@ -702,7 +702,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements return activity.coverFragment; case POS_DESCR: activity.descriptionFragment = ItemDescriptionFragment - .newInstance(activity.media.getItem()); + .newInstance(activity.media.getItem(), true); return activity.descriptionFragment; default: return CoverFragment.newInstance(null); diff --git a/src/de/podfetcher/fragment/ItemDescriptionFragment.java b/src/de/podfetcher/fragment/ItemDescriptionFragment.java index bbb0e2c24..ea565854c 100644 --- a/src/de/podfetcher/fragment/ItemDescriptionFragment.java +++ b/src/de/podfetcher/fragment/ItemDescriptionFragment.java @@ -26,19 +26,22 @@ 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 = "<head><style type=\"text/css\"> * { font-family: Helvetica; line-height: 1.5em; font-size: 12pt; } a { font-style: normal; text-decoration: none; font-weight: normal; color: #00A8DF; }</style></head>"; + private boolean scrollbarEnabled; private WebView webvDescription; private FeedItem item; private AsyncTask<Void, Void, Void> webViewLoader; - public static ItemDescriptionFragment newInstance(FeedItem item) { + public static ItemDescriptionFragment newInstance(FeedItem item, boolean scrollbarEnabled) { 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; } @@ -47,6 +50,7 @@ public class ItemDescriptionFragment extends SherlockFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { webvDescription = new WebView(getActivity()); + webvDescription.setHorizontalScrollBarEnabled(scrollbarEnabled); return webvDescription; } @@ -82,6 +86,7 @@ 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); |