From 0e7e1d686719ddac814124d04ed548c3975c3707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 16 Aug 2023 11:20:35 +0200 Subject: [PATCH] Clean up formatting and style --- .../activities/InsertOrEditContactActivity.kt | 21 ++++++++++--------- .../contacts/pro/activities/MainActivity.kt | 14 +++++++------ .../pro/adapters/SelectContactsAdapter.kt | 2 -- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt index ce72a492..c32a35ac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/InsertOrEditContactActivity.kt @@ -42,7 +42,6 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - binding = ActivityInsertEditContactBinding.inflate(layoutInflater) setContentView(binding.root) setupOptionsMenu() isSelectContactIntent = intent.action == Intent.ACTION_PICK @@ -92,7 +91,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { binding.insertEditMenu.onSearchClosedListener = { getAllFragments().forEach { - it?.onSearchClosed() + it.onSearchClosed() } } @@ -140,7 +139,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { override fun onPageSelected(position: Int) { binding.insertEditTabsHolder.getTabAt(position)?.select() getAllFragments().forEach { - it?.finishActMode() + it.finishActMode() } } }) @@ -149,8 +148,8 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { refreshContacts(getTabsMask()) } - binding.selectContactLabel?.setTextColor(getProperPrimaryColor()) - binding.newContactTmb?.setImageDrawable( + binding.selectContactLabel.setTextColor(getProperPrimaryColor()) + binding.newContactTmb.setImageDrawable( resources.getColoredDrawableWithColor( com.simplemobiletools.commons.R.drawable.ic_add_person_vector, getProperTextColor() @@ -167,11 +166,13 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener { contactsFavoritesList.forEachIndexed { index, value -> if (config.showTabs and value != 0) { binding.insertEditTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{ - customView?.let { BottomTablayoutItemBinding.bind(it) }?.apply { - tabItemIcon.setImageDrawable(getTabIcon(index)) - tabItemLabel.text = getTabLabel(index) - binding.insertEditTabsHolder.addTab(this@tab) - } + customView + ?.let { BottomTablayoutItemBinding.bind(it) } + ?.apply { + tabItemIcon.setImageDrawable(getTabIcon(index)) + tabItemLabel.text = getTabLabel(index) + binding.insertEditTabsHolder.addTab(this@tab) + } } } } 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 d1bbd95c..7cff2bbf 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 @@ -417,12 +417,14 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { tabsList.forEachIndexed { index, value -> if (config.showTabs and value != 0) { binding.mainTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{ - customView?.let { BottomTablayoutItemBinding.bind(it) }?.apply { - tabItemIcon.setImageDrawable(getTabIcon(index)) - tabItemLabel.text = getTabLabel(index) - AutofitHelper.create(tabItemLabel) - binding.mainTabsHolder.addTab(this@tab) - } + customView + ?.let { BottomTablayoutItemBinding.bind(it) } + ?.apply { + tabItemIcon.setImageDrawable(getTabIcon(index)) + tabItemLabel.text = getTabLabel(index) + AutofitHelper.create(tabItemLabel) + binding.mainTabsHolder.addTab(this@tab) + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/SelectContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/SelectContactsAdapter.kt index 39e68eec..790a3e77 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/SelectContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/SelectContactsAdapter.kt @@ -187,7 +187,6 @@ class SelectContactsAdapter( override fun bind(view: View): ItemAddFavoriteBinding { return ItemAddFavoriteWithNumberBindingAdapter(ItemAddFavoriteWithNumberBinding.bind(view)) } - } data object WithoutNumber : Binding { @@ -198,7 +197,6 @@ class SelectContactsAdapter( override fun bind(view: View): ItemAddFavoriteBinding { return ItemAddFavoriteWithoutNumberBindingAdapter(ItemAddFavoriteWithoutNumberBinding.bind(view)) } - } }