From d6fa715d8dd8d8012833451a3e5ab92c58234b0e Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 26 Apr 2024 13:45:23 +0300 Subject: [PATCH] Refactor CommentUserNoteBlock to Kotlin --- .../NotificationsDetailListFragment.kt | 20 +- .../blocks/CommentUserNoteBlock.java | 292 ------------------ .../blocks/CommentUserNoteBlock.kt | 243 +++++++++++++++ .../ui/notifications/blocks/UserNoteBlock.kt | 2 +- 4 files changed, 255 insertions(+), 302 deletions(-) delete mode 100644 WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.java create mode 100644 WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.kt diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt index 0d6b7f79dbc4..975c362ed927 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt @@ -321,15 +321,17 @@ class NotificationsDetailListFragment : ListFragment(), NotificationFragment { } } } - private val mOnGravatarClickedListener = OnGravatarClickedListener { siteId, _, siteUrl -> - if (!isAdded || activity !is NotificationsDetailActivity) { - return@OnGravatarClickedListener - } - val detailActivity = activity as NotificationsDetailActivity - if (siteId == 0L && !TextUtils.isEmpty(siteUrl)) { - detailActivity.showWebViewActivityForUrl(siteUrl) - } else if (siteId != 0L) { - detailActivity.showBlogPreviewActivity(siteId, note?.isFollowType) + private val mOnGravatarClickedListener = object : OnGravatarClickedListener { + override fun onGravatarClicked(siteId: Long, userId: Long, siteUrl: String?) { + if (!isAdded || activity !is NotificationsDetailActivity) { + return + } + val detailActivity = activity as NotificationsDetailActivity + if (siteId == 0L && !TextUtils.isEmpty(siteUrl)) { + detailActivity.showWebViewActivityForUrl(siteUrl) + } else if (siteId != 0L) { + detailActivity.showBlogPreviewActivity(siteId, note?.isFollowType) + } } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.java b/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.java deleted file mode 100644 index d655626e83f3..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.java +++ /dev/null @@ -1,292 +0,0 @@ -package org.wordpress.android.ui.notifications.blocks; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.text.Spannable; -import android.text.SpannableStringBuilder; -import android.text.TextUtils; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.core.text.HtmlCompat; -import androidx.core.view.ViewCompat; - -import org.wordpress.android.R; -import org.wordpress.android.fluxc.model.CommentStatus; -import org.wordpress.android.fluxc.tools.FormattableContent; -import org.wordpress.android.ui.notifications.utils.NotificationsUtilsWrapper; -import org.wordpress.android.util.extensions.ContextExtensionsKt; -import org.wordpress.android.util.DateTimeUtils; -import org.wordpress.android.util.WPAvatarUtils; -import org.wordpress.android.util.image.ImageManager; -import org.wordpress.android.util.image.ImageType; - -// A user block with slightly different formatting for display in a comment detail -public class CommentUserNoteBlock extends UserNoteBlock { - private static final String EMPTY_LINE = "\n\t"; - private static final String DOUBLE_EMPTY_LINE = "\n\t\n\t"; - private CommentStatus mCommentStatus = CommentStatus.APPROVED; - private int mNormalBackgroundColor; - private int mIndentedLeftPadding; - private final Context mContext; - private boolean mStatusChanged; - - private FormattableContent mCommentData; - private final long mTimestamp; - - private CommentUserNoteBlockHolder mNoteBlockHolder; - - public interface OnCommentStatusChangeListener { - void onCommentStatusChanged(CommentStatus newStatus); - } - - public CommentUserNoteBlock(Context context, FormattableContent noteObject, - FormattableContent commentTextBlock, - long timestamp, OnNoteBlockTextClickListener onNoteBlockTextClickListener, - OnGravatarClickedListener onGravatarClickedListener, - ImageManager imageManager, NotificationsUtilsWrapper notificationsUtilsWrapper) { - super(context, noteObject, onNoteBlockTextClickListener, onGravatarClickedListener, imageManager, - notificationsUtilsWrapper); - mContext = context; - mCommentData = commentTextBlock; - mTimestamp = timestamp; - - if (context != null) { - setAvatarSize(context.getResources().getDimensionPixelSize(R.dimen.avatar_sz_small)); - } - } - - @Override - public BlockType getBlockType() { - return BlockType.USER_COMMENT; - } - - @Override - public int getLayoutResourceId() { - return R.layout.note_block_comment_user; - } - - @SuppressLint("ClickableViewAccessibility") // fixed by setting a click listener to avatarImageView - @Override - public View configureView(View view) { - mNoteBlockHolder = (CommentUserNoteBlockHolder) view.getTag(); - - setUserName(); - setUserCommentAgo(); - setUserCommentSite(); - setUserAvatar(); - setUserComment(); - setCommentStatus(view); - - return view; - } - - private void setUserName() { - mNoteBlockHolder.mNameTextView.setText( - HtmlCompat.fromHtml( - "" + getNoteText().toString() + "", - HtmlCompat.FROM_HTML_MODE_LEGACY - ) - ); - } - - private void setUserCommentAgo() { - mNoteBlockHolder.mAgoTextView.setText(DateTimeUtils.timeSpanFromTimestamp(getTimestamp(), - mNoteBlockHolder.mAgoTextView.getContext())); - } - - private void setUserCommentSite() { - if (!TextUtils.isEmpty(getMetaHomeTitle()) || !TextUtils.isEmpty(getMetaSiteUrl())) { - mNoteBlockHolder.mBulletTextView.setVisibility(View.VISIBLE); - mNoteBlockHolder.mSiteTextView.setVisibility(View.VISIBLE); - if (!TextUtils.isEmpty(getMetaHomeTitle())) { - mNoteBlockHolder.mSiteTextView.setText(getMetaHomeTitle()); - } else { - mNoteBlockHolder.mSiteTextView.setText(getMetaSiteUrl().replace("http://", "").replace("https://", "")); - } - } else { - mNoteBlockHolder.mBulletTextView.setVisibility(View.GONE); - mNoteBlockHolder.mSiteTextView.setVisibility(View.GONE); - } - mNoteBlockHolder.mSiteTextView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); - } - - private void setUserAvatar() { - String imageUrl = ""; - if (hasImageMediaItem()) { - imageUrl = WPAvatarUtils.rewriteAvatarUrl(getNoteMediaItem().getUrl(), getAvatarSize()); - mNoteBlockHolder.mAvatarImageView.setContentDescription( - mContext.getString(R.string.profile_picture, getNoteText().toString()) - ); - if (!TextUtils.isEmpty(getUserUrl())) { - mNoteBlockHolder.mAvatarImageView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - showBlogPreview(); - } - }); - //noinspection AndroidLintClickableViewAccessibility - mNoteBlockHolder.mAvatarImageView.setOnTouchListener(mOnGravatarTouchListener); - } else { - mNoteBlockHolder.mAvatarImageView.setOnClickListener(null); - //noinspection AndroidLintClickableViewAccessibility - mNoteBlockHolder.mAvatarImageView.setOnTouchListener(null); - mNoteBlockHolder.mAvatarImageView.setContentDescription(null); - } - } else { - mNoteBlockHolder.mAvatarImageView.setOnClickListener(null); - //noinspection AndroidLintClickableViewAccessibility - mNoteBlockHolder.mAvatarImageView.setOnTouchListener(null); - mNoteBlockHolder.mAvatarImageView.setContentDescription(null); - } - mImageManager.loadIntoCircle(mNoteBlockHolder.mAvatarImageView, ImageType.AVATAR_WITH_BACKGROUND, imageUrl); - } - - private void setUserComment() { - Spannable spannable = getCommentTextOfNotification(mNoteBlockHolder); - NoteBlockClickableSpan[] spans = spannable.getSpans(0, spannable.length(), NoteBlockClickableSpan.class); - for (NoteBlockClickableSpan span : spans) { - span.enableColors(mContext); - } - - mNoteBlockHolder.mCommentTextView.setText(spannable); - } - - private void setCommentStatus(@NonNull final View view) { - // Change display based on comment status and type: - // 1. Comment replies are indented and have a 'pipe' background - // 2. Unapproved comments have different background and text color - int paddingStart = ViewCompat.getPaddingStart(view); - int paddingTop = view.getPaddingTop(); - int paddingEnd = ViewCompat.getPaddingEnd(view); - int paddingBottom = view.getPaddingBottom(); - if (mCommentStatus == CommentStatus.UNAPPROVED) { - if (hasCommentNestingLevel()) { - paddingStart = mIndentedLeftPadding; - view.setBackgroundResource(R.drawable.bg_rectangle_warning_surface_with_padding); - } else { - view.setBackgroundResource(R.drawable.bg_rectangle_warning_surface); - } - - mNoteBlockHolder.mDividerView.setVisibility(View.INVISIBLE); - } else { - if (hasCommentNestingLevel()) { - paddingStart = mIndentedLeftPadding; - view.setBackgroundResource(R.drawable.comment_reply_background); - mNoteBlockHolder.mDividerView.setVisibility(View.INVISIBLE); - } else { - view.setBackgroundColor(mNormalBackgroundColor); - mNoteBlockHolder.mDividerView.setVisibility(View.VISIBLE); - } - } - ViewCompat.setPaddingRelative(view, paddingStart, paddingTop, paddingEnd, paddingBottom); - // If status was changed, fade in the view - if (mStatusChanged) { - mStatusChanged = false; - view.setAlpha(0.4f); - view.animate().alpha(1.0f).start(); - } - } - - private Spannable getCommentTextOfNotification(CommentUserNoteBlockHolder noteBlockHolder) { - SpannableStringBuilder builder = mNotificationsUtilsWrapper - .getSpannableContentForRanges(mCommentData, - noteBlockHolder.mCommentTextView, getOnNoteBlockTextClickListener(), false); - return removeNewLineInList(builder); - } - - private Spannable removeNewLineInList(SpannableStringBuilder builder) { - String content = builder.toString(); - while (content.contains(DOUBLE_EMPTY_LINE)) { - int doubleSpaceIndex = content.indexOf(DOUBLE_EMPTY_LINE); - builder.replace(doubleSpaceIndex, doubleSpaceIndex + DOUBLE_EMPTY_LINE.length(), EMPTY_LINE); - content = builder.toString(); - } - return builder; - } - - private long getTimestamp() { - return mTimestamp; - } - - private boolean hasCommentNestingLevel() { - return mCommentData.getNestLevel() != null && mCommentData.getNestLevel() > 0; - } - - @Override - public Object getViewHolder(View view) { - return new CommentUserNoteBlockHolder(view); - } - - private class CommentUserNoteBlockHolder { - private final ImageView mAvatarImageView; - private final TextView mNameTextView; - private final TextView mAgoTextView; - private final TextView mBulletTextView; - private final TextView mSiteTextView; - private final TextView mCommentTextView; - private final View mDividerView; - - CommentUserNoteBlockHolder(View view) { - mNameTextView = view.findViewById(R.id.user_name); - mAgoTextView = view.findViewById(R.id.user_comment_ago); - mAgoTextView.setVisibility(View.VISIBLE); - mBulletTextView = view.findViewById(R.id.user_comment_bullet); - mSiteTextView = view.findViewById(R.id.user_comment_site); - mCommentTextView = view.findViewById(R.id.user_comment); - mCommentTextView.setMovementMethod(new NoteBlockLinkMovementMethod()); - mAvatarImageView = view.findViewById(R.id.user_avatar); - mDividerView = view.findViewById(R.id.divider_view); - - mSiteTextView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (getOnNoteBlockTextClickListener() != null) { - getOnNoteBlockTextClickListener().showSitePreview(getMetaSiteId(), getMetaSiteUrl()); - } - } - }); - - // show all comments on this post when user clicks the comment text - mCommentTextView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (getOnNoteBlockTextClickListener() != null) { - getOnNoteBlockTextClickListener().showReaderPostComments(); - } - } - }); - } - } - - public void configureResources(Context context) { - if (context == null) { - return; - } - - mNormalBackgroundColor = ContextExtensionsKt.getColorFromAttribute( - context, - com.google.android.material.R.attr.colorSurface - ); - // Double margin_extra_large for increased indent in comment replies - mIndentedLeftPadding = context.getResources().getDimensionPixelSize(R.dimen.margin_extra_large) * 2; - } - - private final OnCommentStatusChangeListener mOnCommentChangedListener = new OnCommentStatusChangeListener() { - @Override - public void onCommentStatusChanged(CommentStatus newStatus) { - mCommentStatus = newStatus; - mStatusChanged = true; - } - }; - - public void setCommentStatus(CommentStatus status) { - mCommentStatus = status; - } - - public OnCommentStatusChangeListener getOnCommentChangeListener() { - return mOnCommentChangedListener; - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.kt new file mode 100644 index 000000000000..28c4e5db7dee --- /dev/null +++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/CommentUserNoteBlock.kt @@ -0,0 +1,243 @@ +package org.wordpress.android.ui.notifications.blocks + +import android.annotation.SuppressLint +import android.content.Context +import android.text.Spannable +import android.text.SpannableStringBuilder +import android.text.TextUtils +import android.view.View +import android.widget.ImageView +import android.widget.TextView +import androidx.core.text.HtmlCompat +import androidx.core.view.ViewCompat +import org.wordpress.android.R +import org.wordpress.android.fluxc.model.CommentStatus +import org.wordpress.android.fluxc.tools.FormattableContent +import org.wordpress.android.ui.notifications.utils.NotificationsUtilsWrapper +import org.wordpress.android.util.DateTimeUtils +import org.wordpress.android.util.WPAvatarUtils +import org.wordpress.android.util.extensions.getColorFromAttribute +import org.wordpress.android.util.image.ImageManager +import org.wordpress.android.util.image.ImageType + +// A user block with slightly different formatting for display in a comment detail +@Suppress("LongParameterList") +class CommentUserNoteBlock( + private val mContext: Context?, noteObject: FormattableContent, + private val mCommentData: FormattableContent?, + private val timestamp: Long, onNoteBlockTextClickListener: OnNoteBlockTextClickListener?, + onGravatarClickedListener: OnGravatarClickedListener?, + imageManager: ImageManager, + notificationsUtilsWrapper: NotificationsUtilsWrapper +) : UserNoteBlock( + mContext, noteObject, onNoteBlockTextClickListener, onGravatarClickedListener, imageManager, + notificationsUtilsWrapper +) { + private var mCommentStatus = CommentStatus.APPROVED + private var mNormalBackgroundColor = 0 + private var mIndentedLeftPadding = 0 + private var mStatusChanged = false + private var mNoteBlockHolder: CommentUserNoteBlockHolder? = null + + override val blockType: BlockType + get() = BlockType.USER_COMMENT + override val layoutResourceId: Int + get() = R.layout.note_block_comment_user + + init { + avatarSize = mContext?.resources?.getDimensionPixelSize(R.dimen.avatar_sz_small) ?: 0 + } + + interface OnCommentStatusChangeListener { + fun onCommentStatusChanged(newStatus: CommentStatus) + } + + @SuppressLint("ClickableViewAccessibility") // fixed by setting a click listener to avatarImageView + override fun configureView(view: View): View { + mNoteBlockHolder = view.tag as CommentUserNoteBlockHolder + setUserName() + setUserCommentAgo() + setUserCommentSite() + setUserAvatar() + setUserComment() + setCommentStatus(view) + return view + } + + private fun setUserName() { + mNoteBlockHolder?.mNameTextView?.text = HtmlCompat.fromHtml( + "$noteText", + HtmlCompat.FROM_HTML_MODE_LEGACY + ) + } + + private fun setUserCommentAgo() { + mNoteBlockHolder?.mAgoTextView?.text = DateTimeUtils.timeSpanFromTimestamp( + timestamp, + mNoteBlockHolder?.mAgoTextView?.context + ) + } + + private fun setUserCommentSite() { + if (!TextUtils.isEmpty(metaHomeTitle) || !TextUtils.isEmpty(metaSiteUrl)) { + mNoteBlockHolder?.mBulletTextView?.visibility = View.VISIBLE + mNoteBlockHolder?.mSiteTextView?.visibility = View.VISIBLE + if (!TextUtils.isEmpty(metaHomeTitle)) { + mNoteBlockHolder?.mSiteTextView?.text = metaHomeTitle + } else { + mNoteBlockHolder?.mSiteTextView?.text = + metaSiteUrl?.replace("http://", "")?.replace("https://", "") + } + } else { + mNoteBlockHolder?.mBulletTextView?.visibility = View.GONE + mNoteBlockHolder?.mSiteTextView?.visibility = View.GONE + } + mNoteBlockHolder?.mSiteTextView?.importantForAccessibility = + View.IMPORTANT_FOR_ACCESSIBILITY_NO + } + + @SuppressLint("ClickableViewAccessibility") + private fun setUserAvatar() { + var imageUrl = "" + if (hasImageMediaItem()) { + noteMediaItem?.url?.let { imageUrl = WPAvatarUtils.rewriteAvatarUrl(it, avatarSize) } + mNoteBlockHolder?.mAvatarImageView?.contentDescription = + mContext?.getString(R.string.profile_picture, noteText.toString()) + if (!TextUtils.isEmpty(userUrl)) { + mNoteBlockHolder?.mAvatarImageView?.setOnClickListener { showBlogPreview() } + mNoteBlockHolder?.mAvatarImageView?.setOnTouchListener(mOnGravatarTouchListener) + } else { + mNoteBlockHolder?.mAvatarImageView?.setOnClickListener(null) + mNoteBlockHolder?.mAvatarImageView?.setOnTouchListener(null) + mNoteBlockHolder?.mAvatarImageView?.contentDescription = null + } + } else { + mNoteBlockHolder?.mAvatarImageView?.setOnClickListener(null) + mNoteBlockHolder?.mAvatarImageView?.setOnTouchListener(null) + mNoteBlockHolder?.mAvatarImageView?.contentDescription = null + } + mNoteBlockHolder?.mAvatarImageView?.let { + mImageManager.loadIntoCircle(it, ImageType.AVATAR_WITH_BACKGROUND, imageUrl) + } + } + + private fun setUserComment() { + val spannable = getCommentTextOfNotification(mNoteBlockHolder) + val spans = spannable.getSpans(0, spannable.length, NoteBlockClickableSpan::class.java) + mContext?.let { + for (span in spans) { + span.enableColors(it) + } + } + mNoteBlockHolder?.mCommentTextView?.text = spannable + } + + @Suppress("MagicNumber") + private fun setCommentStatus(view: View) { + // Change display based on comment status and type: + // 1. Comment replies are indented and have a 'pipe' background + // 2. Unapproved comments have different background and text color + var paddingStart = ViewCompat.getPaddingStart(view) + val paddingTop = view.paddingTop + val paddingEnd = ViewCompat.getPaddingEnd(view) + val paddingBottom = view.paddingBottom + if (mCommentStatus == CommentStatus.UNAPPROVED) { + if (hasCommentNestingLevel()) { + paddingStart = mIndentedLeftPadding + view.setBackgroundResource(R.drawable.bg_rectangle_warning_surface_with_padding) + } else { + view.setBackgroundResource(R.drawable.bg_rectangle_warning_surface) + } + mNoteBlockHolder?.mDividerView?.visibility = View.INVISIBLE + } else { + if (hasCommentNestingLevel()) { + paddingStart = mIndentedLeftPadding + view.setBackgroundResource(R.drawable.comment_reply_background) + mNoteBlockHolder?.mDividerView?.visibility = View.INVISIBLE + } else { + view.setBackgroundColor(mNormalBackgroundColor) + mNoteBlockHolder?.mDividerView?.visibility = View.VISIBLE + } + } + ViewCompat.setPaddingRelative(view, paddingStart, paddingTop, paddingEnd, paddingBottom) + // If status was changed, fade in the view + if (mStatusChanged) { + mStatusChanged = false + view.alpha = 0.4f + view.animate().alpha(1.0f).start() + } + } + + private fun getCommentTextOfNotification(noteBlockHolder: CommentUserNoteBlockHolder?): Spannable { + val builder = mNotificationsUtilsWrapper.getSpannableContentForRanges( + mCommentData, + noteBlockHolder?.mCommentTextView, + onNoteBlockTextClickListener, + false + ) + return removeNewLineInList(builder) + } + + private fun removeNewLineInList(builder: SpannableStringBuilder): Spannable { + var content = builder.toString() + while (content.contains(DOUBLE_EMPTY_LINE)) { + val doubleSpaceIndex = content.indexOf(DOUBLE_EMPTY_LINE) + builder.replace( + doubleSpaceIndex, + doubleSpaceIndex + DOUBLE_EMPTY_LINE.length, + EMPTY_LINE + ) + content = builder.toString() + } + return builder + } + + private fun hasCommentNestingLevel(): Boolean = mCommentData?.nestLevel?.let { return it > 0 } ?: false + + override fun getViewHolder(view: View): Any = CommentUserNoteBlockHolder(view) + + private inner class CommentUserNoteBlockHolder constructor(view: View) { + val mAvatarImageView: ImageView = view.findViewById(R.id.user_avatar) + val mNameTextView: TextView = view.findViewById(R.id.user_name) + val mBulletTextView: TextView = view.findViewById(R.id.user_comment_bullet) + val mDividerView: View = view.findViewById(R.id.divider_view) + val mAgoTextView: TextView = view.findViewById(R.id.user_comment_ago).apply { + visibility = View.VISIBLE + } + val mCommentTextView: TextView = view.findViewById(R.id.user_comment).apply { + movementMethod = NoteBlockLinkMovementMethod() + setOnClickListener { + // show all comments on this post when user clicks the comment text + onNoteBlockTextClickListener?.showReaderPostComments() + } + } + val mSiteTextView: TextView = view.findViewById(R.id.user_comment_site).apply { + setOnClickListener { + onNoteBlockTextClickListener?.showSitePreview(metaSiteId, metaSiteUrl) + } + } + } + + fun configureResources(context: Context?) { + mNormalBackgroundColor = context?.getColorFromAttribute(com.google.android.material.R.attr.colorSurface) ?: 0 + // Double margin_extra_large for increased indent in comment replies + mIndentedLeftPadding = (context?.resources?.getDimensionPixelSize(R.dimen.margin_extra_large) ?: 0) * 2 + } + + val onCommentChangeListener: OnCommentStatusChangeListener = + object : OnCommentStatusChangeListener { + override fun onCommentStatusChanged(newStatus: CommentStatus) { + mCommentStatus = newStatus + mStatusChanged = true + } + } + + fun setCommentStatus(status: CommentStatus) { + mCommentStatus = status + } + + companion object { + private const val EMPTY_LINE = "\n\t" + private const val DOUBLE_EMPTY_LINE = "\n\t\n\t" + } +} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/UserNoteBlock.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/UserNoteBlock.kt index 2178be98fe1d..738283e2d486 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/UserNoteBlock.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/blocks/UserNoteBlock.kt @@ -33,7 +33,7 @@ open class UserNoteBlock( notificationsUtilsWrapper: NotificationsUtilsWrapper ) : NoteBlock(noteObject, imageManager, notificationsUtilsWrapper, onNoteBlockTextClickListener) { private val mGravatarClickedListener: OnGravatarClickedListener? - protected val avatarSize: Int + var avatarSize: Int override val blockType: BlockType get() = BlockType.USER