Giter Site home page Giter Site logo

markdemo's Introduction

markdemo

gradle 配置

完全按照googleSamples的例子写,学习mvp和数据库的操作

学习room的使用

学习转场动画

学习MVP的架构

问题

  • 一般presenter有start的话最好也加个destroy一些清除工作可以放里面,还有eventbus反注册
  • 然后还有一个我自己用listview adapter的心得, 里面的list最好是内部维护的对象,不要直接引用外部传进来的, 然后每次更新数据的时候做一个clear和addAll
  • 这样有两个好处:一个是两份数据分开管理,避免一些互相影响带来数据混乱; 另一个是如果数据更新了没有及时notifydatachange可能会崩溃,这样做了以后就不会有这个问题 唯一的问题可能就是每次更新的时候clear addAll有一点性能损耗,但是数据量不是特别大、更新不是那么频繁其实就可以忽略不计
  • 保持as默认命名格式就好了,用作activity的就activity打头,用作fragment就fragment打头
  • MainFragment里面的MainPresenter 应该改成MainContract.Presenter 依赖于抽象
  • Activity和Fragment的生命周期方法还是尽量按顺序来写吧 快捷键ctrl+alt+K
  • 记录这个删除操作,直到删除真的成功才删除这个记录,否则一直重试删除 似乎这样界面响应会更快,体验也更好
  • 还有一个就是进行update、delete等危险操作的时候进行二次确认或做假删除是个好习惯

2018年2月1日

  • 增加 Interceptor
  • 用Rxjava+Retrofit重构项目
  • 了解七牛云

markdemo's People

Contributors

badcyc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.