Merge pull request #10636 from t895/getBindingAdapterPosition
Android: Replace deprecated method calls for adapter position
This commit is contained in:
commit
4b6a47396e
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue