SortableTableView icon indicating copy to clipboard operation
SortableTableView copied to clipboard

Provide my own view for sortable_header.xml

Open captrespect opened this issue 8 years ago • 4 comments

Hello,

I'd like to be able to provide my own view for for the SortableTableHeaderView. Instead of the the little widget, I'd like to overlay the header when it's sorted. Unfortunately there isn't a way to override or inject anything in SortableTable to do this.

Do you think it'd be a good idea to allow SortableTableView to inject a custom content provider to inflate the headerContainerLayout in SortableTableHeaderView.renderHeaderViews()? I think we can also change the LinearLayout to a ViewGroup.

I'm thinking something like:

final ViewGroup headerContainerLayout = (ViewGroup) mHeaderContentProvider(adapter, this);

Then providing the appropriate setters on SortableTable and SortableTableHeaderView.

The the default provider would just inflate the current R.layout.sortable_header.

captrespect avatar Aug 09 '16 16:08 captrespect

Hi Jonathon,

die what use case do you need this feature? I don't understand what you mean with "overlay the header when it's sorted". Do you want to get rid of the "sorting indicators" and instead replace the full header of the sorted column?

Best regards, Ingo

ISchwarz23 avatar Aug 10 '16 17:08 ISchwarz23

Yeah our designs have a transparent image with an arrow on the top or bottom of the header. I was able to override the layout using a layout-v9 folder, but that seemed kinda hacky.

captrespect avatar Aug 10 '16 17:08 captrespect

So, instead of the arrows on the left of the header view you want to have them above and below the header view?

ISchwarz23 avatar Aug 10 '16 17:08 ISchwarz23

yeah, we overlay the entire header cell.

captrespect avatar Aug 11 '16 13:08 captrespect