Giter Site home page Giter Site logo

mapleskip / ablepsia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sadfei/ablepsia

0.0 2.0 0.0 105 KB

Ablepsia 是一个可以替代 startActivity() 的框架,并且支持 activity 之间跳转的拦截和重定向,重定向保存此次跳转的存活。

Java 100.00%

ablepsia's Introduction

Ablepsia

Ablepsia 是一个可以替代 startActivity() 的框架,并且支持 activity 之间跳转的拦截和重定向,重定向保存此次跳转的存活。

举个栗子:现在有两个 activity ,一个是 首页,一个是 用户详情,现在的业务规则是打开 用户详情 之前必须要求是已登陆状态。

so.原来的处理方式是你在打开 用户详情 之前判断是否已登陆,如果未登录就打开登录页面,好吧,你这么做我也没有意见。但是如果后续还增加了 订单列表、订单详情、...以及 N 个需要已登录才能打开的页面,那么你又要写 N 次判断。

对于上述栗子,Ablepsia 的处理姿势可谓是十分优雅,将 N 变为 1 次判断,自动重定向到登录页面,登录成功后自动跳转到 用户详情 页面。.......目前 git 上的路由框架的实现方式,一旦你重定向此次跳转,此次跳转的生命就结束了,所以无法做到登录成功后自动跳转到 用户详情 页面

#Use it#

//项目的 build.gradle 添加如下
allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}
// 模块的 build.gradle 添加如下
dependencies {
	        compile 'com.github.Xiao187:Ablepsia:v1.0.5'
	}

Ablepsia - 详细使用姿势

你也可以 clone Demo 到本地运行,Demo 中有用例

ablepsia's People

Contributors

xiaogerger avatar

Watchers

 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.