🎺 Orchestra is a collection of Android custom view compatible libraries for Jetpack Compose.

Overview

Orchestra


License API Profile

🎺 Jetpack Compose compatible libraries using Balloon, ColorPickerView, PowerSpinner.

Balloon

Maven Central

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
    repositories {
        mavenCentral()
    }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:orchestra-balloon:1.0.4"
}

Usage

BalloonAnchor composable can be used in ConstraintLayout and it receives a constraint reference. In the below, BalloonAnchor references image composable. When clicked the image composable, balloon popup will be shown.

ConstraintLayout {
  val (image, title, content, message) = createRefs()

  // image, title, content, message //
  
  BalloonAnchor(
    reference = image,
    modifier = Modifier.aspectRatio(0.8f),
    balloon = BalloonUtils.getTitleBalloon(
      context = context,
      title = poster.name,
      lifecycle = lifecycleOwner
    ),
    onAnchorClick = { balloon, anchor -> balloon.show(anchor) }
  )

Or we can create a BalloonAnchor composable using Balloon.Factory.

BalloonAnchor(
  reference = image,
  modifier = Modifier.aspectRatio(0.8f),
  factory = MyBalloonFactory::class,
  onAnchorClick = { balloon, anchor -> balloon.show(anchor) },
  onBalloonClick = { },
  onBalloonDismiss = { },
  onBalloonInitialized = { content -> },
  onBalloonOutsideTouch = { content, event -> }
)

ColorPicker

Maven Central
And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:orchestra-colorpicker:$version"
}

Usage

ColorPicker composable implements a color picker with AlphaSlideBar and BrightnessSlideBar. We can create an alpha sidebar and brightness sidebar for changing saturation and lightness by tapping on the desired color. They should be used in children inner composable in ColorPicker, and they receive a colorPickerView as a parameter.

val (selectedColor, setSelectedColor) 
      = remember { mutableStateOf(ColorEnvelope(0)) }
ColorPicker(
    modifier = Modifier.fillMaxWidth().height(400.dp),
    onColorListener = { envelope, _ ->
      setSelectedColor(envelope)
    },
    initialColor = purple500,
    children = { colorPickerView ->
      Column(modifier = Modifier.padding(top = 32.dp)) {
        Box(modifier = Modifier.padding(vertical = 6.dp)) {
          AlphaSlideBar(
            modifier = Modifier.fillMaxWidth().height(30.dp)
              .clip(RoundedCornerShape(4.dp)),
            colorPickerView = colorPickerView
          )
        }
        Box(modifier = Modifier.padding(vertical = 6.dp)) {
          BrightnessSlideBar(
            modifier = Modifier.fillMaxWidth().height(30.dp)
              .clip(RoundedCornerShape(4.dp)),
            colorPickerView = colorPickerView
          )
        }
      }
    }
  )

AlphaTileBox

In a normal View, it can not represent ARGB colors accurately. Because a color will be mixed with the parent's background-color. For resolving it we can use AlphaTileBox composable. AlphaTileBox composable reflects ARGB colors.

AlphaTileBox(
  modifier = modifier.constrainAs(square) {
    bottom.linkTo(parent.bottom)
    centerHorizontallyTo(parent)
  }.size(64.dp).clip(RoundedCornerShape(4.dp))
) {
  it.setBackgroundColor(selectedColor.color)
}

Spinner

Maven Central
And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:orchestra-spinner:$version"
}

Usage

Spinner composable implements a lightweight dropdown popup spinner. Here is an example for creating a spinner using a sting array resource. We should use the String generic type for creating a spinner when we us a string array resource.

 val (selectedItem, setSelectedItem) 
      = remember { mutableStateOf("Choose a question") }
 Spinner<String>(
      text = selectedItem0,
      modifier = Modifier.fillMaxWidth().padding(16.dp)
        .background(blue200)
        .align(Alignment.CenterHorizontally),
       itemListRes = R.array.list_spinner,
      color = Color.White,
      style = MaterialTheme.typography.body2,
      textAlign = TextAlign.Center,
      showDivider = true,
      dividerColor = white87,
      overflow = TextOverflow.Ellipsis,
      maxLines = 1,
      spinnerPadding = 16.dp,
      spinnerBackgroundColor = MaterialTheme.colors.onBackground,
      onSpinnerItemSelected = { index, item ->
        setSelectedItem(item)
      }
    )

