Giter Site home page Giter Site logo

huabandemo's Introduction

MD版的花瓣网App

#介绍

  • 作为一个花瓣网用户实在受不了Android版的崩溃而且已经一年多没有更新。工作之余网络抓包和反编译,要自己写一个App,因为毕竟是别人的项目也不指望能上架,就直接开源放到github上,如果侵权请联系我及时删除。
  • 源代码放在GitHub:项目地址
  • 下面介绍目前的工作内容

#更新记录

#UI

Main Drawer

Image User

#架构 这个项目在写在很久之前,当时MVP架构网络上各种分析描述,但是感觉都是各说各的。不确定项目是否采用MVP架构就先动手写代码,随时准备重构项目。就在不久前Google发布Android Architecture Blueprints [beta],终于感觉这事有点靠谱了,我现在已经在动手重构项目了。 分析博文在这里:MVP架构-官方MVP项目和MVP-RxJava项目架构对比分析解读

##目前的架构:

  • 基本**是采用模板方法模式,父类控制代码结构,子类实现,部分具有相同功能的再提供父类实现。 例如BaseSwipeViewPagerActivity是所有具有上拉刷新SwipeRefreshLayout和左右滑动ViewPager的子Activity类的父类。 BaseRecyclerHeadFragment是所有具有能够添加头尾View的RecyclerView的父类Fragment,内部主要实现向下滑动自动加载数据。

  • 每个Activity负责逻辑控制,其中会包含都会有一至多个Fragment负责UI显示,尽可能的不在Activity有网络操作。

#技术点 由于是个人项目所以全部采用目前最新的和最热门技术。

##RxJava 很多基本的逻辑使用RxJava/RxAndroid来实现异步响应,简化了很多异步回调的代码。比如欢迎界面的实现,详解点这里RxAndroid项目实践-使用RxJava响应式编码实现知乎日报的欢迎界面

##Retrofit 网络模块使用Retrofit,搭配RxJava实在是爽。 同时还很简洁的实现了Https的网络访问。功能强大。Retrofit整体框架主要采用代理模式,使得简化我们的网络调用操作,真正的内部还是采用OkHttp,这就导致实现下载上传进度监听会有点麻烦。目前也已经实现不会有内存泄露,具体参考看DownloadService.java后台服务单线程图片下载实现。

##Fresco 图片加载框架使用的是Fresco,同样的功能强大,但是使用复杂。我包装了一个类ImageLoadFresco,采用生成器模式,配置很多的默认实现,同时能够实现复杂操作,具体代码和介绍Fresco的封装和使用说明以及获取缓存中的Bitmap对象

##其他 其他方面,每个功能模块都会提供工具类或者包装类,分化代码使得相同功能代码能够重用,减少代码量。

huabandemo's People

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.