Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andy671/pianochartview
Elementary and clean Android PianoView for displaying piano chord/scale charts in music theory apps for pianists.
https://github.com/andy671/pianochartview
android android-library java music-theory-apps piano-chords piano-keyboard pianoview scale-charts view xml
Last synced: 2 months ago
JSON representation
Elementary and clean Android PianoView for displaying piano chord/scale charts in music theory apps for pianists.
- Host: GitHub
- URL: https://github.com/andy671/pianochartview
- Owner: Andy671
- License: mit
- Created: 2017-01-25T13:46:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T20:57:14.000Z (about 7 years ago)
- Last Synced: 2024-11-09T12:39:45.195Z (3 months ago)
- Topics: android, android-library, java, music-theory-apps, piano-chords, piano-keyboard, pianoview, scale-charts, view, xml
- Language: Java
- Homepage:
- Size: 119 KB
- Stars: 55
- Watchers: 6
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Piano Chart View
[![](https://jitpack.io/v/Andy671/PianoChartView.svg)](https://jitpack.io/#Andy671/PianoChartView)
[![](https://img.shields.io/badge/minSDK-15-brightgreen.svg)](https://developer.android.com/training/basics/supporting-devices/platforms.html)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)## Introduction
Elementary and clean Android View for displaying piano chord and scale charts in music theory apps for pianists.## Sample
![](http://i.giphy.com/vuaHfrpkTbwOc.gif)## Installation
### Step 1
Add the JitPack repository to your build file
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```### Step 2
Add the dependency
```gradle
dependencies {
compile 'com.github.Andy671:PianoChartView:v0.6.6'
}
```# Usage
### Creating from xml:In your layout.xml
```xml
xmlns:custom="http://schemas.android.com/apk/res-auto"
``````xml
```
In your arrays.xml
```xml
5
7
11
1
```In your colors.xml
```xml
#C8E6C9
#1B5E20
```### Editing from code:
```java
PianoChartView pianoChartView = (PianoChartView) findViewById(R.id.piano_chart_view_small);
pianoChartView.setCheckedKeys(new int[]{2, 5, 3, 8, 11, 12});
pianoChartView.setSize(PianoChartView.Size.Small);
pianoChartView.setLightKeysColor(Color.parseColor("#CFD8DC"));
pianoChartView.setDarkKeysColor(Color.parseColor("#607D8B"));
pianoChartView.setCheckedKeysColor(Color.parseColor("#B2EBF2"));
```See sample for more info
## XML Attributes
| Attribute | Type | Default |
| -----------------|:-------------------:| :------------|
| lightKeysColor | color | Color.WHITE |
| darkKeysColor | color | Color.DKGRAY |
| checkedKeysColor | color | #03A9F4 |
| additionalCheckedKeysColor | color | #03A9F4 |
| checkedKeys | reference (int[]) | { } |
| additionalCheckedKeys | reference (int[]) | { } |
| namesOfKeys | reference (String[]) | { } |
| size | enum [Large, Small] | Large |## Public methods
| Type | Method |
|--------------------- |--------------------------------|
| void | setCheckedKeys(int[] numbers) |
| void | setAdditionalCheckedKeys(int[] numbers) |
| void | setNamesOfKeys(String... keyLetters) |
| void | setSize(Size size) |
| void | setLightKeysColor(int color) |
| void | setDarkKeysColor(int color) |
| void | setCheckedKeysColor(int color) |
| void | setAdditionalCheckedKeysColor(int color) |
| int[] | getCheckedKeys() |
| int[] | getAdditionalCheckedKeys() |
| Size | getSize() |
| int | getLightKeysColor() |
| int | getDarkKeysColor() |
| int | getCheckedKeysColor() |
| int | getAdditionalCheckedKeysColor() |## Contribution
- Feel free to fork the repo, make pull requests or fix existing bug
- Feel free to open issues if you find some bug or unexpected behaviour