Here is an another example using a List for creating a spinner. In this case, we don't need to decide a generic type of Spinner.

 val coffeeList = remember { listOf("Americano", "Cold Brew", "Espresso", "Latte") }
 val (selectedItem1, setSelectedItem1) = remember { mutableStateOf("Choose your coffee") }
 Spinner(
      text = selectedItem1,
      modifier = Modifier.fillMaxWidth().padding(16.dp)
        .background(amber700)
        .align(Alignment.CenterHorizontally),
      itemList = coffeeList,
      color = Color.White,
      style = MaterialTheme.typography.body2,
      textAlign = TextAlign.Center,
      dividerColor = white87,
      overflow = TextOverflow.Ellipsis,
      maxLines = 1,
      spinnerPadding = 16.dp,
      spinnerBackgroundColor = MaterialTheme.colors.onBackground,
      onSpinnerItemSelected = { index, item ->
        setSelectedItem1(item)
      }
    )

Find this repository useful? ❀️

Support it by joining stargazers for this repository. ⭐
And follow me for my next creations! 🀩

License

Designed and developed by 2020 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Spinner dont work

    Spinner dont work

    Please complete the following information:

    • Library Version orchestra-spinner:1.1.3
    • Affected Device Xiaomi Redmi Note 8T Android 12

    Describe the Bug:

    I'm trying use Spinner in this View:

    package ru.wanket.rmp.view
    
    import androidx.compose.foundation.layout.fillMaxHeight
    import androidx.compose.foundation.layout.fillMaxWidth
    import androidx.compose.material.Text
    import androidx.compose.runtime.Composable
    import androidx.compose.ui.Modifier
    import androidx.compose.ui.tooling.preview.Preview
    import androidx.compose.ui.unit.dp
    import androidx.constraintlayout.compose.ConstraintLayout
    import com.skydoves.orchestra.spinner.Spinner
    import ru.wanket.rmp.view_model.BeerViewModel
    
    @Composable
    fun BeerView(
        headerText: String,
        colorNames: List<String>,
        viewModel: BeerViewModel
    ) = Ui(
        headerText,
        colorNames,
        viewModel.selectedBrands
    ) { _, item -> viewModel.onItemsSelected(item) }
    
    @Composable
    private fun Ui(
        headerText: String,
        colorNames: List<String>,
        selectedBrands: List<String>,
        onSpinnerItemSelected: (Int, String) -> Unit
    ) = ConstraintLayout(
        modifier = Modifier
            .fillMaxHeight()
            .fillMaxWidth()
    ) {
        val (headerLabel, spinner, resultLabel) = createRefs()
    
        Text(
            text = headerText,
            modifier = Modifier.constrainAs(headerLabel) {
                centerHorizontallyTo(parent)
                bottom.linkTo(spinner.top, 8.dp)
            }
        )
    
        Spinner(
            modifier = Modifier.constrainAs(spinner) {
                centerTo(parent)
            },
            itemList = colorNames,
            onSpinnerItemSelected = onSpinnerItemSelected
        )
    
        Text(
            text = selectedBrands.joinToString(),
            modifier = Modifier.constrainAs(resultLabel) {
                centerHorizontallyTo(parent)
                top.linkTo(spinner.bottom, 8.dp)
            }
        )
    }
    
    @Preview
    @Composable
    fun PreviewUi() = Ui(
        "Header text",
        listOf("Color"),
        listOf("Selected brand")
    ) { _, _ -> }
    

    but I got runtime error:

    E/AndroidRuntime: FATAL EXCEPTION: main
        Process: ru.wanket.rmp, PID: 7897
        java.lang.NoSuchMethodError: No static method rememberConstraintLayoutMeasurePolicy(ILandroidx/constraintlayout/compose/ConstraintLayoutScope;Landroidx/compose/runtime/MutableState;Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/layout/MeasurePolicy; in class Landroidx/constraintlayout/compose/ConstraintLayoutKt; or its super classes (declaration of 'androidx.constraintlayout.compose.ConstraintLayoutKt' appears in /data/app/ru.wanket.rmp-ouLLqshfga8ub_J0R7k4ow==/base.apk)
            at com.skydoves.orchestra.spinner.Spinner__SpinnerComposeKt.Spinner-v3xfejs(SpinnerCompose.kt:264)
            at com.skydoves.orchestra.spinner.Spinner.Spinner-v3xfejs(SpinnerCompose.kt:1)
            at ru.wanket.rmp.view.BeerViewKt$Ui$$inlined$ConstraintLayout$2.invoke(ConstraintLayout.kt:1534)
            at ru.wanket.rmp.view.BeerViewKt$Ui$$inlined$ConstraintLayout$2.invoke(ConstraintLayout.kt:92)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.ui.layout.LayoutKt.MultiMeasureLayout(Layout.kt:562)
            at ru.wanket.rmp.view.BeerViewKt.Ui(BeerView.kt:91)
            at ru.wanket.rmp.view.BeerViewKt.BeerView(BeerView.kt:19)
            at ru.wanket.rmp.activity.BeerActivity$onCreate$1.invoke(BeerActivity.kt:18)
            at ru.wanket.rmp.activity.BeerActivity$onCreate$1.invoke(BeerActivity.kt:17)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:410)
            at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252)
            at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
            at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:166)
            at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
            at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
            at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
            at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
            at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:3337)
    E/AndroidRuntime:     at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2582)
            at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2571)
            at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:247)
            at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
            at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2571)
            at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2522)
            at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:478)
            at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:748)
            at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
            at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:907)
            at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
            at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
            at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
            at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
            at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
            at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:994)
            at android.view.View.dispatchAttachedToWindow(View.java:20105)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3430)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2052)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1745)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7768)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:967)
            at android.view.Choreographer.doCallbacks(Choreographer.java:791)
            at android.view.Choreographer.doFrame(Choreographer.java:726)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:7356)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    

    Using preview in AS show this error:

    java.lang.NoSuchMethodError: 'androidx.compose.ui.layout.MeasurePolicy androidx.constraintlayout.compose.ConstraintLayoutKt.rememberConstraintLayoutMeasurePolicy(int, androidx.constraintlayout.compose.ConstraintLayoutScope, androidx.compose.runtime.MutableState, androidx.compose.runtime.Composer, int)'
    	at com.skydoves.orchestra.spinner.Spinner__SpinnerComposeKt.Spinner-v3xfejs(SpinnerCompose.kt:264)
    	at com.skydoves.orchestra.spinner.Spinner.Spinner-v3xfejs(SpinnerCompose.kt:1)
    	at ru.wanket.rmp.view.BeerViewKt$Ui$$inlined$ConstraintLayout$2.invoke(ConstraintLayout.kt:1534)
    	at ru.wanket.rmp.view.BeerViewKt$Ui$$inlined$ConstraintLayout$2.invoke(ConstraintLayout.kt:92)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.ui.layout.LayoutKt.MultiMeasureLayout(Layout.kt:562)
    	at ru.wanket.rmp.view.BeerViewKt.Ui(BeerView.kt:91)
    	at ru.wanket.rmp.view.BeerViewKt.PreviewUi(BeerView.kt:65)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at androidx.compose.ui.tooling.CommonPreviewUtils.invokeComposableMethod(CommonPreviewUtils.kt:150)
    	at androidx.compose.ui.tooling.CommonPreviewUtils.invokeComposableViaReflection$ui_tooling_release(CommonPreviewUtils.kt:189)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1$composable$1.invoke(ComposeViewAdapter.kt:593)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1$composable$1.invoke(ComposeViewAdapter.kt:591)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1.invoke(ComposeViewAdapter.kt:630)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3$1.invoke(ComposeViewAdapter.kt:586)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
    	at androidx.compose.ui.tooling.InspectableKt.Inspectable(Inspectable.kt:61)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.kt:535)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$WrapPreview$1.invoke(ComposeViewAdapter.kt:534)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
    	at androidx.compose.ui.tooling.ComposeViewAdapter.WrapPreview(ComposeViewAdapter.kt:530)
    	at androidx.compose.ui.tooling.ComposeViewAdapter.access$WrapPreview(ComposeViewAdapter.kt:121)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3.invoke(ComposeViewAdapter.kt:586)
    	at androidx.compose.ui.tooling.ComposeViewAdapter$init$3.invoke(ComposeViewAdapter.kt:583)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:410)
    	at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252)
    	at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
    	at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:166)
    	at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
    	at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
    	at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    	at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:3337)
    	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2582)
    	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2571)
    	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:247)
    	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
    	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2571)
    	at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2522)
    	at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:478)
    	at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:748)
    	at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
    	at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:907)
    	at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
    	at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
    	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
    	at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
    	at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
    	at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:994)
    	at android.view.View.dispatchAttachedToWindow(View.java:20753)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3490)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
    	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497)
    	at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:57)
    	at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:368)
    	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:436)
    	at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:121)
    	at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:736)
    	at com.android.tools.idea.rendering.RenderTask.lambda$inflate$7(RenderTask.java:892)
    	at com.android.tools.idea.rendering.RenderExecutor$runAsyncActionWithTimeout$2.run(RenderExecutor.kt:187)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    

    Expected Behavior:

    View is works

    opened by Wanket 2
  • Show tooltip without clicking the anchor

    Show tooltip without clicking the anchor

    Is your feature request related to a problem?

    I am trying to display a tooltip when the anchor is displayed, is there a way to do this without a click event?

    Describe the solution you'd like:

    Please display the tooltip without requiring a click event.

    opened by CherryPepsi 2
  • BalloonAnchor onAnchorClick onLongClick

    BalloonAnchor onAnchorClick onLongClick

    Is your feature request related to a problem?

    I would like to only show the balloon once the reference was on longclick, while it passed the function for the click

    Describe the solution you'd like:

    using the combineClickable to enable use the onLongClick

    modifier = Modifier.combinedClickable(
        onClick = {
            
        },
        onLongClick = {
            
        }
    ),
    
    opened by ArthurKun021 1
  • Please still support jvmTarget 1.8 in order to support projects with Jacoco

    Please still support jvmTarget 1.8 in order to support projects with Jacoco

    • Library Version - 1.1.1
    • Affecting all builds

    Bug Description:

    So our project uses Jacoco version 0.8.7 and in order to not have the build error mentioned here: https://issuetracker.google.com/issues/178400721 we have to keep the following at Java 8, although our home JDK is set to 11 to support Compose and the AGP 7.0.3

    android {
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    

    The issue is that this library if you use the createBalloon Kotlin DSL method then we get this build error:

    Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
    

    But we can't upgrade the JVM target or we run into the build issue with Jacoco. In the meantime I expect we'll just use the Java supported Balloon.Builder but would be nice to use the Kotlin DSL.

    Expected Behavior:

    The ability to use the createBalloon DSL without having to upgrade the JVM target.

    opened by cweggler 1
  • spinnerBackgroundColor not switching when toggling dark / light theme

    spinnerBackgroundColor not switching when toggling dark / light theme

    Please complete the following information:

    • Library Version v1.1.0
    • Affected Device(s) Pixel 5

    Describe the Bug:

    The value passed to spinnerBackgroundColor is remembered, so the color does not change even when the theme is toggled from/to dark/light.

    https://github.com/skydoves/Orchestra/blob/85e82b5e690ad702bec6275cfff42016509dc59e/spinner/src/main/java/com/skydoves/orchestra/spinner/SpinnerCompose.kt#L144-L157

    Expected Behavior:

    Since the color value passed to color switches when toggling the app theme, I suppose the background color of spinner should also switch based on which theme is currently applied.

    opened by shoheikawano 1
  • Fix typo

    Fix typo

    Guidelines

    Fix typo

    Types of changes

    • [x] Bugfix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    opened by ao0000 0
  • Show arrow on dropdown

    Show arrow on dropdown

    Is your feature request related to a problem?

    It's impossible to discern a Dropdown from a normal Button

    Describe the solution you'd like:

    I'd like to have an arrow pointing downwards on the dropdown, showing that you can display more options.


    I believe this is related to code in https://github.com/skydoves/Orchestra/blob/025385f2a0a982bbbb658e007f60be40a654ebc2/spinner/src/main/kotlin/com/skydoves/orchestra/spinner/SpinnerCompose.kt#L150

    As it has a setArrow boolean, which is not present in the list of parameters. If it is really a 'should I display a dropdown arrow' we should add it to the composable funcion

    opened by LeoColman 0
  • android.view.InflateException

    android.view.InflateException

    Please complete the following information:

    • Library Version 1.1.1
    • Affected Device Xiaomi Mi 11 (Android 12)

    Found a crash on crashlytics. The exception here:

    Fatal Exception: android.view.InflateException: Binary XML file line #65 in com.steleot.jetpackcompose.playground:layout/layout_balloon_library_skydoves: Binary XML file line #65 in com.steleot.jetpackcompose.playground:layout/layout_balloon_library_skydoves: Error inflating class androidx.appcompat.widget.AppCompatImageView
    ...
    Caused by android.content.res.Resources$NotFoundException: Drawable (missing name) with resource ID #0x7f080059
    ...
    

    Expected Behavior:

    Not to crash on Android 12 on Device

    opened by Vivecstel 0
  •  How should I use ComposeView to setLayout in Balloon?

    How should I use ComposeView to setLayout in Balloon?

    • Library Version com.github.skydoves:orchestra-balloon:1.1.1

    • Affected Device(s) Android 10

    Describe the Bug:

    I try to write like this

    BalloonAnchor(
                reference = row,
                balloon = Balloon.Builder(LocalContext.current).apply {
                    setLayout(ComposeView(LocalContext.current).apply {
                        setContent {
                            // In Compose world
                            MaterialTheme {
                                Text("Hello Compose!")
                            }
                        }
                    })
                }.build(),
                onAnchorClick = { balloon, anchor ->
                    balloon.showAsDropDown(anchor)
                }
            )
    

    it crashed

      java.lang.IllegalStateException: Cannot locate windowRecomposer; View androidx.compose.ui.platform.ComposeView{8b981b1 V.E...... ......I. 0,0-0,0} is not attached to a window
            at androidx.compose.ui.platform.WindowRecomposer_androidKt.getWindowRecomposer(WindowRecomposer.android.kt:225)
            at androidx.compose.ui.platform.AbstractComposeView.resolveParentCompositionContext(ComposeView.android.kt:244)
            at androidx.compose.ui.platform.AbstractComposeView.ensureCompositionCreated(ComposeView.android.kt:251)
            at androidx.compose.ui.platform.AbstractComposeView.onMeasure(ComposeView.android.kt:288)
            at android.view.View.measure(View.java:25477)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
            at android.view.View.measure(View.java:25477)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
            at android.view.View.measure(View.java:25477)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
            at android.view.View.measure(View.java:25477)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
            at android.view.View.measure(View.java:25477)
            at com.skydoves.balloon.Balloon$showAsDropDown$$inlined$show$1.run(Balloon.kt:747)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:217)
            at android.app.ActivityThread.main(ActivityThread.java:8002)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:502)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
    
    opened by wosika 2
