Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply padding in Parent Layout #24

Open
desmond1121 opened this issue Dec 15, 2015 · 2 comments
Open

Apply padding in Parent Layout #24

desmond1121 opened this issue Dec 15, 2015 · 2 comments
Assignees

Comments

@desmond1121
Copy link

I've noticed that you handle bottom padding in scroll back. That would cause much time in "measure".
I catched a systrace of your "scroll back":

trace

I understand why you need this logic, View.offsetTopAndBottom would destroy the bottom padding. But this not handled in scroll down yet. Actually, you can notify user to set padding in parent layout such as following code, and handle padding logic in onLayout() of PullToRefreshView.

<com.yalantis.phoenix.PullToRefreshView
        android:id="@+id/pull_to_refresh"
        android:padding="10dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <ListView
        android:id="@+id/yalantis_list_view"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</com.yalantis.phoenix.PullToRefreshView>
@shliama
Copy link
Contributor

shliama commented Dec 15, 2015

Thanks for reporting the issue.
I'll look into it this week and try to find a workaround because it would be hard to ask every library user to update their layouts :(

@shliama shliama self-assigned this Dec 15, 2015
@desmond1121
Copy link
Author

Yes, it is. You can just take padding property value by content's attributes, and apply it in your
it in your onLayout() :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants