<commit_before>Intents
=======

![Logo](../logo.png)

Extras binding and builder for Android activities and fragments which uses annotation processing to generate boilerplate code for you.

 * Eliminate `Activity.getIntent().getExtra()` or `Fragment.getArguments().getStringExtra()` calls by using `@BindExtra` on fields.
 * Generates elegant **IntentBuilder/FragmentBuilder** with appropriate arguments.

```java
class ExampleActivity extends Activity {
  @BindExtra String name;
  @BindExtra int age;

  @Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ExampleActivity_.bindExtras(this);
    // TODO Use fields...
  }
}

public class ExampleFragment extends Fragment {
  @BindExtra int height;
  @BindExtra int weight;

  @Override public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ExampleFragment_.bindExtras(this);
    // TODO Use fields...
  }
}

class CallerActivity extends Activity {  
  
  public void addExampleFragent() {
    getSupportFragmentManager().beginTransaction()
          .add(R.id.fragmentContainer, ExampleFragment_.builder() // Generated by the library
              .height(170)
              .weight(60)
              .make())
          .commit();
  }
  
  public void openExampleActivity() {
    final Intent intent = ExampleActivity_.intentBuilder(this) // Generated by the library
        .name("Giang")
        .age(29)
        .make();
    startActivity(intent);
  }
}
```

Download
--------

```groovy
allprojects {
  repositories {
	 ...
    maven { url ‘https://jitpack.io’ }
  }
}

dependencies {
  compile 'com.github.tikivn.android-template:intents:-SNAPSHOT’
  annotationProcessor 'com.github.tikivn.android-template:intents-compiler:-SNAPSHOT'
}
```

License
-------

    Copyright 2017 Tiki Corp

    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<commit_msg>add sample to reference<commit_after>Intents
=======

![Logo](../logo.png)

Extras binding and builder for Android activities and fragments which uses annotation processing to generate boilerplate code for you.

 * Eliminate `Activity.getIntent().getExtra()` or `Fragment.getArguments().getStringExtra()` calls by using `@BindExtra` on fields.
 * Generates elegant **IntentBuilder/FragmentBuilder** with appropriate arguments.

```java
class ExampleActivity extends Activity {
  @BindExtra String name;
  @BindExtra int age;

  @Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ExampleActivity_.bindExtras(this);
    // TODO Use fields...
  }
}

public class ExampleFragment extends Fragment {
  @BindExtra int height;
  @BindExtra int weight;

  @Override public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ExampleFragment_.bindExtras(this);
    // TODO Use fields...
  }
}

class CallerActivity extends Activity {  
  
  public void addExampleFragent() {
    getSupportFragmentManager().beginTransaction()
          .add(R.id.fragmentContainer, ExampleFragment_.builder() // Generated by the library
              .height(170)
              .weight(60)
              .make())
          .commit();
  }
  
  public void openExampleActivity() {
    final Intent intent = ExampleActivity_.intentBuilder(this) // Generated by the library
        .name("Giang")
        .age(29)
        .make();
    startActivity(intent);
  }
}
```

For example and additional information see [sample](../sample).

Download
--------

```groovy
allprojects {
  repositories {
	 ...
    maven { url ‘https://jitpack.io’ }
  }
}

dependencies {
  compile 'com.github.tikivn.android-template:intents:-SNAPSHOT’
  annotationProcessor 'com.github.tikivn.android-template:intents-compiler:-SNAPSHOT'
}
```

License
-------

    Copyright 2017 Tiki Corp

    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
{'fraction_non_alphanumeric': 0.10997500568052715, 'fraction_numerical': 0.006816632583503749, 'mean_word_length': 3.298828125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5477598', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1171, 'n_words': 353}