scale bottom tab text size flexibly

This commit is contained in:
tibbi 2022-06-27 10:04:17 +02:00
parent c5d371edbe
commit a40d72ac05
2 changed files with 5 additions and 2 deletions

View file

@ -63,10 +63,11 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:4aa0b9aaad'
implementation 'com.github.SimpleMobileTools:Simple-Commons:e79c9bba93'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'me.grantland:autofittextview:0.2.1'
kapt "androidx.room:room-compiler:2.4.2"
implementation "androidx.room:room-runtime:2.4.2"

View file

@ -48,6 +48,7 @@ import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_contacts.*
import kotlinx.android.synthetic.main.fragment_favorites.*
import kotlinx.android.synthetic.main.fragment_groups.*
import me.grantland.widget.AutofitHelper
import java.io.FileOutputStream
import java.io.OutputStream
import java.util.*
@ -376,6 +377,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
main_tabs_holder.newTab().setCustomView(R.layout.bottom_tablayout_item).apply {
customView?.findViewById<ImageView>(R.id.tab_item_icon)?.setImageDrawable(getTabIcon(index))
customView?.findViewById<TextView>(R.id.tab_item_label)?.text = getTabLabel(index)
AutofitHelper.create(customView?.findViewById(R.id.tab_item_label))
main_tabs_holder.addTab(this)
}
}
@ -541,7 +543,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private fun launchAbout() {
closeSearch()
val licenses = LICENSE_JODA or LICENSE_GLIDE or LICENSE_GSON or LICENSE_INDICATOR_FAST_SCROLL
val licenses = LICENSE_JODA or LICENSE_GLIDE or LICENSE_GSON or LICENSE_INDICATOR_FAST_SCROLL or LICENSE_AUTOFITTEXTVIEW
val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title, R.string.faq_1_text),