{"action":"created","issue":{"url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/9","labels_url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/9/comments","events_url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/9/events","html_url":"https://github.com/kivy-garden/garden.recycleview/pull/9","id":94541655,"number":9,"title":"More fixes","user":{"login":"matham","id":1644286,"avatar_url":"https://avatars.githubusercontent.com/u/1644286?v=3","gravatar_id":"","url":"https://api.github.com/users/matham","html_url":"https://github.com/matham","followers_url":"https://api.github.com/users/matham/followers","following_url":"https://api.github.com/users/matham/following{/other_user}","gists_url":"https://api.github.com/users/matham/gists{/gist_id}","starred_url":"https://api.github.com/users/matham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matham/subscriptions","organizations_url":"https://api.github.com/users/matham/orgs","repos_url":"https://api.github.com/users/matham/repos","events_url":"https://api.github.com/users/matham/events{/privacy}","received_events_url":"https://api.github.com/users/matham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-12T06:57:41Z","updated_at":"2015-07-12T21:54:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kivy-garden/garden.recycleview/pulls/9","html_url":"https://github.com/kivy-garden/garden.recycleview/pull/9","diff_url":"https://github.com/kivy-garden/garden.recycleview/pull/9.diff","patch_url":"https://github.com/kivy-garden/garden.recycleview/pull/9.patch"},"body":"Following is a detailed summery of each of the 4 commits. It explains the reasoning and what was done.\r\n\r\n* The first commit removes the size_key and instead uses height/width explicitly. The reason is as followes. Internally, we only use key_size to get the data value. We use width/height where appropriate to set them directly. So key_size is only valuable for the user to not have to say either width or height depending e.g. on the orientation of the lm. However, this does not generalize to 2D like a gridded layout. Would we add key_width, key_height? Instead, I think we should make the user set width/height in the data dicts directly as relevant.\r\n\r\n  Continuing with that, I changed default_size to be a aliasprop that is now a tuple using new default_width/height properties. But, for backward compat, it accepts the syntax of VariableListProperty, so you could just do default_size = '48dp'.\r\n\r\n  I would also be in favor of removing key_viewclass and instead just do data.get('viewclass', rv.viewclass), but I did not do that for now.\r\n\r\n* Another change, currently, for the orientation-perpendicular dim (e.g. width with vertical lm), we set it to the container size. I changed it so e.g. with orientation == vertical, we do data.get('width', rv.width). This allows the user to set the second dim size of a view rather than forced to the container size. What this means is that even for a vertical layout, we could still scroll horizontally (like a normal sv) if the user sets the width dim of the view to be larger than the rv. \r\nAlso, we set the orientation-perpendicular dim of the container to be the max of rv value of that dim and of the values of the data if set by user allowing the scrolling. However, those views not set by user will be set to the width of the sv (like before), even if the container is larger. Because of that, I removed the restriction of do_scroll_x=False.\r\n\r\n  This can be tested with \r\n  ```py\r\nview = RecycleView(viewclass='Label')\r\nview.data = [{'text': str(i), 'height': i * 10} for i in range(50)]\r\nview.data[10]['width'] = 1000\r\nrunTouchApp(view)\r\n```\r\n  I think this change is quite nice to have.\r\n\r\n* I removed refresh_view_layout from rv because I think this should only be called by the layout manager and no one else. Right now, if the view was in views, adapter would return it and the lm would call refresh_view_layout on it. But if the adapter didn't have it, it'd create it and call refresh_view_layout on it and lm would not. I think the adpater should never call refresh_view_layout and instead layouting should belong only in lm. So I made the lm always call refresh_view_layout and removed it from adapter and rv.\r\n\r\n  I also created a new base class `ViewBaseClass` for views. If a view inherits from it, then instead of the adapter/lm setting the pos/size and attributes from data directly on the view, the corresponding method will be called. This allows the view to do further processing if need be. I have an example coming up with label where this is used.\r\n\r\n* Doc addition and fixes so that prop changes in underlying adapter/lm e.g. data will cause a dispatch in the rv."},"comment":{"url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/comments/120765814","html_url":"https://github.com/kivy-garden/garden.recycleview/pull/9#issuecomment-120765814","issue_url":"https://api.github.com/repos/kivy-garden/garden.recycleview/issues/9","id":120765814,"user":{"login":"matham","id":1644286,"avatar_url":"https://avatars.githubusercontent.com/u/1644286?v=3","gravatar_id":"","url":"https://api.github.com/users/matham","html_url":"https://github.com/matham","followers_url":"https://api.github.com/users/matham/followers","following_url":"https://api.github.com/users/matham/following{/other_user}","gists_url":"https://api.github.com/users/matham/gists{/gist_id}","starred_url":"https://api.github.com/users/matham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matham/subscriptions","organizations_url":"https://api.github.com/users/matham/orgs","repos_url":"https://api.github.com/users/matham/repos","events_url":"https://api.github.com/users/matham/events{/privacy}","received_events_url":"https://api.github.com/users/matham/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T21:54:33Z","updated_at":"2015-07-12T21:54:33Z","body":"With the last commit, I added a `LayoutChangeException` class. This class can be used by a view during a refresh layout to stop the layout and restart the refresh process. This is useful, e.g. if the current view changes size in the middle of the size refresh, you don't want to continue laying out the remaining views because we'll have to redo it immediately anyway, so by raising `LayoutChangeException`, it restarts the refresh.\r\n\r\nI don't know if this is a good implementation; it certainly saves some work in certain situations, but it does use exceptions for flow control which may be considered bad. I'm open to removing this commit if you guys think it's bad."}}