Skip to content

Commit 1ec06e3

Browse files
committed
Module text-editor, refactor code
1 parent b1a72c7 commit 1ec06e3

28 files changed

+409
-203
lines changed

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
<category android:name="android.intent.category.DEFAULT" />
6868
</intent-filter>
6969
</activity>
70-
71-
<activity android:name="com.jecelyin.editor.v2.settings.EditorSettingsActivity" />
7270
<activity android:name="com.duy.file.explorer.FileExplorerActivity" />
7371
<activity android:name=".ui.examples.ExampleActivity" />
7472
<activity android:name=".compiler.CompilerSettingActivity" />

app/src/main/java/com/duy/ccppcompiler/compiler/manager/CompileManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
import com.duy.ccppcompiler.compiler.shell.OutputParser;
3232
import com.duy.common.DLog;
3333
import com.duy.editor.CodeEditorActivity;
34-
import com.duy.ide.Diagnostic;
35-
import com.duy.ide.DiagnosticPresenter;
36-
import com.duy.ide.DiagnosticsCollector;
34+
import com.duy.ide.diagnostic.Diagnostic;
35+
import com.duy.ide.diagnostic.DiagnosticPresenter;
36+
import com.duy.ide.diagnostic.DiagnosticsCollector;
3737
import com.duy.ide.editor.SimpleEditorActivity;
3838
import com.jecelyin.common.utils.UIUtils;
3939
import com.jecelyin.editor.v2.widget.menu.MenuDef;

app/src/main/java/com/duy/ccppcompiler/compiler/shell/OutputParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
package com.duy.ccppcompiler.compiler.shell;
1818

19-
import com.duy.ide.Diagnostic;
20-
import com.duy.ide.DiagnosticFactory;
21-
import com.duy.ide.DiagnosticsCollector;
22-
import com.duy.ide.Kind;
19+
import com.duy.ide.diagnostic.Diagnostic;
20+
import com.duy.ide.diagnostic.DiagnosticFactory;
21+
import com.duy.ide.diagnostic.DiagnosticsCollector;
22+
import com.duy.ide.diagnostic.Kind;
2323

2424
import java.io.LineNumberReader;
2525
import java.io.StringReader;
2626
import java.util.regex.Matcher;
2727
import java.util.regex.Pattern;
2828

29-
import static com.duy.ide.Kind.OTHER;
29+
import static com.duy.ide.diagnostic.Kind.OTHER;
3030

3131
/**
3232
* https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gnat_ug_unx/Output-and-Error-Message-Control.html

editor/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919

2020
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
2121
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
22+
2223
<uses-permission android:name="android.permission.INTERNET" />
2324
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2425

2526
<application android:supportsRtl="false">
27+
<activity android:name="com.duy.ide.settings.EditorSettingsActivity" />
2628
</application>
2729
</manifest>

editor/src/main/java/com/duy/ide/DiagnosticClickListener.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

editor/src/main/java/com/duy/ide/DiagnosticListener.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

editor/src/main/java/com/duy/ide/DiagnosticsCollector.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

editor/src/main/java/com/duy/ide/Diagnostic.java renamed to editor/src/main/java/com/duy/ide/diagnostic/Diagnostic.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
/*
2-
* Copyright 2018 Mr Duy
2+
* Copyright (C) 2018 Duy Tran Le
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
78
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
913
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1516
*/
1617

17-
package com.duy.ide;
18+
package com.duy.ide.diagnostic;
1819

1920
import android.content.Context;
2021
import android.os.Parcelable;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (C) 2018 Duy Tran Le
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.duy.ide.diagnostic;
19+
20+
import android.view.View;
21+
22+
import com.duy.ide.suggestion.ISuggestion;
23+
24+
/**
25+
* Created by Duy on 28-Apr-18.
26+
*/
27+
28+
public interface DiagnosticClickListener {
29+
void onDiagnosisClick(Diagnostic diagnostic, View view);
30+
31+
void onSuggestionClick(View v, Diagnostic diagnostic, ISuggestion suggestion);
32+
}

0 commit comments

Comments
 (0)