洞察提升小程序标签管理,实现高效的金融行业数字化转型
925
2022-10-30
Piano Chart View 用于音乐理论、音乐应用程序钢琴图表视图
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.6' }
Usage
Creating from xml:
In your layout.xml
xmlns:custom="http://schemas.android.com/apk/res-auto"
In your arrays.xml
In your colors.xml
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 |
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 bugFeel free to open issues if you find some bug or unexpected behaviour
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~