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(); mCheckbox.toggle();
getAdapter().onBooleanClick(mItem, getAdapterPosition(), mCheckbox.isChecked()); getAdapter().onBooleanClick(mItem, getBindingAdapterPosition(), mCheckbox.isChecked());
setStyle(mTextSettingName, mItem); setStyle(mTextSettingName, mItem);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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