{"action":"created","issue":{"url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/6","repository_url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary","labels_url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/6/comments","events_url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/6/events","html_url":"https://github.com/TommyLemon/Android-ZBLibrary/issues/6","id":185310478,"number":6,"title":"这样的书写风格是？","user":{"login":"anybus","id":14803159,"avatar_url":"https://avatars.githubusercontent.com/u/14803159?v=3","gravatar_id":"","url":"https://api.github.com/users/anybus","html_url":"https://github.com/anybus","followers_url":"https://api.github.com/users/anybus/followers","following_url":"https://api.github.com/users/anybus/following{/other_user}","gists_url":"https://api.github.com/users/anybus/gists{/gist_id}","starred_url":"https://api.github.com/users/anybus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anybus/subscriptions","organizations_url":"https://api.github.com/users/anybus/orgs","repos_url":"https://api.github.com/users/anybus/repos","events_url":"https://api.github.com/users/anybus/events{/privacy}","received_events_url":"https://api.github.com/users/anybus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T06:50:04Z","updated_at":"2016-10-26T09:13:22Z","closed_at":"2016-10-26T09:13:22Z","body":"比如BottomTabActivity 继承 BaseBottomTabActivity  从而把   selectTab（）、getTabIds（）、getFragment （）这些个性化的方法暴露出来，父类调用子类实现来处理通用操作。\r\n\r\n我注意到getTabIds专门处理数据；getFragment（）负责创建新fragment；selectTab(int position)负责界面ui操作；\r\n\r\n这就是mvp吗？"},"comment":{"url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/comments/256292199","html_url":"https://github.com/TommyLemon/Android-ZBLibrary/issues/6#issuecomment-256292199","issue_url":"https://api.github.com/repos/TommyLemon/Android-ZBLibrary/issues/6","id":256292199,"user":{"login":"TommyLemon","id":5738175,"avatar_url":"https://avatars.githubusercontent.com/u/5738175?v=3","gravatar_id":"","url":"https://api.github.com/users/TommyLemon","html_url":"https://github.com/TommyLemon","followers_url":"https://api.github.com/users/TommyLemon/followers","following_url":"https://api.github.com/users/TommyLemon/following{/other_user}","gists_url":"https://api.github.com/users/TommyLemon/gists{/gist_id}","starred_url":"https://api.github.com/users/TommyLemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TommyLemon/subscriptions","organizations_url":"https://api.github.com/users/TommyLemon/orgs","repos_url":"https://api.github.com/users/TommyLemon/repos","events_url":"https://api.github.com/users/TommyLemon/events{/privacy}","received_events_url":"https://api.github.com/users/TommyLemon/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T09:13:22Z","updated_at":"2016-10-26T09:13:22Z","body":"@anybus 这是用了java的封装（BaseBottomTabActivity）、继承（BottomTabActivity  extends BaseBottomTabActivity）、多态（abstract方法及interface）的特性。\r\nMVP，即Model-View-Presenter，是一种用于把业务、UI、逻辑分离，使结构清晰、使用灵活的设计模式。\r\n你提的这个例子不是一个单纯的MVP，\r\n可以把Fragment当成Model，是FragmentContainer里呈现的内容数据；\r\nBottomTabActivity当成View，负责界面渲染；\r\nBaseBottomTabActivity当成Presenter，负责通用的tab逻辑处理。\r\n\r\nActivity、Fragment采用了MVC的设计模式，所以基于它们做出来的脱离不了MVC，最多是多种设计模式混用。\r\n\r\n可以看下ZBLibrary里的UserView，User是Model，UserView是View， BaseView是Presenter。UserActivity和UserAdapter里都有用到。"}}
{"actor":{"display_login":"TommyLemon"}}