Android: Call notifyItemChanged after file picker
This commit is contained in:
parent
62e6bedd25
commit
713d309386
|
@ -279,16 +279,18 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
dialog.show();
|
||||
}
|
||||
|
||||
public void onFilePickerDirectoryClick(SettingsItem item)
|
||||
public void onFilePickerDirectoryClick(SettingsItem item, int position)
|
||||
{
|
||||
mClickedItem = item;
|
||||
mClickedPosition = position;
|
||||
|
||||
FileBrowserHelper.openDirectoryPicker(mView.getActivity(), FileBrowserHelper.GAME_EXTENSIONS);
|
||||
}
|
||||
|
||||
public void onFilePickerFileClick(SettingsItem item)
|
||||
public void onFilePickerFileClick(SettingsItem item, int position)
|
||||
{
|
||||
mClickedItem = item;
|
||||
mClickedPosition = position;
|
||||
FilePicker filePicker = (FilePicker) item;
|
||||
|
||||
switch (filePicker.getRequestType())
|
||||
|
@ -320,7 +322,10 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
FilePicker filePicker = (FilePicker) mClickedItem;
|
||||
|
||||
if (!filePicker.getSelectedValue(mView.getSettings()).equals(selectedFile))
|
||||
{
|
||||
notifyItemChanged(mClickedPosition);
|
||||
mView.onSettingChanged();
|
||||
}
|
||||
|
||||
filePicker.setSelectedValue(mView.getSettings(), selectedFile);
|
||||
|
||||
|
|
|
@ -71,13 +71,14 @@ public final class FilePickerViewHolder extends SettingViewHolder
|
|||
return;
|
||||
}
|
||||
|
||||
int position = getAdapterPosition();
|
||||
if (mFilePicker.getRequestType() == MainPresenter.REQUEST_DIRECTORY)
|
||||
{
|
||||
getAdapter().onFilePickerDirectoryClick(mItem);
|
||||
getAdapter().onFilePickerDirectoryClick(mItem, position);
|
||||
}
|
||||
else
|
||||
{
|
||||
getAdapter().onFilePickerFileClick(mItem);
|
||||
getAdapter().onFilePickerFileClick(mItem, position);
|
||||
}
|
||||
|
||||
setStyle(mTextSettingName, mItem);
|
||||
|
|
Loading…
Reference in New Issue