Clean up formatting and style

This commit is contained in:
Ensar Sarajčić 2023-08-16 11:20:35 +02:00
parent 7c48f6cc19
commit 0e7e1d6867
3 changed files with 19 additions and 18 deletions

View File

@ -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,7 +166,9 @@ 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 {
customView
?.let { BottomTablayoutItemBinding.bind(it) }
?.apply {
tabItemIcon.setImageDrawable(getTabIcon(index))
tabItemLabel.text = getTabLabel(index)
binding.insertEditTabsHolder.addTab(this@tab)

View File

@ -417,7 +417,9 @@ 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 {
customView
?.let { BottomTablayoutItemBinding.bind(it) }
?.apply {
tabItemIcon.setImageDrawable(getTabIcon(index))
tabItemLabel.text = getTabLabel(index)
AutofitHelper.create(tabItemLabel)

View File

@ -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))
}
}
}