• This repository has been archived on 23/May/2020
  • Stars
    star
    617
  • Rank 72,724 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Adds listening capabilities to Activities and Fragments

Navi

Hey, listen!

Adds listeners for Activity and Fragment.

Deprecated

The navi library is deprecated in favor of lifecycle-aware components. No more development will be taking place.

Why?

In a word: composition.

For applications, you currently have to tie a lot of your functionality directly to each Activity and Fragment. The potential for code reuse is low. Testing is difficult.

For libraries, if you want to interact with the Activity or Fragment at all, good luck. You either have to leave brittle instructions on how to properly implement the library, or you provide your own Activity/Fragment. Two libraries providing their own components are difficult (or impossible) to use together.

With Navi, you can avoid all these problems. Applications can decouple your code from the underlying Activity or Fragment. Libraries using Navi can write real plugins instead of brittle/coupled solutions.

Usage

The NaviComponent interface is the basis for everything; you can add/remove listeners for any specific callbacks that exist on Activity and Fragment:

naviComponent.addListener(Event.CREATE, new Listener<Bundle>() {
  @Override public void call(Bundle bundle) {
    setContentView(R.layout.main);
  }
});

You will either need to implement the NaviComponent interface yourself, or if you're able, you can save time by using one of the default implementations provided (in the form of NaviActivity, NaviAppCompatActivity, NaviFragment and NaviDialogFragment). This flexibility allows you to integrate Navi even if you're already being forced to use a different base Activity or Fragment.

Since RxJava is the bees knees, it also provides Rx bindings for all listeners via RxNavi. Simply pass your NaviComponent to them and it'll do the rest. For example, you could use it to set the content view instead of overriding onCreate():

RxNavi.observe(naviComponent, Event.CREATE)
    .subscribe(bundle -> setContentView(R.layout.main));

Installation

compile 'com.trello.navi2:navi:2.1.0'

License

Copyright (C) 2018 Trello

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.

More Repositories

1

RxLifecycle

Lifecycle handling APIs for Android apps using RxJava
Java
7,720
star
2

victor

Use SVGs as resources in Android
Java
1,007
star
3

scientist

A Node.js library for carefully refactoring critical paths in production
CoffeeScript
408
star
4

trellisheets

Guidelines, resources, and examples for writing CSS for Trello
HTML
253
star
5

mr-clean

Don't leak sensitive data.
Kotlin
230
star
6

iconathon

An icon task runner that convert Sketch files to mobile and web formats.
CoffeeScript
219
star
7

power-up-template

A static GitHub pages hosted sample Power-Up
JavaScript
123
star
8

trello-ios-assisted-onboarding

This project is a simple iOS App that hosts the Trello iOS Assisted Onboarding screens.
Swift
44
star
9

node-dependencies

Check out-of-date dependencies for your Node.js app
JavaScript
34
star
10

chromello

A sample Chrome extension written for Trello with a few great features.
JavaScript
32
star
11

api-docs

The documentation site for the Build with Trello content
27
star
12

weather-power-up

A small sample Power-Up for Trello that shows weather data on cards
JavaScript
21
star
13

trellicolors

Converts the Trello brand colors to various formats.
CoffeeScript
19
star
14

category-theory

sometimes math is just too much fun
19
star
15

node-coffee-cache

Caches the contents of required CoffeeScript files so that they are not recompiled to help improve startup time
JavaScript
18
star
16

full-name-splitter

Attempts to split a Latinesque fullname into first name and last name components
JavaScript
17
star
17

glitch-trello-power-up

Example Glitch Project Using Many Power-up Capabilities
JavaScript
15
star
18

glitch-power-up-tutorial-part-one

JavaScript
12
star
19

node-coffee-backtrace

Give some context to uncaught exceptions for Node.js projects written in CoffeeScript
JavaScript
7
star
20

diplomat

A Slack bot for making international collaboration and communication more seamless.
JavaScript
6
star
21

support-team-bookmarklets

Some bookmarklets you can run while using Trello
JavaScript
6
star
22

hearsay

A library for observing things
CoffeeScript
6
star
23

staunton

The massive multiplayer Chess game slash ✨ ReactiveCocoa tutorial ✨
Objective-C
6
star
24

magellan

Mapping and routing for REST endpoints
Objective-C
4
star
25

trello.cards

Less
3
star
26

power-up-on-heroku

A simple Trello Power-Up hosted on Heroku.
JavaScript
3
star
27

code-snippets

Trello Code Snippets Power-Up
JavaScript
3
star
28

yeoman-generator-trello

A Yeoman generator for quickly getting started with the Trello API.
JavaScript
2
star
29

url-parse-fix-auth

Fix url.parse to work with percent (%) characters in auth strings
JavaScript
2
star