Releases(1.2.0)
  • 1.2.0(Aug 28, 2022)

    What's Changed

    • Updated Jetpack Compose Compiler to 1.3.0 and UI to 1.3.0-beta01.
    • Updated Balloon to 1.4.7 and PowerSpinner to 1.2.5.
    • Added onAnchorLongClick and onLongClickLabel properties to the BalloonAnchor by @skydoves in https://github.com/skydoves/Orchestra/pull/26
    • Added ColorPickerProperties and SpinnerProperties by @skydoves in https://github.com/skydoves/Orchestra/pull/27
    • Implement ColorPicker & Spinner properties' local providers by @skydoves in https://github.com/skydoves/Orchestra/pull/27

    Full Changelog: https://github.com/skydoves/Orchestra/compare/1.1.5...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.5(Jul 7, 2022)

    πŸŽ‰ A new version 1.1.5 was released! πŸŽ‰

    What's Changed

    • Update PowerSpinner to 1.2.3 and Landscapist to 1.5.2 by @skydoves in https://github.com/skydoves/Orchestra/pull/23
    • Update Compose compiler version to 1.2.0 and balloon to 1.4.6 by @skydoves in https://github.com/skydoves/Orchestra/pull/24

    Full Changelog: https://github.com/skydoves/Orchestra/compare/1.1.4...1.1.5

    Source code(tar.gz)
    Source code(zip)
  • 1.1.4(May 10, 2022)

    πŸŽ‰ Released a new version 1.1.4! πŸŽ‰

    What's Changed

    • Updated Jetpack Compose to version 1.1.1 by @skydoves in https://github.com/skydoves/Orchestra/pull/18
    • Migrated Balloon to version 1.4.5 and PowerSpinner to 1.2.1 by @skydoves in https://github.com/skydoves/Orchestra/pull/21
    • Migrate internal maven publishing processes by @skydoves in https://github.com/skydoves/Orchestra/pull/22

    Full Changelog: https://github.com/skydoves/Orchestra/compare/1.1.3...1.1.4

    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Feb 11, 2022)

    What's Changed

    • Bump Jetpack Compose to 1.1.0 and clean up Gradle by @skydoves in https://github.com/skydoves/Orchestra/pull/17

    Full Changelog: https://github.com/skydoves/Orchestra/compare/1.1.2...1.1.3

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Jan 8, 2022)

    What's Changed

    • Bump Jetpack Compose to 1.1.0-rco1 by @skydoves in https://github.com/skydoves/Orchestra/pull/12
    • Bump Balloon to 1.4.1 by @skydoves in https://github.com/skydoves/Orchestra/pull/14
    • Bump ColorPickerView to 2.2.4 by @skydoves in https://github.com/skydoves/Orchestra/pull/14
    • Bump Landscapist 1.4.5 by @skydoves in https://github.com/skydoves/Orchestra/pull/9

    Full Changelog: https://github.com/skydoves/Orchestra/compare/1.1.1...1.1.2

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Oct 9, 2021)

    πŸŽ‰ Released a new stable 1.1.1! πŸŽ‰

    What's New?

    • Migrated Jetpack Compose to 1.0.3.
    • Updated Balloon to 1.3.9 internally.
    • Updated Kotlin to 1.5.30 internally.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jul 28, 2021)

  • 1.0.8(Jul 17, 2021)

    πŸŽ‰ Released a new version 1.0.8! πŸŽ‰

    What's New?

    • Migrated Jetpack Compose to Rc02.
    • Updated Balloon to 1.3.5.
    • Updated PowerSpinner to 1.1.8.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.7(Jun 18, 2021)

  • 1.0.6(Jun 6, 2021)

  • 1.0.5(May 25, 2021)

  • 1.0.4(Mar 12, 2021)

    πŸŽ‰ Released a new version 1.0.4! πŸŽ‰

    What's New?

    • Migrated to compose beta02.
    • Updated to balloon 1.3.3 in the orchestra-balloon module.
    • Updated to colorpickerview 2.2.3 in the orchestra-colorpicker module.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Jan 16, 2021)

  • 1.0.2(Dec 17, 2020)

    πŸŽ‰ Released a new version 1.0.2! πŸŽ‰

    What's new?

    • Migrated to compose 1.0.0-alpha09.
    • Updated Balloon version to 1.2.8.
    • Updated PowerSpinner version to 1.1.7.
    • Update kotlin version to 1.4.21.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Nov 12, 2020)

    πŸŽ‰ Released a new version 1.0.1! πŸŽ‰

    What's New?

    • Updated compose version to 1.0.0-alpha07.
    • Updated ColorPickerView version to 2.2.2.
    • Updated Balloon version to 1.2.5.
    • Updated PowerSpinner version to 1.1.5
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Oct 4, 2020)

