Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
875 stars 259 forks source link

Sketchware crashes when applying com.google.android.material.search.SearchView #1008

Open guhg opened 7 months ago

guhg commented 7 months ago

Bug description When I attempt to add the com.google.android.material.search.SearchView layout to my project, Sketchware crashes immediately and does not save my changes.

Crash log The following is the crash log that I obtained from the app:

java.lang.ClassCastException: com.besome.sketch.editor.view.item.ItemLinearLayout cannot be cast to android.widget.EditText
at dev.aldi.sayuti.editor.view.ExtraViewPane.a(ExtraViewPane.java:25)
at com.besome.sketch.editor.view.ViewPane.b(ViewPane.java:311)
at com.besome.sketch.editor.view.ViewPane.g(ViewPane.java:164)
at com.besome.sketch.editor.view.ViewEditor.e(ViewEditor.java:559)
at a.a.a.ViewEditorFragment.c(ViewEditorFragment.java:201)
at a.a.a.ViewEditorFragment.a(ViewEditorFragment.java:142)
at a.a.a.ViewEditorFragment.lambda$initialize$0(ViewEditorFragment.java:62)
at a.a.a.ViewEditorFragment.$r8$lambda$gxYuV1FcXT_gFhp3RNWfnsbMixo(Unknown Source:0)
at a.a.a.ViewEditorFragment$$ExternalSyntheticLambda0.a(Unknown Source:2)
at com.besome.sketch.editor.view.ViewProperty.lambda$setOnPropertyValueChangedListener$0(ViewProperty.java:97)
at com.besome.sketch.editor.view.ViewProperty.$r8$lambda$HgcyxHBzdL67NbjqhdR-SAOZQHg(Unknown Source:0)
at com.besome.sketch.editor.view.ViewProperty$$ExternalSyntheticLambda0.a(Unknown Source:2)
at com.besome.sketch.editor.property.ViewPropertyItems.a(ViewPropertyItems.java:243)
at com.besome.sketch.editor.property.PropertyInputItem.lambda$showTextInputDialog$4(PropertyInputItem.java:201)
at com.besome.sketch.editor.property.PropertyInputItem.$r8$lambda$ufu-RKgfliQ5ZroaUgz4JnKGHoY(Unknown Source:0)
at com.besome.sketch.editor.property.PropertyInputItem$$ExternalSyntheticLambda4.onClick(Unknown Source:6)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Steps to reproduce the bug The bug can be reproduced by following these steps:

  1. Create a new project or open an existing one in Sketchware.
  2. Add a linear layout to the design editor.
  3. Open the convert dialog and enter com.google.android.material.search.SearchView as the class name.
  4. Confirm the conversion and observe that Sketchware crashes.
  5. Restart Sketchware and notice that the changes are not saved.

Expected behavior Sketchware should not crash when adding the SearchView layout. It should also save the changes made before the crash.

Video demonstration I have recorded a video to demonstrate the bug. You can watch it here: https://drive.google.com/file/d/1pvL7mV8g-2mfp1vHl-t7PPjTHyouhIrf/view?usp=drivesdk.

Device and Sketchware Pro-related information

hasrat-ali commented 7 months ago

Ok, i reproduced it. Should be fixed soon.

guhg commented 7 months ago

Thanks, I will wait

appt2 commented 7 months ago

Bug description When I attempt to add the com.google.android.material.search.SearchView layout to my project, Sketchware crashes immediately and does not save my changes.

Crash log The following is the crash log that I obtained from the app:

java.lang.ClassCastException: com.besome.sketch.editor.view.item.ItemLinearLayout cannot be cast to android.widget.EditText
at dev.aldi.sayuti.editor.view.ExtraViewPane.a(ExtraViewPane.java:25)
at com.besome.sketch.editor.view.ViewPane.b(ViewPane.java:311)
at com.besome.sketch.editor.view.ViewPane.g(ViewPane.java:164)
at com.besome.sketch.editor.view.ViewEditor.e(ViewEditor.java:559)
at a.a.a.ViewEditorFragment.c(ViewEditorFragment.java:201)
at a.a.a.ViewEditorFragment.a(ViewEditorFragment.java:142)
at a.a.a.ViewEditorFragment.lambda$initialize$0(ViewEditorFragment.java:62)
at a.a.a.ViewEditorFragment.$r8$lambda$gxYuV1FcXT_gFhp3RNWfnsbMixo(Unknown Source:0)
at a.a.a.ViewEditorFragment$$ExternalSyntheticLambda0.a(Unknown Source:2)
at com.besome.sketch.editor.view.ViewProperty.lambda$setOnPropertyValueChangedListener$0(ViewProperty.java:97)
at com.besome.sketch.editor.view.ViewProperty.$r8$lambda$HgcyxHBzdL67NbjqhdR-SAOZQHg(Unknown Source:0)
at com.besome.sketch.editor.view.ViewProperty$$ExternalSyntheticLambda0.a(Unknown Source:2)
at com.besome.sketch.editor.property.ViewPropertyItems.a(ViewPropertyItems.java:243)
at com.besome.sketch.editor.property.PropertyInputItem.lambda$showTextInputDialog$4(PropertyInputItem.java:201)
at com.besome.sketch.editor.property.PropertyInputItem.$r8$lambda$ufu-RKgfliQ5ZroaUgz4JnKGHoY(Unknown Source:0)
at com.besome.sketch.editor.property.PropertyInputItem$$ExternalSyntheticLambda4.onClick(Unknown Source:6)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Steps to reproduce the bug The bug can be reproduced by following these steps:

  1. Create a new project or open an existing one in Sketchware.
  2. Add a linear layout to the design editor.
  3. Open the convert dialog and enter com.google.android.material.search.SearchView as the class name.
  4. Confirm the conversion and observe that Sketchware crashes.
  5. Restart Sketchware and notice that the changes are not saved.

Expected behavior Sketchware should not crash when adding the SearchView layout. It should also save the changes made before the crash.

Video demonstration I have recorded a video to demonstrate the bug. You can watch it here: https://drive.google.com/file/d/1pvL7mV8g-2mfp1vHl-t7PPjTHyouhIrf/view?usp=drivesdk.

Device and Sketchware Pro-related information

  • Device model: Samsung Galaxy Tab S8
  • Operating system: Android 13, One UI 5.1.1
  • Sketchware Pro version: The bug occurs in both snapshot and latest release versions

plz Convert EditText to SerachView

hasrat-ali commented 7 months ago

⬆️ For a quik fix you can use EditText widget as placeholder for MaterialSeachView

guhg commented 7 months ago

Yes but would be nice if the issue I reported also gets fixed

On Fri, Oct 13, 2023, 8:59 AM Hasrat A. Khan @.***> wrote:

⬆️ For a quik fix you can use EditText widget as placeholder for MaterialSeachView

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/1008#issuecomment-1761480430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3NVF66APWSWIAL5OFBQ3TX7E3JPANCNFSM6AAAAAA54RIYGY . You are receiving this because you authored the thread.Message ID: @.***>

hasrat-ali commented 7 months ago

Fixed with https://github.com/Sketchware-Pro/Sketchware-Pro/commit/921f1c0a6f874256ba88ec24280a5a39f3d90e59