diff options
Diffstat (limited to 'News-Android-App/src')
2 files changed, 80 insertions, 79 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemHeadlineThumbnailViewHolder.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemHeadlineThumbnailViewHolder.java index b14cfd69..693a3c23 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemHeadlineThumbnailViewHolder.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemHeadlineThumbnailViewHolder.java @@ -19,12 +19,14 @@ import de.luhmer.owncloudnewsreader.R; import de.luhmer.owncloudnewsreader.database.DatabaseConnectionOrm; import de.luhmer.owncloudnewsreader.database.model.RssItem; import de.luhmer.owncloudnewsreader.databinding.SubscriptionDetailListItemHeadlineThumbnailBinding; +import de.luhmer.owncloudnewsreader.helper.FavIconHandler; import de.luhmer.owncloudnewsreader.helper.SquareRoundedBitmapDisplayer; import static android.view.View.GONE; public class RssItemHeadlineThumbnailViewHolder extends RssItemViewHolder { private final DisplayImageOptions displayImageOptionsThumbnail; + private final SubscriptionDetailListItemHeadlineThumbnailBinding binding; RssItemHeadlineThumbnailViewHolder(@NonNull SubscriptionDetailListItemHeadlineThumbnailBinding binding, SharedPreferences sharedPreferences) { @@ -32,10 +34,10 @@ public class RssItemHeadlineThumbnailViewHolder extends RssItemViewHolder { this.binding = binding; Drawable feedIcon = VectorDrawableCompat.create(itemView.getResources(), R.drawable.feed_icon, null); - int width = Math.round(88f * binding.imgViewThumbnail.getContext().getResources().getDisplayMetrics().density); + int widthThumbnail = Math.round(88f * binding.imgViewThumbnail.getContext().getResources().getDisplayMetrics().density); displayImageOptionsThumbnail = new DisplayImageOptions.Builder() .resetViewBeforeLoading(true) - .preProcessor(new SquareRoundedBitmapDisplayer(30, 0,width)) + .preProcessor(new SquareRoundedBitmapDisplayer(30, 0, widthThumbnail)) .showImageOnLoading(feedIcon) .showImageForEmptyUri(feedIcon) .showImageOnFail(feedIcon) @@ -112,7 +114,8 @@ public class RssItemHeadlineThumbnailViewHolder extends RssItemViewHolder { Drawable feedIcon = VectorDrawableCompat.create(itemView.getResources(), R.drawable.feed_icon, null); binding.imgViewThumbnail.setImageDrawable(feedIcon); } else { - binding.imgViewThumbnail.setVisibility(GONE); + binding.imgViewThumbnail.setImageDrawable(null); + binding.imgViewThumbnail.setVisibility(View.GONE); } } } diff --git a/News-Android-App/src/main/res/layout/subscription_detail_list_item_headline_thumbnail.xml b/News-Android-App/src/main/res/layout/subscription_detail_list_item_headline_thumbnail.xml index dac06670..9f56c92d 100644 --- a/News-Android-App/src/main/res/layout/subscription_detail_list_item_headline_thumbnail.xml +++ b/News-Android-App/src/main/res/layout/subscription_detail_list_item_headline_thumbnail.xml @@ -1,97 +1,95 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" - android:background="?attr/selectableItemBackground"> - <!-- - <View - android:id="@+id/color_line_feed" - android:layout_height="match_parent" - android:layout_width="4dp" - android:background="?attr/dividerLineColor" - android:layout_marginEnd="@dimen/listview_row_margin_left" /> - --> - <RelativeLayout - android:id="@+id/list_item_header" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/listview_row_margin_bottom" - android:descendantFocusability="blocksDescendants" - android:paddingStart="@dimen/listview_row_margin_left" - android:paddingEnd="0dp"> +<androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/list_item_header" + android:layout_width="match_parent" + android:layout_height="116dp" + android:paddingTop="@dimen/listview_row_margin_top" + android:paddingBottom="@dimen/listview_row_margin_bottom" + android:descendantFocusability="blocksDescendants" + android:paddingStart="@dimen/listview_row_margin_left" + android:paddingEnd="@dimen/listview_row_margin_right" + android:background="?attr/selectableItemBackground" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools"> - <TextView - android:id="@+id/summary" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_marginTop="@dimen/listview_row_margin_top" - android:layout_marginBottom="8dp" + <androidx.constraintlayout.widget.ConstraintLayout + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/imgViewThumbnail" android:layout_marginEnd="16dp" - android:layout_toStartOf="@id/imgViewThumbnail" - android:lineSpacingMultiplier="1.2" - android:ellipsize="end" - android:gravity="center_vertical" - android:maxLines="3" - android:textSize="17sp" - android:textStyle="bold" - android:textColor="?attr/primaryTextColor" - tools:text="Headline - some longer text might go here.. and it can be multiline.. and it can also be reaaally long so we need to consider that as well" /> + android:layout_width="0dp" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/summary" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:lineSpacingMultiplier="1.2" + android:maxLines="3" + android:textColor="?attr/primaryTextColor" + android:textSize="17sp" + android:textStyle="bold" + android:ellipsize="end" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="Some very long text that can fill up to three lines and still fits on the screen! So cool! Pretty good design" /> + + <ImageView + android:id="@+id/imgViewFavIcon" + android:layout_width="18dp" + android:layout_height="18dp" + android:layout_below="@id/summary" + android:layout_alignParentStart="true" + android:layout_marginTop="8dp" + android:contentDescription="@string/content_desc_none" + app:layout_constraintTop_toBottomOf="@id/summary" + app:layout_constraintStart_toStartOf="parent" + tools:src="@drawable/default_feed_icon_light" /> + + + <TextView + android:id="@+id/tv_subscription" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_below="@id/summary" + android:ellipsize="middle" + android:gravity="start" + android:singleLine="true" + android:textAlignment="viewStart" + android:textColor="@color/material_grey_500" + android:textSize="13sp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintTop_toBottomOf="@id/summary" + app:layout_constraintStart_toEndOf="@id/imgViewFavIcon" + app:layout_constraintEnd_toEndOf="parent" + tools:text="Caschys Blo ds d dsadadsaadadaasdasdadasdad" /> + + </androidx.constraintlayout.widget.ConstraintLayout> <ImageView android:id="@+id/imgViewThumbnail" android:layout_width="88dp" android:layout_height="88dp" - android:layout_alignParentEnd="true" - android:layout_marginTop="4dp" - android:layout_marginEnd="16dp" + android:visibility="visible" android:contentDescription="@string/img_view_thumbnail" android:scaleType="centerCrop" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" tools:src="@drawable/feed_icon" /> <include android:id="@+id/podcast_wrapper" layout="@layout/subscription_detail_list_item_podcast_wrapper" - android:layout_height="88dp" android:layout_width="88dp" - android:layout_marginTop="4dp" - android:layout_marginEnd="16dp" - android:layout_alignParentEnd="true"/> - - - <ImageView - android:id="@+id/imgViewFavIcon" - android:layout_width="15dp" - android:layout_height="15dp" - android:layout_alignParentStart="true" - android:layout_below="@id/summary" - android:layout_marginEnd="8dp" - android:layout_marginTop="2dp" - android:contentDescription="@string/content_desc_none" - tools:src="@drawable/default_feed_icon_light" /> + android:layout_height="88dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <TextView - android:id="@+id/tv_subscription" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:ellipsize="middle" - android:gravity="start" - android:singleLine="true" - android:textAlignment="viewStart" - android:textColor="@color/material_grey_500" - android:textSize="13sp" - android:layout_below="@id/summary" - android:layout_toEndOf="@id/imgViewFavIcon" - android:layout_toStartOf="@id/imgViewThumbnail" - android:layout_marginEnd="16dp" - tools:text="Caschys Blo ds d dsadadsaadadaasdasdadasdad" /> - </RelativeLayout> -</LinearLayout>
\ No newline at end of file + </androidx.constraintlayout.widget.ConstraintLayout> |