From 6a8c2d7fcdf7a9a3ef2078e615901f818017a103 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Mon, 22 Nov 2021 07:09:12 +0100 Subject: [PATCH] Trim sources title when too long (#383) --- .../bou/readerforselfoss/SourcesActivity.kt | 2 +- app/src/main/res/layout/activity_sources.xml | 5 +- app/src/main/res/layout/source_list_item.xml | 60 +++++++++---------- app/src/main/res/values/strings.xml | 1 + 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt index b6453a3..05687c0 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt @@ -71,7 +71,7 @@ class SourcesActivity : AppCompatActivity() { binding.recyclerView.setHasFixedSize(true) binding.recyclerView.layoutManager = mLayoutManager - if (this@SourcesActivity.isNetworkAccessible(this@SourcesActivity.findViewById(R.id.recyclerView))) { + if (this@SourcesActivity.isNetworkAccessible(binding.recyclerView)) { api.sources.enqueue(object : Callback> { override fun onResponse( call: Call>, diff --git a/app/src/main/res/layout/activity_sources.xml b/app/src/main/res/layout/activity_sources.xml index 1097e6b..613ea6a 100644 --- a/app/src/main/res/layout/activity_sources.xml +++ b/app/src/main/res/layout/activity_sources.xml @@ -31,14 +31,13 @@ android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="end|bottom|right" + android:layout_gravity="end|bottom|end" android:src="@drawable/ic_add_white_24dp" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin" android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_marginBottom="16dp" android:layout_marginEnd="16dp" - android:layout_marginRight="16dp"/> + android:contentDescription="@string/add_source" /> diff --git a/app/src/main/res/layout/source_list_item.xml b/app/src/main/res/layout/source_list_item.xml index aa81876..575eb1e 100644 --- a/app/src/main/res/layout/source_list_item.xml +++ b/app/src/main/res/layout/source_list_item.xml @@ -1,55 +1,49 @@ - + android:layout_height="48dp" + android:orientation="vertical"> + android:layout_height="36dp" + android:importantForAccessibility="no" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/deleteBtn" + app:layout_constraintStart_toEndOf="@+id/itemImage" + app:layout_constraintTop_toTopOf="parent" + tools:text="source title" />