Before I file a bug I wanted to get the sense from others if this is one or 
if I'm just using layouts wrong.

Say you have a Constraint Layout like so:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">


    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include
            android:id="@+id/logo"
            layout="@layout/include_login_logo" />

        <android.support.constraint.ConstraintLayout
            android:id="@+id/loginControlsContainer"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/logo">

            <android.support.design.widget.TextInputLayout
                android:id="@+id/passwordInput"
                style="@style/TextInputLayout.Large"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                app:layout_constraintLeft_toLeftOf="@+id/usernameInput"
                app:layout_constraintRight_toRightOf="@+id/usernameInput"
                app:layout_constraintTop_toBottomOf="@+id/usernameInput">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/passwordEdit"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Password"
                    android:inputType="textPassword" />

            </android.support.design.widget.TextInputLayout>


            <android.support.design.widget.TextInputLayout
                android:id="@+id/usernameInput"
                style="@style/TextInputLayout.Large"
                android:layout_width="248dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="27dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent">
                <android.support.design.widget.TextInputEditText
                    android:id="@+id/usernameEdit"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Email Address"
                    android:inputType="textEmailAddress" />
            </android.support.design.widget.TextInputLayout>

            <Switch
                android:id="@+id/loginRememberMeSwitch"
                android:layout_width="0dp"
                android:layout_height="48dp"
                android:checked="false"
                android:paddingEnd="0dp"
                android:paddingStart="4dp"
                android:text="Remember me"
                app:layout_constraintLeft_toLeftOf="@+id/passwordInput"
                app:layout_constraintRight_toRightOf="@+id/passwordInput"
                app:layout_constraintTop_toBottomOf="@+id/passwordInput" />

            <Button
                android:id="@+id/loginSubmitBtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="Log In"
                app:elevation="2dp"
                
app:layout_constraintRight_toRightOf="@+id/loginRememberMeSwitch"
                
app:layout_constraintTop_toBottomOf="@+id/loginRememberMeSwitch" />

        </android.support.constraint.ConstraintLayout>


        <TextView
            android:id="@+id/loginForgotPasswordLink"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_marginEnd="16dp"
            android:layout_marginStart="16dp"
            android:layout_marginTop="30dp"
            android:gravity="center"
            android:text="Forgot Password"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            
app:layout_constraintTop_toBottomOf="@+id/loginControlsContainer"
            app:layout_constraintVertical_bias="1.0" />

    </android.support.constraint.ConstraintLayout>

</ScrollView>



and then include file including a single element as such:

<ImageView xmlns:app="http://schemas.android.com/apk/res-auto";
    xmlns:android="http://schemas.android.com/apk/res/android";
    android:id="@+id/logo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginEnd="16dp"
    android:layout_marginStart="16dp"
    android:layout_marginTop="10dp"
    android:src="@drawable/logo"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.48000002"
    android:layout_marginBottom="347dp" />


It works fine when running but if I open it in the AndroidStudio layout 
editor and make any changes to any element in the layout it will change the 
include element to something like as follows:

       <include
            android:id="@+id/logo"
            layout="@layout/include_login_logo"
            android:layout_height="0dp"
            android:layout_width="0dp"
            tools:layout_editor_absoluteX="60dp"
            tools:layout_editor_absoluteY="0dp" />

Which breaks the layout until I go in and manually fix it in the text view.


Much appreciate opinions/advice before I file a bug in Android Studio.

Thanks,
Thad

-- 
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/babb4408-7bc4-4513-9522-78b6e6b5dd76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to