ahmadaghazadeh / codeeditor Goto Github PK
View Code? Open in Web Editor NEWCode Editor Native Way
License: Apache License 2.0
Code Editor Native Way
License: Apache License 2.0
When code is null, this error occurs:
java.lang.NullPointerException: Attempt to invoke interface method 'int android.text.Editable.length()' on a null object reference
at com.github.ahmadaghazadeh.editor.widget.CodeEditor.getIndexForEndOfLine(CodeEditor.java:369)
at com.github.ahmadaghazadeh.editor.processor.TextProcessor.onDraw(TextProcessor.java:905)
at android.view.View.draw(View.java:20207)
at android.view.View.buildDrawingCacheImpl(View.java:19478)
at android.view.View.buildDrawingCache(View.java:19338)
at android.view.View.updateDisplayListIfDirty(View.java:19059)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
at android.view.View.updateDisplayListIfDirty(View.java:19042)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at com.android.internal.policy.DecorView.draw(DecorView.java:780)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3312)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3116)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2485)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7184)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
CodeEditor widget always applies 100 margins, see the code below
Extract from source code
recyclerViewParam.setMargins(0, height - 100, 0, 0);
paramsTxtprocessor.setMargins(0, 0, 0, 100);
Can you set it to 0 instead of 100?
In the project README
, you have:
<com.github.ahmadaghazadeh.editor.widget.CodeEditor
bind:code="<html></html>"
bind:lang="html"
bind:isReadOnly="true"
bind:isShowExtendedKeyboard="false"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
However, this is invalid XML. That HTML needs to be escaped:
<com.github.ahmadaghazadeh.editor.widget.CodeEditor
bind:code="<html></html>"
bind:lang="html"
bind:isReadOnly="true"
bind:isShowExtendedKeyboard="false"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
lineNumbers is in TextProcessor, so GutterView is useless?
Give some descriptions on this library. It is hard to understand how to use this library. Sample app is also hard because of view bindings and models. Make it easier!
Can you make it public or add method getTextProcessor()? TextProcessor has a lot of useful methods
Best regards
Please provide the screenshot of the library ,it will be very helpful for us
Hi
When installing on some devices listed below, an extra white bar appears between the default keyboard and the extended one.
Samsung Galaxy Tab E 9.6 (T-560) Android 4.4.4
https://imgur.com/ott7Q7n
Samsung Galaxy Core Prime (SM-G361H) Android 5.1.1
https://imgur.com/PKzO1c3
Android Simulator 10.1 Tablet API 28
https://imgur.com/Yd5ps9D
Hello,
i have a problem with the following code snipped:
codeEditor = findViewById(R.id.codeeditor);
codeEditor.setText("TEST", 1);
codeEditor.getText(); // method getText() returns "TESTTEST"
The text which gets returned is doubled.
Am i doing something wrong or is this a bug?
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.