- Render chord based on chord name
- Support normal chords and advanced chords: maj, add, sus, dim, aug...
- Draw all hand positions for each chord
- Transpose chord
- Resizeable bitmap
- Supports Android API >= 4
// Prepare data
Resources resources = activity.getResources();
int width = 200;
int height = 200;
String chordName = "Am";
int position = 0; // fret position index (0 to 8)
int transpose = 0; // transpose distance (-12 to 12)
// Draw chord
BitmapDrawable chord = DrawHelper.getBitmapDrawable(
resources, width, height, chordName, position, transpose);
// Display chord to your image view
yourImageView.setImageDrawable(chord);
In your layout:
<com.dqt.libs.chorddroid.components.ChordTextureView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:id="@+id/chord_texture_view" />
In your code:
ChordTextureView chord = (ChordTextureView) findViewById(R.id.chord_texture_view);
chord.drawChord("Am", 0);
ChordHelper.transpose(String chordName, int distance)
ChordHelper.getChord(String chordName, int position)
ChordHelper.simplifyName(String chordName)
./gradlew assemble
Check ChordDroidLibrary/build/outputs/arr
directory to find ChordDroidLibrary-release.arr
files.
- Copy
aar
file to yourlibs
directory - Add following section to your gradle file:
Add flatDir
to your repositories
tag:
repositories {
...
flatDir {
dirs 'libs'
}
}
Add compile
to your dependencies
tag:
dependencies {
...
compile(name:'ChordDroidLibrary-release', ext:'aar')
}