From d8a26a87a604b440fddee0ed991f8c5cbb6fe551 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Aug 2018 14:38:30 +0200 Subject: [PATCH] hide the viewpager tabs if only one is visible --- .../com/simplemobiletools/contacts/activities/MainActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt index a386bcc6..a1225c5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt @@ -327,6 +327,8 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { main_tabs_holder.addTab(main_tabs_holder.newTab().setIcon(getTabIcon(index)), index - skippedTabs, config.lastUsedViewPagerPage == index - skippedTabs) } } + + main_tabs_holder.beVisibleIf(skippedTabs < 2) } private fun getTabIcon(position: Int) = resources.getDrawable(when (position) {