Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NT-2171]: Position of item on ViewHolder #1354

Merged
merged 61 commits into from Aug 12, 2021

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented Aug 10, 2021

📲 What

  • Retrieved the position of the item via getAbsoluteAdapterPosition
  • No need to modify the bindData(data: Any?) as we have available the previously mentioned function
  • There was a duplicated CommentExt I gather together the comment extension in just one.
  • Modified extension methods
    Comment.updateCommentAfterSuccessfulPost and fun Comment.updateCommentFailedToPost to receive as parameter the position to update in the comment list.
  • The callback fun onCommentPostedSuccessFully(comment: Comment) and fun onCommentPostedFailed(comment: Comment) now get the position as parameter as well.

🤔 Why

  • To avoid any search on the comments list for the specific comment, the callbacks are given now the position of that item on the recyclerView.

🛠 How

👀 See

  • No user facing changes
    | | |

📋 QA

  • Try the to post comments without internet to have the error state on RootComments and Threads, everything should work as usual.

Story 📖

NT-2171

hadia added 30 commits August 2, 2021 21:35
@codecov
Copy link

codecov bot commented Aug 10, 2021

Codecov Report

Merging #1354 (ba6bdd2) into master (3b083a4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1354   +/-   ##
=========================================
  Coverage     74.16%   74.16%           
  Complexity      743      743           
=========================================
  Files           221      221           
  Lines          6669     6669           
  Branches        409      409           
=========================================
  Hits           4946     4946           
  Misses         1584     1584           
  Partials        139      139           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b083a4...ba6bdd2. Read the comment docs.

Copy link
Contributor

@hadia hadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Arkariang Arkariang requested a review from hadia August 11, 2021 17:45
@Arkariang Arkariang changed the title Imartin/nt 2171 send position to view holder [NT-2171]: Position of item on ViewHolder Aug 11, 2021
@@ -111,12 +111,12 @@ class CommentCardViewHolder(
this.vm.outputs.isSuccessfullyPosted()
.compose(bindToLifecycle())
.compose(Transformers.observeForUI())
.subscribe { this.delegate.onCommentPostedSuccessFully(it) }
.subscribe { this.delegate.onCommentPostedSuccessFully(it, absoluteAdapterPosition) }
Copy link
Contributor Author

@Arkariang Arkariang Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arkariang Arkariang merged commit 3449c33 into master Aug 12, 2021
@Arkariang Arkariang deleted the imartin/NT-2171-send-position-to-viewHolder branch August 12, 2021 15:48
Arkariang added a commit that referenced this pull request Aug 12, 2021
…tin/prepare-for-arctic-fox

* 'master' of github.com:kickstarter/android-oss:
  [NT-2171]: Position of item on ViewHolder (#1354)
  Fix shipping isssue (#1356)
  NT-2178 :💥 – Posting comment on update (#1355)
  [no-jira]: remove 3 random failing screenshot test (#1359)
Arkariang added a commit that referenced this pull request Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants