<commit_before># Rhythm [![Download](https://api.bintray.com/packages/actinarium/maven/rhythm/images/download.svg)](https://bintray.com/actinarium/maven/rhythm/_latestVersion)

Rhythm is a small library for Android that draws grids and guides over views, making it easier to fine tune
your layouts according to the [principles][mdspec] of beautiful, balanced, _rhythmic_ design.

If you are passionate about carefully crafted layouts and aspiring to #BuildBetterApps, add Rhythm into your toolchain.

![Rhythm][heroimg]

**Key features:**

* Superior flexibility.  
  Highly customizable grids and guides, possibility to draw your own overlays, and more!  
  Make as many different overlays and assign them to as many views as you need.
* Saving lots of time.  
  Define your overlays once and control everything via the Quick Control notification¹ without leaving your current screen.
  No need to rebuild too!  
* Adaptable.  
  Inject Rhythm into your existing views with a single line of code without changing view hierarchy, or wrap layouts
  with `RhythmicFrameLayout` for finer control.
  Furthermore, Rhythm is built on Drawables, which you can obtain and use in any way imaginable.  
* Suitable for dialogs and scrolling content.
* Built with performance in mind.
* Code thoroughly documented.
* API 8+¹.
* Crafted by a design-minded developer, for design-minded developers.
* Open source, open for forks, pull requests, and suggestions².

Sample application available: [APK][apk] or:
[![Get it on Google Play](https://developer.android.com/images/brand/en_generic_rgb_wo_45.png)][playstore]

**Important note:** this is a pre-release version of Rhythm. Things may break and APIs may change.
See [Plans for the future](#plans-for-the-future) for more info.

## Setup

The most definitive guide so far is the [sample source][samplesrc], particularly the configuration [here][appsrc].
While a better guide is being prepared, enjoy thoroughly documented code :stuck_out_tongue:

### Get Rhythm

The easiest way to include Rhythm is to add a dependency in your `build.gradle` file:

```
compile 'com.actinarium.rhythm:rhythm:0.9'
```

The library is available via [Bintray][bintray]. If there’s a problem resolving it, check if you have jCenter added as your
Maven repository.

### Quick start

To set up Rhythm in an intended way—that is, with Quick Control notification, do the following in your `Application` class:

```java
// Implement RhythmControl.Host - otherwise Rhythm components won't be able to access Rhythm control
public class MyApplication extends Application implements RhythmControl.Host {

    // Rhythm control is a "singleton" through which the notification, RhythmicFrameLayouts and the overlays communicate
    private RhythmControl mRhythmControl;

    @Override
    public void onCreate() {
        super.onCreate();<commit_msg>Notice about declarative approach coming soon<commit_after># Rhythm [![Download](https://api.bintray.com/packages/actinarium/maven/rhythm/images/download.svg)](https://bintray.com/actinarium/maven/rhythm/_latestVersion)

Rhythm is a small library for Android that draws grids and guides over views, making it easier to fine tune
your layouts according to the [principles][mdspec] of beautiful, balanced, _rhythmic_ design.

If you are passionate about carefully crafted layouts and aspiring to #BuildBetterApps, add Rhythm into your toolchain.

![Rhythm][heroimg]

**Key features:**

* Superior flexibility.  
  Highly customizable grids and guides, possibility to draw your own overlays, and more!  
  Make as many different overlays and assign them to as many views as you need.
* Saving lots of time.  
  Define your overlays once and control everything via the Quick Control notification¹ without leaving your current screen.
  No need to rebuild too!  
* Adaptable.  
  Inject Rhythm into your existing views with a single line of code without changing view hierarchy, or wrap layouts
  with `RhythmicFrameLayout` for finer control.
  Furthermore, Rhythm is built on Drawables, which you can obtain and use in any way imaginable.  
* Suitable for dialogs and scrolling content.
* Built with performance in mind.
* Code thoroughly documented.
* API 8+¹.
* Crafted by a design-minded developer, for design-minded developers.
* Open source, open for forks, pull requests, and suggestions².

Sample application available: [APK][apk] or:
[![Get it on Google Play](https://developer.android.com/images/brand/en_generic_rgb_wo_45.png)][playstore]

**Important note:** this is a pre-release version of Rhythm. Things may break and APIs may change.
See [Plans for the future](#plans-for-the-future) for more info.

## Setup

The most definitive guide so far is the [sample source][samplesrc], particularly the configuration [here][appsrc].
While a better guide is being prepared, enjoy thoroughly documented code :stuck_out_tongue:

### Get Rhythm

The easiest way to include Rhythm is to add a dependency in your `build.gradle` file:

```
compile 'com.actinarium.rhythm:rhythm:0.9'
```

The library is available via [Bintray][bintray]. If there’s a problem resolving it, check if you have jCenter added as your
Maven repository.

### Quick start

To set up Rhythm in an intended way—that is, with Quick Control notification, do the following in your `Application` class.

**Note:** While currently overlays are configured imperatively like this (i.e. with lots of code),
it is already [planned](#plans-for-the-future) to add declarative configs (e.g. with JSON or such) in v1.0.

```java
// Implement RhythmControl.Host - otherwise Rhythm components won't be able to access Rhythm control
public class MyApplication extends Application implements RhythmControl.Host {

    // Rhythm control is a "singleton" through which the notification, RhythmicFrameLayouts and the overlays communicate
    private RhythmControl mRhythmControl;

    @Override
    public void onCreate() {
        super.onCreate();
{'fraction_non_alphanumeric': 0.07421087978509067, 'fraction_numerical': 0.0020147750167897917, 'mean_word_length': 4.684160305343512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '278134', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1579, 'n_words': 733}