Code Monkey home page Code Monkey logo

chords's Introduction

chRyNaN

Chris Keenan

Professional software engineer. Kotlin and clean code enthusiast. Active open source contributor for the Kotlin multi-platform ecosystem. Senior Android Engineer at @StarryInternet.


Open Source Projects

  • inject - Inject annotations for common code.
  • serialization-parcelable - Android Parcelable support for kotlinx.serialization.
  • krypt - Kotlin multi-platform cryptographic utility library.
  • kapi - Server-side API development with Ktor.
  • cycle - App presentation layer design pattern.
  • navigation - App navigation library.
  • time - Kotlin Duration and kotlinx.datetime companion library.
  • paginate - Kotlin Pagination Library.
  • dispatchers - Simple wrapper around the Kotlin Coroutine Dispatchers object for common usecases.
  • validator - Simple and flexible validation library.
  • colors - Color representation for common code.
  • emoji - Emoji usage and UI support library.
  • logger - Kotlin Multi-platform logging utility.
  • uri - Kotlin Mutli-platform URI objects and validation.

Featured articles

Badge Badge Badge Badge Badge Badge
Kotlin Weekly Issue #182


Help support my Kotlin multi-platform open source work!

Buy Me A Coffee

chords's People

Contributors

chrynan avatar cullub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chords's Issues

Bintray hosting shut down

Describe the bug
Pulling this repo from bintray no longer works. This appears to be because bintray is shutting down: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

The main readme.md shows

    maven {
        url = uri("https://dl.bintray.com/chrynan/chrynan")
    }

[...]

    implementation "com.chrynan.chords:chords-core:$rootProject.chordsVersion"
    implementation "com.chrynan.chords:chords-core-jvm:$rootProject.chordsVersion"
    implementation "com.chrynan.chords:chords-android:$rootProject.chordsVersion"

as the correct way to download this library, but this seems to no longer be working.

Trying the above resulted in the following error message during build:

9: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.chrynan.chords:chords-core-jvm:2.4.0.
     Required by:
         project :app
      > Could not resolve com.chrynan.chords:chords-core-jvm:2.4.0.
         > Could not get resource 'https://dl.bintray.com/chrynan/chrynan/com/chrynan/chords/chords-core-jvm/2.4.0/chords-core-jvm-2.4.0.pom'.
            > Could not GET 'https://dl.bintray.com/chrynan/chrynan/com/chrynan/chords/chords-core-jvm/2.4.0/chords-core-jvm-2.4.0.pom'. Received status code 502 from server: Bad Gateway
   > Could not resolve com.chrynan.chords:chords-android:2.4.0.
     Required by:
         project :app
      > Could not resolve com.chrynan.chords:chords-android:2.4.0.
         > Could not get resource 'https://dl.bintray.com/chrynan/chrynan/com/chrynan/chords/chords-android/2.4.0/chords-android-2.4.0.pom'.
            > Could not GET 'https://dl.bintray.com/chrynan/chrynan/com/chrynan/chords/chords-android/2.4.0/chords-android-2.4.0.pom'. Received status code 502 from server: Bad Gateway

It also failed with the previous version I had been using (2.3.1).

ChordChart.fretStart doesn't affect ChordWidget display

Setting ChordChart.fretStart does not change where the widget displays the first fret. The number of frets displayed will consistently be fretEnd - fretStart, but setting fretStart = 5 should make the first (top) fret displayed be fret number 5.

I'm using Kotlin for Android, and Chords version 2.1.0. Here's some relevant code:

val defaultChordChart = ChordChart.STANDARD_TUNING_GUITAR_CHART
chordWidget.chord = myChord
chordWidget.chart = defaultChordChart.copy(fretStart = 5, fretEnd = 6)

This results in frets 1 and 2 being shown. Note that when fret labels are turned on, they are correctly positioned, and the right numbers as well (i.e., frets 5 and 6 would be labeled in this case, although they wouldn't be shown since only the first two frets are shown here).

  • Library Version: [2.1.0]

Colors library out of date/buggy

The com.chrynan.colors library version is currently 0.3.0, which triggers a crash every time a chord is displayed due to a colors bug (that was fixed in more recent versions). Upgrade to latest?

Publish new release?

Could we get another release published to the official channels with the latest bug fixes/etc?

Release build fails "unexpected attempt to get register for a value without a method"

Error:

Unexpected attempt to get register for a value without a register in method java.util.List com.chrynan.chords.parser.AsciiChordParser.parseLineAsString(java.lang.String, int, java.util.Set).

This only happens when I try to generate a signed APK or Bundle, not when I generate an apk or bundle normally, and the app starts and runs fine using debug apks.

Is this a chords problem?

Chord unparcelizing / deserializing throws SerializationException

Describe the bug
When I call com.chrynan.chords.util.putChord(key, chord) to put a chord in a Bundle(), then later call bundle.getChord(key), the chords library throws a SerializationException ("Expected Json Decoder").

To Reproduce
Here's my code putting the chord in a Bundle:

MyFragment().apply {
    arguments = Bundle().apply {
        putChord(KEY_CHORD, chord)
    }
}

And here's the get:

arguments?.getChord(KEY_CHORD)

Expected behavior
The chord should be retrieved.

Desktop (please complete the following information):

  • OS: Android
  • Browser N/A
  • Version 11

Smartphone (please complete the following information):

  • Device: Emulated Pixel 4 XL API 30
  • OS: Android
  • Browser N/A
  • Version 11

Stacktrace

2021-12-27 00:37:40.111 5630-5630/com.gbros.tabslite E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.gbros.tabslite, PID: 5630
    kotlinx.serialization.SerializationException: Expected Json Decoder for com.chrynan.parcelable.core.ParcelDecoder@4761331.
        at com.chrynan.chords.model.serializer.ChordMarkerJsonSerializer.deserialize(ChordMarkerJsonSerializer.kt:36)
        at com.chrynan.chords.model.serializer.ChordMarkerJsonSerializer.deserialize(ChordMarkerJsonSerializer.kt:16)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:260)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
        at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535)
        at kotlinx.serialization.internal.ListLikeSerializer.readElement(CollectionSerializers.kt:80)
        at kotlinx.serialization.internal.ListLikeSerializer.readAll(CollectionSerializers.kt:76)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:31)
        at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:260)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
        at com.chrynan.chords.model.Chord$$serializer.deserialize(Chord.kt:25)
        at com.chrynan.chords.model.Chord$$serializer.deserialize(Chord.kt:25)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:260)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at com.chrynan.parcelable.android.AndroidParcelableUtilsKt.decodeFromParcel(AndroidParcelableUtils.kt:63)
        at com.chrynan.parcelable.android.AndroidParceler.createFromParcel(AndroidParceler.kt:23)
        at com.chrynan.parcelable.android.AndroidParcelBundleUtilsKt.decodeFromBundle(AndroidParcelBundleUtils.kt:88)
        at com.chrynan.chords.util.ParcelableUtilsKt.getChord(ParcelableUtils.kt:104)
        at com.gbros.tabslite.ChordFragment$chord$2.invoke(ChordFragment.kt:34)
        at com.gbros.tabslite.ChordFragment$chord$2.invoke(ChordFragment.kt:34)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at com.gbros.tabslite.ChordFragment.getChord(ChordFragment.kt:34)
        at com.gbros.tabslite.ChordFragment.onCreateView(ChordFragment.kt:38)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2995)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:523)
        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1840)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
        at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1670)
        at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:317)
        at androidx.viewpager2.adapter.FragmentStateAdapter.placeFragmentInViewHolder(FragmentStateAdapter.java:341)
        at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:276)
        at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:67)
        at androidx.recyclerview.widget.RecyclerView.dispatchChildAttached(RecyclerView.java:7867)
        at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:893)
        at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:107)
2021-12-27 00:37:40.117 5630-5630/com.gbros.tabslite E/AndroidRuntime:     at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:8902)
        at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8860)
        at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8848)
        at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1645)
        at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
        at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
        at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
        at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3686)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChild(ViewGroup.java:6928)
        at androidx.viewpager2.widget.ViewPager2.onMeasure(ViewPager2.java:498)
        at android.view.View.measure(View.java:25466)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:25466)
        at com.google.android.material.bottomsheet.BottomSheetBehavior.onMeasureChild(BottomSheetBehavior.java:463)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:831)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:747)
        at android.view.View.measure(View.java:25466)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3397)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2228)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2486)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:731)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
2021-12-27 00:37:40.117 5630-5630/com.gbros.tabslite E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-12-27 00:37:40.144 5630-5630/com.gbros.tabslite I/Process: Sending signal. PID: 5630 SIG: 9

Additional context

getChord() uses com.chrynan.parcelable and calls (eventually) ChordMarkerJsonSerializer.deserialize, but calls it with a com.chrynan.parcelable.core.ParcelDecoder. That doesn't implement JsonDecoder, so ChordMarkerJsonSerializer.kt throws a SerializationException.

For reference, I'm working on TabsLite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.