Merge pull request #3854 from ByteHamster/item-details-page

Updated item details page
This commit is contained in:
H. Lehmann 2020-02-19 15:09:45 +01:00 committed by GitHub
commit 4e26749757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 118 additions and 108 deletions

View File

@ -23,6 +23,8 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide; 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.bumptech.glide.request.RequestOptions;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
@ -256,10 +258,10 @@ public class ItemFragment extends Fragment {
Glide.with(getActivity()) Glide.with(getActivity())
.load(ImageResourceUtils.getImageLocation(item)) .load(ImageResourceUtils.getImageLocation(item))
.apply(new RequestOptions() .apply(new RequestOptions()
.placeholder(R.color.light_gray)
.error(R.color.light_gray) .error(R.color.light_gray)
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.fitCenter() .transforms(new FitCenter(),
new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density)))
.dontAnimate()) .dontAnimate())
.into(imgvCover); .into(imgvCover);

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_root" android:id="@+id/content_root"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -11,86 +10,87 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="?attr/colorPrimary"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
tools:background="@android:color/darker_gray"> android:paddingLeft="16dp"
android:paddingRight="16dp">
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginLeft="16dp" android:orientation="horizontal">
android:layout_marginRight="16dp">
<ImageView <ImageView
android:id="@+id/imgvCover" android:id="@+id/imgvCover"
android:layout_alignParentTop="true" android:layout_width="@dimen/thumbnail_length_queue_item"
android:layout_alignParentLeft="true" android:layout_height="@dimen/thumbnail_length_queue_item"
android:layout_alignParentStart="true" android:layout_gravity="center_vertical"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:contentDescription="@string/cover_label" android:contentDescription="@string/cover_label"
android:gravity="center_vertical"
android:foreground="?attr/selectableItemBackground" android:foreground="?attr/selectableItemBackground"
tools:src="@drawable/ic_antenna" tools:src="@tools:sample/avatars" />
tools:background="@android:color/holo_green_dark" />
<TextView <LinearLayout
android:id="@+id/txtvPodcast" android:layout_width="match_parent"
style="@style/AntennaPod.TextView.ListItemSecondaryTitle" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_marginLeft="16dp"
android:layout_height="wrap_content" android:layout_marginStart="16dp"
android:layout_alignTop="@id/imgvCover" android:layout_height="wrap_content">
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" />
<TextView <TextView
android:id="@+id/txtvTitle" android:id="@+id/txtvPodcast"
android:layout_width="wrap_content" style="@style/AntennaPod.TextView.ListItemSecondaryTitle"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_below="@id/txtvPodcast" android:layout_height="wrap_content"
android:layout_toRightOf="@id/imgvCover" android:foreground="?attr/selectableItemBackground"
android:layout_toEndOf="@id/imgvCover" tools:text="Podcast title"
android:textSize="16sp" tools:background="@android:color/holo_green_dark" />
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="end"
android:maxLines="5"
tools:text="Episode title"
tools:background="@android:color/holo_green_dark" />
<TextView <TextView
android:id="@+id/txtvDuration" android:id="@+id/txtvTitle"
style="@style/AntennaPod.TextView.ListItemSecondaryTitle" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:textSize="16sp"
android:layout_toRightOf="@id/imgvCover" android:textColor="?android:attr/textColorPrimary"
android:layout_toEndOf="@id/imgvCover" android:ellipsize="end"
android:layout_below="@id/txtvTitle" android:maxLines="5"
tools:text="00:42:23" tools:text="@sample/episodes.json/data/title"
tools:background="@android:color/holo_green_dark"/> tools:background="@android:color/holo_green_dark" />
<TextView <LinearLayout
android:id="@+id/txtvPublished" android:layout_width="match_parent"
style="@style/AntennaPod.TextView.ListItemSecondaryTitle" android:layout_height="wrap_content">
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" />
</RelativeLayout> <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 <ProgressBar
android:id="@+id/progbarDownload" android:id="@+id/progbarDownload"
@ -98,8 +98,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
@ -110,56 +108,66 @@
tools:background="@android:color/holo_blue_bright"> tools:background="@android:color/holo_blue_bright">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:id="@+id/butAction1" android:id="@+id/butAction1"
android:orientation="horizontal" android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:id="@+id/butAction1Icon" android:id="@+id/butAction1Icon"
android:layout_margin="12dp" android:layout_marginRight="8dp"
tools:src="@drawable/ic_settings_grey600_24dp"/> android:layout_marginEnd="8dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
tools:src="@drawable/ic_settings_grey600_24dp" />
<TextView <TextView
android:textAppearance="@style/TextAppearance.AppCompat.Button" android:textAppearance="@style/TextAppearance.AppCompat.Button"
android:id="@+id/butAction1Text" android:id="@+id/butAction1Text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:text="Button 1"/> tools:text="Button 1" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:id="@+id/butAction2" android:id="@+id/butAction2"
android:orientation="horizontal" android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:id="@+id/butAction2Icon" android:id="@+id/butAction2Icon"
android:layout_margin="12dp" android:layout_marginRight="8dp"
tools:src="@drawable/ic_settings_grey600_24dp"/> android:layout_marginEnd="8dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
tools:src="@drawable/ic_settings_grey600_24dp" />
<TextView <TextView
android:textAppearance="@style/TextAppearance.AppCompat.Button" android:textAppearance="@style/TextAppearance.AppCompat.Button"
android:id="@+id/butAction2Text" android:id="@+id/butAction2Text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:text="Button 2"/> tools:text="Button 2" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp" android:layout_height="1dp"
android:background="@color/light_gray"/> android:background="?android:attr/dividerVertical"/>
</LinearLayout> </LinearLayout>