Skip to content

Commit

Permalink
NT-2161:UI – Not-a-backer-anymore taking the space of the original co…
Browse files Browse the repository at this point in the history
…mment (#1342)

* Fix extra space in case cancaled pledge  comment

* Re record the screen shots as ui changes

* Add extra space to show comment

* Update ui test

* Update test case
  • Loading branch information
hadia committed Aug 3, 2021
1 parent d9e6734 commit 3e70dcf
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 14 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -76,8 +76,9 @@ class CommentCardShotTest : ScreenshotTest {
fun commentCardScreenshotTest_CANCELED_PLEDGE_MESSAGE() {
commentCard.setCommentCardStatus(CommentCardStatus.CANCELED_PLEDGE_MESSAGE)
commentCard.setCancelPledgeMessage(
getInstrumentation().targetContext.getString(R.string.this_person_canceled_pledge) +
getInstrumentation().targetContext.getString(R.string.show_comment)

getInstrumentation().targetContext.getString(R.string.this_person_canceled_pledge).plus(" ").plus(getInstrumentation().targetContext.getString(R.string.show_comment))

)
compareScreenshot(commentCard)
}
Expand Down
Expand Up @@ -155,8 +155,7 @@ class CommentCardViewHolder(
)

binding.commentsCardView.setCancelPledgeMessage(
context().getString(R.string.this_person_canceled_pledge) +
context().getString(R.string.show_comment)
context().getString(R.string.this_person_canceled_pledge).plus(" ").plus(context().getString(R.string.show_comment))
)

if (isReply) {
Expand Down
Expand Up @@ -26,8 +26,7 @@ class RootCommentViewHolder(
if (it == CommentCardStatus.CANCELED_PLEDGE_MESSAGE) {
binding.commentsCardView.setCommentCardStatus(it)
binding.commentsCardView.setCancelPledgeMessage(
context().getString(R.string.this_person_canceled_pledge) +
context().getString(R.string.show_comment)
context().getString(R.string.this_person_canceled_pledge).plus(" ").plus(context().getString(R.string.show_comment))
)
binding.commentsCardView.setCommentCardClickedListener(object :
OnCommentCardClickedListener {
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/com/kickstarter/ui/views/CommentCard.kt
Expand Up @@ -9,7 +9,6 @@ import android.view.View.OnClickListener
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.content.withStyledAttributes
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import com.kickstarter.R
import com.kickstarter.databinding.CommentCardBinding
Expand Down Expand Up @@ -150,10 +149,6 @@ class CommentCard @JvmOverloads constructor(
cardCommentStatus == CommentCardStatus.TRYING_TO_POST ||
cardCommentStatus == CommentCardStatus.CANCELED_PLEDGE_COMMENT

if (cardCommentStatus == CommentCardStatus.DELETED_COMMENT || cardCommentStatus == CommentCardStatus.CANCELED_PLEDGE_MESSAGE) {
binding.commentBody.isInvisible = true
}

binding.commentDeletedMessageGroup.isVisible =
cardCommentStatus == CommentCardStatus.DELETED_COMMENT

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/comment_card.xml
Expand Up @@ -105,7 +105,7 @@
android:text="@string/View_replies"
app:layout_constraintBottom_toTopOf="@+id/reply_button"
app:layout_goneMarginBottom="@dimen/grid_3"
android:layout_marginTop="@dimen/grid_3_half"
app:layout_goneMarginTop="@dimen/grid_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

Expand Down
4 changes: 2 additions & 2 deletions app/src/test/java/com/kickstarter/ui/view/CommentCardTest.kt
Expand Up @@ -6,7 +6,7 @@ import androidx.appcompat.widget.AppCompatButton
import androidx.appcompat.widget.AppCompatTextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.Group
import androidx.core.view.isInvisible
import androidx.core.view.isGone
import androidx.core.view.isVisible
import com.kickstarter.KSRobolectricTestCase
import com.kickstarter.R
Expand Down Expand Up @@ -47,7 +47,7 @@ class CommentCardTest : KSRobolectricTestCase() {
@Test
fun testDeleteCommentStatus() {
commentCard.setCommentCardStatus(CommentCardStatus.DELETED_COMMENT)
assertTrue(commentBody.isInvisible)
assertTrue(commentBody.isGone)
assertFalse(retryButton.isVisible)
assertFalse(replyButton.isVisible)
assertTrue(commentDeletedMessageGroup.isVisible)
Expand Down

0 comments on commit 3e70dcf

Please sign in to comment.