AmrDeveloper / CodeView

Android Library to make it easy to create an Code editor or IDE that support any languages and themes, with auto complete, auto indenting, snippets and more features
https://amrdeveloper.github.io/CodeView/
MIT License
378 stars 48 forks source link

Activity must extend AppCompatActivity #5

Closed piemmm closed 2 years ago

piemmm commented 2 years ago

Describe the bug Documentation does not mention the activity must extend AppCompatActivity that uses codeView

If you do not, you can't edit anything.

To Reproduce Steps to reproduce the behavior: use CodeView in a normal Activity, not an AppCompatActivity

Expected behavior You should be able to use it regardsless (I guess)

AmrDeveloper commented 2 years ago

Hello, @piemmm Thanks for your report,

I have tested it with Activity, not AppCompatActivity and its work good, for example, you can download the example app and change AppCompatActivity by Activity in the MainActivity class and you will see it will run without problems and you can edit it easily.

So if you can provide more information about this problem so we can know what exactly the problem is, such as android version, SDK version, code example, or a full example if you can and we can solve it 👍🏻

Thanks Amr Hesham

piemmm commented 2 years ago

Hi!

The issue happens if the themes parent is: parent="android:Theme.Material" (and the MainActivity extends plain Activity)

AmrDeveloper commented 2 years ago

Hi, Thank you @piemmm,

The problem is when you use android:Theme.Material theme you can't navigate on the source code of the View by clicking, if you use Emulator you can work with arrows so after searching I found that if you want to work with this theme you need to add this attribute and it will work fine.

In XML

android:textIsSelectable="true"

Or in Java or Kotlin code

codeView.setTextIsSelectable(true);

I have tested it on the example app, and I will test it more in different SDK's, if you found any other problem please report it 👍🏻

Thank you so much 😄 Amr Hesham

piemmm commented 2 years ago

Thankyou!