I think it's this 
bug https://code.google.com/p/android/issues/detail?id=225912

On Monday, October 24, 2016 at 4:44:33 AM UTC-7, Martin Hogge wrote:
>
> Hi !
>
> I think I found a bug with the new CoordinatorLayout 
> <https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.html>
> .
> I got a *FrameLayout* inside a *CoordinatorLayout* and when I try to set 
> it as "wrap_content" with the ui tools, it automatically re-set it to 
> *48dp*. I also tried to set directly in the xml file (not with the 
> editor) and it works... Until I reopen the file where I suppose AS's editor 
> is doing some work and reset the height my *FrameLayout* to *48dp*.
>
> Here is my layout :
>
>
> <layout
>     xmlns:tools="http://schemas.android.com/tools";
>     xmlns:android="http://schemas.android.com/apk/res/android";
>     xmlns:app="http://schemas.android.com/apk/res-auto";>
>
>     <data>
>
>         <import type="android.view.View" />
>         <variable
>             name="viewModel"
>             type="com.mydomain.relationViewModel" />
>
>     </data>
>
>     <RelativeLayout
>         android:layout_width="match_parent"
>         android:layout_height="wrap_content">
>
>         <ProgressBar
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:indeterminate="true"
>             android:layout_centerInParent="true"
>
>             android:visibility="@{viewModel.isLoading() ? View.VISIBLE : 
> View.GONE}"/>
>
>         <android.support.constraint.ConstraintLayout
>             android:layout_width="match_parent"
>             android:layout_height="wrap_content"
>             android:visibility="@{viewModel.isLoading() ? View.INVISIBLE : 
> View.VISIBLE}">
>
>             <TextView
>                 android:layout_width="0dp"
>                 android:layout_height="wrap_content"
>                 android:id="@+id/hint"
>                 tools:text="Relation"
>                 android:layout_marginStart="16dp"
>                 app:layout_constraintLeft_toLeftOf="parent"
>                 android:layout_marginLeft="16dp"
>                 android:text="@string/relationship_spinner_hint"
>                 android:layout_marginTop="16dp"
>                 app:layout_constraintTop_toTopOf="parent"
>                 app:layout_constraintBottom_toBottomOf="@+id/spinner" />
>
>             <Spinner
>                 android:layout_width="0dp"
>                 android:layout_height="48dp"
>                 android:id="@+id/spinner"
>                 android:dropDownWidth="match_parent"
>                 android:layout_marginEnd="16dp"
>                 app:layout_constraintRight_toRightOf="parent"
>                 android:layout_marginRight="16dp"
>                 app:layout_constraintLeft_toRightOf="@+id/hint"
>                 android:layout_marginStart="16dp"
>                 android:layout_marginLeft="16dp"
>                 android:layout_marginTop="16dp"
>                 app:layout_constraintTop_toTopOf="parent"
>
>                 
> app:setOnItemSelectedListener="@{viewModel.relationshipsListener}"/>
>
>             <FrameLayout
>                 android:layout_width="0dp"
>                 android:layout_height="48dp"
>                 app:layout_constraintRight_toRightOf="parent"
>                 app:layout_constraintLeft_toLeftOf="parent"
>                 android:id="@+id/search_fragment_container"
>                 android:layout_marginEnd="16dp"
>                 android:layout_marginRight="16dp"
>                 app:layout_constraintHorizontal_bias="0.0"
>                 
> app:layout_constraintTop_toBottomOf="@+id/search_patient_title">
>
>             </FrameLayout>
>
>             <Button
>                 android:text="@string/cancel"
>                 android:layout_width="wrap_content"
>                 android:layout_height="wrap_content"
>                 android:id="@+id/cancel"
>                 app:layout_constraintLeft_toLeftOf="parent"
>                 style="@style/buttonStyle"
>                 android:layout_marginTop="8dp"
>                 
> app:layout_constraintTop_toBottomOf="@+id/search_fragment_container" />
>
>             <TextView
>                 android:text="@string/search_patient"
>                 android:layout_width="wrap_content"
>                 android:layout_height="wrap_content"
>                 android:id="@+id/search_patient_title"
>                 android:layout_marginTop="8dp"
>                 app:layout_constraintTop_toBottomOf="@+id/spinner"
>                 android:layout_marginStart="16dp"
>                 app:layout_constraintLeft_toLeftOf="parent"
>                 android:layout_marginLeft="16dp"
>                 tools:text="Recherche du patient"
>                 style="@style/myTitle" />
>
>         </android.support.constraint.ConstraintLayout>
>
>     </RelativeLayout>
>
> </layout>
>
> Saisissez le code ici...
>
> And here is my blueprint screenshot (where the selected layout is my 
> *FrameLayout*) :
>
>   
> <https://lh3.googleusercontent.com/-q392hNb16pQ/WA3zRgGBdII/AAAAAAAACh4/g-9uFCJKzTYFIMVNQZUlELd5f1kdW5vGwCLcB/s1600/Capture.PNG>I
>  
> also post this issue on StackOverflow where you can follow it 
> <https://lh3.googleusercontent.com/-q392hNb16pQ/WA3zRgGBdII/AAAAAAAACh4/g-9uFCJKzTYFIMVNQZUlELd5f1kdW5vGwCLcB/s1600/Capture.PNG>
>  
> here 
> <http://stackoverflow.com/questions/40179207/framelayout-wrap-content-in-constraintlayout>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/acd261df-24c4-45ef-80d6-f70e37ecf1df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to