android-constraintlayout

ConstraintLayout with Barriers; How to constraint to bottom / top of barrier depending on size

时光怂恿深爱的人放手 提交于 2019-12-30 05:14:12
问题 I am trying out the new Barrier feature in the 1.1.0-beta1. It works as expected however there is this use-case I cant seem to figure or (or is possible ConstraintLayout at all?) What I am trying to accomplish is: I have a imageview to the left, and title and subtitle textviews to the right of the imageview. Imageview is fixed height. I have a button, that is bottom constrained to the bottom of the imageview however should be top constrained to the bottom of the subtitle textview, if

can ConstraintLayout help to flow the right side item to next line?

心已入冬 提交于 2019-12-29 07:05:43
问题 Having a textView alight to left edge, its width could grow. Having some other textView in its right align in single line. When the left textView width grows, would like the right textView to be pushed down to next line: [AAA] [BBB] when left one width grows: [AAA AAA AAA AAA AAA] [BBB] Thought seeing some sample using ConstraintLayout to automatically push the right side item to next line down, but couldnt find any. It is doable with ContraintLayOut , or anyone knows some sample to do it?

Could not find Constraint Layout inside Android Studio

。_饼干妹妹 提交于 2019-12-25 09:17:47
问题 Everything was working fine inside studio, but then I get error: Could not find com.android.support.constraint:constraint-layout:1.0.0-beta4. Problem is that I can not install Constraint layout in Android Studio because I am using Ubuntu.I can not find SDK Tools(System Settings) to install manually like usually on MAC. None of solutions here worked for me because they are mostly for MAC OS. I am using Android 2.2 on Ubuntu 14.04, and Gradle 2.2.2. 回答1: I am using Android 2.2 if you use

Showing a full-width ImageView containing a SVG distorts it

本秂侑毒 提交于 2019-12-25 00:53:15
问题 My aim is to show a SVG background image filling the whole screen's width, in a ConstraintLayout . A Button is superposed to this background image, that's why you can see in the mock-up below: The background image is the one that contains the stars. Its start and end sides would be constrained to the root GroupView , so that it would fill entirely the width of the screen. The problem is the following: whether I bind the bottom side to the bottom side of the screen or not, the background image

Dynamic circleRadius in ConstraintLayout

蹲街弑〆低调 提交于 2019-12-24 21:51:01
问题 In my application I have following layout which uses the new circular positioning property of its inner ConstraintLayout . I think it is pretty good because it does not use fixed dp values for any view size except the circleRadius . And exactly that is my problem: My circleRadius should also be dynamic but accordingly to the documentation it only takes dimensions. So I need is a dimension relative to the constraintCircle size. Is that possible? <?xml version="1.0" encoding="utf-8"?>

Set weight for a View inside ConstraintLayout

那年仲夏 提交于 2019-12-24 21:05:02
问题 I have the following project in Github : https://github.com/Ali-Rezaei/Contacts, where I show flags of countries based on contact's numbers. The following layout includes flagItem as a LinearLayout in which I add the flag imageViews to it programmatically : <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/detail" android

constraintlayout wraps its content width with children match_constraint

依然范特西╮ 提交于 2019-12-24 18:50:31
问题 I have a simple side bar with 2 buttons vertical chained and i want my side bar to wrap largest button while smaller button expands to match largest one. Here is a capture where i want "AAA" button to match "VALIDATE" button width Of course what poped my mind is to use match contraint width for both buttons but when using a wrap_content container this leads to: my layout : <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas

set percent width constraintlayout Android programmatically

耗尽温柔 提交于 2019-12-23 20:57:06
问题 For constraint layout v1.1.x in Android we can set height and width as percentage. Similarly, need to set view width and height as percent in Android programmatically: for example, this code is written in xml for some constraint layout: <!-- the widget will take 40% of the available space --> app:layout_constraintWidth_default="percent" app:layout_constraintWidth_percent="0.4" what will be its java code for doing it runtime? 回答1: You need to use ConstraintSet - Reference This class allows you

Constraint Layout - Group visibility is not working inside dynamic module

若如初见. 提交于 2019-12-23 20:21:03
问题 Has anyone experienced issues with ConstraintLayout group visibility? I'm using ConstraintLayout 1.1.3 and I'm setting the visibility of group in both XML layout and java code. But it does not change the visibility status. It is always visible. This is the layout file <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas

Performance of ConstraintLayout inside RecyclerView ViewHolder

守給你的承諾、 提交于 2019-12-23 19:49:53
问题 I've spent the last 2 days attempting to triage why my RecyclerView is so is so unbearably slow while scrolling and I've narrowed it down to the ConstraintLayout I'm using for the rows. Using the GPU profiler on android shows green/blueish green bars all the way up to the top of the screen, indicating substantial jank. It's super obvious something is wrong. Here's what my viewholder looks like: class MyViewHolder( override val containerView: View) : RecyclerView.ViewHolder(containerView),