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

Commit d434d233 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

MaxLines is respected in TextViews, even when ellipsize is set to end.

Bug 3322607

Re-applying the revert that fixed the ANR (https://android-git.corp.google.com/g/#change,87129),
whith an updated here value that seems to fix the problem.

This layout code is pretty involved, with destabilizing variable names and
uses. Althought I tested it, this fix is not 100% garanteed.

Change-Id: I1f4b09b329fb8a328ae8ab26ae472e343453beda
parent b1c36cda
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -138921,7 +138921,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -138976,7 +138976,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -138987,7 +138987,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -138998,7 +138998,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -139244,7 +139244,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -139266,7 +139266,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139343,7 +139343,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="deprecated"
 deprecated="not deprecated"
 visibility="public"
>
</method>
@@ -139387,7 +139387,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139398,7 +139398,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139409,7 +139409,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139420,7 +139420,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139524,7 +139524,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -256491,7 +256491,7 @@
 return="java.beans.PropertyChangeListener[]"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256504,7 +256504,7 @@
 return="java.beans.PropertyChangeListener[]"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256515,7 +256515,7 @@
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256528,7 +256528,7 @@
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256543,7 +256543,7 @@
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256800,7 +256800,7 @@
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
@@ -256813,7 +256813,7 @@
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 synchronized="true"
 static="false"
 final="false"
 deprecated="not deprecated"
+92 −90
Original line number Diff line number Diff line
@@ -361,7 +361,8 @@ public class StaticLayout extends Layout
                            if (fitbottom > okbottom)
                                okbottom = fitbottom;
                        }
                    } else if (breakOnlyAtSpaces) {
                    } else {
                        if (breakOnlyAtSpaces) {
                            if (ok != here) {
                                // Log.e("text", "output ok " + here + " to " +ok);

@@ -386,7 +387,7 @@ public class StaticLayout extends Layout
                                // Act like it fit even though it didn't.

                                fitwidth = w;
                            fit = j + 1;
                                here = fit = j + 1;

                                if (fmtop < fittop)
                                    fittop = fmtop;
@@ -457,6 +458,7 @@ public class StaticLayout extends Layout

                                here = here + 1;
                            }
                        }

                        if (here < spanStart) {
                            // didn't output all the text for this span