Skip to content

Commit d279c6d

Browse files
author
appt2
committed
add layout perview tnks for -> https://github.com/timscriptov
1 parent 5a7382f commit d279c6d

File tree

17 files changed

+75
-3811
lines changed

17 files changed

+75
-3811
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"allFiles": [
3+
{
4+
"file": "/storage/emulated/0/AndroidIDEProjects/Ghost-web-ide/app/src/main/java/Ninja/coder/Ghostemane/code/AboutActivity.java",
5+
"selection": {
6+
"end": {
7+
"column": 0,
8+
"index": 0,
9+
"line": 0
10+
},
11+
"start": {
12+
"column": 0,
13+
"index": 0,
14+
"line": 0
15+
}
16+
}
17+
}
18+
],
19+
"selectedFile": "/storage/emulated/0/AndroidIDEProjects/Ghost-web-ide/app/src/main/java/Ninja/coder/Ghostemane/code/AboutActivity.java"
20+
}

app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010

1111
defaultConfig {
1212
applicationId "Ninja.coder.Ghostemane.code"
13-
minSdk 21
13+
minSdk 24
1414
targetSdk 30
1515
versionCode 25
1616
versionName "1.6.0-rc"
@@ -115,4 +115,6 @@ dependencies {
115115
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.2'
116116
implementation 'com.squareup:javapoet:1.13.0'
117117
implementation 'com.android.tools:r8:8.3.37'
118+
//ui
119+
implementation 'com.github.TimScriptov:App-UI-Designer:1.0.9'
118120
}

app/src/main/java/Ninja/coder/Ghostemane/code/AboutActivity.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package Ninja.coder.Ghostemane.code;
22

3-
import Ninja.coder.Ghostemane.code.GlideUtilApi.GlideCompat;
3+
import Ninja.coder.Ghostemane.code.GlideUtilApi.GlideCompat;
44
import Ninja.coder.Ghostemane.code.adapter.DevAd;
55
import Ninja.coder.Ghostemane.code.model.DevModel;
66
import android.content.Intent;
77
import android.net.Uri;
88
import android.util.Log;
99
import android.view.View;
1010
import android.widget.ImageView;
11-
import android.widget.TextView;
11+
import android.widget.TextView;
1212

1313
import android.widget.Toast;
1414
import androidx.activity.OnBackPressedCallback;
@@ -19,7 +19,7 @@
1919
import java.util.HashMap;
2020
import android.os.Bundle;
2121
import java.util.List;
22-
import org.eclipse.jdt.internal.compiler.batch.Main;
22+
import org.eclipse.jdt.internal.compiler.batch.Main;
2323
import org.jsoup.Jsoup;
2424
import org.jsoup.nodes.Document;
2525
import org.jsoup.select.Elements;
@@ -53,8 +53,9 @@ private void start() {
5353
listModel.add(new DevModel("Ban Doroid", "marco"));
5454
listModel.add(new DevModel("Mister Java", "macro"));
5555
listModel.add(new DevModel("Psi", "Help to adding python"));
56-
listModel.add(new DevModel("EUP", "marco"));
57-
GlideCompat.GlideNormal(appicon,R.mipmap.ghosticon);
56+
listModel.add(new DevModel("EUP", "marco"));
57+
listModel.add(new DevModel("timscriptov", "Tanks for Library layout preview"));
58+
GlideCompat.GlideNormal(appicon, R.mipmap.ghosticon);
5859
devAd = new DevAd(listModel, this);
5960
rv_about_dev.setAdapter(devAd);
6061
rv_about_dev.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
@@ -67,11 +68,9 @@ public void onResponse(String _param1, String respanse, HashMap<String, Object>
6768
}
6869

6970
@Override
70-
public void onErrorResponse(String _param1, String _param2) {
71-
72-
}
73-
};
74-
71+
public void onErrorResponse(String _param1, String _param2) {}
72+
};
73+
7574
getOnBackPressedDispatcher()
7675
.addCallback(
7776
this,
@@ -116,6 +115,9 @@ public void onItemChange(View v, int pos) {
116115
case 6:
117116
Toast.makeText(getApplicationContext(), "User not found Github page", 2).show();
118117
break;
118+
case 7:
119+
openUrl("https://github.com/timscriptov");
120+
break;
119121
}
120122
}
121123

app/src/main/java/Ninja/coder/Ghostemane/code/CodeeditorActivity.java

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
import android.media.AudioManager;
4444
import android.view.inputmethod.EditorInfo;
4545
import android.util.TypedValue;
46+
import com.mcal.uidesigner.XmlLayoutDesignActivity;
47+
import com.sdsmdg.harjot.vectormaster.VectorMasterView;
48+
import com.google.android.material.bottomsheet.BottomSheetDialog;
4649
import io.github.rosemoe.sora.data.Span;
4750
import io.github.rosemoe.sora.text.TextStyle;
4851
import io.github.rosemoe.sora.widget.CodeEditor;
@@ -2001,11 +2004,42 @@ public void _fabCl() {
20012004
shp.getString("pos_path", ""));
20022005