Owner
Jaewoong Eum
Android software engineer. Digital Nomad. Open Source Contributor. ❀️ Love coffee, music, magic tricks and writing poems. Coffee Driven Development.
Jaewoong Eum
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
Lightweight library to tweak the fling behaviour in Android. This library is only compatible with Jetpack-Compose.

Flinger (Only compatible with compose) What is Flinger? Flinger is a plugin that is made on top of jetpack compose that will help the developer to twe

Joseph James 73 Dec 24, 2022
An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries

An application that i developed with a aim of learning Jetpack compose and many other jetpack libraries, The application make use of jikan Api which displays a list of animations,there more details and even trailers of the animations.

Odhiambo Brandy 10 Nov 23, 2022
A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential

ComposeCookBook Declarative UI A Collection of all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential. Jetpack Compo

Gurupreet Singh 4.9k Dec 31, 2022
A Collection of major Jetpack compose UI components which are commonly used.πŸŽ‰πŸ”πŸ‘Œ

SSComposeCookBook A Collection of major Jetpack compose UI components which are commonly used. Introduction Jetpack Compose is a modern toolkit for bu

Simform Solutions 370 Dec 28, 2022
ComposeAnimations - Collection of nice animations created with Jetpack Compose

CertificateStack.kt CardStackDemo.mp4 SwipeButton.kt SwipeButton.mp4

