Repository: thunderbird/thunderbird-android
File: legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageTopView.kt (Kotlin)

Code before:
import com.fsck.k9.mail.Message
import com.fsck.k9.mailstore.AttachmentViewInfo
import com.fsck.k9.mailstore.MessageViewInfo
import com.fsck.k9.ui.R
import com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener
import com.fsck.k9.view.MessageHeader
import com.fsck.k9.view.ThemeUtils
import com.fsck.k9.view.ToolableViewAnimator
import com.google.android.material.button.MaterialButton
import com.google.android.material.textview.MaterialTextView
import net.thunderbird.core.android.account.LegacyAccountDto
import net.thunderbird.core.android.account.ShowPictures
import net.thunderbird.core.common.mail.EmailAddress
import net.thunderbird.core.common.mail.toEmailAddressOrNull
import net.thunderbird.core.preference.BodyContentType
import net.thunderbird.core.preference.GeneralSettingsManager
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class MessageTopView(
    context: Context,
    attrs: AttributeSet?,
) : LinearLayout(context, attrs), KoinComponent {

    private val contactRepository: ContactRepository by inject()
    private val generalSettingsManager: GeneralSettingsManager by inject()

    private lateinit var layoutInflater: LayoutInflater

    private lateinit var viewAnimator: ToolableViewAnimator
    private lateinit var progressBar: ProgressBar
    private lateinit var progressText: MaterialTextView

    lateinit var messageHeaderView: MessageHeader

    private lateinit var containerView: ViewGroup
    private lateinit var downloadRemainderButton: MaterialButton
    private lateinit var attachmentCallback: AttachmentViewCallback
    private lateinit var extraHeaderContainer: View
    private lateinit var showPicturesButton: MaterialButton

    private var isShowingProgress = false
    private var showPicturesButtonClicked = false
    private var renderPlainFormat = false

    private var showAccountIndicator = false

    private var messageCryptoPresenter: MessageCryptoPresenter? = null

    public override fun onFinishInflate() {
        super.onFinishInflate()

Review comment (suggestion):
suggestion: As you only need the `visualSettings.bodyContentType` here, you could inject directly the `DisplayVisualSettingsPreferenceManager` instead of the `GeneralSettingsManager`

Code after:
import com.fsck.k9.mail.Message
import com.fsck.k9.mailstore.AttachmentViewInfo
import com.fsck.k9.mailstore.MessageViewInfo
import com.fsck.k9.ui.R
import com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener
import com.fsck.k9.view.MessageHeader
import com.fsck.k9.view.ThemeUtils
import com.fsck.k9.view.ToolableViewAnimator
import com.google.android.material.button.MaterialButton
import com.google.android.material.textview.MaterialTextView
import net.thunderbird.core.android.account.LegacyAccountDto
import net.thunderbird.core.android.account.ShowPictures
import net.thunderbird.core.common.mail.EmailAddress
import net.thunderbird.core.common.mail.toEmailAddressOrNull
import net.thunderbird.core.preference.BodyContentType
import net.thunderbird.core.preference.display.visualSettings.DisplayVisualSettingsPreferenceManager
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class MessageTopView(
    context: Context,
    attrs: AttributeSet?,
) : LinearLayout(context, attrs), KoinComponent {

    private val contactRepository: ContactRepository by inject()
    private val visualSettingsPrefManager: DisplayVisualSettingsPreferenceManager by inject()

    private lateinit var layoutInflater: LayoutInflater

    private lateinit var viewAnimator: ToolableViewAnimator
    private lateinit var progressBar: ProgressBar
    private lateinit var progressText: MaterialTextView

    lateinit var messageHeaderView: MessageHeader

    private lateinit var containerView: ViewGroup
    private lateinit var downloadRemainderButton: MaterialButton
    private lateinit var attachmentCallback: AttachmentViewCallback
    private lateinit var extraHeaderContainer: View
    private lateinit var showPicturesButton: MaterialButton

    private var isShowingProgress = false
    private var showPicturesButtonClicked = false
    var renderPlainFormat = false

    private var showAccountIndicator = false

    private var messageCryptoPresenter: MessageCryptoPresenter? = null

    public override fun onFinishInflate() {
        super.onFinishInflate()