20032006
} else if (shp.getString("pos_path", "").contains(".java")) {
2004-
2007+
20052008
JavaCompilerBeta.run(
20062009
CodeeditorActivity.this, editor.getText().toString());
20072010
} else if (shp.getString("pos_path", "").contains(".xml")) {
2008-
EditorSearcherT.xmlparser(CodeeditorActivity.this,editor);
2011+
2012+
if (editor.getText().toString().startsWith("<vector")) {
2013+
var vectorShow = new VectorMasterView(CodeeditorActivity.this);
2014+
var file = new File(shp.getString("pos_path", ""));
2015+
var par =
2016+
new LinearLayout.LayoutParams(
2017+
LinearLayout.LayoutParams.MATCH_PARENT,
2018+
LinearLayout.LayoutParams.MATCH_PARENT);
2019+
vectorShow.setLayoutParams(par);
2020+
if (vectorShow.isVector()) {
2021+
vectorShow.setVectorFile(file);
2022+
}
2023+
var sheet = new BottomSheetDialog(CodeeditorActivity.this);
2024+
sheet.setContentView(vectorShow);
2025+
if (sheet != null) {
2026+
sheet.show();
2027+
}
2028+
} else if (editor.getText().toString().startsWith("<?xml")) {
2029+
XmlLayoutDesignActivity.show(
2030+
CodeeditorActivity.this,
2031+
"xml",
2032+
shp.getString("pos_path", ""),
2033+
false,
2034+
false);
2035+
}else{
2036+
XmlLayoutDesignActivity.show(
2037+
CodeeditorActivity.this,
2038+
"xml",
2039+
shp.getString("pos_path", ""),
2040+
false,
2041+
false);
2042+
}
20092043
}
20102044
}
20112045
}
@@ -2222,14 +2256,9 @@ public void onBindViewHolder(ViewHolder _holder, final int _position) {
22222256
selector.setBackground(SketchUi);
22232257
}
22242258
}
2225-
datas =
2226-
Uri.parse(_data.get((int) _position).get("path").toString())
2227-
.getLastPathSegment()
2228-
;
2259+
datas = Uri.parse(_data.get((int) _position).get("path").toString()).getLastPathSegment();
22292260
textview1.setText(
2230-
Uri.parse(_data.get((int) _position).get("path").toString())
2231-
.getLastPathSegment()
2232-
);
2261+
Uri.parse(_data.get((int) _position).get("path").toString()).getLastPathSegment());
22332262

22342263
if (FileUtil.isDirectory(_data.get((int) _position).get("path").toString())) {
22352264

@@ -2241,8 +2270,7 @@ public void onBindViewHolder(ViewHolder _holder, final int _position) {
22412270
"FileNotFound*"
22422271
.concat(
22432272
Uri.parse(_data.get((int) _position).get("path").toString())
2244-
.getLastPathSegment())
2245-
);
2273+
.getLastPathSegment()));
22462274
}
22472275
if (_data
22482276
.get((int) _position)

app/src/main/java/Ninja/coder/Ghostemane/code/marco/EditorSearcherT.java

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,9 @@
1212
import android.view.View;
1313
import android.view.ViewGroup;
1414
import android.widget.EditText;
15-
import android.widget.ImageView;
16-
import android.widget.LinearLayout;
1715
import android.widget.PopupWindow;
18-
import com.google.android.material.bottomsheet.BottomSheetDialog;
1916
import com.google.android.material.button.MaterialButton;
2017
import com.google.android.material.color.MaterialColors;
21-
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
22-
import com.google.android.material.textfield.TextInputLayout;
23-
import coyamo.visualxml.lib.parser.AndroidXmlParser;
24-
import coyamo.visualxml.lib.parser.ReadOnlyParser;
25-
import coyamo.visualxml.lib.proxy.ProxyResources;
26-
import coyamo.visualxml.lib.ui.OutlineView;
27-
import coyamo.visualxml.lib.utils.MessageArray;
2818
import io.github.rosemoe.sora.widget.CodeEditor;
2919

3020
public class EditorSearcherT {
@@ -91,46 +81,6 @@ public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
9181

9282
public static void show(IDEEDITOR editor, View views) {
9383
show(editor, views, "");
94-
}
95-
96-
public static void xmlparser(Context context, CodeEditor editor) {
97-
var sheet = new BottomSheetDialog(context);
98-
try {
99-
ProxyResources.getInstance().getViewIdMap().clear();
100-
MessageArray.getInstanse().clear();
101-
} catch (Exception err) {
102-
err.printStackTrace();
103-
}
104-
OutlineView outline = new OutlineView(context, null);
105-
LinearLayout.LayoutParams par =
106-
new LinearLayout.LayoutParams(
107-
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
108-
outline.setLayoutParams(par);
109-
outline.setHoldOutline(false);
110-
outline.setDisplayType(OutlineView.DISPLAY_DESIGN);
111-
AndroidXmlParser.with(outline)
112-
.setOnParseListener(
113-
new AndroidXmlParser.OnParseListener() {
114-
115-
@Override
116-
public void onAddChildView(View v, ReadOnlyParser parser) {}
117-
118-
@Override
119-
public void onFinish() {}
120-
121-
@Override
122-
public void onJoin(ViewGroup viewGroup, ReadOnlyParser parser) {}
123-
124-
@Override
125-
public void onRevert(ViewGroup viewGroup, ReadOnlyParser parser) {}
126-
127-
@Override
128-
public void onStart() {}
129-
})
130-
.parse(editor.getText().toString());
131-
sheet.setContentView(outline);
132-
if (sheet != null) {
133-
sheet.show();
134-
}
84+
13585
}
13686
}

app/src/main/java/com/sdsmdg/harjot/vectormaster/DefaultValues.java

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

0 commit comments

Comments
 (0)