<commit_before># android fore

[![license-apache2](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/erdo/android-fore/blob/master/LICENSE.txt){: .float-left}

![jcenter-1.1.3](https://img.shields.io/badge/jcenter-1.1.3-green.svg){: .float-left}

![api-16](https://img.shields.io/badge/api-16%2B-orange.svg){: .float-left}

[![circleci](https://circleci.com/gh/erdo/android-fore/tree/master.svg?style=shield)](https://circleci.com/gh/erdo/android-fore/tree/master){: .float-left}

![year asafcore and forecore jcenter downloads 2018 Nov 18](https://img.shields.io/badge/downloads-3%2C369-red.svg){: .float-left}

<br/>
<br/>

[(click here if you're reading this on github)](https://erdo.github.io/android-fore/#shoom)

**fore** helps you move code out of the view layer. Because once you do that, magical things start to happen.

The most important class in the fore library is the observable implementation [kotlin](https://github.com/erdo/android-fore/blob/master/fore-core-kt/src/main/java/co/early/fore/kt/core/observer/ObservableImp.kt) \| [java](https://github.com/erdo/android-fore/blob/master/fore-core/src/main/java/co/early/fore/core/observer/ObservableImp.java). This very simple class lets you **make anything observable** (usually its models & repositories that are made observable, things in the view layer like activities & fragments do the observing).


<!-- Tabbed code sample -->
 <div class="tab">
   <button class="tablinks java" onclick="openLanguage('java')">Java</button>
   <button class="tablinks kotlin" onclick="openLanguage('kotlin')">Kotlin</button>
 </div>

<pre class="tabcontent tabbed java"><code>
public class AccountRepository extends ObservableImp {

  public AccountRepository(WorkMode workMode) {
    super(workMode);
  }

  ...

}
 </code></pre>

<pre class="tabcontent tabbed kotlin"><code>
class AccountRepository(workMode: WorkMode) : Observable by ObservableImp(workMode) {

  ...

}
 </code></pre>


The fore observable has two different WorkModes:
- **ASYNCHROUNOUS**: observers will always be notified on the UI thread (making it trivial to update UI elements)
- **SYNCHRONOUS**: observers will be always be notified on the same thread that notifyObservers() was called on (perfect for running Unit tests).

The core package is so small (**126 methods** and about **500 lines of code**), you can just use the observer to immediately make your view layer [**reactive**](https://erdo.github.io/android-fore/03-reactive-uis.html#shoom) and **testable**, or go full on [MVO](https://erdo.github.io/android-fore/00-architecture.html#shoom) and wonder where all your code went ;)

Because the view layer is so sparse when implementing MVO with **fore** the apps are highly scalable from a complexity standpoint and **fore** works from quick prototypes, right up to large complex commercial projects with 100K+ lines of code.

If you're interested, there is a dev.to tutorial [here](https://dev.to/erdo/tutorial-android-architecture-blueprints-full-todo-app-mvo-edition-259o) that explains the whys and the hows of converting the Android Architecture Blueprint sample app, from MVP to [MVO](https://erdo.github.io/android-fore/00-architecture.html#shoom). (That app is in Java, but the same principles apply for [Kotlin](https://github.com/erdo/fore-full-example-02-kotlin) apps).

## Quick Start
<commit_msg>doc updates<commit_after># android fore

[![license-apache2](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/erdo/android-fore/blob/master/LICENSE.txt){: .float-left}

![jcenter-1.1.3](https://img.shields.io/badge/jcenter-1.1.3-green.svg){: .float-left}

![api-16](https://img.shields.io/badge/api-16%2B-orange.svg){: .float-left}

[![circleci](https://circleci.com/gh/erdo/android-fore/tree/master.svg?style=shield)](https://circleci.com/gh/erdo/android-fore/tree/master){: .float-left}

![year asafcore and forecore jcenter downloads 2018 Nov 18](https://img.shields.io/badge/downloads-3%2C369-red.svg){: .float-left}

<br/>
<br/>

[(click here if you're reading this on github)](https://erdo.github.io/android-fore/#shoom)

**fore** helps you move code out of the view layer. Because once you do that, magical things start to happen.

The most important class in the fore library is the observable implementation [kotlin](https://github.com/erdo/android-fore/blob/master/fore-core-kt/src/main/java/co/early/fore/kt/core/observer/ObservableImp.kt) \| [java](https://github.com/erdo/android-fore/blob/master/fore-core/src/main/java/co/early/fore/core/observer/ObservableImp.java). This very simple class lets you **make anything observable** (usually its models & repositories that are made observable, things in the view layer like activities & fragments do the observing).


<!-- Tabbed code sample -->
 <div class="tab">
   <button class="tablinks java" onclick="openLanguage('java')">Java</button>
   <button class="tablinks kotlin" onclick="openLanguage('kotlin')">Kotlin</button>
 </div>

<pre class="tabcontent tabbed java"><code>
public class AccountRepository extends ObservableImp {

  public AccountRepository(WorkMode workMode) {
    super(workMode);
  }

  ...

}
 </code></pre>

<pre class="tabcontent tabbed kotlin"><code>
class AccountRepository(workMode: WorkMode) : Observable by ObservableImp(workMode) {

  ...

}
 </code></pre>


The fore observable has two different WorkModes:
- **ASYNCHROUNOUS**: observers will always be notified on the UI thread (making it trivial to update UI elements)
- **SYNCHRONOUS**: observers will be always be notified on the same thread that notifyObservers() was called on (perfect for running Unit tests).

The core package is so small (**126 methods** and about **500 lines of code**), you can just use the observer to immediately make your view layer [**reactive**](https://erdo.github.io/android-fore/03-reactive-uis.html#shoom) and **testable**, or go full on [MVO](https://erdo.github.io/android-fore/00-architecture.html#shoom) and wonder where all your code went ;)

Because the view layer is so sparse when implementing MVO with **fore** the apps are highly scalable from a complexity standpoint and **fore** works from quick prototypes, right up to large complex commercial projects with 100K+ lines of code.

If you're interested, there is a dev.to tutorial [here](https://dev.to/erdo/tutorial-android-architecture-blueprints-full-todo-app-mvo-edition-259o) that explains the whys and the hows of converting the Android Architecture Blueprint sample app, from MVP to MVO. (That app is in Java, but the same principles apply for [Kotlin](https://github.com/erdo/fore-full-example-02-kotlin) apps).

## Quick Start

{'fraction_non_alphanumeric': 0.14048473967684022, 'fraction_numerical': 0.013464991023339317, 'mean_word_length': 4.8282476024411505, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 29, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '176087', 'n_tokens_mistral': 2178, 'n_tokens_neox': 2021, 'n_words': 601}