Merge pull request #10636 from t895/getBindingAdapterPosition

Android: Replace deprecated method calls for adapter position
This commit is contained in:
Mai M 2022-05-07 09:41:44 -04:00 committed by GitHub
commit 4b6a47396e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

View File

@ -59,7 +59,7 @@ public final class CheckBoxSettingViewHolder extends SettingViewHolder
mCheckbox.toggle();
getAdapter().onBooleanClick(mItem, getAdapterPosition(), mCheckbox.isChecked());
getAdapter().onBooleanClick(mItem, getBindingAdapterPosition(), mCheckbox.isChecked());
setStyle(mTextSettingName, mItem);
}

View File

@ -90,7 +90,7 @@ public final class FilePickerViewHolder extends SettingViewHolder
return;
}
int position = getAdapterPosition();
int position = getBindingAdapterPosition();
if (mFilePicker.getRequestType() == MainPresenter.REQUEST_DIRECTORY)
{
getAdapter().onFilePickerDirectoryClick(mItem, position);

View File

@ -61,7 +61,7 @@ public final class InputBindingSettingViewHolder extends SettingViewHolder
return;
}
getAdapter().onInputBindingClick(mItem, getAdapterPosition());
getAdapter().onInputBindingClick(mItem, getBindingAdapterPosition());
setStyle(mTextSettingName, mItem);
}

View File

@ -61,7 +61,7 @@ public class RumbleBindingViewHolder extends SettingViewHolder
return;
}
getAdapter().onInputBindingClick(mItem, getAdapterPosition());
getAdapter().onInputBindingClick(mItem, getBindingAdapterPosition());
setStyle(mTextSettingName, mItem);
}

View File

@ -102,7 +102,7 @@ public abstract class SettingViewHolder extends RecyclerView.ViewHolder
builder
.setPositiveButton(R.string.ok, (dialog, whichButton) ->
{
getAdapter().clearSetting(item, getAdapterPosition());
getAdapter().clearSetting(item, getBindingAdapterPosition());
bind(item);
Toast.makeText(context, R.string.setting_cleared, Toast.LENGTH_SHORT).show();
dialog.dismiss();

View File

@ -98,7 +98,7 @@ public final class SingleChoiceViewHolder extends SettingViewHolder
return;
}
int position = getAdapterPosition();
int position = getBindingAdapterPosition();
if (mItem instanceof SingleChoiceSetting)
{
getAdapter().onSingleChoiceClick((SingleChoiceSetting) mItem, position);

View File

@ -67,7 +67,7 @@ public final class SliderViewHolder extends SettingViewHolder
return;
}
getAdapter().onSliderClick(mItem, getAdapterPosition());
getAdapter().onSliderClick(mItem, getBindingAdapterPosition());
setStyle(mTextSettingName, mItem);
}