Source:
<code>public void bind(int position) { UploadMediaDetail uploadMediaDetail = uploadMediaDetails.get(position); Timber.d("UploadMediaDetail is " + uploadMediaDetail); captionItemEditText.setText(uploadMediaDetail.getCaptionText()); descItemEditText.setText(uploadMediaDetail.getDescriptionText()); captionItemEditText.addTextChangedListener(new AbstractTextWatcher( value -> { <START> if (getAdapterPosition() == 0) { <END> eventListener.onPrimaryCaptionTextChange(value.length() != 0); } })); if (position == 0) { removeButton.setVisibility(View.GONE); captionInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM); captionInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default); captionInputLayout.setEndIconOnClickListener(v -> callback.showAlert(R.string.media_detail_caption, R.string.caption_info)); descInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM); descInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default); descInputLayout.setEndIconOnClickListener(v -> callback.showAlert(R.string.media_detail_description, R.string.description_info)); } else { removeButton.setVisibility(View.VISIBLE); captionInputLayout.setEndIconDrawable(null); descInputLayout.setEndIconDrawable(null); } removeButton.setOnClickListener(v -> removeDescription(uploadMediaDetail, getAdapterPosition())); captionItemEditText.addTextChangedListener(new AbstractTextWatcher( captionText -> uploadMediaDetails.get(getAdapterPosition()).setCaptionText(captionText))); initLanguageSpinner(position, uploadMediaDetail); descItemEditText.addTextChangedListener(new AbstractTextWatcher( descriptionText -> uploadMediaDetails.get(getAdapterPosition()).setDescriptionText(descriptionText))); initLanguageSpinner(position, uploadMediaDetail); if (uploadMediaDetail.isManuallyAdded()) { captionItemEditText.requestFocus(); } else { captionItemEditText.clearFocus(); } }</code><technical_language>position, need of getAdapterPosition calls</technical_language>

Target:
public void bind(int position) { UploadMediaDetail uploadMediaDetail = uploadMediaDetails.get(position); Timber.d("UploadMediaDetail is " + uploadMediaDetail); captionItemEditText.setText(uploadMediaDetail.getCaptionText()); descItemEditText.setText(uploadMediaDetail.getDescriptionText()); captionItemEditText.addTextChangedListener(new AbstractTextWatcher( value -> { if (position == 0) { eventListener.onPrimaryCaptionTextChange(value.length() != 0); } })); if (position == 0) { removeButton.setVisibility(View.GONE); captionInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM); captionInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default); captionInputLayout.setEndIconOnClickListener(v -> callback.showAlert(R.string.media_detail_caption, R.string.caption_info)); descInputLayout.setEndIconMode(TextInputLayout.END_ICON_CUSTOM); descInputLayout.setEndIconDrawable(R.drawable.mapbox_info_icon_default); descInputLayout.setEndIconOnClickListener(v -> callback.showAlert(R.string.media_detail_description, R.string.description_info)); } else { removeButton.setVisibility(View.VISIBLE); captionInputLayout.setEndIconDrawable(null); descInputLayout.setEndIconDrawable(null); } removeButton.setOnClickListener(v -> removeDescription(uploadMediaDetail, position)); captionItemEditText.addTextChangedListener(new AbstractTextWatcher( captionText -> uploadMediaDetails.get(position).setCaptionText(captionText))); initLanguageSpinner(position, uploadMediaDetail); descItemEditText.addTextChangedListener(new AbstractTextWatcher( descriptionText -> uploadMediaDetails.get(position).setDescriptionText(descriptionText))); initLanguageSpinner(position, uploadMediaDetail); if (uploadMediaDetail.isManuallyAdded()) { captionItemEditText.requestFocus(); } else { captionItemEditText.clearFocus(); } }