<commit_before>Freight
===

Use this to ship data between `Controller` instances when you're using [Conductor](https://github.com/bluelinelabs/Conductor)



Using `Freight`
-------------------

```java
@ControllerBuilder //This will generate a builder
public class MainController extends Controller{
  @Extra String testStringExtra;
  @Nullable @Extra int testIntExtra; //Fields annotated with @Nullable are optional
  @Extra("booleanExtraYo") boolean testBooleanExtra;

  public MainController(Bundle args) {
    super(args);
  }

  @NonNull
  @Override
  protected View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
    View view = inflater.inflate(R.layout.controller_main, container, false);
    Freight.ship(this);
    return view;
  }
}
```

Using the builder
---

```java
public class MainActivity extends AppCompatActivity {

  private Router router;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);

    router = Conductor.attachRouter(this, container, savedInstanceState);
    if(!router.hasRootController()){
      router.setRoot(new MainControllerBuilder()
              .booleanExtraYo(false)
              .testStringExtra("Yeah this is a string")
              .testIntExtra(1)
              .asTransaction());
    }
  }
}
```

Navigator
----

Freight can generate scoped navigators for use outside of the main controller.

```java
@ControllerBuilder(value = "Login",
                   scope = "Welcome",
                   popChangeHandler = FadeChangeHandler.class,
                   pushChangeHandler = FadeChangeHandler.class)
public class LoginController {
    @Extra String username;
    @Nullable @Extra String password;


}
```

this will generate a "scoped" navigator interface named `WelcomeNavigator`<commit_msg>fix LoginController in README<commit_after>Freight
===

Use this to ship data between `Controller` instances when you're using [Conductor](https://github.com/bluelinelabs/Conductor)



Using `Freight`
-------------------

```java
@ControllerBuilder //This will generate a builder
public class MainController extends Controller{
  @Extra String testStringExtra;
  @Nullable @Extra int testIntExtra; //Fields annotated with @Nullable are optional
  @Extra("booleanExtraYo") boolean testBooleanExtra;

  public MainController(Bundle args) {
    super(args);
  }

  @NonNull
  @Override
  protected View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
    View view = inflater.inflate(R.layout.controller_main, container, false);
    Freight.ship(this);
    return view;
  }
}
```

Using the builder
---

```java
public class MainActivity extends AppCompatActivity {

  private Router router;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);

    router = Conductor.attachRouter(this, container, savedInstanceState);
    if(!router.hasRootController()){
      router.setRoot(new MainControllerBuilder()
              .booleanExtraYo(false)
              .testStringExtra("Yeah this is a string")
              .testIntExtra(1)
              .asTransaction());
    }
  }
}
```

Navigator
----

Freight can generate scoped navigators for use outside of the main controller.

```java
@ControllerBuilder(value = "Login",
                   scope = "Welcome",
                   popChangeHandler = FadeChangeHandler.class,
                   pushChangeHandler = FadeChangeHandler.class)
public class LoginController extends Controller {
    @Extra String username;
    @Nullable @Extra String password;

    public LoginController(Bundle bundle){
        super(bundle);
    }

}
```

this will generate a "scoped" navigator interface named `WelcomeNavigator`
{'fraction_non_alphanumeric': 0.10293012772351616, 'fraction_numerical': 0.0005008765339343851, 'mean_word_length': 3.4725643896976486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4381470', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1029, 'n_words': 296}