scale bottom tab text size flexibly

This commit is contained in:
tibbi 2022-06-27 10:03:00 +02:00
parent 8fd408d196
commit 86a4d7a113
3 changed files with 10 additions and 7 deletions

View File

@ -62,11 +62,12 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f7c3e0ed7c' implementation 'com.github.SimpleMobileTools:Simple-Commons:e79c9bba93'
implementation 'org.greenrobot:eventbus:3.3.1' implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'com.github.Armen101:AudioRecordView:1.0.4' implementation 'com.github.Armen101:AudioRecordView:1.0.4'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.github.naman14:TAndroidLame:1.1' implementation 'com.github.naman14:TAndroidLame:1.1'
implementation 'me.grantland:autofittextview:0.2.1'
} }

View File

@ -16,6 +16,7 @@ import com.simplemobiletools.voicerecorder.extensions.config
import com.simplemobiletools.voicerecorder.helpers.STOP_AMPLITUDE_UPDATE import com.simplemobiletools.voicerecorder.helpers.STOP_AMPLITUDE_UPDATE
import com.simplemobiletools.voicerecorder.services.RecorderService import com.simplemobiletools.voicerecorder.services.RecorderService
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import me.grantland.widget.AutofitHelper
class MainActivity : SimpleActivity() { class MainActivity : SimpleActivity() {
@ -109,6 +110,7 @@ class MainActivity : SimpleActivity() {
main_tabs_holder.newTab().setCustomView(R.layout.bottom_tablayout_item).apply { main_tabs_holder.newTab().setCustomView(R.layout.bottom_tablayout_item).apply {
customView?.findViewById<ImageView>(R.id.tab_item_icon)?.setImageDrawable(getDrawable(drawableId)) customView?.findViewById<ImageView>(R.id.tab_item_icon)?.setImageDrawable(getDrawable(drawableId))
customView?.findViewById<TextView>(R.id.tab_item_label)?.setText(tabLabels[i]) customView?.findViewById<TextView>(R.id.tab_item_label)?.setText(tabLabels[i])
AutofitHelper.create(customView?.findViewById(R.id.tab_item_label))
main_tabs_holder.addTab(this) main_tabs_holder.addTab(this)
} }
} }
@ -155,7 +157,7 @@ class MainActivity : SimpleActivity() {
} }
private fun launchAbout() { private fun launchAbout() {
val licenses = LICENSE_EVENT_BUS or LICENSE_AUDIO_RECORD_VIEW or LICENSE_ANDROID_LAME val licenses = LICENSE_EVENT_BUS or LICENSE_AUDIO_RECORD_VIEW or LICENSE_ANDROID_LAME or LICENSE_AUTOFITTEXTVIEW
val faqItems = arrayListOf( val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title, R.string.faq_1_text), FAQItem(R.string.faq_1_title, R.string.faq_1_text),

View File

@ -7,7 +7,7 @@ import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.widget.SeekBar import android.widget.SeekBar
import com.simplemobiletools.commons.dialogs.ColorPickerDialog import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.dialogs.WidgetLockedDialog import com.simplemobiletools.commons.dialogs.FeatureLockedDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
import com.simplemobiletools.voicerecorder.R import com.simplemobiletools.voicerecorder.R
@ -20,7 +20,7 @@ class WidgetRecordDisplayConfigureActivity : SimpleActivity() {
private var mWidgetId = 0 private var mWidgetId = 0
private var mWidgetColor = 0 private var mWidgetColor = 0
private var mWidgetColorWithoutTransparency = 0 private var mWidgetColorWithoutTransparency = 0
private var mWidgetLockedDialog: WidgetLockedDialog? = null private var mFeatureLockedDialog: FeatureLockedDialog? = null
public override fun onCreate(savedInstanceState: Bundle?) { public override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false useDynamicTheme = false
@ -43,7 +43,7 @@ class WidgetRecordDisplayConfigureActivity : SimpleActivity() {
config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor) config_widget_seekbar.setColors(getProperTextColor(), primaryColor, primaryColor)
if (!isCustomizingColors && !isOrWasThankYouInstalled()) { if (!isCustomizingColors && !isOrWasThankYouInstalled()) {
mWidgetLockedDialog = WidgetLockedDialog(this) { mFeatureLockedDialog = FeatureLockedDialog(this) {
if (!isOrWasThankYouInstalled()) { if (!isOrWasThankYouInstalled()) {
finish() finish()
} }
@ -55,8 +55,8 @@ class WidgetRecordDisplayConfigureActivity : SimpleActivity() {
super.onResume() super.onResume()
window.decorView.setBackgroundColor(0) window.decorView.setBackgroundColor(0)
if (mWidgetLockedDialog != null && isOrWasThankYouInstalled()) { if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) {
mWidgetLockedDialog?.dismissDialog() mFeatureLockedDialog?.dismissDialog()
} }
} }