florent37 / ShapeOfView

Give a custom shape to any android view, Material Design 2 ready
Apache License 2.0
3.13k stars 398 forks source link

RoundRectView not displayed #28

Open polilluminato opened 6 years ago

polilluminato commented 6 years ago

I everyone I've got a little bug when using multiple RoundRectView inside a scrollView. My layout is something like this

<LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorTransparent"
                android:orientation="vertical">

                <include layout="@layout/layout_1" />
                <include layout="@layout/layout_2" />
                <include layout="@layout/layout_3" />
                <include layout="@layout/layout_4" />
</LinearLayout>

Every layout is like this

<com.github.florent37.shapeofview.shapes.RoundRectView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="@style/AppTheme.CardDettaglioCasting"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

    <!--Some Stuff-->

    </LinearLayout>

</com.github.florent37.shapeofview.shapes.RoundRectView>

and this is the @style/AppTheme.CardDettaglioCasting

<style name="AppTheme.CardDettaglioCasting">
            <item name="android:elevation">4dp</item>
            <item name="android:layout_marginEnd">16dp</item>
            <item name="android:layout_marginLeft">16dp</item>
            <item name="android:layout_marginRight">16dp</item>
            <item name="android:layout_marginStart">16dp</item>
            <item name="android:layout_marginTop">24dp</item>
            <item name="shape_roundRect_bottomLeftRadius">16dp</item>
            <item name="shape_roundRect_bottomRightRadius">16dp</item>
            <item name="shape_roundRect_topLeftRadius">16dp</item>
            <item name="shape_roundRect_topRightRadius">16dp</item>
            <item name="android:background">@drawable/background_card_casting</item>
</style>

Inside layouts there're some relativelayout, linear layout, images, textview and all of them are layout_height="wrap_content". In particular in the last layout there is a RecycleView with about 10 rows. If I include the last layout (the one with the recycleview) I don't see that layout and the Logcat gives me

RoundRectView not displayed because it is too large to fit into a software layer (or drawing cache), needs 11166432 bytes, only 8294400 available

I'm trying to display some much stuff and I ran in some performance issue?

Thanks for your help

npace commented 4 years ago

I also encountered a similar issue, did you find a solution in the end?