Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4362443c authored by Diego Perez's avatar Diego Perez
Browse files

Render to measured size when using expand mode

When using RenderingMode.V_SCROLL or RenderingMode.H_SCROLL, if the
screen size is smaller than the measured size but as large as the
desired size, the layout will render incorrectly and won't expand.
This changes that to expand to at least the size of the screen.

Added tests for the V_SCROLL and H_SCROLL modes.

Bug: http://b.android.com/174928
Change-Id: I22686903560775e2e4f362af1d7b50c9b985467d
parent 958a7c1c
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -523,6 +523,11 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
                        if (neededWidth > measuredWidth) {
                        if (neededWidth > measuredWidth) {
                            mMeasuredScreenWidth += neededWidth - measuredWidth;
                            mMeasuredScreenWidth += neededWidth - measuredWidth;
                        }
                        }
                        if (mMeasuredScreenWidth < measuredWidth) {
                            // If the screen width is less than the exact measured width,
                            // expand to match.
                            mMeasuredScreenWidth = measuredWidth;
                        }
                    }
                    }


                    if (renderingMode.isVertExpand()) {
                    if (renderingMode.isVertExpand()) {
@@ -531,6 +536,11 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
                        if (neededHeight > measuredHeight) {
                        if (neededHeight > measuredHeight) {
                            mMeasuredScreenHeight += neededHeight - measuredHeight;
                            mMeasuredScreenHeight += neededHeight - measuredHeight;
                        }
                        }
                        if (mMeasuredScreenHeight < measuredHeight) {
                            // If the screen height is less than the exact measured height,
                            // expand to match.
                            mMeasuredScreenHeight = measuredHeight;
                        }
                    }
                    }
                }
                }
            }
            }
+79 B (598 B)

File changed.

No diff preview for this file type.

+636 B
Loading image diff...
+578 B
Loading image diff...
+15 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:padding="16dp"
              android:orientation="horizontal"
              android:background="#AAAAAA"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content">

    <include layout="@layout/expand_layout"
             android:layout_height="wrap_content"
             android:layout_width="wrap_content" />

</LinearLayout>
Loading