Anton Shilov 276 Dec 24, 2022
πŸš€πŸžπŸ’ͺ Collection of Images, Modifiers, utility functions for Jetpack Compose to expand and enrich displaying, manipulating, scaling, resizing, zooming, and getting cropped ImageBitmap based on selection area

Collection of Images, Modifiers, utility functions for Jetpack Compose to expand and enrich displaying, manipulating, scaling, resizing, zooming, and getting cropped ImageBitmap based on selection area, before/after image to with handle to show partial of both images and more is cooking up

Smart Tool Factory 207 Dec 26, 2022
FullMangement - an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries, and MVVM design pattern.

Full Management is an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries and MVVM design pattern.

Amr algnyat 4 Nov 1, 2022
Pinocchio is a group of libraries for various common UI components. It could contain Composable, View, and everything related to UI.

Pinocchio Pinocchio is a group of libraries for various common UI components. It could contain Composable, View, and everything related to UI. All UI

NAVER Z 24 Nov 30, 2022
OTPView is a view made in Jetpack compose. It is highly customisable and can be used to show OTP view with different length and shapes.

OTPView OTPView is a highly costumizable OTP view made in the Jetpack compose UI. Usage: CircleOtpView is a sample composable that calls the OtpView w

kunalsale 17 Aug 4, 2022
πŸ’» A cross-platform desktop application to identify libraries used inside an android application. Made possible by Compose Desktop ⚑

?? stackzy A desktop app to analyse APK. Built using Compose desktop ✨ Demo Watch demo ??️ Usage Show usage ?? Install Platform Download Status Linux

theapache64 876 Dec 24, 2022
Carol 12 Sep 25, 2022
a Custom Snackbar Library for Jetpack Compose πŸš€πŸŽ¨

?? Snackie is a custom snackbar library for jetpack compose built without using the built in snackbar component ?? Implementation repositories { ma

MathRoda 10 Dec 24, 2022
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

MindOrks 382 Jan 5, 2023
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop πŸš€, using Canvas API 🎨

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

omar 1 Aug 11, 2022
Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose

Jetpack-compose-animations-examples This repository consists of 4 animations: St

Canopas Software 180 Jan 2, 2023
Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

Adam Kobus 5 Apr 5, 2022