Fixed
Status Update
Comments
am...@gmail.com <am...@gmail.com> #2
Android Studio 2.3 Beta 4
Build #AI-162.3715353, built on February 8, 2017
JRE: 1.8.0_112-release-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Build #AI-162.3715353, built on February 8, 2017
JRE: 1.8.0_112-release-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
ni...@google.com <ni...@google.com>
di...@google.com <di...@google.com> #3
I've tried with a couple of 9 patch drawables and the behaviour seemed to match the device. Could you please attach the sample layout and the nine patch you were trying in the screenshots?
Thanks
Thanks
am...@gmail.com <am...@gmail.com> #4
I've done some research.
The problem occurs in a layout as simple as:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:name="com.timesolutely.ui.EventEditorPopupFragment"
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:background="@drawable/wbg7_dis"
android:gravity="top"
android:orientation="vertical"
tools:context="com.my.ui.EventTimeEditorPopupFragment"
tools:layout_editor_absoluteX="40dp"
tools:layout_editor_absoluteY="65dp">
<!--fails: android:background="@drawable/wbg7_dis"-->
<!--works fine, no 9 patch: android:background="#333"-->
<!--works fine! android:background="@android:drawable/editbox_background"-->
<TextView
android:id="@+id/title"
style="@style/txt_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:background="#923"
android:gravity="start"
android:padding="10dp"
android:text="@string/relative_time"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintTop_creator="1"
tools:text="@string/relative_time"/>
</android.support.constraint.ConstraintLayout>
Interestingly, when using 9 patch coming from @android:..., it works fine.
The problem is reproducible when the 9 patch is inside "drawable-nodpi" res folder.
I'm attaching a sample 9 patch file, please put it in nodpi.
The problem occurs in a layout as simple as:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:name="com.timesolutely.ui.EventEditorPopupFragment"
xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/wbg7_dis"
android:gravity="top"
android:orientation="vertical"
tools:context="com.my.ui.EventTimeEditorPopupFragment"
tools:layout_editor_absoluteX="40dp"
tools:layout_editor_absoluteY="65dp">
<!--fails: android:background="@drawable/wbg7_dis"-->
<!--works fine, no 9 patch: android:background="#333"-->
<!--works fine! android:background="@android:drawable/editbox_background"-->
<TextView
android:id="@+id/title"
style="@style/txt_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:background="#923"
android:gravity="start"
android:padding="10dp"
android:text="@string/relative_time"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintTop_creator="1"
tools:text="@string/relative_time"/>
</android.support.constraint.ConstraintLayout>
Interestingly, when using 9 patch coming from @android:..., it works fine.
The problem is reproducible when the 9 patch is inside "drawable-nodpi" res folder.
I'm attaching a sample 9 patch file, please put it in nodpi.
ex...@gmail.com <ex...@gmail.com> #5
I just ran into this problem of a ConstraintLayout not rendering, but I am using a drawable shape (in res\drawable). The shape is a simple rounded rectangle:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android " android:shape="rectangle">
<corners android:radius="20dp"/>
<padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>
<solid android:color="@android:color/background_dark"/>
</shape>
After fiddling with it a little, I was able to get it to render if I removed the <padding /> element.
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="
<corners android:radius="20dp"/>
<padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/>
<solid android:color="@android:color/background_dark"/>
</shape>
After fiddling with it a little, I was able to get it to render if I removed the <padding /> element.
ni...@google.com <ni...@google.com>
ni...@google.com <ni...@google.com>
di...@google.com <di...@google.com> #6
This is likely to be a problem in the 9patch parting lib. The problem with the drawable background is probably a different one (might happen on device as well?)
ca...@google.com <ca...@google.com> #7
The Rendering bug with a 9 patch background in the no-dpi folder is repoducible
ca...@google.com <ca...@google.com> #8
The 9 patch background bug is resolved.
I wasn't able to reproduce Brian's bug (#5). If the bug still happens can you please create a new bug with your layout and drawables attached?
I wasn't able to reproduce Brian's bug (#5). If the bug still happens can you please create a new bug with your layout and drawables attached?
Description
In Android Studio 2.3 Beta 4
The Design View fails to render anything correctly when 9 patch background is used.
When running the app on on device or emulator - everything works well.
Screenshot 1 (Selection_174):
Using android:background="#300" inside the <android.support.constraint.ConstraintLayout /> tag
Using android:background="#923" inside the <TextView /> tag
Screenshot 2 (Selection_175):
Using android:background="@drawable/frame6" inside the <android.support.constraint.ConstraintLayout /> tag
Using android:background="#923" inside the <TextView /> tag
Screenshot 3 (Selection_176):
Using android:background="#300" inside the <android.support.constraint.ConstraintLayout /> tag
Using android:background="@drawable/frame6" inside the <TextView /> tag
The same problem occurs with any other 9 patch drawable I've tried.