All Projects → kevelbreh → journey

kevelbreh / journey

Licence: other
A conductor routing helper library

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to journey

Router
⚡️ A lightning fast HTTP router
Stars: ✭ 158 (+351.43%)
Mutual labels:  router, routing
Next Routes
Universal dynamic routes for Next.js
Stars: ✭ 2,354 (+6625.71%)
Mutual labels:  router, routing
Rayo.js
Micro framework for Node.js
Stars: ✭ 170 (+385.71%)
Mutual labels:  router, routing
Grip
The microframework for writing powerful web applications.
Stars: ✭ 137 (+291.43%)
Mutual labels:  router, routing
Router
Router implementation for fasthttp
Stars: ✭ 234 (+568.57%)
Mutual labels:  router, routing
Nextjs Dynamic Routes
[Deprecated] Super simple way to create dynamic routes with Next.js
Stars: ✭ 145 (+314.29%)
Mutual labels:  router, routing
Routerify
A lightweight, idiomatic, composable and modular router implementation with middleware support for the Rust HTTP library hyper.rs
Stars: ✭ 173 (+394.29%)
Mutual labels:  router, routing
Universal Router
A simple middleware-style router for isomorphic JavaScript web apps
Stars: ✭ 1,598 (+4465.71%)
Mutual labels:  router, routing
Klein.php
A fast & flexible router
Stars: ✭ 2,622 (+7391.43%)
Mutual labels:  router, routing
Falco
A functional-first toolkit for building brilliant ASP.NET Core applications using F#.
Stars: ✭ 214 (+511.43%)
Mutual labels:  router, routing
Router5
Flexible and powerful universal routing solution
Stars: ✭ 1,704 (+4768.57%)
Mutual labels:  router, routing
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (+602.86%)
Mutual labels:  router, routing
Bsdrp
BSD Router Project
Stars: ✭ 126 (+260%)
Mutual labels:  router, routing
Redux Tower
Saga powered routing engine for Redux app.
Stars: ✭ 155 (+342.86%)
Mutual labels:  router, routing
Django Macros Url
Django Macros URL. Routing must be simple as possible
Stars: ✭ 121 (+245.71%)
Mutual labels:  router, routing
Flow builder
Flutter Flows made easy! A Flutter package which simplifies flows with a flexible, declarative API.
Stars: ✭ 169 (+382.86%)
Mutual labels:  router, routing
Php Router
simple and flexible Router class for PHP. with Controllers and Middlewares support.
Stars: ✭ 111 (+217.14%)
Mutual labels:  router, routing
React Page Layout
Create layouts for react
Stars: ✭ 117 (+234.29%)
Mutual labels:  router, routing
Ui Router
The de-facto solution to flexible routing with nested views in AngularJS
Stars: ✭ 13,738 (+39151.43%)
Mutual labels:  router, routing
Swiftuirouter
Routing in SwiftUI
Stars: ✭ 242 (+591.43%)
Mutual labels:  router, routing

Journey

A light weight routing helper for conductor based android applications.

Usage

Defining routes

Annotate the controllers you want registered with Journey. These will be matched based on the a dispatched URI path using Java regex matcher (so any valid regex is accepted.)

@Route("/something")
public class SomeController extends Controller {
  ...
}

You can can also use placeholders which extract data that will use the placeholder text as it's key.

@Route("/user/{user_uuid}")
public class UserController extends Controller {
  public UserController(Bundle args) {
    String userUuid = args.getString("user_uuid");
  }
}

Hooking things up

A journey requires a router and a list of routes that can be travelled. If you are using the the annotation processor then a journey provider will be compiled for you to use.

Don't forget to handle new incoming intents if you're using a single activity application.

public class MainActivity extends AppCompatActivity {

  ...

  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    router = Conductor.attachRouter(this, view, savedInstanceState);
    journey = new Journey(router, new DefaultJourneyProvider());
  }

  @Override protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    journey.routeUsing(intent);
  }
}

Intercepting transactions

You can add transaction interceptors to alter controller transactions before they are pushed to the router.

new TransactionInterceptor() {
  @Override public RouterTransaction intercept(RouterTransaction transaction) {
    return transaction.popChangeHandler(new HorizontalChangeHandler())
        .pushChangeHandler(new AutoTransitionChangeHandler());
  }
});

Download

Add via Gradle:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
  implementation 'com.github.kevelbreh.journey:journey:0.1.3'
  annotationProcessor 'com.github.kevelbreh.journey:journey-compiler:0.1.3'
}

License

Copyright 2017 Kevin Woodland

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].