[File View] highlight sourcecode syntax #151

Closed
opened 2020-06-03 17:19:14 +00:00 by 6543 · 10 comments
Member

If noticed a language - highlite it

If noticed a language - highlite it
6543 added this to the 2.3.0 milestone 2020-06-03 17:19:14 +00:00
6543 added the
🚀 Improvement
💻 UI/UX
labels 2020-06-03 17:19:14 +00:00
6543 closed this issue 2020-06-03 17:19:14 +00:00
6543 self-assigned this 2020-06-03 17:19:54 +00:00
Owner

I was about to open an issue with the same title. :)

I was thinking, we should look for a library if possible which do many things like languages highlights, render repo images etc.
If we can do it without a library would be awesome, but not easy of a task though.

I was about to open an issue with the same title. :) I was thinking, we should look for a library if possible which do many things like languages highlights, render repo images etc. If we can do it without a library would be awesome, but not easy of a task though.
Author
Member

@mmarif psoido code idear:

type = File_Detect_Type(file)
 -> https://sourceforge.net/projects/mime-util/ ?
Switch(type){
 case "txt":
   Syntax highlight
     -> https://github.com/bobbylight/RSyntaxTextArea ?
   break;
 case "pic":
   PicViewer();
   break;
 default:
   Binary_Icon.setText("file type (" + type + ") cant be displayed");
   break;
}
@mmarif psoido code idear: ```java type = File_Detect_Type(file) -> https://sourceforge.net/projects/mime-util/ ? Switch(type){ case "txt": Syntax highlight -> https://github.com/bobbylight/RSyntaxTextArea ? break; case "pic": PicViewer(); break; default: Binary_Icon.setText("file type (" + type + ") cant be displayed"); break; } ```
Owner

Yes, but doing it for almost all languages we know would not be easy. We can use a library.

Yes, but doing it for almost all languages we know would not be easy. We can use a library.
Author
Member

-> https://sourceforge.net/projects/mime-util/ ?
-> https://github.com/bobbylight/RSyntaxTextArea ?

I found them in a quic search ... do you know them?

-> https://sourceforge.net/projects/mime-util/ ? -> https://github.com/bobbylight/RSyntaxTextArea ? I found them in a quic search ... do you know them?
Owner

Nope, but I found this interesting library.

https://github.com/kbiakov/CodeView-Android

Nope, but I found this interesting library. https://github.com/kbiakov/CodeView-Android
Author
Member

I i try to build GitNex with this lib:

Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Language found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Contract found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)

Go to the documentation to learn how to Fix dependency resolution errors.
I i try to build GitNex with this lib: ``` Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Language found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Contract found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Nls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Go to the documentation to learn how to Fix dependency resolution errors. ```
Author
Member

@mmarif I forked it to https://github.com/6543-forks/CodeView-Android so if you have a idear ...

@mmarif I forked it to https://github.com/6543-forks/CodeView-Android so if you have a idear ...
Owner

Ok @6543 , I will take a look.

Ok @6543 , I will take a look.
Owner

Add this before dependencies block in app build.gradle.

configurations {
    cleanedAnnotations
    compile.exclude group: 'org.jetbrains' , module:'annotations'
}
Add this before dependencies block in app build.gradle. ``` configurations { cleanedAnnotations compile.exclude group: 'org.jetbrains' , module:'annotations' } ```
Owner

Close via #187

Close via #187
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#151
No description provided.