android10 /
Android-CleanArchitecture
This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
Loading repository data…
youxin11544 / repository
This is an Android MVP model good architecture design,Which also inherited the Android architecture and HTML 5 interaction。(这是一个Android MVP模型良好的架构设计,同时也做了Android和HTML 5交互架构,用到了RxJava+Retrofit+MVP+泛型缩减mvp+模板模式+命令模式+观察者模式+管理者模式 +简单工厂模式)
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
整个app网络请求是rxjava+retrofit+okttp 来完成网络请求的。这一层主要是对网络请求框架的一个封装方便我们使用。主要处理就是给所有请求添加共同的消息头,打印所有请求的log日志,请求结果的过滤和请求错误的通用处理。。。等等。
Api层的类图:
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
这一层包含了所有app的基类,类图: 图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
BaseAcitity为所有Activity的基类,此类为抽象类,采用模板方法模式, 在init()方法中定义一个骨架,而将一些步骤延迟到子类中。使得子类acitivity可以在不改变结构的情况下,实现定义抽象中的某些步骤,这样所有的Activity都是这样的一种模式,看着简单易懂。另外包含了一些Activity常用的方法。 图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
BaseCommonPresenter 为presenter的基类,这里理做了一些presenter 初始化的事情,以及一些公用的方法,同时将persenter与view关联起来
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
在LoginFragmentActivity 中,代码如下:
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
在LoginActivity 中,代码如下:
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
BasePresent 和 BaseView 为view接口和preseter接口的父类。
HaiBaoApplication 自定义的Application 这对第三方的库的一些初始化,还有我们自定义的一些东西的初始化,例如: 日志处理类,全局图片加载默认图片设置。。。等等,对于贯穿真个app的变量和对象也保存在这里方便,全局拿到,比如:用户信息对象(User)。。。等等。
对于app的列表展示全部采用谷歌最新的api,用RecylerView来做MyRecylerViewHolder和BaseRecylerAdapter 这两个基类处理了关于列表适配器的封装,BaseRecylerAdapter 在onCreateViewHolder()中返回的是MyRecylerViewHolder这个对象,而不是针对不同的RecylerView返回不同的ViewHolder,MyRecylerViewHolder用SparseArray通过view的id来充当key来保存view对象的。
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
ActivityPagerManager 为Activity的堆栈管理类,另外这里包含了对Activity资源的释放,采用的时递归的方法,从Activity的根view开始递归释放资源,包含了退出App的处理方法。 图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
CrashHander 是app未捕捉异常的处理类,在调试阶段把错误日志存在手机的文件夹里面,方便测试出问题了,开发人员可以从手机中找到错误日志,如果发布的话,将错误日志联网发送到第三方错误统计。
AnimationUtils 处理Acitiity和Fragment里面view的动画,能公用的公用,不能共用的单独在写个方法。把页面上的动画效果都放到这里来处理
MobclickAgentUtils 处理统计友盟事件的工具类也是统计的管理类,这样有利于观察整个app统计了那些时间,同时也方便查到一个统计时间在哪里调用了。将页面所有的统计都用这个类来作为统一 接口来处理。
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
ui层是安装功能模块来划分的,分为课堂模块,书架模块,发现模块,我的模块。对于页面的交互采用MVP的模式,例如:如下的登录页面。用了LoginActivity+LoginFragment来做,LoginActivity里面承载着LoginFragment,而LoginFragment承载着我们的主要页面view。loginPreseter处理登录页面的相关逻辑。
Model: 负责数据的检索,持久化等操作
View: 负责UI的绘制和用户的交互
Presenter: 作为Model和View的中间协调部分,负责两者之间的业务逻辑处理
View层 把View层针对控件操作抽象出来一些列的接口 在Activity或者Fragment里面实现该接口的控件操作,并且初始化Presenter,这是可以看到Activity里面没有逻辑处理,只是对UI的控件进行数据或者行为的操作,所有的动作都是有Presenter的接口来实现,这样在项目里面会极大得精简Activity的体积.
Presenter层 在Presenter层里面,Presenter掌握着View和Model的所有接口,Presenter就可以根据不同的业务逻辑通过MV两层的接口来实现特定的功能,让M和V独立出来.
为了减少多的类处理这里没有对M层单独处理,直接交给Presenter层,present直接处理了M层数据模型的处理(数据的获取,例如:发送请求获得实体类),这样减少了M层的一层接口。
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
图片去看:https://shimo.im/doc/jNDmzg24guglSMjy?r=O9GXJ/「App架构」
Selected from shared topics, language and repository description—not editorial ratings.
android10 /
This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
apache /
OplaPlanner has moved to https://github.com/apache/incubator-kie-drools. This repository is archived. OptaPlanner is an AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assignment, maintenance scheduling, conference scheduling and other planning problems.
signalapp /
This library is no longer maintained. libsignal-protocol-javascript was an implementation of the Signal Protocol, written in JavaScript. It has been replaced by libsignal-client’s typesafe TypeScript API.
thepranaygupta /
A repository that contains all the Data Structures and Algorithms concepts and their implementation in several ways, programming questions and Interview questions. The main aim of this repository is to help students who are learning Data Structures and Algorithms or preparing for an interview.
pdepend /
PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.
sceneview /
Sceneform Maintained is an ARCore Android SDK with Google Filament as 3D engine. This is the continuation of the archived Sceneform