Custom string attribute breaks Android Studio's ConstraintLayout preview
up vote
0
down vote
favorite
I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:
broken view when setting custom attribute named model_field
attrs.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>
Layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- TODO: Update blank fragment layout -->
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
When I remove the model_field
attributes, the preview works properly like below
the view when I remove the custom attributes named "model_field"
java android android-studio kotlin custom-attribute
add a comment |
up vote
0
down vote
favorite
I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:
broken view when setting custom attribute named model_field
attrs.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>
Layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- TODO: Update blank fragment layout -->
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
When I remove the model_field
attributes, the preview works properly like below
the view when I remove the custom attributes named "model_field"
java android android-studio kotlin custom-attribute
check Car_engine_no string resource
– navylover
2 days ago
@navylover it already exists like<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attributemodel_field
slides up to the top of the layout. The constraints not working with custom attribute.
– Yusuf Gündoğdu
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:
broken view when setting custom attribute named model_field
attrs.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>
Layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- TODO: Update blank fragment layout -->
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
When I remove the model_field
attributes, the preview works properly like below
the view when I remove the custom attributes named "model_field"
java android android-studio kotlin custom-attribute
I created a custom view extending the AutoCompleteTextView. Also I have custom attributes related to that. When I set the custom string attribute value in the layout, the constraint layout design screen preview stops properly working. When I remove the custom string attribute, the constraint layout works properly. This only takes place at design time, there is no problem at run time. I reinstalled and updated Android Studio but it didn't help me. My codes and screenshots are below:
broken view when setting custom attribute named model_field
attrs.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="DATV">
<attr name="model_field" format="string"/>
<attr name="search_type" format="enum">
<enum name="never" value="0"/>
<enum name="always" value="1"/>
<enum name="depended" value="2"/>
</attr>
</declare-styleable>
</resources>
Layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.constraint.ConstraintLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- TODO: Update blank fragment layout -->
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView16" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView7"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView17" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView8" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView18" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<TextView
android:text="@string/arac_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="16dp" android:textStyle="bold"/>
<TextView
android:text="@string/marka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView2" android:labelFor="@+id/carBrandDATV"/>
<tr.com.universe.raportiz.lib.views.CarBrandDATV
app:model_field="@string/CarBrand_name"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carBrandDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"
/>
<TextView
android:text="@string/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carBrandDATV"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
/>
<tr.com.universe.raportiz.lib.views.CarModelDATV
app:model_field="@string/CarModel_name"
app:search_type="depended"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/carModelDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/plaka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView6" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/carModelDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_plate_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/plateNoDATV"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView6"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/sasi_numaras"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView7" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/plateNoDATV" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_chassis_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView5"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView7"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/motor_numarasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView8" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView5"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<tr.com.universe.raportiz.lib.views.CarDATV
app:model_field="@string/Car_engine_no"
app:search_type="always"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView8"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/arac_sahibi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView9"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView2"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView11" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView2"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintTop_toBottomOf="@+id/textView11"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView12" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView3"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView4"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView12"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView13" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView4"/>
<MultiAutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/multiAutoCompleteTextView"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView13"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/alici_bilgileri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView14" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/multiAutoCompleteTextView"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
android:textStyle="bold"/>
<TextView
android:text="@string/ad_soyad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView15" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView14"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView6" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView15" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/tc_kimlik_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView19" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView6"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView9" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView19" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/telefon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView20" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView9"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView10"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/textView20"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
android:background="@drawable/edittext_selector"/>
<TextView
android:text="@string/e_mail_adresi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView21" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/autoCompleteTextView10"/>
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView11" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/textView21" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:background="@drawable/edittext_selector"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
When I remove the model_field
attributes, the preview works properly like below
the view when I remove the custom attributes named "model_field"
java android android-studio kotlin custom-attribute
java android android-studio kotlin custom-attribute
edited 2 days ago
asked 2 days ago
Yusuf Gündoğdu
11
11
check Car_engine_no string resource
– navylover
2 days ago
@navylover it already exists like<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attributemodel_field
slides up to the top of the layout. The constraints not working with custom attribute.
– Yusuf Gündoğdu
2 days ago
add a comment |
check Car_engine_no string resource
– navylover
2 days ago
@navylover it already exists like<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attributemodel_field
slides up to the top of the layout. The constraints not working with custom attribute.
– Yusuf Gündoğdu
2 days ago
check Car_engine_no string resource
– navylover
2 days ago
check Car_engine_no string resource
– navylover
2 days ago
@navylover it already exists like
<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attribute model_field
slides up to the top of the layout. The constraints not working with custom attribute.– Yusuf Gündoğdu
2 days ago
@navylover it already exists like
<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attribute model_field
slides up to the top of the layout. The constraints not working with custom attribute.– Yusuf Gündoğdu
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237864%2fcustom-string-attribute-breaks-android-studios-constraintlayout-preview%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
check Car_engine_no string resource
– navylover
2 days ago
@navylover it already exists like
<string name="Car_engine_no">Car.engine_no</string>
. The custom views with attributemodel_field
slides up to the top of the layout. The constraints not working with custom attribute.– Yusuf Gündoğdu
2 days ago