android-constraintlayout

When manually set progress to MotionLayout it clear all constraints

≯℡__Kan透↙ 提交于 2021-01-27 06:16:24
问题 I have MotionLayout with two widgets, one is described in MotionLayout, second - in scene file. Layout file: <android.support.constraint.motion.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/motion_layout" android:layout_width="match_parent" android:layout_height="match_parent" app:layoutDescription="@xml/scene_test"> <View android:id="@+id/test_view_static" android:layout_width="40dp" android:layout

ConstraintLayout Barrier not visible in design view

你离开我真会死。 提交于 2021-01-27 04:52:07
问题 I'm trying to add a barrier to my ConstraintLayout in Android Studio but it is not showing up the way it should in design view. I have been following this tutorial, but I can't get things to work properly. I'm currently using: Android Studio 3.1.1 androidx.constraintlayout:constraintlayout:1.1.3 Things I have tried: Invalidate caches/restart Removing the attribute tools:layout_editor_absoluteX Fiddling around! Here's my test.xml : <?xml version="1.0" encoding="utf-8"?> <androidx

MotionLayout: OnSwipe and OnClick on same view

亡梦爱人 提交于 2021-01-21 07:31:28
问题 I am using MotionLayout for my page. I have two states which is toggled with OnSwipe of a view: <Transition motion:constraintSetStart="@+id/start" motion:constraintSetEnd="@+id/end" motion:duration="700" motion:motionInterpolator="easeIn"> <OnSwipe motion:dragDirection="dragUp" motion:touchAnchorId="@+id/view" motion:touchAnchorSide="bottom" motion:touchRegionId="@+id/view" /> </Transition> I also want to add OnClickListener to this view from code, or add new Transition in scene.xml file,

Multi-line text-views alignment to their baseline (ConstraintLayout Android Studio)

*爱你&永不变心* 提交于 2021-01-21 06:33:31
问题 I have three TextViews "hi" , "x" and "Hello World" which I would like to align in the bottom of the Hello World text (ie hi_x_World). Hello World is just one line but both layout_width and layout_height are set to wrap_content . They have different font sizes so even though I can easily align the bottom of the boxes of the textviews, the text itself does not become aligned. I found a different XML parameter app:layout_constraintBaseline_toBaselineOf="@+id/text that works when I only have one

RecyclerView changes its scroll position when inside a ConstraintLayout

做~自己de王妃 提交于 2020-12-30 07:43:44
问题 I encountered an issue with RecyclerView when it is a child of a ConstraintLayout . Originally, the RecyclerView was somewhere deep in the view hierarchy of Relative- , Frame- and LinearLeayout s, and everything worked well until I decided to flatten view tree using ConstraintLayout. I noticed that each time when there is a layout change, caused by anything (window resize, data set change notification, etc), the scroll position of the RecyclerView is changed. For example, every time I show

Equally spaced four images using constraint layout

痞子三分冷 提交于 2020-11-29 03:06:14
问题 i want to equally spaced four images using constraint layout...i have used guidelines but it is giving me a lot of space between the images and right corner images are going out of the screen i want something like this --> but from following code im getting this --> from another device i tried running it is not giving desired result following is the code:-- <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android

Equally spaced four images using constraint layout

浪子不回头ぞ 提交于 2020-11-29 03:00:46
问题 i want to equally spaced four images using constraint layout...i have used guidelines but it is giving me a lot of space between the images and right corner images are going out of the screen i want something like this --> but from following code im getting this --> from another device i tried running it is not giving desired result following is the code:-- <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android