From 12f4c47e2b364401f12744126c5fbcda27d0bbc1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 11 May 2025 10:34:36 +0300 Subject: adjust layout of compact headline rows, disable dividers for now --- .../main/java/org/fox/ttrss/HeadlinesFragment.java | 11 ++- .../src/main/res/layout/headlines_row_compact.xml | 89 +++++++-------------- .../res/layout/headlines_row_compact_selected.xml | 86 +++++++------------- .../headlines_row_compact_selected_unread.xml | 93 +++++++++------------- .../res/layout/headlines_row_compact_unread.xml | 76 ++++++++---------- 5 files changed, 135 insertions(+), 220 deletions(-) (limited to 'org.fox.ttrss/src/main') diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 52ef4327..175b417c 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -358,12 +358,12 @@ public class HeadlinesFragment extends androidx.fragment.app.Fragment { m_list.setLayoutManager(m_layoutManager); m_list.setItemAnimator(new DefaultItemAnimator()); - if (m_compactLayoutMode) { + /* if (m_compactLayoutMode) { MaterialDividerItemDecoration materialDivider = new MaterialDividerItemDecoration(m_list.getContext(), m_layoutManager.getOrientation()); materialDivider.setDividerInsetStart(dpToPx(80)); m_list.addItemDecoration(materialDivider); - } + } */ ArticleListAdapter adapter = new ArticleListAdapter(getActivity(), R.layout.headlines_row, m_articles); @@ -795,7 +795,6 @@ public class HeadlinesFragment extends androidx.fragment.app.Fragment { menuButtonView = v.findViewById(R.id.article_menu_button); flavorImageHolder = v.findViewById(R.id.flavorImageHolder); flavorImageLoadingBar = v.findViewById(R.id.flavorImageLoadingBar); - headlineFooter = v.findViewById(R.id.headline_footer); textImage = v.findViewById(R.id.text_image); textChecked = v.findViewById(R.id.text_checked); headlineHeader = v.findViewById(R.id.headline_header); @@ -1191,6 +1190,12 @@ public class HeadlinesFragment extends androidx.fragment.app.Fragment { holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize); holder.excerptView.setText(excerpt); + if (!excerpt.isEmpty()) { + holder.excerptView.setVisibility(View.VISIBLE); + } else { + holder.excerptView.setVisibility(View.GONE); + } + if (!canShowFlavorImage()) { holder.excerptView.setPadding(holder.excerptView.getPaddingLeft(), 0, diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml index fd328276..352aad91 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_compact.xml @@ -4,21 +4,23 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/headlines_row" - android:padding="@dimen/activity_horizontal_margin" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="8dp" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - tools:ignore="HardcodedText" > + android:orientation="horizontal"> @@ -44,94 +45,64 @@ android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" - android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" tools:text="Sample entry title" android:textColor="?colorPrimary" - android:textSize="18sp" - android:layout_span="2" /> + android:textSize="18sp" /> + + - - - - - - - + android:layout_marginTop="4dp" /> - - - - - - \ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected.xml index 6030df54..5721dcb8 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected.xml @@ -4,16 +4,16 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/headlines_row" - android:padding="@dimen/activity_horizontal_margin" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="8dp" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="horizontal" android:background="?colorTertiaryContainer" - android:textColor="?colorOnTertiaryContainer" - tools:ignore="HardcodedText" > + android:orientation="horizontal"> @@ -46,91 +46,63 @@ android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" - android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" tools:text="Sample entry title" - android:textSize="18sp" - android:layout_span="2" /> + android:textColor="?colorOnTertiaryContainer" + android:textSize="18sp" /> + + - - - - - - - + android:layout_marginTop="4dp" /> - - - - - - \ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected_unread.xml index 0d8d930d..06813e04 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_selected_unread.xml @@ -4,38 +4,41 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/headlines_row" - android:padding="@dimen/activity_horizontal_margin" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="8dp" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="horizontal" android:background="?colorTertiaryContainer" - tools:ignore="HardcodedText" > + android:orientation="horizontal"> + android:layout_marginEnd="16dp"> + android:id="@+id/text_checked" + android:layout_gravity="center" /> @@ -43,89 +46,65 @@ android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" - android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" tools:text="Sample entry title" + android:textColor="?colorOnTertiaryContainer" android:textStyle="bold" - android:textSize="18sp" - android:layout_span="2" /> + android:textSize="18sp" /> + + - - - - - - - + android:layout_marginTop="4dp" /> + android:textSize="12sp" + /> - - - - - \ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_unread.xml index 222d19d1..6aa1bdcd 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_compact_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_compact_unread.xml @@ -4,15 +4,16 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/headlines_row" - android:padding="@dimen/activity_horizontal_margin" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="8dp" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:orientation="horizontal" android:background="?colorSurfaceContainerLowest" - tools:ignore="HardcodedText" > + android:orientation="horizontal"> @@ -45,78 +46,65 @@ android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:gravity="center_vertical" - android:textAlignment="viewStart" android:maxLines="2" android:ellipsize="end" tools:text="Sample entry title" android:textStyle="bold" - android:textSize="18sp" - android:layout_span="2" /> + android:textSize="18sp" /> + + - - - - - - + android:layout_marginTop="4dp" /> + android:textColor="?colorSecondary" + android:textSize="12sp" + /> - - \ No newline at end of file -- cgit v1.2.3-54-g00ecf