Skip to content

Commit

Permalink
feat: Open kotlin file
Browse files Browse the repository at this point in the history
  • Loading branch information
PHANTOMLOCAL authored and CyberGlitch01 committed Sep 12, 2023
1 parent 1a4c8ce commit ec352ae
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void onClick(View v) {
final File FinalFile = file;
switch (getFileFormat(file.getAbsolutePath())) {
case "java":
case "kt":
case "xml":
case "html":
case "htm":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void run() {
(view) -> {
switch (FileTypeHandler.getFileFormat(file.getAbsolutePath())) {
case "java":
case "kt":
case "xml":
case "html":
case "htm":
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/android/code/editor/utils/FileIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public static void setUpIcon(Context context, String path, ImageView imageview)
case "java":
imageview.setImageResource(R.drawable.ic_language_java);
break;
case "kt":
imageview.setImageResource(R.drawable.ic_language_kotlin);
break;
case "xml":
imageview.setImageResource(R.drawable.file_xml_box);
break;
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/drawable/ic_language_kotlin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- drawable/language_kotlin.xml --><vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"><path android:fillColor="#000000" android:pathData="M2 2H22L12 12L22 22H2Z" /></vector>
8 changes: 7 additions & 1 deletion editor/src/main/assets/Editor/SoraEditor/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
"scopeName": "source.java",
"languageConfiguration": "Editor/SoraEditor/java/language-configuration.json"
},
{
"grammar": "Editor/SoraEditor/kotlin/syntaxes/Kotlin.tmLanguage.json",
"name": "kt",
"scopeName": "source.kt",
"languageConfiguration": "Editor/SoraEditor/kotlin/language-configuration.json"
},
{
"grammar": "Editor/SoraEditor/javascript/syntaxes/JavaScript.tmLanguage.json",
"name": "javascript",
Expand Down Expand Up @@ -54,4 +60,4 @@
"languageConfiguration": "Editor/SoraEditor/json/language-configuration.json"
}
]
}
}
3 changes: 3 additions & 0 deletions editor/src/main/java/editor/tsd/editors/AceEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ public void setLanguageMode(String LanguageMode) {
case Language.Java:
aceJSInterface.languageMode = "java";
break;
case Language.Kt:
aceJSInterface.languageMode = "kt";
break;
case Language.XML:
aceJSInterface.languageMode = "xml";
break;
Expand Down
1 change: 1 addition & 0 deletions editor/src/main/java/editor/tsd/tools/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

public class Language {
public static final String Java = "java";
public static final String Kt = "kt";
public static final String JavaScript = "js";
public static final String HTML = "html";
public static final String CSS = "css";
Expand Down

2 comments on commit ec352ae

@SyntaxGalaxy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CyberGlitch01 why you didn't formatted app/src/main/res/drawable/ic_language_kotlin.xml?

@CyberGlitch01
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CyberGlitch01 why you didn't formatted app/src/main/res/drawable/ic_language_kotlin.xml?

I pulled code from the PHANTOMLOCAL fork. All Java code was formatted so I thought he must formatted the icon.

Please sign in to comment.