Piano Chart View


Source link: https://github.com/Andy671/PianoChartView

Piano Chart View

Introduction

Elementary and clean Android View for displaying piano chord and scale charts in music theory apps for pianists.

Sample

Installation

Step 1

Add the JitPack repository to your build file

 allprojects {

repositories {

 ...
 maven {
 url 'https://jitpack.io' 
}

}
  
}

Step 2

Add the dependency

 dependencies {

compile 'com.github.Andy671:PianoChartView:v0.6.4'  
}

Usage

Creating from xml:

In your layout.xml

xmlns:custom="http://schemas.android.com/apk/res-auto"
<!-- Custom arguments are optional - if you don't override them it uses default values -->  <com.kekstudio.pianochartview.PianoChartView

android:id="@+id/piano_chart_view"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

 custom:checkedKeysColor="@android:color/white"

custom:lightKeysColor="@color/colorCustomLight"

custom:darkKeysColor="@color/colorCustomDark"

custom:size="Small"

custom:checkedKeys="@array/some_integer_array"/>

In your arrays.xml

<!-- Numbers = keys on keyboard -->
  <integer-array name="some_integer_array">

<item>5</item>

<item>7</item>

<item>11</item>

<item>1</item>
  </integer-array>

In your colors.xml

 <color name="colorCustomLight">#C8E6C9</color>
  <color name="colorCustomDark">#1B5E20</color>

Editing from code:

  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
checkedKeys reference (int[]) { }
size enum [Large, Small] Large

Public methods

Type Method
void setCheckedKeys(int[] numbers)
void setSize(Size size)
void setLightKeysColor(int color)
void setDarkKeysColor(int color)
void setCheckedKeysColor(int color)
int[] getCheckedKeys()
Size getSize()
int getLightKeysColor()
int getDarkKeysColor()
int getCheckedKeysColor()

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

Buy me a cup of coffee

Bitcoin Wallet: 15BuUMAW2jUdStPVkoNPt85P8tJnAy5vD4

Resources

Android Dynamic Loader is a plugin system. The host application is like a browser, but instead of loading web pages, it loads plugins which could be run natively on Android system.

A library to work with RecyclerView as easily as if you'd use ListView or GridView.

The easiest way to simplify custom View tags in layout xmls.

Wrapper around ActiveAndroid which introduces reactive queries with SQLBrite.

A simple API that cleanly registers pending intent for location updates from Google location api. Using Recon and FlankLocation annotation the location update registration using pending intent is made easier, This still supports dynamic location request at runtime by accepting it as parameter when registering for location updates.

AndroidPermissionsUsage is an IntelliJ IDEA (and Android Studio) plugin designed to find the usage of the permissions defined in an Android application.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes