diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2020-02-19 15:09:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 15:09:45 +0100 |
commit | 4e26749757088a9f32fd1b6f89c28a186a9d32dd (patch) | |
tree | a8967647539980e359175b90e072adcf15addb02 /app | |
parent | 3e51442560a7e98e90afe8f48b2ef4e2ed3e84cc (diff) | |
parent | 5070c6cb03d4342220983be7f2c9a5723600d427 (diff) | |
download | AntennaPod-4e26749757088a9f32fd1b6f89c28a186a9d32dd.zip |
Merge pull request #3854 from ByteHamster/item-details-page
Updated item details page
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/res/layout/feeditem_fragment.xml | 224 |
2 files changed, 120 insertions, 110 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 5caaa592f..e263d2b3e 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -23,6 +23,8 @@ import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.fragment.app.Fragment; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.bitmap.FitCenter; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import com.google.android.material.snackbar.Snackbar; import de.danoeh.antennapod.R; @@ -256,10 +258,10 @@ public class ItemFragment extends Fragment { Glide.with(getActivity()) .load(ImageResourceUtils.getImageLocation(item)) .apply(new RequestOptions() - .placeholder(R.color.light_gray) .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .fitCenter() + .transforms(new FitCenter(), + new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))) .dontAnimate()) .into(imgvCover); diff --git a/app/src/main/res/layout/feeditem_fragment.xml b/app/src/main/res/layout/feeditem_fragment.xml index 47460a28f..beabd20b6 100644 --- a/app/src/main/res/layout/feeditem_fragment.xml +++ b/app/src/main/res/layout/feeditem_fragment.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/content_root" android:layout_width="match_parent" @@ -11,86 +10,87 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:background="?attr/colorPrimary" android:gravity="center_horizontal" android:orientation="vertical" - tools:background="@android:color/darker_gray"> + android:paddingLeft="16dp" + android:paddingRight="16dp"> - <RelativeLayout + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" android:layout_marginTop="16dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp"> + android:orientation="horizontal"> <ImageView android:id="@+id/imgvCover" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" - android:layout_width="50dp" - android:layout_height="50dp" - android:layout_marginRight="16dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" + android:layout_width="@dimen/thumbnail_length_queue_item" + android:layout_height="@dimen/thumbnail_length_queue_item" + android:layout_gravity="center_vertical" android:contentDescription="@string/cover_label" - android:gravity="center_vertical" android:foreground="?attr/selectableItemBackground" - tools:src="@drawable/ic_antenna" - tools:background="@android:color/holo_green_dark" /> + tools:src="@tools:sample/avatars" /> - <TextView - android:id="@+id/txtvPodcast" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignTop="@id/imgvCover" - android:layout_toRightOf="@id/imgvCover" - android:layout_toEndOf="@id/imgvCover" - android:foreground="?attr/selectableItemBackground" - tools:text="Podcast title" - tools:background="@android:color/holo_green_dark" /> + <LinearLayout + android:layout_width="match_parent" + android:orientation="vertical" + android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" + android:layout_height="wrap_content"> - <TextView - android:id="@+id/txtvTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/txtvPodcast" - android:layout_toRightOf="@id/imgvCover" - android:layout_toEndOf="@id/imgvCover" - android:textSize="16sp" - android:textColor="?android:attr/textColorPrimary" - android:ellipsize="end" - android:maxLines="5" - tools:text="Episode title" - tools:background="@android:color/holo_green_dark" /> - - <TextView - android:id="@+id/txtvDuration" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@id/imgvCover" - android:layout_toEndOf="@id/imgvCover" - android:layout_below="@id/txtvTitle" - tools:text="00:42:23" - tools:background="@android:color/holo_green_dark"/> - - <TextView - android:id="@+id/txtvPublished" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentEnd="true" - android:layout_below="@id/txtvTitle" - android:layout_marginLeft="8dp" - android:layout_marginStart="8dp" - tools:text="Jan 23" - tools:background="@android:color/holo_green_dark" /> + <TextView + android:id="@+id/txtvPodcast" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:foreground="?attr/selectableItemBackground" + tools:text="Podcast title" + tools:background="@android:color/holo_green_dark" /> - </RelativeLayout> + <TextView + android:id="@+id/txtvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="16sp" + android:textColor="?android:attr/textColorPrimary" + android:ellipsize="end" + android:maxLines="5" + tools:text="@sample/episodes.json/data/title" + tools:background="@android:color/holo_green_dark" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/txtvDuration" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:text="@sample/episodes.json/data/duration" + tools:background="@android:color/holo_green_dark" /> + + <TextView + android:id="@+id/separatorIcons" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="4dp" + android:layout_marginStart="4dp" + android:layout_marginRight="4dp" + android:layout_marginEnd="4dp" + android:text="ยท" + tools:background="@android:color/holo_blue_light" /> + + <TextView + android:id="@+id/txtvPublished" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:text="Jan 23" + tools:background="@android:color/holo_green_dark" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> <ProgressBar android:id="@+id/progbarDownload" @@ -98,8 +98,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" android:visibility="gone" /> <LinearLayout @@ -110,56 +108,66 @@ tools:background="@android:color/holo_blue_bright"> <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:id="@+id/butAction1" - android:orientation="horizontal" - android:background="?android:attr/selectableItemBackground" - android:gravity="center"> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:id="@+id/butAction1" + android:orientation="horizontal" + android:background="?android:attr/selectableItemBackground" + android:gravity="center"> + <ImageView - android:layout_width="24dp" - android:layout_height="24dp" - android:id="@+id/butAction1Icon" - android:layout_margin="12dp" - tools:src="@drawable/ic_settings_grey600_24dp"/> + android:layout_width="24dp" + android:layout_height="24dp" + android:id="@+id/butAction1Icon" + android:layout_marginRight="8dp" + android:layout_marginEnd="8dp" + android:layout_marginTop="12dp" + android:layout_marginBottom="12dp" + tools:src="@drawable/ic_settings_grey600_24dp" /> + <TextView - android:textAppearance="@style/TextAppearance.AppCompat.Button" - android:id="@+id/butAction1Text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="?android:attr/textColorPrimary" - tools:text="Button 1"/> + android:textAppearance="@style/TextAppearance.AppCompat.Button" + android:id="@+id/butAction1Text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="?android:attr/textColorPrimary" + tools:text="Button 1" /> </LinearLayout> <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:id="@+id/butAction2" - android:orientation="horizontal" - android:background="?android:attr/selectableItemBackground" - android:gravity="center"> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:id="@+id/butAction2" + android:orientation="horizontal" + android:background="?android:attr/selectableItemBackground" + android:gravity="center"> + <ImageView - android:layout_width="24dp" - android:layout_height="24dp" - android:id="@+id/butAction2Icon" - android:layout_margin="12dp" - tools:src="@drawable/ic_settings_grey600_24dp"/> + android:layout_width="24dp" + android:layout_height="24dp" + android:id="@+id/butAction2Icon" + android:layout_marginRight="8dp" + android:layout_marginEnd="8dp" + android:layout_marginTop="12dp" + android:layout_marginBottom="12dp" + tools:src="@drawable/ic_settings_grey600_24dp" /> + <TextView - android:textAppearance="@style/TextAppearance.AppCompat.Button" - android:id="@+id/butAction2Text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="?android:attr/textColorPrimary" - tools:text="Button 2"/> + android:textAppearance="@style/TextAppearance.AppCompat.Button" + android:id="@+id/butAction2Text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="?android:attr/textColorPrimary" + tools:text="Button 2" /> </LinearLayout> </LinearLayout> <View android:layout_width="match_parent" - android:layout_height="2dp" - android:background="@color/light_gray"/> + android:layout_height="1dp" + android:background="?android:attr/dividerVertical"/> </LinearLayout> |