Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6a7cb9ed authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

refactor: rename accountChip to accountIndicator

parent 98d7c23c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ open class MessageList :
    private var messageListWasDisplayed = false
    private var viewSwitcher: ViewSwitcher? = null

    private val isShowAccountChip: Boolean
        get() = messageListFragment?.isShowAccountChip ?: true
    private val isShowAccountIndicator: Boolean
        get() = messageListFragment?.isShowAccountIndicator ?: true

    public override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
@@ -1106,7 +1106,7 @@ open class MessageList :
        } else {
            val fragment = MessageViewContainerFragment.newInstance(
                reference = messageReference,
                showAccountChip = isShowAccountChip,
                isShowAccountIndicator = isShowAccountIndicator,
            )
            supportFragmentManager.commitNow {
                replace(R.id.message_view_container, fragment, FRAGMENT_TAG_MESSAGE_VIEW_CONTAINER)
+4 −1
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ data class MessageListAppearance(
    val showContactPicture: Boolean,
    val showingThreadedList: Boolean,
    val backGroundAsReadIndicator: Boolean,
    val showAccountChip: Boolean,
    /**
     * Whether to show an account color indicator on the left side of the message item.
     */
    val showAccountIndicator: Boolean,
    val density: UiDensity,
)
+2 −2
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ class MessageListFragment :
            maybeHideFloatingActionButton()
        }

    val isShowAccountChip: Boolean
    val isShowAccountIndicator: Boolean
        get() = isUnifiedFolders || !isSingleAccountMode

    override fun onAttach(context: Context) {
@@ -785,7 +785,7 @@ class MessageListFragment :
            showingThreadedList = showingThreadedList,
            backGroundAsReadIndicator = generalSettingsManager
                .getConfig().display.visualSettings.isUseBackgroundAsUnreadIndicator,
            showAccountChip = isShowAccountChip,
            showAccountIndicator = isShowAccountIndicator,
            density = K9.messageListDensity,
        )

+5 −5
Original line number Diff line number Diff line
@@ -89,10 +89,10 @@ class MessageViewHolder(
                threadCount = displayThreadCount,
            )

            if (appearance.showAccountChip) {
                val accountChipDrawable = chipView.drawable.mutate()
                DrawableCompat.setTint(accountChipDrawable, account.profile.color)
                chipView.setImageDrawable(accountChipDrawable)
            if (appearance.showAccountIndicator) {
                val accountIndicatorDrawable = chipView.drawable.mutate()
                DrawableCompat.setTint(accountIndicatorDrawable, account.profile.color)
                chipView.setImageDrawable(accountIndicatorDrawable)
            }

            if (appearance.stars) {
@@ -315,7 +315,7 @@ class MessageViewHolder(
                holder.contactPictureView.isVisible = false
            }

            holder.chipView.isVisible = appearance.showAccountChip
            holder.chipView.isVisible = appearance.showAccountIndicator

            // 1 preview line is needed even if it is set to 0, because subject is part of the same text view
            holder.previewView.maxLines = max(appearance.previewLines, 1)
+4 −4
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ class MessageTopView(
    private var isShowingProgress = false
    private var showPicturesButtonClicked = false

    private var showAccountChip = false
    private var showAccountIndicator = false

    private var messageCryptoPresenter: MessageCryptoPresenter? = null

@@ -83,8 +83,8 @@ class MessageTopView(
        hideHeaderView()
    }

    fun setShowAccountChip(showAccountChip: Boolean) {
        this.showAccountChip = showAccountChip
    fun setShowAccountIndicator(showAccountIndicator: Boolean) {
        this.showAccountIndicator = showAccountIndicator
    }

    private fun setShowPicturesButtonListener() {
@@ -197,7 +197,7 @@ class MessageTopView(
    }

    fun setHeaders(message: Message?, account: LegacyAccountDto?, showStar: Boolean) {
        messageHeaderView.populate(message, account, showStar, showAccountChip)
        messageHeaderView.populate(message, account, showStar, showAccountIndicator)
        messageHeaderView.visibility = VISIBLE
    }

Loading