Open smedic opened 5 years ago
There is no shortcut but:
.withAdapterSetter(new ChooserDialog.AdapterSetter() {
@Override
public void apply(DirAdapter adapter) {
// since 1.1.17
adapter.overrideGetView((file, isSelected, isFocused, convertView, parent, inflater) -> {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.li_row, parent, false);
...
return view;
}
}
})
How to use that? To set custom layout for every row, right?
no bother so much:
adapter.overrideGetView((file, isSelected, isFocused, convertView, parent, inflater) -> {
ViewGroup view = (ViewGroup) inflater.inflate(com.obsez.filechooser.R.layout.li_row, parent, false);
// ...
// set filename, isSelected, isFocused to control views
// ...
ImageView iv = view.findViewById(com.obsez.filechooser.R.layout.icon) // ?? find the right res id from xml source file pls.
// ...generate thumb image and set it to iv
return view;
}
pls refer the redIds from the source xml of R.layout.li_row
.
sorry for the simple reply from phone editor.
@smedic, if the only thing you want to change are the icons, you can copy the source code of getView in DirAdapter here
Thanks for prompt answers, I ll try this :)
Is it possible to implement thumbnails for images? On left side, there can be a thumbnail instead of small file icon.