Separate children of a layout with new line in generated XML

Update icons for linear layout and relative layout
This commit is contained in:
Akash Yadav
2021-12-31 20:13:18 +05:30
parent b33c434fe1
commit 02118b2286
5 changed files with 70 additions and 10 deletions
+2
View File
@@ -6,6 +6,8 @@
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/drawable/bg_design_container_background.xml" value="0.1" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/drawable/bg_ui_view_pressed.xml" value="0.1" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/drawable/ic_github.xml" value="0.21837606837606838" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/drawable/ic_linear_layout.xml" value="0.175" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/drawable/ic_relative_layout.xml" value="0.175" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/layout/activity_about.xml" value="0.2" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/layout/activity_designer.xml" value="0.264" />
<entry key="..\:/Projects/AndroidStudioProjects/AndroidIDE/app/src/main/res/layout/activity_editor.xml" value="0.20512820512820512" />
@@ -236,8 +236,6 @@ public class DesignerActivity extends StudioActivity implements WidgetItemAdapte
.show ();
}
// FIXME Generated XML does not leave a space between
// codes of two adjacent views (in same parent)
private void finishWithResult (String result) {
final var intent = new Intent ();
intent.putExtra (KEY_GENERATED_CODE, result);
+41 -4
View File
@@ -1,5 +1,42 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6,7h2.5L5,3.5 1.5,7L4,7v10L1.5,17L5,20.5 8.5,17L6,17L6,7zM10,5v2h12L22,5L10,5zM10,19h12v-2L10,17v2zM10,13h12v-2L10,11v2z"/>
<!--
~ This file is part of AndroidIDE.
~
~ AndroidIDE is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ AndroidIDE is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M50.28,451.72c0,5.52 4.48,10 10,10h391.44c5.52,0 10,-4.48 10,-10V60.28c0,-5.52 -4.48,-10 -10,-10H60.28c-5.52,0 -10,4.48 -10,10V451.72z"
android:strokeWidth="20"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"/>
<path
android:pathData="M134.9,52.08c1.95,137.82 -1.95,272.71 0,410.53"
android:strokeWidth="20"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"/>
<path
android:pathData="M255.66,50.91c1.95,137.82 -1.95,272.71 0,410.53"
android:strokeWidth="20"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"/>
<path
android:pathData="M363.66,50.91c1.95,137.82 -1.95,272.71 0,410.53"
android:strokeWidth="20"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"/>
</vector>
+26 -4
View File
@@ -1,5 +1,27 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z"/>
<!--
~ This file is part of AndroidIDE.
~
~ AndroidIDE is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ AndroidIDE is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,5v2h-4L15,5h4M9,5v6L5,11L5,5h4m10,8v6h-4v-6h4M9,17v2L5,19v-2h4M21,3h-8v6h8L21,3zM11,3L3,3v10h8L11,3zM21,11h-8v10h8L21,11zM11,15L3,15v6h8v-6z" />
</vector>
@@ -256,6 +256,7 @@ public abstract class BaseView implements IView {
for (var child : group.getChildren()) {
newLine(sb, indentCount + 1);
sb.append(child.generateCode(indentCount + 1));
newLine (sb, indentCount + 1);
}
}
}