All Projects → Meituan-Dianping → Shield

Meituan-Dianping / Shield

Licence: mit
A declarative, efficient, and flexible Native framework for building user interfaces.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Shield

Ok Gradle
IntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
Stars: ✭ 664 (-26.3%)
Mutual labels:  gradle
Ktlint Gradle
A ktlint gradle plugin
Stars: ✭ 713 (-20.87%)
Mutual labels:  gradle
Fod
Freedom of Developers
Stars: ✭ 815 (-9.54%)
Mutual labels:  gradle
React Native Shimmer Placeholder
Placeholder/ Skeleton of React Native
Stars: ✭ 679 (-24.64%)
Mutual labels:  module
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (-20.98%)
Mutual labels:  gradle
Gradle Completion
Gradle tab completion for bash and zsh
Stars: ✭ 748 (-16.98%)
Mutual labels:  gradle
Elasticsuite
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
Stars: ✭ 647 (-28.19%)
Mutual labels:  module
Darkage
🎮 Darkage mod for Minetest
Stars: ✭ 6 (-99.33%)
Mutual labels:  module
Walle
Android Signature V2 Scheme签名下的新一代渠道包打包神器
Stars: ✭ 6,283 (+597.34%)
Mutual labels:  gradle
Androidsdk
🐳 Full-fledged Android SDK Docker Image
Stars: ✭ 776 (-13.87%)
Mutual labels:  gradle
Deep Clean
When Gradle or the IDE let you down, just --nuke all them caches
Stars: ✭ 689 (-23.53%)
Mutual labels:  gradle
Jiamoduledemo
一个针对iOS模块化开发的解决方案(不断完善优化中)
Stars: ✭ 709 (-21.31%)
Mutual labels:  module
Android Next
Android Next 公共组件库
Stars: ✭ 768 (-14.76%)
Mutual labels:  gradle
Oji
(◕‿◕) Text Emoticons Maker
Stars: ✭ 668 (-25.86%)
Mutual labels:  module
Acgclub
一款纯粹的ACG聚合类App
Stars: ✭ 829 (-7.99%)
Mutual labels:  module
Minecraftdev
Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
Stars: ✭ 645 (-28.41%)
Mutual labels:  gradle
Stringfog
一款自动对字节码中的字符串进行加密Android插件工具
Stars: ✭ 733 (-18.65%)
Mutual labels:  gradle
Infinity Dashboard Modules
Infinity Dashboard Modules
Stars: ✭ 17 (-98.11%)
Mutual labels:  module
Spring Streaming
SPA on Spring Boot 1.x, WebSockets and React, gradle, nodejs, spring-boot, gradle multi project, spring-mvc, spring-data, gradle dependency update plugin, react-router
Stars: ✭ 6 (-99.33%)
Mutual labels:  gradle
Light Novel Library wenku8 android
[CASUALLY MAINTAINED] 轻小说文库 (Wenku8.com) 安卓版第三方公益App,始于2014年的Material Design风格、无广告、不盈利、Google Play上安装包最小的轻小说阅读器(light novel reader)。目前除了网站的API以外,还添加了我自己架的Cloudflare Worker 中继节点用来突破网站API的限制 wenku8-relay.mewx.org.
Stars: ✭ 772 (-14.32%)
Mutual labels:  gradle

Shield

PRs Welcome License

概述

Shield是一个模块化UI界面解决方案,它不仅仅是一个Native(Android&iOS)的UI开发框架,而是美团点评到店综合团队基于自身复杂的业务场景沉淀出来的UI开发最佳实践,它不但具备高可复用性,协同开发等特性,还包括后端动态配置,动态模块等一系列解决方案。

接入

在工程的build.gradle文件中添加依赖:

compile 'com.dianping.android.sdk:shieldCore:1.6.0'

设计思想

1.模块独立

模块具备完整的页面能力(生命周期,Context等),模块可以在不同的页面中自由组合,模块与页面高度解耦,模块不关心具体在哪个页面中运行。模块之间需要解耦,模块只关心自己涉及的状态和数据。

2.数据驱动

模块的表现只取决于所依赖的数据,而与具体的行为无关。

3.接口

整个模块化框架通过抽象接口进行交互,通过接口规范行为,通过接口的不同实现达到多态的目的

整体框架

一个典型的模块化页面主要由页面和多个模块构成。页面通过模块配置(Config)确定加载哪些模块构成页面。模块又分为业务逻辑(Agent)和视图逻辑部分(SectionCellInterface, 包括 Section 和 Row)。 页面包含两个管理器,模块管理器(AgentManager)和视图管理器(CellManager)。其中模块管理器决定了如何创建,更新,恢复及销毁模块以及如何将模块添加到页面中; 视图管理器则决定了页面使用何种视图容器管理视图以及模块中的视图组件(SectionCellInterface)如何添加到视图容器中。 除此之外,页面还持有一个支持数据订阅和通知的白板(WhiteBoard),用于模块与页面,模块与模块之间的数据交互。

接入

请参照Sample中的com.example.shield.fragments.AgentManagerFragment

另外:

  1. 在onCreateView中构建页面容器ContentView。
  2. 在onActivityCreated方法中调用setAgentContainerView方法设置模块容器。
  3. 在getCellManager方法中指定页面使用何种CellManager(默认为SectionRecyclerCellManager,与RecyclerView容器配合使用)。
  4. 在getAgentManager方法中指定页面使用何种AgentManager(默认为LightAgentManager,一般无需定制)。
  5. 通过generaterDefaultConfigAgentList方法指定模块配置。

博客文章

Shield——开源的移动端页面模块化开发框架

技术支持

  • 通过提交issue来寻求帮助
  • 联系我们寻求帮助

ChangeLog

[2018.3.12]

  • RecyclerView容器支持设置是否可以滚动
  • HeaderCell&FooterCell新增置顶置底支持
  • HeaderCell&FooterCell新增上下分割线完善
  • 优化模块配置方式
  • 优化模块曝光计算逻辑
  • Bug Fix

[2019.1.30]

  • 基于Kotlin的全面重构
  • 新的视图管理器ShieldNodeCellManager
  • 新的生命周期路由ShieldLifeCycler
  • 新的ShieldSectionCellItem视图层表达方式
  • Bugfix

贡献代码

  • 欢迎提交issue
  • 欢迎提交PR

LICENSE

Shield is MIT licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].