From 9de68501f7aff387f45016148ae6767680586a7e Mon Sep 17 00:00:00 2001 From: merkost Date: Sat, 22 Jul 2023 10:22:46 +1000 Subject: [PATCH] Changed CONTACTS_GRID_MIN_COLUMNS_COUNT to 1 --- .../simplemobiletools/contacts/pro/activities/MainActivity.kt | 2 +- .../contacts/pro/adapters/ContactsAdapter.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt index 3182edc6..37d66490 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt @@ -248,7 +248,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { } private fun changeColumnCount() { - val items = (CONTACTS_GRID_MIN_COLUMNS_COUNT..CONTACTS_GRID_MAX_COLUMNS_COUNT).map { + val items = (1..CONTACTS_GRID_MAX_COLUMNS_COUNT).map { RadioItem(it, resources.getQuantityString(R.plurals.column_counts, it, it)) } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt index 874912b5..47184631 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt @@ -496,7 +496,7 @@ class ContactsAdapter( val layoutManager = recyclerView.layoutManager if (layoutManager is GridLayoutManager) { val currentSpanCount = layoutManager.spanCount - val newSpanCount = (currentSpanCount - 1).coerceIn(CONTACTS_GRID_MIN_COLUMNS_COUNT, CONTACTS_GRID_MAX_COLUMNS_COUNT) + val newSpanCount = (currentSpanCount - 1).coerceIn(1, CONTACTS_GRID_MAX_COLUMNS_COUNT) layoutManager.spanCount = newSpanCount recyclerView.requestLayout() onColumnCountListener(newSpanCount) @@ -507,7 +507,7 @@ class ContactsAdapter( val layoutManager = recyclerView.layoutManager if (layoutManager is GridLayoutManager) { val currentSpanCount = layoutManager.spanCount - val newSpanCount = (currentSpanCount + 1).coerceIn(CONTACTS_GRID_MIN_COLUMNS_COUNT, CONTACTS_GRID_MAX_COLUMNS_COUNT) + val newSpanCount = (currentSpanCount + 1).coerceIn(1, CONTACTS_GRID_MAX_COLUMNS_COUNT) layoutManager.spanCount = newSpanCount recyclerView.requestLayout() onColumnCountListener(newSpanCount)