Questions tagged [constraintset]

is a class that allows you to define programmatically a set of constraints to be used with ConstraintLayout

[please rename this tag to android-constraintset since it belongs to android.]

30 questions
7
votes
4 answers

Is ConstraintSet.connect() margin parameter in px or dp?

val margin = 8 ConstraintSet().apply { connect(anId, ConstraintSet.START, anotherId, ConstraintSet.START, margin) } Is margin applied as pixels or density-dependent pixels? Various articles scattered around the web and apocryphal knowledge seem…
nukeforum
  • 1,284
  • 3
  • 16
  • 38
7
votes
1 answer

Constraint Set animation inside Recycler View not animating properly

I am using a constraint layout for my recycler view items. To animate (expand/collapse) them I use Constraint Set animation. The opening animation runs fine on all items. The closing animation runs fine also, but when the closing animation starts on…
2
votes
1 answer

Adding barriers programmatically via ConstraintSet doesn't work when I change id's of elements?

I've been trying to add a barrier programmatically to a constraint layout in Android Studio using ConstraintSet but I just can't get my code to work, the end result should just be a textView, then a barrier to its right, and another textview that…
2
votes
2 answers

measured layout size is zero when using ConstraintSet

This is driving me crazy! measured layout is always 0 when i try to build layout programmatically using constraint layout and constraint set. I tried requestLayout, forceLayout, invalidate on all child and parents. but width and height is 0…
1
vote
0 answers

Working with ConstraintLayout, ConstraintSet and TransitionManager in Android

I am trying to understand how ConstraintLayout, ConstraintSet and TransitionManager work in Android development. For that I made the following tiny application and then I have a question for any expert in the field that may happen to read…
Michel
  • 10,303
  • 17
  • 82
  • 179
1
vote
1 answer

How to use MotionLayout, MotionScene, ConstraintSet in jetpack compose?

I'm trying to implement something like this animation in jetpack compose and from what I've laid my eyes up until this point makes me think I should use MotionLayout, ConstraintSet, MotionScene but the documentation is poor and I don't get much of…
1
vote
1 answer

Animate TextView to lower case using MotionLayout

Animate textView in Capitalize to lower Case using MotionLayout like FACTS -> facts I am succeeded in translating and change textColor where as I am not able to convert all letter to lower case during animation MotionScene
1
vote
1 answer

ConstraintLayout Slide Transition animation is displaying the view's full height before the animation ends

I have the following Activity and layout: import android.os.Bundle import android.view.Gravity import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.constraintlayout.widget.ConstraintLayout import…
1
vote
0 answers

How to show different xml layout with different component and ids in one constraintLayout with constraintSet in android

I have a fragment that I need show and gone some XML layout into that with some steps (in this example I have 3 steps) I know simply we can include layout into parent fragment layout and just handle visible/gone layout. but I want to do it with…
1
vote
1 answer
1
vote
2 answers

Change constraint in recyclerview viewholder layout - android

I am working on chat app so I want time TextView to be like whats app it's constraint can change depend on the text So I tried the view tree observer in the message layout and it somehow worked but there something missing private fun…
1
vote
1 answer

Repeating ConstraintSet's transition animation issue on BottomSheetFragment

I wanted to animate the layout changes on BottomSheetFragment upon clicked. I implemented the ConstraintSet.applyTo and TransitionManager.beginDelayedTransition to change the initial scene to final scene. But when transition occurs, it seems the…
0
votes
1 answer

Move a button in constrainlayout according to finger movement in Android

I want to move a button in constrainlayout according to finger movement however it has problem. I used the constrainset to reposition the button where I put my finger down, but the button automatically shifted a bit more than I expected. I already…
0
votes
1 answer

Constraining a EditText view to a checkBox programmatically in android?

What I am trying here is, when the addNewToDo button is clicked, the defaultEditText view should be converted from editText view into a checkBox view with the same constraints as the defaultEditText, and I am quite successful in doing so Using the…
0
votes
1 answer

Is there a way to set MotionLayout custom attribute for MaterialButton's iconTint?

According to this article CustomAttribute are specified with the attributeName, which needs to match the getter/setter methods of an object such that: getter: getName (e.g. getBackgroundColor) setter: setName (e.g. setBackgroundColor) (so…
1
2