├── .gitignore ├── .gitignore.swp ├── .idea ├── codeStyles │ └── Project.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── konatsup │ │ └── timelinesample │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── konatsup │ │ │ └── timelinesample │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── konatsup │ └── timelinesample │ └── ExampleUnitTest.kt ├── art └── screenshot.png ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── timelineview ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── konatsup │ └── timelineview │ └── ExampleInstrumentedTest.java ├── main ├── AndroidManifest.xml ├── java │ └── com │ │ └── konatsup │ │ └── timelineview │ │ ├── AudioComposition.kt │ │ ├── Cell.kt │ │ ├── CellViewAdapter.kt │ │ ├── CellViewHolder.kt │ │ ├── Composition.kt │ │ ├── FixedGridLayoutManager.kt │ │ ├── MidiComposition.kt │ │ ├── PositionBarView.kt │ │ ├── Rhythm.kt │ │ ├── TimelineType.kt │ │ ├── TimelineView.kt │ │ └── Track.kt └── res │ ├── drawable │ ├── audio_image_sample.png │ └── midi_image_sample.png │ ├── layout │ ├── cell.xml │ └── timeline_view.xml │ └── values │ ├── dimen.xml │ └── strings.xml └── test └── java └── com └── konatsup └── timelineview └── ExampleUnitTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | 4 | *.apk 5 | *.ap_ 6 | *.aab 7 | *.dex 8 | *.class 9 | bin/ 10 | gen/ 11 | out/ 12 | build/ 13 | proguard/ 14 | *.log 15 | .navigation/ 16 | captures/ 17 | .idea/workspace.xml 18 | .idea/tasks.xml 19 | .idea/gradle.xml 20 | .idea/assetWizardSettings.xml 21 | .idea/dictionaries 22 | .idea/libraries 23 | .idea/caches 24 | .idea/modules.xml 25 | 26 | local.properties 27 | .DS_Store 28 | .externalNativeBuild -------------------------------------------------------------------------------- /.gitignore.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/konatsup/TimelineView/f0af45527e9178c48b94d2283420ae50d08c8e26/.gitignore.swp -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 konatsup 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TimelineView 2 | 3 | ![Imgur](https://i.imgur.com/q1l5czv.gif) 4 | 5 | ## OverView 6 | TimelineView is view of timeline. 7 | You can swipe and scroll view. 8 | 9 | This library is developed for creating music or movie edit App on Android. 10 | 11 | ## Usage 12 | ### Step 1. Add the JitPack repository to your build file 13 | 14 | Add it in your root build.gradle at the end of repositories: 15 | ``` 16 | allprojects { 17 | repositories { 18 | ... 19 | maven { url 'https://jitpack.io' } 20 | } 21 | } 22 | ``` 23 | if you have some error, add this in same build.gradle: 24 | ``` 25 | buildscript { 26 | repositories { 27 | ... 28 | maven { url "https://jitpack.io" } 29 | } 30 | } 31 | ``` 32 | 33 | 34 | ### Step 2. Add the dependency 35 | ```kotlin 36 | dependencies { 37 | implementation 'com.github.konatsup:timelineview:v0.3' 38 | } 39 | ``` 40 | 41 | DONE! 42 | 43 | 44 | ### Step 3. Use the library 45 | 46 | 47 | *.xml: 48 | ```xml 49 | 53 | 54 | ``` 55 | 56 | *.kt: 57 | ```kotlin 58 | 59 | val tv : TimelineView = findViewById(R.id.timelineView) 60 | tv.timelineType = TimelineType.TIME 61 | tv.trackList = ArrayList() 62 | tv.currentPosition = 0 63 | tv.columnCount = 30 64 | 65 | 66 | val map1 = HashMap() 67 | val track1 = Track(map1) 68 | 69 | val comp1 = AudioComposition(3) 70 | val comp2 = MidiComposition(5) 71 | track1.addComposition(3, comp1) 72 | track1.addComposition(7, comp2) 73 | 74 | tv.addTrack(track1) 75 | 76 | ``` 77 | 78 | ## LICENSE 79 | ``` 80 | MIT License 81 | 82 | Copyright (c) 2018 konatsup 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining a copy 85 | of this software and associated documentation files (the "Software"), to deal 86 | in the Software without restriction, including without limitation the rights 87 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 88 | copies of the Software, and to permit persons to whom the Software is 89 | furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in all 92 | copies or substantial portions of the Software. 93 | 94 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 95 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 96 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 97 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 99 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 100 | SOFTWARE. 101 | ``` 102 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 28 7 | defaultConfig { 8 | applicationId "com.konatsup.timelinesample" 9 | minSdkVersion 15 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation fileTree(dir: 'libs', include: ['*.jar']) 25 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 26 | implementation 'com.android.support:appcompat-v7:28.0.0' 27 | implementation 'com.android.support:recyclerview-v7:28.0.0' 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | implementation project(':timelineview') 33 | } 34 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/konatsup/timelinesample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.konatsup.timelinesample 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.konatsup.timelinesample", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/konatsup/timelinesample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.konatsup.timelinesample 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.View 6 | import com.konatsup.timelineview.* 7 | 8 | class MainActivity : AppCompatActivity() { 9 | 10 | private lateinit var tv: TimelineView 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.activity_main) 14 | 15 | tv = findViewById(R.id.timelineView) 16 | 17 | tv.timelineType = TimelineType.TIME 18 | tv.trackList = ArrayList() 19 | tv.currentPosition = 0 20 | tv.columnCount = 30 21 | 22 | val map1 = HashMap() 23 | val map2 = HashMap() 24 | val map3 = HashMap() 25 | val map4 = HashMap() 26 | val map5 = HashMap() 27 | val map6 = HashMap() 28 | 29 | val track1 = Track(map1) 30 | val track2 = Track(map2) 31 | val track3 = Track(map3) 32 | val track4 = Track(map4) 33 | val track5 = Track(map5) 34 | val track6 = Track(map6) 35 | 36 | val comp1 = AudioComposition(3) 37 | val comp2 = MidiComposition(5) 38 | track1.addComposition(3, comp1) 39 | track1.addComposition(7, comp2) 40 | 41 | val comp3 = AudioComposition(3) 42 | val comp4 = MidiComposition(12) 43 | track2.addComposition(0, comp3) 44 | track2.addComposition(5, comp4) 45 | 46 | val comp5 = AudioComposition(3) 47 | val comp6 = MidiComposition(5) 48 | track3.addComposition(14, comp5) 49 | track3.addComposition(23, comp6) 50 | 51 | val comp7 = AudioComposition(6) 52 | val comp8 = MidiComposition(5) 53 | track4.addComposition(4, comp7) 54 | track4.addComposition(13, comp8) 55 | 56 | val comp9 = AudioComposition(8) 57 | val comp10 = MidiComposition(5) 58 | track5.addComposition(2, comp9) 59 | track5.addComposition(13, comp10) 60 | 61 | val comp11 = AudioComposition(3) 62 | val comp12 = MidiComposition(2) 63 | track6.addComposition(0, comp11) 64 | track6.addComposition(10, comp12) 65 | 66 | tv.addTrack(track1) 67 | tv.addTrack(track2) 68 | tv.addTrack(track3) 69 | tv.addTrack(track4) 70 | tv.addTrack(track5) 71 | tv.addTrack(track6) 72 | 73 | tv.addEmptyTrack() 74 | tv.addEmptyTrack() 75 | tv.addEmptyTrack() 76 | 77 | } 78 | 79 | fun startButtonOnClick(v : View){ 80 | tv.play() 81 | } 82 | 83 | fun stopButtonOnClick(v : View){ 84 | tv.stop() 85 | } 86 | 87 | fun backToTopButtonOnClick(v : View){ 88 | tv.backToTop() 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 |