mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-16 19:40:43 +01:00
Clean up formatting and style
This commit is contained in:
parent
7c48f6cc19
commit
0e7e1d6867
@ -42,7 +42,6 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityInsertEditContactBinding.inflate(layoutInflater)
|
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setupOptionsMenu()
|
setupOptionsMenu()
|
||||||
isSelectContactIntent = intent.action == Intent.ACTION_PICK
|
isSelectContactIntent = intent.action == Intent.ACTION_PICK
|
||||||
@ -92,7 +91,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
binding.insertEditMenu.onSearchClosedListener = {
|
binding.insertEditMenu.onSearchClosedListener = {
|
||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.onSearchClosed()
|
it.onSearchClosed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +139,7 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
binding.insertEditTabsHolder.getTabAt(position)?.select()
|
binding.insertEditTabsHolder.getTabAt(position)?.select()
|
||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.finishActMode()
|
it.finishActMode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -149,8 +148,8 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
refreshContacts(getTabsMask())
|
refreshContacts(getTabsMask())
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.selectContactLabel?.setTextColor(getProperPrimaryColor())
|
binding.selectContactLabel.setTextColor(getProperPrimaryColor())
|
||||||
binding.newContactTmb?.setImageDrawable(
|
binding.newContactTmb.setImageDrawable(
|
||||||
resources.getColoredDrawableWithColor(
|
resources.getColoredDrawableWithColor(
|
||||||
com.simplemobiletools.commons.R.drawable.ic_add_person_vector,
|
com.simplemobiletools.commons.R.drawable.ic_add_person_vector,
|
||||||
getProperTextColor()
|
getProperTextColor()
|
||||||
@ -167,11 +166,13 @@ class InsertOrEditContactActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
contactsFavoritesList.forEachIndexed { index, value ->
|
contactsFavoritesList.forEachIndexed { index, value ->
|
||||||
if (config.showTabs and value != 0) {
|
if (config.showTabs and value != 0) {
|
||||||
binding.insertEditTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{
|
binding.insertEditTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{
|
||||||
customView?.let { BottomTablayoutItemBinding.bind(it) }?.apply {
|
customView
|
||||||
tabItemIcon.setImageDrawable(getTabIcon(index))
|
?.let { BottomTablayoutItemBinding.bind(it) }
|
||||||
tabItemLabel.text = getTabLabel(index)
|
?.apply {
|
||||||
binding.insertEditTabsHolder.addTab(this@tab)
|
tabItemIcon.setImageDrawable(getTabIcon(index))
|
||||||
}
|
tabItemLabel.text = getTabLabel(index)
|
||||||
|
binding.insertEditTabsHolder.addTab(this@tab)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,12 +417,14 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
tabsList.forEachIndexed { index, value ->
|
tabsList.forEachIndexed { index, value ->
|
||||||
if (config.showTabs and value != 0) {
|
if (config.showTabs and value != 0) {
|
||||||
binding.mainTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{
|
binding.mainTabsHolder.newTab().setCustomView(com.simplemobiletools.commons.R.layout.bottom_tablayout_item).apply tab@{
|
||||||
customView?.let { BottomTablayoutItemBinding.bind(it) }?.apply {
|
customView
|
||||||
tabItemIcon.setImageDrawable(getTabIcon(index))
|
?.let { BottomTablayoutItemBinding.bind(it) }
|
||||||
tabItemLabel.text = getTabLabel(index)
|
?.apply {
|
||||||
AutofitHelper.create(tabItemLabel)
|
tabItemIcon.setImageDrawable(getTabIcon(index))
|
||||||
binding.mainTabsHolder.addTab(this@tab)
|
tabItemLabel.text = getTabLabel(index)
|
||||||
}
|
AutofitHelper.create(tabItemLabel)
|
||||||
|
binding.mainTabsHolder.addTab(this@tab)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,6 @@ class SelectContactsAdapter(
|
|||||||
override fun bind(view: View): ItemAddFavoriteBinding {
|
override fun bind(view: View): ItemAddFavoriteBinding {
|
||||||
return ItemAddFavoriteWithNumberBindingAdapter(ItemAddFavoriteWithNumberBinding.bind(view))
|
return ItemAddFavoriteWithNumberBindingAdapter(ItemAddFavoriteWithNumberBinding.bind(view))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data object WithoutNumber : Binding {
|
data object WithoutNumber : Binding {
|
||||||
@ -198,7 +197,6 @@ class SelectContactsAdapter(
|
|||||||
override fun bind(view: View): ItemAddFavoriteBinding {
|
override fun bind(view: View): ItemAddFavoriteBinding {
|
||||||
return ItemAddFavoriteWithoutNumberBindingAdapter(ItemAddFavoriteWithoutNumberBinding.bind(view))
|
return ItemAddFavoriteWithoutNumberBindingAdapter(ItemAddFavoriteWithoutNumberBinding.bind(view))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user