massivemadness / Squircle-CE

👨‍💻 Squircle CE is a fast and free multi-language code editor for Android
https://play.google.com/store/apps/details?id=com.blacksquircle.ui
Apache License 2.0
1.38k stars 101 forks source link

Syntax Highlighting menu partly obscured by... something? #204

Closed Yetangitu closed 1 year ago

Yetangitu commented 1 year ago

App Version: 2023.1.4 (F-Droid build)

Affected Device(s): Xiaomi Redmi Note 5 Pro, de-fanged (as in 'removed anything suspected of leaking data) MIUI Global 11.0.3, Android 9, 440dpi, XS font

Describe the bug When using the "Force Syntax" option to forcibly get the editor to syntax highlight a recalcitrant XML file I noticed the menu is partly obscured by something invisible which hovers over the centre of the screen. This something hides the text for the majority of the options in the menu as well as the title of the menu itself, the latter can be made to appear and disappear by scrolling upwards. Scrolling the menu makes the text appear at the bottom 4 lines and just the top line of the menu, in between are 14 options without text (I use a tiny font so the menu contains 19 visible options).

This is what it looks like: photo_2023-06-26_01-38-29

To Reproduce Steps to reproduce the behavior:

  1. Open editor on my device and navigate to Tools -> Force Syntax
  2. Notice that most of the text seems to be missing but that it is possible to make it appear by scrolling the menu so the text ends up on the lower side of the display

Expected behavior All text in the menu should be visible, there should not be anything obscuring it

massivemadness commented 1 year ago

Hi @Yetangitu, can you please check 2023.1.5 build?

Yetangitu commented 1 year ago

I did, it crashes as soon as I select Tools -> Force Syntax.

On startup it produces the following in logcat:

06-26 19:15:17.404 27161 27161 W lacksquircle.u: Accessing hidden field Landroid/widget/Editor;->mDrawableForCursor:Landroid/graphics/drawable/Drawable; (dark greylist, reflection)
06-26 19:15:17.404 27161 27161 W System.err: java.lang.NoSuchFieldException: No field mDrawableForCursor in class Landroid/widget/Editor; (declaration of 'android.widget.Editor' appears in /system/framework/framework.jar!classes2.dex)
06-26 19:15:17.405 27161 27161 W System.err:    at java.lang.Class.getDeclaredField(Native Method)
06-26 19:15:17.405 27161 27161 W System.err:    at ge.d.v(Unknown Source:6)
06-26 19:15:17.405 27161 27161 W System.err:    at k4.e.setColorScheme(SourceFile:218)
06-26 19:15:17.405 27161 27161 W System.err:    at d1.t.k(SourceFile:81)
06-26 19:15:17.405 27161 27161 W System.err:    at y4.m.r(SourceFile:26)
06-26 19:15:17.405 27161 27161 W System.err:    at y4.m.j(SourceFile:13)
06-26 19:15:17.405 27161 27161 W System.err:    at o5.a0.b(SourceFile:84)
06-26 19:15:17.405 27161 27161 W System.err:    at df.i.L(SourceFile:124)
06-26 19:15:17.405 27161 27161 W System.err:    at of.j.r(SourceFile:12)
06-26 19:15:17.405 27161 27161 W System.err:    at we.a.i(Unknown Source:8)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.z.run(Unknown Source:109)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.k0.L(SourceFile:24)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.h.s(SourceFile:139)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.h.C(SourceFile:45)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.h.i(SourceFile:17)
06-26 19:15:17.405 27161 27161 W System.err:    at of.y0.l(SourceFile:112)
06-26 19:15:17.405 27161 27161 W System.err:    at of.y0.k(Unknown Source:5)
06-26 19:15:17.405 27161 27161 W System.err:    at c5.p.r(SourceFile:493)
06-26 19:15:17.405 27161 27161 W System.err:    at we.a.i(Unknown Source:8)
06-26 19:15:17.405 27161 27161 W System.err:    at lf.z.run(Unknown Source:109)
06-26 19:15:17.405 27161 27161 W System.err:    at android.os.Handler.handleCallback(Handler.java:873)
06-26 19:15:17.405 27161 27161 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 19:15:17.405 27161 27161 W System.err:    at android.os.Looper.loop(Looper.java:201)
06-26 19:15:17.405 27161 27161 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:6810)
06-26 19:15:17.405 27161 27161 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
06-26 19:15:17.405 27161 27161 W System.err:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
06-26 19:15:17.405 27161 27161 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

This is repeated 3 times. It continues to load a few pluginsm then is quiet until I navigate to Tools -> Force Syntax upon which it produces the following:

06-26 19:23:07.241 27434 27434 E lacksquircle.u: Invalid ID 0x00000000.
06-26 19:23:07.241 27434 27434 D AndroidRuntime: Shutting down VM
06-26 19:23:07.249 27434 27434 E AndroidRuntime: FATAL EXCEPTION: main
06-26 19:23:07.249 27434 27434 E AndroidRuntime: Process: com.blacksquircle.ui, PID: 27434
06-26 19:23:07.249 27434 27434 E AndroidRuntime: android.content.res.Resources$NotFoundException: Resource ID #0x0
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:216)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.content.res.MiuiResourcesImpl.getValue(MiuiResourcesImpl.java:94)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2181)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.content.res.Resources.getLayout(Resources.java:1169)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at d.j.d(SourceFile:106)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at com.blacksquircle.ui.feature.editor.ui.dialog.ForceSyntaxDialog.d0(SourceFile:89)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.s.H(SourceFile:29)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at com.blacksquircle.ui.feature.editor.ui.dialog.ForceSyntaxDialog.H(SourceFile:1)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.c0.Q(Unknown Source:0)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.a1.f(SourceFile:47)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.a1.k(SourceFile:144)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.u0.z(SourceFile:51)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.u0.U(Unknown Source:91)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.u0.x(SourceFile:74)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at androidx.fragment.app.n.run(SourceFile:22)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:873)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:201)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6810)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
06-26 19:23:07.249 27434 27434 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
massivemadness commented 1 year ago

I think it's due to resources shrinking, I uploaded the patch on GitHub release page, it might take a day or two to publish in google play

Yetangitu commented 1 year ago

I did notice that the latest release is some 2.6 MB lighter than the one before that, shrunk a few resources too many perhaps?

massivemadness commented 1 year ago

Not exactly 😄 v2023.1.3 is lighter than v2023.1.4 because in 1.4 I used compiled jar of bouncycastle instead of normal gradle dependency, which can be optimized with proguard/r8 code shrinker