-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
Looks good, but I don't think the |
I agree with @reisub Do we have a removeHeader/Footer methods? If not I think we should have it. There could be a need to remove it after inital set, do you agree? |
Or maybe we could remove by setting it to null. Here we should take a look
at the listview API since it has similar features.
On Fri, Feb 24, 2017, 17:07 Ivan Marić ***@***.***> wrote:
I agree with @reisub <https://github.com/reisub> shouldReplace is
unnecessary. Return type can be void and you need to update javadoc.
Do we have a removeHeader/Footer methods? If not I think we should have
it. There could be a need to remove it after inital set, do you agree?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA8mQz7k2MkdOW734zyegdG7WgeUSzTaks5rfwAmgaJpZM4MLA-v>
.
--
Android Team Lead • Infinum
+385 95 911 6324
infinum.co
|
headerView = LayoutInflater.from(getContext()).inflate(headerViewId, null, false); | ||
setDefaultLayoutParams(headerView); | ||
|
||
if (hadHeaderBefore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could call setHeader(View) method to avoid duplicate logic.
boolean hadFooterBefore = hasFooter(); | ||
|
||
int position = getCollectionCount() + (hasHeader() ? 1 : 0); | ||
footerView = LayoutInflater.from(getContext()).inflate(footerViewId, null, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as for the header. You can call setFooter(View) to avoid duplicate logic.
@reisub all comments have been resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very clean now!
Removed deprecated methods in order to prepare Mjolnir for 2.0.0 release.
Also, I've renamed addFooter/addHeader methods to setFooter/setHeader, as they are more precise - if we use "add" keyword, it immediately signals that we are supporting multiple headers/footers, which is still not the case.