= ArrayList()
-
- for (attr in attrs) {
- values.add(attr.value)
- }
-
- return values
- }
-
- /**
- * Checks if the AttributeMap contains a key
- *
- * @param key the key to check for
- * @return true if the AttributeMap contains the key, false otherwise
- */
- fun contains(key: String): Boolean {
- for (attr in attrs) {
- if (attr.key == key) {
- return true
- }
- // Check for attribute with/without android: prefix
- if (key.startsWith("android:") && attr.key == key.substring(8)) {
- return true
- }
- if (attr.key.startsWith("android:") && attr.key.substring(8) == key) {
- return true
- }
- }
-
- return false
- }
-
- /**
- * Gets the index of the Attribute with the given key
- *
- * @param key the key of the Attribute
- * @return the index of the Attribute
- */
- private fun getAttributeIndexFromKey(key: String): Int {
- var index = 0
-
- for (attr in attrs) {
- if (attr.key == key) {
- return index
- }
- // Check for attribute with/without android: prefix
- if (key.startsWith("android:") && attr.key == key.substring(8)) {
- return index
- }
- if (attr.key.startsWith("android:") && attr.key.substring(8) == key) {
- return index
- }
-
- index++
- }
-
- return index
- }
-
- private class Attribute
- /**
- * Constructs an Attribute with the specified key-value pair
- *
- * @param key the key of the Attribute
- * @param value the value of the Attribute
- */(val key: String, var value: String)
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ButtonDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ButtonDesign.java
deleted file mode 100644
index 9089154954..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ButtonDesign.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.Button;
-
-import androidx.annotation.NonNull;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("AppCompatCustomView")
-public class ButtonDesign extends Button {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ButtonDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(@NonNull Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(@NonNull Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/CheckBoxDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/CheckBoxDesign.java
deleted file mode 100644
index 912de18016..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/CheckBoxDesign.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.CheckBox;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("AppCompatCustomView")
-public class CheckBoxDesign extends CheckBox {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public CheckBoxDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipDesign.java
deleted file mode 100644
index 9b0cabe807..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.chip.Chip;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ChipDesign extends Chip {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ChipDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipGroupDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipGroupDesign.java
deleted file mode 100644
index f9dfe76004..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ChipGroupDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.chip.ChipGroup;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ChipGroupDesign extends ChipGroup {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ChipGroupDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/FloatingActionButtonDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/FloatingActionButtonDesign.java
deleted file mode 100644
index dc340024b5..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/FloatingActionButtonDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class FloatingActionButtonDesign extends FloatingActionButton {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public FloatingActionButtonDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ImageButtonDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ImageButtonDesign.java
deleted file mode 100644
index 8e9cb8925e..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ImageButtonDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.ImageButton;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ImageButtonDesign extends ImageButton {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ImageButtonDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioButtonDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioButtonDesign.java
deleted file mode 100644
index cb2497dcb8..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioButtonDesign.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.RadioButton;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("AppCompatCustomView")
-public class RadioButtonDesign extends RadioButton {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public RadioButtonDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioGroupDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioGroupDesign.java
deleted file mode 100644
index b436f6aefc..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/RadioGroupDesign.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.RadioGroup;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class RadioGroupDesign extends RadioGroup {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public RadioGroupDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/SwitchDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/SwitchDesign.java
deleted file mode 100644
index 95996b840f..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/SwitchDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.Switch;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("UseSwitchCompatOrMaterialCode")
-public class SwitchDesign extends Switch {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public SwitchDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ToggleButtonDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ToggleButtonDesign.java
deleted file mode 100644
index 3ee3a3b46a..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/buttons/ToggleButtonDesign.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.buttons;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.ToggleButton;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ToggleButtonDesign extends ToggleButton {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ToggleButtonDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/AppBarLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/AppBarLayoutDesign.java
deleted file mode 100644
index 6f3063d091..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/AppBarLayoutDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.appbar.AppBarLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class AppBarLayoutDesign extends AppBarLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public AppBarLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomAppBarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomAppBarDesign.java
deleted file mode 100644
index 7364dc8aaf..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomAppBarDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.bottomappbar.BottomAppBar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class BottomAppBarDesign extends BottomAppBar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public BottomAppBarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomNavigationViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomNavigationViewDesign.java
deleted file mode 100644
index b6a75dff1b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/BottomNavigationViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.bottomnavigation.BottomNavigationView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class BottomNavigationViewDesign extends BottomNavigationView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public BottomNavigationViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/CardViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/CardViewDesign.java
deleted file mode 100644
index e26305c6e8..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/CardViewDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import androidx.cardview.widget.CardView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class CardViewDesign extends CardView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public CardViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/HorizontalScrollViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/HorizontalScrollViewDesign.java
deleted file mode 100644
index c1bd4816d0..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/HorizontalScrollViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.HorizontalScrollView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class HorizontalScrollViewDesign extends HorizontalScrollView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public HorizontalScrollViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/MaterialToolbarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/MaterialToolbarDesign.java
deleted file mode 100644
index ca2dddac2b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/MaterialToolbarDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.appbar.MaterialToolbar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class MaterialToolbarDesign extends MaterialToolbar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public MaterialToolbarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NavigationViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NavigationViewDesign.java
deleted file mode 100644
index 75d27b6606..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NavigationViewDesign.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import com.google.android.material.navigation.NavigationView;
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NavigationViewDesign extends NavigationView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- private final Logger logger = LoggerFactory.getLogger(NavigationViewDesign.class);
-
- public NavigationViewDesign(Context context) {
- super(context);
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint)
- Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else
- super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- @Override
- protected void onAttachedToWindow() {
- try {
- super.onAttachedToWindow();
- } catch (IllegalArgumentException e) {
- logger.error("NavigationView should be placed in a DrawerLayout", e);
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NestedScrollViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NestedScrollViewDesign.java
deleted file mode 100644
index 1363d94ea9..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/NestedScrollViewDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import androidx.core.widget.NestedScrollView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class NestedScrollViewDesign extends NestedScrollView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public NestedScrollViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/RecyclerViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/RecyclerViewDesign.java
deleted file mode 100644
index 2a3739e901..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/RecyclerViewDesign.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-
-import androidx.recyclerview.widget.RecyclerView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class RecyclerViewDesign extends RecyclerView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
- private Paint previewPaint;
-
- public RecyclerViewDesign(Context context) {
- super(context);
- init();
- }
-
- private void init() {
- previewPaint = new Paint();
- previewPaint.setColor(Color.GRAY);
- previewPaint.setStyle(Paint.Style.FILL);
- previewPaint.setTextSize(35);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- int numColumns = 3; // number of columns in the grid
- int itemWidth = getWidth() / numColumns;
- int itemHeight = getHeight() / numColumns;
- int x = 0;
- int y = 0;
-
- for (int i = 1; i <= numColumns * numColumns; i++) {
- // draw item placeholder
- String text = "item " + i;
- float textWidth = previewPaint.measureText(text);
- float textHeight = previewPaint.descent() - previewPaint.ascent();
- float xPos = x + (itemWidth - textWidth) / 2;
- float yPos = y + (itemHeight - textHeight) / 2 - previewPaint.ascent();
- canvas.drawText(text, xPos, yPos, previewPaint);
-
- // update x and y position for next item
- x += itemWidth;
- if (i % numColumns == 0) {
- x = 0;
- y += itemHeight;
- }
- }
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ScrollViewDesign.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ScrollViewDesign.kt
deleted file mode 100644
index 640a72284d..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ScrollViewDesign.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers
-
-import android.content.Context
-import android.graphics.Canvas
-import android.util.AttributeSet
-import android.view.GestureDetector
-import android.view.MotionEvent
-import android.widget.ScrollView
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-
-class ScrollViewDesign @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : ScrollView(context, attrs) {
- private var drawStrokeEnabled = false
- private var isBlueprint = false
-
- private val gestureDetector: GestureDetector
-
- init {
- gestureDetector = GestureDetector(context, ScrollDetector())
- }
-
- override fun onTouchEvent(ev: MotionEvent): Boolean {
- return gestureDetector.onTouchEvent(ev) || super.onTouchEvent(ev)
- }
-
- override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
-
- if (drawStrokeEnabled) Utils.drawDashPathStroke(
- this, canvas, if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR
- )
- }
-
- override fun draw(canvas: Canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR)
- else super.draw(canvas)
- }
-
- inner class ScrollDetector : GestureDetector.SimpleOnGestureListener() {
- override fun onScroll(
- e1: MotionEvent?,
- e2: MotionEvent,
- distanceX: Float,
- distanceY: Float
- ): Boolean {
- if (e1 != null) {
- val deltaY = e2.y - e1.y
- val threshold = resources.displayMetrics.heightPixels * 0.2f
- if (deltaY > threshold) {
- smoothScrollTo(0, scrollY + 100)
- return true
- } else if (deltaY < -threshold) {
- smoothScrollTo(0, scrollY - 100)
- return true
- }
- }
-
- return super.onScroll(e1, e2, distanceX, distanceY)
- }
- }
-
- fun setStrokeEnabled(enabled: Boolean) {
- drawStrokeEnabled = enabled
- invalidate()
- }
-
- fun setBlueprint(isBlueprint: Boolean) {
- this.isBlueprint = isBlueprint
- invalidate()
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/SpinnerDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/SpinnerDesign.java
deleted file mode 100644
index 3fb590061d..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/SpinnerDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.Spinner;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class SpinnerDesign extends Spinner {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public SpinnerDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabItemDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabItemDesign.java
deleted file mode 100644
index 9b8ada6344..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabItemDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.tabs.TabItem;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TabItemDesign extends TabItem {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TabItemDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabLayoutDesign.java
deleted file mode 100644
index ea4008b283..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/TabLayoutDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import com.google.android.material.tabs.TabLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TabLayoutDesign extends TabLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TabLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ToolbarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ToolbarDesign.java
deleted file mode 100644
index 1c763120f9..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ToolbarDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.Toolbar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ToolbarDesign extends Toolbar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ToolbarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ViewPagerDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ViewPagerDesign.java
deleted file mode 100644
index 58f4f04661..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/containers/ViewPagerDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.containers;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import androidx.viewpager.widget.ViewPager;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ViewPagerDesign extends ViewPager {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ViewPagerDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/ConstraintLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/ConstraintLayoutDesign.java
deleted file mode 100644
index 956c5fa52e..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/ConstraintLayoutDesign.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.view.View;
-
-import androidx.constraintlayout.widget.ConstraintLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ConstraintLayoutDesign extends ConstraintLayout {
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- private Paint linePaint;
- private Paint fillPaint;
-
- private final int PARENT_ID = ConstraintLayout.LayoutParams.PARENT_ID;
- private final int LEFT = 1;
- private final int RIGHT = 2;
- private final int TOP = 3;
- private final int BOTTOM = 4;
-
- public ConstraintLayoutDesign(Context context) {
- super(context);
-
- linePaint = new Paint();
- linePaint.setColor(Color.LTGRAY);
- linePaint.setStrokeWidth(2);
- linePaint.setAntiAlias(true);
- linePaint.setStyle(Paint.Style.STROKE);
-
- fillPaint = new Paint();
- fillPaint.setColor(Color.LTGRAY);
- fillPaint.setAntiAlias(true);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- if (drawStrokeEnabled) {
- drawBindings(canvas);
- }
-
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- private void drawBindings(Canvas canvas) {
- for (int i = 0; i < getChildCount(); i++) {
- View view = getChildAt(i);
- ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) view.getLayoutParams();
-
- // Draw connection lines for the view's constraints
- if (params.leftToLeft != -1) {
- int targetId = params.leftToLeft;
- drawConstraintLine(canvas, view, targetId, LEFT, LEFT);
- }
- if (params.leftToRight != -1) {
- int targetId = params.leftToRight;
- drawConstraintLine(canvas, view, targetId, LEFT, RIGHT);
- }
- if (params.rightToLeft != -1) {
- int targetId = params.rightToLeft;
- drawConstraintLine(canvas, view, targetId, RIGHT, LEFT);
- }
- if (params.rightToRight != -1) {
- int targetId = params.rightToRight;
- drawConstraintLine(canvas, view, targetId, RIGHT, RIGHT);
- }
- if (params.topToTop != -1) {
- int targetId = params.topToTop;
- drawConstraintLine(canvas, view, targetId, TOP, TOP);
- }
- if (params.topToBottom != -1) {
- int targetId = params.topToBottom;
- drawConstraintLine(canvas, view, targetId, TOP, BOTTOM);
- }
- if (params.bottomToTop != -1) {
- int targetId = params.bottomToTop;
- drawConstraintLine(canvas, view, targetId, BOTTOM, TOP);
- }
- if (params.bottomToBottom != -1) {
- int targetId = params.bottomToBottom;
- drawConstraintLine(canvas, view, targetId, BOTTOM, BOTTOM);
- }
- }
- }
-
- private void drawConstraintLine(Canvas canvas, View view, int targetId, int startSide, int endSide) {
- View targetView = targetId == PARENT_ID ? this : findViewById(targetId);
- if (targetView == null) return;
-
- int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
-
- // Get source coordinates
- switch (startSide) {
- case LEFT:
- x1 = view.getLeft();
- y1 = view.getTop() + view.getHeight() / 2;
- break;
- case RIGHT:
- x1 = view.getRight();
- y1 = view.getTop() + view.getHeight() / 2;
- break;
- case TOP:
- x1 = view.getLeft() + view.getWidth() / 2;
- y1 = view.getTop();
- break;
- case BOTTOM:
- x1 = view.getLeft() + view.getWidth() / 2;
- y1 = view.getBottom();
- break;
- }
-
- // Get target coordinates
- switch (endSide) {
- case LEFT:
- x2 = targetView.getLeft();
- y2 = targetView.getTop() + targetView.getHeight() / 2;
- break;
- case RIGHT:
- x2 = targetView.getRight();
- y2 = targetView.getTop() + targetView.getHeight() / 2;
- break;
- case TOP:
- x2 = targetView.getLeft() + targetView.getWidth() / 2;
- y2 = targetView.getTop();
- break;
- case BOTTOM:
- x2 = targetView.getLeft() + targetView.getWidth() / 2;
- y2 = targetView.getBottom();
- break;
- }
-
- // Draw the constraint line
- Paint constraintPaint = new Paint();
- constraintPaint.setColor(Color.DKGRAY);
- constraintPaint.setStrokeWidth(2);
- constraintPaint.setStyle(Paint.Style.STROKE);
- canvas.drawLine(x1, y1, x2, y2, constraintPaint);
- }
-
- private void drawHorArrow(Canvas canvas, int x, int y, int x2, int y2) {
- int width = x2 - x;
- int step = 10;
- int height = 10;
-
- for (int i = 0; i < width; i += step) {
- // line(x + i, y, x + i + step, y + step);
- canvas.drawLine(x + i, y - height / 2, x + i + step, y + height / 2, linePaint);
- canvas.drawLine(x + i + step, y - height / 2, x + i + step, y + height / 2, linePaint);
- }
- }
-
- private void drawVerArrow(Canvas canvas, int x, int y, int x2, int y2) {
- int height = y2 - y;
- int step = 10;
- int width = 10;
-
- for (int i = 0; i < height; i += step) {
- canvas.drawLine(x - width / 2, y + i, x + width / 2, y + i + step, linePaint);
- canvas.drawLine(x - width / 2, y + i + step, x + width / 2, y + i + step, linePaint);
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/CoordinatorLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/CoordinatorLayoutDesign.java
deleted file mode 100644
index e1050e9ed6..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/CoordinatorLayoutDesign.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-
-import androidx.annotation.NonNull;
-import androidx.coordinatorlayout.widget.CoordinatorLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-/**
- * A design-time representation of a CoordinatorLayout.
- *
- * This class provides visual feedback within the layout editor, such as a dashed
- * border, to indicate its boundaries and state (e.g., blueprint mode). It mirrors
- * the functionality of ConstraintLayoutDesign for a consistent look and feel.
- */
-public class CoordinatorLayoutDesign extends CoordinatorLayout {
- private boolean isBlueprint;
- private boolean drawStrokeEnabled;
-
- public CoordinatorLayoutDesign(Context context) {
- super(context);
- }
-
- /**
- * Overridden to draw custom design-time visuals *after* the children have been drawn.
- * This is where we draw the dashed border for the layout itself.
- */
- @Override
- protected void dispatchDraw(@NonNull Canvas canvas) {
- // Let the default CoordinatorLayout draw its children first.
- super.dispatchDraw(canvas);
-
- // After drawing children, draw our custom dashed stroke on top if enabled.
- if (drawStrokeEnabled) {
- Utils.drawDashPathStroke(
- this,
- canvas,
- isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
- }
-
- /**
- * Overridden to handle the "blueprint" mode. In blueprint mode, we don't draw
- * the standard background or children, only a dashed outline.
- */
- @Override
- public void draw(@NonNull Canvas canvas) {
- if (isBlueprint) {
- // In blueprint mode, only draw the dashed outline and nothing else.
- Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- } else {
- // In normal design mode, perform the standard draw operation.
- super.draw(canvas);
- }
- }
-
- /**
- * Toggles blueprint mode.
- *
- * @param isBlueprint true to enable blueprint mode, false for normal design mode.
- */
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate(); // Redraw the view with the new mode.
- }
-
- /**
- * Toggles the visibility of the dashed stroke outline in design mode.
- *
- * @param enabled true to show the dashed outline.
- */
- public void setStrokeEnabled(boolean enabled) {
- this.drawStrokeEnabled = enabled;
- invalidate(); // Redraw the view.
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/DrawerLayoutDesign.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/DrawerLayoutDesign.kt
deleted file mode 100644
index 3ab468ea8a..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/DrawerLayoutDesign.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts
-
-import android.content.Context
-import android.graphics.Canvas
-import androidx.drawerlayout.widget.DrawerLayout
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-import org.slf4j.Logger
-import org.slf4j.LoggerFactory
-
-class DrawerLayoutDesign(
- context: Context,
-) : DrawerLayout(context) {
- private var drawStrokeEnabled = false
- private var isBlueprint = false
-
- private val logger: Logger = LoggerFactory.getLogger(DrawerLayoutDesign::class.java)
-
- override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
-
- if (drawStrokeEnabled) {
- Utils.drawDashPathStroke(
- this,
- canvas,
- if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR,
- )
- }
- }
-
- override fun draw(canvas: Canvas) {
- if (isBlueprint) {
- Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR)
- } else {
- super.draw(canvas)
- }
- }
-
- fun setStrokeEnabled(enabled: Boolean) {
- drawStrokeEnabled = enabled
- invalidate()
- }
-
- fun setBlueprint(isBlueprint: Boolean) {
- this.isBlueprint = isBlueprint
- invalidate()
- }
-
- override fun onAttachedToWindow() {
- try {
- super.onAttachedToWindow()
- } catch (e: Exception) {
- logger.error("Error in previewing DrawerLayoutDesign", e)
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/FrameLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/FrameLayoutDesign.java
deleted file mode 100644
index 15243094ae..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/FrameLayoutDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.FrameLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class FrameLayoutDesign extends FrameLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public FrameLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/LinearLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/LinearLayoutDesign.java
deleted file mode 100644
index 0ce5f05790..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/LinearLayoutDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.LinearLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class LinearLayoutDesign extends LinearLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public LinearLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/RelativeLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/RelativeLayoutDesign.java
deleted file mode 100644
index adf252bd48..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/RelativeLayoutDesign.java
+++ /dev/null
@@ -1,258 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Path;
-import android.view.View;
-import android.widget.RelativeLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class RelativeLayoutDesign extends RelativeLayout {
-
- private Paint linePaint;
- private Paint fillPaint;
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public RelativeLayoutDesign(Context context) {
- super(context);
-
- linePaint = new Paint();
- linePaint.setColor(Color.LTGRAY);
- linePaint.setStrokeWidth(Utils.pxToDp(context, 2));
- linePaint.setAntiAlias(true);
- linePaint.setStyle(Paint.Style.STROKE);
-
- fillPaint = new Paint();
- fillPaint.setColor(Color.LTGRAY);
- fillPaint.setAntiAlias(true);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- if (drawStrokeEnabled) {
- drawBindings(canvas);
- }
-
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- private void drawBindings(Canvas canvas) {
- for (int i = 0; i < getChildCount(); i++) {
- View view = getChildAt(i);
-
- RelativeLayout.LayoutParams par = (RelativeLayout.LayoutParams) view.getLayoutParams();
-
- if (par.getRule(CENTER_HORIZONTAL) == -1) {
- drawHorArrow(
- canvas,
- 0,
- view.getTop() + view.getHeight() / 2,
- view.getLeft(),
- view.getTop() + view.getHeight() / 2);
- drawHorArrow(
- canvas,
- view.getRight(),
- view.getTop() + view.getHeight() / 2,
- getWidth(),
- view.getTop() + view.getHeight() / 2);
- }
-
- if (par.getRule(CENTER_VERTICAL) == -1) {
- drawVerArrow(
- canvas,
- view.getLeft() + view.getWidth() / 2,
- 0,
- view.getLeft() + view.getWidth() / 2,
- view.getTop());
- drawVerArrow(
- canvas,
- view.getLeft() + view.getWidth() / 2,
- view.getBottom(),
- view.getLeft() + view.getWidth() / 2,
- getHeight());
- }
-
- if (par.getRule(CENTER_IN_PARENT) == -1) {
- drawHorArrow(
- canvas,
- 0,
- view.getTop() + view.getHeight() / 2,
- view.getLeft(),
- view.getTop() + view.getHeight() / 2);
- drawHorArrow(
- canvas,
- view.getRight(),
- view.getTop() + view.getHeight() / 2,
- getWidth(),
- view.getTop() + view.getHeight() / 2);
-
- drawVerArrow(
- canvas,
- view.getLeft() + view.getWidth() / 2,
- 0,
- view.getLeft() + view.getWidth() / 2,
- view.getTop());
- drawVerArrow(
- canvas,
- view.getLeft() + view.getWidth() / 2,
- view.getBottom(),
- view.getLeft() + view.getWidth() / 2,
- getHeight());
- }
-
- if (par.getRule(ABOVE) != 0) {
- View anchor = findViewById(par.getRule(ABOVE));
-
- if (anchor != null) drawBind(canvas, view, anchor, ABOVE);
- }
-
- if (par.getRule(BELOW) != 0) {
- View anchor = findViewById(par.getRule(BELOW));
-
- if (anchor != null) drawBind(canvas, view, anchor, BELOW);
- }
-
- if (par.getRule(LEFT_OF) != 0) {
- View anchor = findViewById(par.getRule(LEFT_OF));
-
- if (anchor != null) drawBind(canvas, view, anchor, LEFT_OF);
- }
-
- if (par.getRule(RIGHT_OF) != 0) {
- View anchor = findViewById(par.getRule(RIGHT_OF));
-
- if (anchor != null) drawBind(canvas, view, anchor, RIGHT_OF);
- }
- }
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- private void drawHorArrow(Canvas canvas, int x, int y, int x2, int y2) {
- int width = x2 - x;
- int step = 10;
- int height = 10;
-
- for (int i = 0; i < width; i += step) {
- // line(x + i, y, x + i + step, y + step);
- canvas.drawLine(x + i, y - height / 2, x + i + step, y + height / 2, linePaint);
- canvas.drawLine(x + i + step, y - height / 2, x + i + step, y + height / 2, linePaint);
- }
- }
-
- private void drawVerArrow(Canvas canvas, int x, int y, int x2, int y2) {
- int height = y2 - y;
- int step = 10;
- int width = 10;
-
- for (int i = 0; i < height; i += step) {
- canvas.drawLine(x - width / 2, y + i, x + width / 2, y + i + step, linePaint);
- canvas.drawLine(x - width / 2, y + i + step, x + width / 2, y + i + step, linePaint);
- }
- }
-
- private void drawBind(Canvas canvas, View view, View anchor, int rule) {
- int x1 = 0, y1 = 0;
- int x2 = 0, y2 = 0;
- int offset = 100;
-
- Path path = new Path();
-
- switch (rule) {
- case BELOW:
- {
- x1 = view.getLeft() + view.getWidth() / 2;
- y1 = view.getTop();
- x2 = anchor.getLeft() + anchor.getWidth() / 2;
- y2 = anchor.getBottom();
-
- int halfX = (x1 + x2) / 2;
- int halfY = (y1 + y2) / 2;
-
- path.moveTo(x1, y1);
- path.cubicTo(x1, y1, x1, y1 - offset, halfX, halfY);
- path.moveTo(x2, y2);
- path.cubicTo(x2, y2, x2, y2 + offset, halfX, halfY);
- break;
- }
-
- case ABOVE:
- {
- x1 = view.getLeft() + view.getWidth() / 2;
- y1 = view.getBottom();
- x2 = anchor.getLeft() + anchor.getWidth() / 2;
- y2 = anchor.getTop();
-
- int halfX = (x1 + x2) / 2;
- int halfY = (y1 + y2) / 2;
-
- path.moveTo(x1, y1);
- path.cubicTo(x1, y1, x1, y1 + offset, halfX, halfY);
- path.moveTo(x2, y2);
- path.cubicTo(x2, y2, x2, y2 - offset, halfX, halfY);
- break;
- }
-
- case LEFT_OF:
- {
- x1 = view.getRight();
- y1 = view.getTop() + view.getHeight() / 2;
- x2 = anchor.getLeft();
- y2 = anchor.getTop() + anchor.getHeight() / 2;
-
- int halfX = (x1 + x2) / 2;
- int halfY = (y1 + y2) / 2;
-
- path.moveTo(x1, y1);
- path.cubicTo(x1, y1, x1 + offset, y1, halfX, halfY);
- path.moveTo(x2, y2);
- path.cubicTo(x2, y2, x2 - offset, y2, halfX, halfY);
- break;
- }
-
- case RIGHT_OF:
- {
- x1 = view.getLeft();
- y1 = view.getTop() + view.getHeight() / 2;
- x2 = anchor.getRight();
- y2 = anchor.getTop() + anchor.getHeight() / 2;
-
- int halfX = (x1 + x2) / 2;
- int halfY = (y1 + y2) / 2;
-
- path.moveTo(x1, y1);
- path.cubicTo(x1, y1, x1 - offset, y1, halfX, halfY);
- path.moveTo(x2, y2);
- path.cubicTo(x2, y2, x2 + offset, y2, halfX, halfY);
- break;
- }
- }
-
- canvas.drawPath(path, linePaint);
- canvas.drawCircle(x2, y2, 10, fillPaint);
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableLayoutDesign.java
deleted file mode 100644
index bc17dcd006..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableLayoutDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.TableLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TableLayoutDesign extends TableLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TableLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableRowDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableRowDesign.java
deleted file mode 100644
index 25b9462165..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/layouts/TableRowDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.layouts;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.TableRow;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TableRowDesign extends TableRow {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TableRowDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridLayoutDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridLayoutDesign.java
deleted file mode 100644
index 745003ac70..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridLayoutDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.legacy;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.GridLayout;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class GridLayoutDesign extends GridLayout {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public GridLayoutDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridViewDesign.java
deleted file mode 100644
index dd82e118fc..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/GridViewDesign.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.legacy;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.widget.GridView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class GridViewDesign extends GridView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
- private Paint previewPaint;
-
- public GridViewDesign(Context context) {
- super(context);
- init();
- }
-
- private void init() {
- previewPaint = new Paint();
- previewPaint.setColor(Color.GRAY);
- previewPaint.setStyle(Paint.Style.FILL);
- previewPaint.setTextSize(35);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- int numColumns = 3; // number of columns in the grid
- int itemWidth = getWidth() / numColumns;
- int itemHeight = getHeight() / numColumns;
- int x = 0;
- int y = 0;
-
- for (int i = 1; i <= numColumns * numColumns; i++) {
- // draw item placeholder
- String text = "item " + i;
- float textWidth = previewPaint.measureText(text);
- float textHeight = previewPaint.descent() - previewPaint.ascent();
- float xPos = x + (itemWidth - textWidth) / 2;
- float yPos = y + (itemHeight - textHeight) / 2 - previewPaint.ascent();
- canvas.drawText(text, xPos, yPos, previewPaint);
-
- // update x and y position for next item
- x += itemWidth;
- if (i % numColumns == 0) {
- x = 0;
- y += itemHeight;
- }
- }
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/ListViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/ListViewDesign.java
deleted file mode 100644
index 6b41b39a09..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/ListViewDesign.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.legacy;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.widget.ListView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ListViewDesign extends ListView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
- private Paint previewPaint;
-
- public ListViewDesign(Context context) {
- super(context);
- init();
- }
-
- private void init() {
- previewPaint = new Paint();
- previewPaint.setColor(Color.GRAY);
- previewPaint.setStyle(Paint.Style.FILL);
- previewPaint.setTextSize(35);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- int numItems = 3;
- int itemHeight = getHeight() / numItems;
-
- for (int i = 0; i < numItems; i++) {
- // draw item placeholder
- String text = "ListView Item " + (i + 1);
- float textWidth = previewPaint.measureText(text);
- float textHeight = previewPaint.descent() - previewPaint.ascent();
- float xPos = (getWidth() - textWidth) / 2;
- float yPos = i * itemHeight + (itemHeight - textHeight) / 2 - previewPaint.ascent();
- canvas.drawText(text, xPos, yPos, previewPaint);
- }
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/TabHostDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/TabHostDesign.java
deleted file mode 100644
index 97e714ad6f..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/legacy/TabHostDesign.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.legacy;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.TabHost;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressWarnings("deprecation")
-public class TabHostDesign extends TabHost {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TabHostDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/AutoCompleteTextViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/AutoCompleteTextViewDesign.java
deleted file mode 100644
index 77d62d62f4..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/AutoCompleteTextViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.AutoCompleteTextView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class AutoCompleteTextViewDesign extends AutoCompleteTextView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public AutoCompleteTextViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/CheckedTextViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/CheckedTextViewDesign.java
deleted file mode 100644
index bf1b9e1ece..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/CheckedTextViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.CheckedTextView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class CheckedTextViewDesign extends CheckedTextView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public CheckedTextViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/EditTextDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/EditTextDesign.java
deleted file mode 100644
index 7ecaa1d60b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/EditTextDesign.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.EditText;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("AppCompatCustomView")
-public class EditTextDesign extends EditText {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public EditTextDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/MultiAutoCompleteTextViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/MultiAutoCompleteTextViewDesign.java
deleted file mode 100644
index 8b19c07b63..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/MultiAutoCompleteTextViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.MultiAutoCompleteTextView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class MultiAutoCompleteTextViewDesign extends MultiAutoCompleteTextView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public MultiAutoCompleteTextViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputEditTextDesign.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputEditTextDesign.kt
deleted file mode 100644
index 999fc58858..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputEditTextDesign.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text
-
-import android.content.Context
-import android.graphics.Canvas
-import com.google.android.material.textfield.TextInputEditText
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-
-open class TextInputEditTextDesign(context: Context) : TextInputEditText(context) {
-
- private var drawStrokeEnabled: Boolean = false
- private var isBlueprint: Boolean = false
-
- override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
-
- if (drawStrokeEnabled) {
- Utils.drawDashPathStroke(
- this,
- canvas,
- if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR
- )
- }
- }
-
- fun setStrokeEnabled(enabled: Boolean) {
- drawStrokeEnabled = enabled
- invalidate()
- }
-
- override fun draw(canvas: Canvas) {
- if (isBlueprint) {
- Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR)
- } else {
- super.draw(canvas)
- }
- }
-
- fun setBlueprint(isBlueprint: Boolean) {
- this.isBlueprint = isBlueprint
- invalidate()
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputLayoutDesign.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputLayoutDesign.kt
deleted file mode 100644
index 03049bb20c..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputLayoutDesign.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text
-
-import android.content.Context
-import android.graphics.Canvas
-import com.google.android.material.textfield.TextInputLayout
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-
-open class TextInputLayoutDesign(context: Context) : TextInputLayout(context) {
-
- private var drawStrokeEnabled: Boolean = false
- private var isBlueprint: Boolean = false
-
- override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
-
- if (drawStrokeEnabled) {
- Utils.drawDashPathStroke(
- this,
- canvas,
- if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR
- )
- }
- }
-
- fun setStrokeEnabled(enabled: Boolean) {
- drawStrokeEnabled = enabled
- invalidate()
- }
-
- override fun draw(canvas: Canvas) {
- if (isBlueprint) {
- Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR)
- } else {
- super.draw(canvas)
- }
- }
-
- fun setBlueprint(isBlueprint: Boolean) {
- this.isBlueprint = isBlueprint
- invalidate()
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextViewDesign.java
deleted file mode 100644
index aea139982d..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.text;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.TextView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TextViewDesign extends TextView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TextViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/CalendarViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/CalendarViewDesign.java
deleted file mode 100644
index 1b45a579bd..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/CalendarViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.CalendarView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class CalendarViewDesign extends CalendarView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public CalendarViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ImageViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ImageViewDesign.java
deleted file mode 100644
index 53e695554b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ImageViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.ImageView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ImageViewDesign extends ImageView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ImageViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ProgressBarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ProgressBarDesign.java
deleted file mode 100644
index 5aafd028ed..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ProgressBarDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.ProgressBar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ProgressBarDesign extends ProgressBar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ProgressBarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/RatingBarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/RatingBarDesign.java
deleted file mode 100644
index b949840d15..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/RatingBarDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.RatingBar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class RatingBarDesign extends RatingBar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public RatingBarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SearchViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SearchViewDesign.java
deleted file mode 100644
index 3b546f7605..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SearchViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.SearchView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class SearchViewDesign extends SearchView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public SearchViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SeekBarDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SeekBarDesign.java
deleted file mode 100644
index 1e9ed52343..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SeekBarDesign.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.SeekBar;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-@SuppressLint("AppCompatCustomView")
-public class SeekBarDesign extends SeekBar {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public SeekBarDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SurfaceViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SurfaceViewDesign.java
deleted file mode 100644
index c2c506f18e..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/SurfaceViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.view.SurfaceView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class SurfaceViewDesign extends SurfaceView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public SurfaceViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextClockDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextClockDesign.java
deleted file mode 100644
index 3b3229d9b4..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextClockDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.TextClock;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TextClockDesign extends TextClock {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TextClockDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextureViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextureViewDesign.java
deleted file mode 100644
index b439ffe952..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/TextureViewDesign.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.view.TextureView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class TextureViewDesign extends TextureView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public TextureViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/VideoViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/VideoViewDesign.java
deleted file mode 100644
index ae9652fa1a..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/VideoViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.widget.VideoView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class VideoViewDesign extends VideoView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public VideoViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ViewDesign.java
deleted file mode 100644
index 54a14fd678..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/ViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.view.View;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class ViewDesign extends View {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public ViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/WebViewDesign.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/WebViewDesign.java
deleted file mode 100644
index e7b6ab758c..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/palette/widgets/WebViewDesign.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.palette.widgets;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.webkit.WebView;
-
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.Utils;
-
-public class WebViewDesign extends WebView {
-
- private boolean drawStrokeEnabled;
- private boolean isBlueprint;
-
- public WebViewDesign(Context context) {
- super(context);
- }
-
- @Override
- protected void dispatchDraw(Canvas canvas) {
- super.dispatchDraw(canvas);
-
- if (drawStrokeEnabled)
- Utils.drawDashPathStroke(
- this, canvas, isBlueprint ? Constants.BLUEPRINT_DASH_COLOR : Constants.DESIGN_DASH_COLOR);
- }
-
- public void setStrokeEnabled(boolean enabled) {
- drawStrokeEnabled = enabled;
- invalidate();
- }
-
- @Override
- public void draw(Canvas canvas) {
- if (isBlueprint) Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR);
- else super.draw(canvas);
- }
-
- public void setBlueprint(boolean isBlueprint) {
- this.isBlueprint = isBlueprint;
- invalidate();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropHandler.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropHandler.kt
deleted file mode 100644
index 56fa75bc19..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropHandler.kt
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.positioning
-
-import android.view.View
-import android.view.ViewGroup
-import android.widget.FrameLayout
-import android.widget.GridLayout
-import android.widget.LinearLayout
-import android.widget.RelativeLayout
-import androidx.constraintlayout.widget.ConstraintLayout
-import androidx.coordinatorlayout.widget.CoordinatorLayout
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-
-
-/**
- * Updates the stored attributes for a [child] view after it is "dropped"
- * at a new position (x, y) within its parent [ViewGroup].
- *
- * This function orchestrates the process of:
- * 1. Calculating the final, clamped coordinates in Dp.
- * 2. Clearing any previous positioning attributes to prevent conflicts.
- * 3. Applying the correct new attributes based on the parent's layout type.
- *
- * @param child The view being positioned.
- * @param x The raw target X coordinate in container pixels.
- * @param y The raw target Y coordinate in container pixels.
- */
-fun positionAtDrop(child: View, x: Float, y: Float, viewAttributeMap: HashMap) {
- val container = child.parent as? ViewGroup ?: return
-
- val density = container.resources.displayMetrics.density
- val coords = calculateDropCoordinatesInDp(container, child, x, y, density)
-
- val attributes = viewAttributeMap[child] ?: return
-
- clearPositioningAttributes(attributes)
-
- applyLayoutAttributes(container, child, attributes, coords, x, y, viewAttributeMap)
-}
-
-/**
- * Acts as a "dynamic mapper" or "strategy" function.
- * It detects the type of the [container] and calls the appropriate
- * helper function to apply layout-specific attributes.
- *
- * @param container The parent ViewGroup.
- * @param attributes The AttributeMap for the child view.
- * @param coords The final Dp coordinates to apply.
- */
-internal fun applyLayoutAttributes(
- container: ViewGroup,
- child: View,
- attributes: AttributeMap,
- coords: DpCoordinates,
- x: Float,
- y: Float,
- fullAttributeMap: HashMap
-) {
- when (container) {
- is ConstraintLayout -> applyConstraintLayoutAttributes(attributes, coords)
- is FrameLayout, is CoordinatorLayout -> applyGravityMarginAttributes(attributes, coords)
- is RelativeLayout -> applyRelativeLayoutAttributes(attributes, coords)
- is LinearLayout -> applyDragReorder(container, child, x, y)
- is GridLayout -> applyGridLayoutAttributes(container, child, attributes, x, y, fullAttributeMap)
- else -> applyGenericLayoutAttributes(attributes, coords)
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropStrategies.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropStrategies.kt
deleted file mode 100644
index d4e0b6a65b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutDropStrategies.kt
+++ /dev/null
@@ -1,379 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.positioning
-
-import android.view.Gravity
-import android.view.View
-import android.view.ViewGroup
-import android.widget.FrameLayout
-import android.widget.GridLayout
-import android.widget.LinearLayout
-import android.widget.RelativeLayout
-import android.widget.TableLayout
-import android.widget.TableRow
-import androidx.constraintlayout.widget.ConstraintLayout
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-import kotlin.math.roundToInt
-
-
-private data class GridCell(val row: Int, val col: Int)
-
-
-/**
- * Ensures the [child] view has valid [TableRow.LayoutParams].
- *
- * This function is crucial for preventing a [View] from becoming invisible
- * when added to a [TableRow]. It converts generic `LayoutParams`
- * (like `LinearLayout.LayoutParams` or `MarginLayoutParams`) into
- * `TableRow.LayoutParams`, ensuring the `weight` is 0f and
- * the `width` is `WRAP_CONTENT` if not otherwise defined.
- *
- * @param child The [View] whose `layoutParams` will be checked and
- * potentially replaced.
- */
-private fun ensureTableRowLayoutParams(child: View) {
- val newLp: TableRow.LayoutParams = when (val lp = child.layoutParams) {
- is TableRow.LayoutParams -> {
- if ((lp.width == 0 || lp.width == ViewGroup.LayoutParams.WRAP_CONTENT) && lp.weight == 0f) {
- TableRow.LayoutParams(
- ViewGroup.LayoutParams.WRAP_CONTENT,
- if (lp.height <= 0) ViewGroup.LayoutParams.WRAP_CONTENT else lp.height
- ).apply {
- setMargins(lp.leftMargin, lp.topMargin, lp.rightMargin, lp.bottomMargin)
- gravity = lp.gravity
- weight = 0f
- }
- } else lp
- }
-
- is LinearLayout.LayoutParams -> {
- TableRow.LayoutParams(
- if (lp.width == 0 && lp.weight == 0f) ViewGroup.LayoutParams.WRAP_CONTENT else lp.width,
- if (lp.height <= 0) ViewGroup.LayoutParams.WRAP_CONTENT else lp.height
- ).apply {
- setMargins(lp.leftMargin, lp.topMargin, lp.rightMargin, lp.bottomMargin)
- gravity = lp.gravity
- weight = lp.weight
- }
- }
-
- is ViewGroup.MarginLayoutParams -> {
- TableRow.LayoutParams(lp).apply {
- if (width == 0) width = ViewGroup.LayoutParams.WRAP_CONTENT
- if (height <= 0) height = ViewGroup.LayoutParams.WRAP_CONTENT
- }
- }
-
- else -> {
- TableRow.LayoutParams(
- ViewGroup.LayoutParams.WRAP_CONTENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
- }
-
- if (child.layoutParams !== newLp) child.layoutParams = newLp
-}
-
-
-/**
- * Reorders a [child] within a [container] that supports drag-reordering
- * (like [LinearLayout], [TableLayout], or [TableRow]).
- *
- * The function determines the container's orientation (vertical or horizontal)
- * and uses the [x] or [y] coordinate to find the new index where
- * the [child] should be inserted.
- *
- * If the [container] is a [TableRow], it first calls [ensureTableRowLayoutParams]
- * to prevent the [child] from becoming invisible.
- *
- * @param container The parent [ViewGroup] (must be [LinearLayout],
- * [TableLayout], or [TableRow]).
- * @param child The [View] being moved.
- * @param x The raw X coordinate of the drop (used for horizontal orientation).
- * @param y The raw Y coordinate of the drop (used for vertical orientation).
- */
-internal fun applyDragReorder(container: ViewGroup, child: View, x: Float, y: Float) {
- if (container is TableRow) {
- ensureTableRowLayoutParams(child)
- }
-
- val currentIndex = container.indexOfChild(child)
- var newIndex = -1
-
- val isVertical = when (container) {
- is TableLayout -> true
- is TableRow -> false
- is LinearLayout -> container.orientation == LinearLayout.VERTICAL
- else -> return
- }
-
- for (i in 0 until container.childCount) {
- val otherChild = container.getChildAt(i)
- if (otherChild == child) continue
-
- val center: Float
- val dropCoord: Float
-
- if (isVertical) {
- center = otherChild.top + (otherChild.height / 2f)
- dropCoord = y
- } else {
- center = otherChild.left + (otherChild.width / 2f)
- dropCoord = x
- }
-
- if (dropCoord < center) {
- newIndex = i
- break
- }
- }
-
- if (newIndex == -1) {
- newIndex = container.childCount
- }
-
- if (currentIndex == -1) {
- container.addView(child, newIndex)
- } else {
- if (currentIndex == newIndex) return
-
- val targetIndex = if (newIndex > currentIndex) newIndex - 1 else newIndex
-
- if (currentIndex == targetIndex) return
-
- container.removeViewAt(currentIndex)
- container.addView(child, targetIndex)
- }
-
- container.requestLayout()
-
- if (container is TableRow) {
- (container.parent as? TableLayout)?.requestLayout()
- container.invalidate()
- }
-}
-
-
-/**
- * Applies positioning attributes for a [ConstraintLayout] to the [map].
- *
- * Anchors the view to the parent's top-start and uses margins.
- *
- * **Attributes Written:**
- * - `app:layout_constraintStart_toStartOf`
- * - `app:layout_constraintTop_toTopOf`
- * - `android:layout_marginStart`
- * - `android:layout_marginTop`
- *
- * @param map The [AttributeMap] to write attributes to.
- * @param coords The [DpCoordinates] containing the margins to apply.
- */
-internal fun applyConstraintLayoutAttributes(
- map: AttributeMap,
- coords: DpCoordinates
-) {
- map.putValue("app:layout_constraintStart_toStartOf", "parent")
- map.putValue("app:layout_constraintTop_toTopOf", "parent")
- map.putValue("android:layout_marginStart", "${coords.xDp}dp")
- map.putValue("android:layout_marginTop", "${coords.yDp}dp")
-}
-
-/**
- * Applies positioning attributes for layouts that use gravity and margins (e.g., [FrameLayout], [androidx.coordinatorlayout.widget.CoordinatorLayout])
- *
- * Uses `layout_gravity` to lock to the top-start and standard margins.
- *
- * **Attributes Written:**
- * - `android:layout_gravity`
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param map The [AttributeMap] to write attributes to.
- * @param coords The [DpCoordinates] containing the margins to apply.
- */
-internal fun applyGravityMarginAttributes(
- map: AttributeMap,
- coords: DpCoordinates
-) {
- map.putValue("android:layout_gravity", "top|start")
- map.putValue("android:layout_marginLeft", "${coords.xDp}dp")
- map.putValue("android:layout_marginTop", "${coords.yDp}dp")
-}
-
-/**
- * Applies positioning attributes for a [RelativeLayout] to the [map].
- *
- * Aligns the view to the parent's top-start and uses standard margins.
- *
- * **Attributes Written:**
- * - `android:layout_alignParentStart`
- * - `android:layout_alignParentTop`
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param map The [AttributeMap] to write attributes to.
- * @param coords The [DpCoordinates] containing the margins to apply.
- */
-internal fun applyRelativeLayoutAttributes(
- map: AttributeMap,
- coords: DpCoordinates
-) {
- map.putValue("android:layout_alignParentStart", "true")
- map.putValue("android:layout_alignParentTop", "true")
- map.putValue("android:layout_marginLeft", "${coords.xDp}dp")
- map.putValue("android:layout_marginTop", "${coords.yDp}dp")
-}
-
-/**
- * Applies positioning attributes for a [GridLayout] child view.
- *
- * This function orchestrates the entire drop logic for a GridLayout:
- * 1. Determines the intended row/column count by checking the [fullAttributeMap] first,
- * falling back to the live [container] count.
- * 2. Calculates the target cell (row, col) based on the drop coordinates and child's size.
- * 3. Expands the [container] (updating its live `columnCount` and its attributes)
- * if the `targetCell` is outside the current bounds.
- * 4. Applies the final position (row, col) and a standard `columnWeight` of 1.0
- * to both the [childAttributes] (for XML saving) and the child's live
- * `LayoutParams` (to prevent `onMeasure` crashes).
- *
- * @param container The parent [GridLayout] where the child is being dropped.
- * @param child The [View] being positioned.
- * @param childAttributes The [AttributeMap] for the [child] view (to be updated).
- * @param x The raw X drop coordinate in container pixels.
- * @param y The raw Y drop coordinate in container pixels.
- * @param fullAttributeMap The complete map of all views to their attributes, used to
- * read/write the [container]'s attributes (e.g., `android:columnCount`).
- */
-internal fun applyGridLayoutAttributes(
- container: GridLayout,
- child: View,
- childAttributes: AttributeMap,
- x: Float,
- y: Float,
- fullAttributeMap: HashMap
-) {
- val intendedColCount = getIntendedGridCount(container, fullAttributeMap, isColumn = true)
- val intendedRowCount = getIntendedGridCount(container, fullAttributeMap, isColumn = false)
-
- val targetCell = calculateTargetCell(container, child, x, y, intendedColCount, intendedRowCount)
-
- val gridChanged = expandGridIfNeeded(container, targetCell, intendedColCount, intendedRowCount, fullAttributeMap)
-
- val weight = 1f
- updateChildGridAttributes(childAttributes, targetCell, weight)
- updateChildGridLayoutPostDrop(child, targetCell, weight)
-
- if (gridChanged) {
- container.requestLayout()
- }
-}
-
-/* START GridLayout Utils */
-private fun getIntendedGridCount(
- container: GridLayout,
- fullAttributeMap: HashMap,
- isColumn: Boolean
-): Int {
- val attrKey = if (isColumn) "android:columnCount" else "android:rowCount"
- val liveCount = if (isColumn) container.columnCount else container.rowCount
-
- return fullAttributeMap[container]?.getValue(attrKey)?.toIntOrNull()
- ?.takeIf { it > 0 }
- ?: liveCount.takeIf { it > 0 }
- ?: 1
-}
-
-private fun calculateTargetCell(
- container: GridLayout,
- child: View,
- x: Float,
- y: Float,
- intendedColCount: Int,
- intendedRowCount: Int
-): GridCell {
- val rowHeight = (container.height.toFloat() / intendedRowCount).coerceAtLeast(1f)
-
- val colWidth = if (intendedColCount > 1) {
- (container.width.toFloat() / intendedColCount).coerceAtLeast(1f)
- } else {
- child.width.toFloat().coerceAtLeast(100f)
- }
-
- val childCenterX = x + (child.width / 2f)
- val childCenterY = y + (child.height / 2f)
-
- val targetCol = (childCenterX / colWidth).roundToInt().coerceAtLeast(0)
- val targetRow = (childCenterY / rowHeight).roundToInt().coerceAtLeast(0)
-
- return GridCell(row = targetRow, col = targetCol)
-}
-
-private fun expandGridIfNeeded(
- container: GridLayout,
- targetCell: GridCell,
- intendedColCount: Int,
- intendedRowCount: Int,
- fullAttributeMap: HashMap
-): Boolean {
- var gridChanged = false
-
- if (targetCell.col >= intendedColCount) {
- container.columnCount = targetCell.col + 1
- gridChanged = true
- }
- if (targetCell.row >= intendedRowCount) {
- container.rowCount = targetCell.row + 1
- gridChanged = true
- }
-
- if (gridChanged) {
- val contAttrs = fullAttributeMap[container]
- contAttrs?.putValue("android:columnCount", container.columnCount.toString())
- contAttrs?.putValue("android:rowCount", container.rowCount.toString())
- }
-
- return gridChanged
-}
-
-private fun updateChildGridAttributes(childAttributes: AttributeMap, targetCell: GridCell, weight: Float) {
- childAttributes.putValue("android:layout_row", "${targetCell.row}")
- childAttributes.putValue("android:layout_column", "${targetCell.col}")
- childAttributes.putValue("android:layout_rowSpan", "1")
- childAttributes.putValue("android:layout_columnSpan", "1")
- childAttributes.putValue("android:layout_columnWeight", "$weight")
- childAttributes.putValue("android:layout_gravity", "center")
-}
-
-private fun updateChildGridLayoutPostDrop(child: View, targetCell: GridCell, weight: Float) {
- val lp = (child.layoutParams as? GridLayout.LayoutParams)
- ?: GridLayout.LayoutParams()
-
- lp.rowSpec = GridLayout.spec(targetCell.row, 1)
- lp.columnSpec = GridLayout.spec(targetCell.col, 1, weight)
- lp.setGravity(Gravity.CENTER)
-
- child.layoutParams = lp
-}
-
-/* END GridLayout Utils */
-
-/**
- * A generic fallback that applies standard margins to the [map].
- *
- * This is used for parent layouts that are not explicitly handled but
- * still support [android.view.ViewGroup.MarginLayoutParams].
- *
- * **Attributes Written:**
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param map The [AttributeMap] to write attributes to.
- * @param coords The [DpCoordinates] containing the margins to apply.
- */
-internal fun applyGenericLayoutAttributes(
- map: AttributeMap,
- coords: DpCoordinates
-) {
- map.putValue("android:layout_marginLeft", "${coords.xDp}dp")
- map.putValue("android:layout_marginTop", "${coords.yDp}dp")
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreHandler.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreHandler.kt
deleted file mode 100644
index 115c4af67c..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreHandler.kt
+++ /dev/null
@@ -1,178 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.positioning
-
-import android.view.View
-import android.view.ViewGroup
-import android.widget.FrameLayout
-import android.widget.GridLayout
-import android.widget.LinearLayout
-import android.widget.RelativeLayout
-import android.widget.TableLayout
-import android.widget.TableRow
-import androidx.constraintlayout.widget.ConstraintLayout
-import androidx.constraintlayout.widget.ConstraintSet
-import androidx.coordinatorlayout.widget.CoordinatorLayout
-import androidx.core.view.children
-import androidx.core.view.doOnLayout
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-import kotlin.sequences.forEach
-
-
-private fun ConstraintLayout.cloneWithIds(): ConstraintSet {
- children.forEach { child ->
- if (child.id == View.NO_ID) {
- child.id = View.generateViewId()
- }
- }
- return ConstraintSet().apply { clone(this@cloneWithIds) }
-}
-
-/**
- * Executes the core positioning logic for a **single view**.
- *
- * This function resets the view's [View.translationX] and [View.translationY] to `0f`,
- * as positions are restored using layout parameters (like margins) rather than translations.
- *
- * It then dispatches to a layout-specific helper (e.g., [collectConstraintLayoutChange]
- * or [restoreFrameLayoutPosition]) based on the [view]'s parent [ViewGroup] type.
- *
- * If the parent is a [ConstraintLayout], this function populates the [constraintChanges]
- * map for batch application in the "Application Pass."
- *
- * @param view The [View] to be repositioned.
- * @param attrs The [AttributeMap] containing the saved positional attributes for the [view].
- * @param density The screen's display density for DP/PX calculations.
- * @param constraintChanges An **output map**. If the [view]'s parent is a [ConstraintLayout],
- * a [ViewConstraintChange] object will be added to this map, keyed by the parent container.
- */
-private fun applyPositioningLogic(
- view: View,
- attrs: AttributeMap,
- density: Float,
- constraintChanges: MutableMap>
-) {
- val parent = view.parent as? ViewGroup ?: return
-
- view.translationX = 0f
- view.translationY = 0f
-
- when (parent) {
- is ConstraintLayout -> collectConstraintLayoutChange(parent, view, attrs, density, constraintChanges)
- is FrameLayout -> restoreFrameLayoutPosition(parent, view, attrs, density)
- is RelativeLayout -> restoreRelativeLayoutPosition(parent, view, attrs, density)
- is CoordinatorLayout -> restoreCoordinatorLayoutPosition(parent, view, attrs, density)
- is TableLayout, is TableRow, is LinearLayout -> {} // No-op
- is GridLayout -> restoreGridLayoutPosition(view, attrs)
- else -> restoreGenericMarginPosition(parent, view, attrs, density)
- }
-}
-
-
-/**
- * Applies a batch of collected [ConstraintLayout] changes.
- *
- * This function implements the **Application Pass**. It iterates through each
- * [ConstraintLayout] container that has pending changes, clones its [ConstraintSet],
- * modifies it with all the changes in the `changeList`, and finally applies the
- * modified set back to the container using [ConstraintSet.applyTo].
- *
- * This batch approach is significantly more efficient than applying changes one by one.
- *
- * @param changesByContainer A [Map] where each key is a [ConstraintLayout] and the
- * value is a [List] of [ViewConstraintChange] objects to be applied to it.
- */
-private fun applyConstraintChanges(changesByContainer: Map>) {
- changesByContainer.forEach { (container, changeList) ->
- if (changeList.isEmpty()) return@forEach
-
- val constraintSet = container.cloneWithIds()
- changeList.forEach { change ->
- modifyConstraintsForView(
- constraintSet,
- change.viewId,
- change.startMargin,
- change.topMargin
- )
- }
- constraintSet.applyTo(container)
- }
-}
-
-
-/**
- * Restores the saved positions of **all views** in the [attributeMap] after an initial layout pass.
- *
- * This function is intended for loading a complete layout from scratch.
- *
- * This function must run within [doOnLayout] to ensure parent and child view
- * dimensions are measured, which is necessary for clamping coordinates correctly.
- *
- * It uses a "dynamic strategy" approach based on the parent [ViewGroup] type,
- * implemented by [applyPositioningLogic] and [applyConstraintChanges]:
- *
- * 1. **Collection Pass:**
- * - Iterates through the entire [attributeMap].
- * - For each view, it calls [applyPositioningLogic] to reset translations and
- * collect [ConstraintLayout] changes.
- *
- * 2. **Application Pass (for ConstraintLayout):**
- * - Calls [applyConstraintChanges] to apply all collected [ConstraintLayout]
- * changes in a single batch for maximum efficiency.
- *
- * @param rootView The root [View] to observe for layout completion.
- * @param attributeMap A [Map] of [View]s to their corresponding [AttributeMap]
- * containing the saved positioning attributes.
- */
-fun restorePositionsAfterLoad(rootView: View, attributeMap: Map) {
- rootView.doOnLayout { container ->
- val density = container.resources.displayMetrics.density
-
- val changesByContainer = mutableMapOf>()
-
- // --- 1. COLLECTION PASS
- attributeMap.forEach { (view, attrs) ->
- applyPositioningLogic(view, attrs, density, changesByContainer)
- }
-
- // --- 2. APPLICATION PASS ---
- applyConstraintChanges(changesByContainer)
- }
-}
-
-
-/**
- * Restores the saved position for a **single view** after a layout pass.
- *
- * This is an optimized version of [restorePositionsAfterLoad], designed to be called
- * after a single view is added or moved (e.g., from a drag-and-drop operation).
- *
- * Like its counterpart, this function **must run within [doOnLayout]** to ensure
- * coordinates are clamped correctly against measured parent/child dimensions.
- *
- * It performs the same Collection and Application pass, but **only for the
- * specified [viewToRestore]**, providing a significant performance boost by not
- * iterating over all other views.
- *
- * @param rootView The root [View] to observe for layout completion.
- * @param viewToRestore The specific [View] whose position needs to be restored.
- * @param attributeMap The complete [Map] of views to attributes, used to look up
- * the data for [viewToRestore].
- */
-fun restoreSingleViewPosition(
- rootView: View,
- viewToRestore: View,
- attributeMap: Map
-) {
- rootView.doOnLayout { container ->
- val density = container.resources.displayMetrics.density
-
- val attrs = attributeMap[viewToRestore] ?: return@doOnLayout
-
- val changesByContainer = mutableMapOf>()
-
- // --- 1. COLLECTION PASS ---
- applyPositioningLogic(viewToRestore, attrs, density, changesByContainer)
-
- // --- 2. APPLICATION PASS ---
- applyConstraintChanges(changesByContainer)
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreStrategies.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreStrategies.kt
deleted file mode 100644
index 2874fb7735..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/LayoutRestoreStrategies.kt
+++ /dev/null
@@ -1,295 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.positioning
-
-import android.view.Gravity
-import android.view.View
-import android.view.ViewGroup
-import android.widget.FrameLayout
-import android.widget.GridLayout
-import android.widget.RelativeLayout
-import androidx.constraintlayout.widget.ConstraintLayout
-import androidx.constraintlayout.widget.ConstraintSet
-import androidx.coordinatorlayout.widget.CoordinatorLayout
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-
-
-/**
- * Modifies a [ConstraintSet] to apply basic constraints to a specific view.
- *
- * - Anchors the view to the parent's START and TOP.
- * - Clears existing END and BOTTOM constraints to avoid conflicts.
- * - Sets START and TOP margins in **pixels** using the provided values.
- *
- * @param constraintSet The [ConstraintSet] instance to modify.
- * @param viewId The ID of the target view.
- * @param startPxMargin The START margin in **pixels**.
- * @param topPxMargin The TOP margin in **pixels**.
- */
-fun modifyConstraintsForView(constraintSet: ConstraintSet, viewId: Int, startPxMargin: Int, topPxMargin: Int) {
- constraintSet.clear(viewId, ConstraintSet.BOTTOM)
- constraintSet.clear(viewId, ConstraintSet.END)
- constraintSet.connect(viewId, ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START)
- constraintSet.connect(viewId, ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP)
- constraintSet.setMargin(viewId, ConstraintSet.START, startPxMargin)
- constraintSet.setMargin(viewId, ConstraintSet.TOP, topPxMargin)
-}
-
-/**
- * Reads [ConstraintLayout] positioning attributes and collects them for batch processing.
- *
- * This function does not apply changes directly. Instead, it calculates the pixel
- * margins and adds them to the [changesByContainer] map. This allows all
- * constraint changes for a single [ConstraintLayout] to be applied at once
- * for better performance.
- *
- * **Attributes Read:**
- * - `android:layout_marginStart`
- * - `android:layout_marginTop`
- *
- * @param container The parent [ConstraintLayout].
- * @param view The child view to read attributes for.
- * @param attrs The [AttributeMap] containing the stored attributes.
- * @param density The screen density for px conversion.
- * @param changesByContainer The map to add the [ViewConstraintChange] to.
- */
-fun collectConstraintLayoutChange(
- container: ConstraintLayout,
- view: View,
- attrs: AttributeMap,
- density: Float,
- changesByContainer: MutableMap>
-) {
- val txStr = attrs.getValue("android:layout_marginStart")
- val tyStr = attrs.getValue("android:layout_marginTop")
-
- if (txStr.isNotEmpty() || tyStr.isNotEmpty()) {
- val (txPx, tyPx) = calculateClampedPx(container, view, txStr, tyStr, density)
- val changesList = changesByContainer.getOrPut(container) { mutableListOf() }
- changesList.add(ViewConstraintChange(
- viewId = view.id,
- startMargin = txPx.toInt(),
- topMargin = tyPx.toInt()
- ))
- }
-}
-
-/**
- * Restores the position for a child view within a [FrameLayout].
- *
- * This function reads the stored margins, calculates the final clamped pixel values,
- * and applies them directly to the [view]'s [FrameLayout.LayoutParams]. It also
- * sets the `gravity` to `TOP|START` to match the positioning logic.
- *
- * **Attributes Read:**
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param container The parent [FrameLayout].
- * @param view The child view to position.
- * @param attrs The [AttributeMap] containing the stored attributes.
- * @param density The screen density for px conversion.
- */
-fun restoreFrameLayoutPosition(
- container: FrameLayout, view: View, attrs: AttributeMap, density: Float
-) {
- val lp = view.layoutParams as? FrameLayout.LayoutParams ?: return
- val txStr = attrs.getValue("android:layout_marginLeft")
- val tyStr = attrs.getValue("android:layout_marginTop")
-
- if (txStr.isNotEmpty() || tyStr.isNotEmpty()) {
- val (txPx, tyPx) = calculateClampedPx(container, view, txStr, tyStr, density)
- lp.leftMargin = txPx.toInt()
- lp.topMargin = tyPx.toInt()
- lp.gravity = Gravity.TOP or Gravity.START
- view.layoutParams = lp
- }
-}
-
-/**
- * Restores the position for a child view within a [CoordinatorLayout].
- *
- * This function reads the stored margins, calculates the final clamped pixel values,
- * and applies them directly to the [view]'s [CoordinatorLayout.LayoutParams]. It also
- * sets the `gravity` to `TOP|START`.
- *
- * **Attributes Read:**
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param container The parent [CoordinatorLayout].
- * @param view The child view to position.
- * @param attrs The [AttributeMap] containing the stored attributes.
- * @param density The screen density for px conversion.
- */
-internal fun restoreCoordinatorLayoutPosition(
- container: CoordinatorLayout, view: View, attrs: AttributeMap, density: Float
-) {
- val lp = view.layoutParams as? CoordinatorLayout.LayoutParams ?: return
- val txStr = attrs.getValue("android:layout_marginLeft")
- val tyStr = attrs.getValue("android:layout_marginTop")
-
- if (txStr.isNotEmpty() || tyStr.isNotEmpty()) {
- val (txPx, tyPx) = calculateClampedPx(container, view, txStr, tyStr, density)
- lp.leftMargin = txPx.toInt()
- lp.topMargin = tyPx.toInt()
- lp.gravity = Gravity.TOP or Gravity.START
- view.layoutParams = lp
- }
-}
-
-/**
- * Restores the position for a child view within a [RelativeLayout].
- *
- * This function reads stored margins and alignment rules. It first **clears**
- * all existing parent alignment rules (START, TOP, END, BOTTOM) to prevent
- * conflicts, then applies the new margins and `alignParent` rules directly to the
- * [view]'s [RelativeLayout.LayoutParams].
- *
- * **Attributes Read:**
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- * - `android:layout_alignParentStart`
- * - `android:layout_alignParentTop`
- *
- * @param container The parent [RelativeLayout].
- * @param view The child view to position.
- * @param attrs The [AttributeMap] containing the stored attributes.
- * @param density The screen density for px conversion.
- */
-fun restoreRelativeLayoutPosition(
- container: RelativeLayout, view: View, attrs: AttributeMap, density: Float
-) {
- val lp = view.layoutParams as? RelativeLayout.LayoutParams ?: return
- val txStr = attrs.getValue("android:layout_marginLeft")
- val tyStr = attrs.getValue("android:layout_marginTop")
- val alignParentStart = attrs.getValue("android:layout_alignParentStart") == "true"
- val alignParentTop = attrs.getValue("android:layout_alignParentTop") == "true"
-
- if (txStr.isNotEmpty() || tyStr.isNotEmpty() || alignParentStart || alignParentTop) {
- val (txPx, tyPx) = calculateClampedPx(container, view, txStr, tyStr, density)
-
- lp.removeRule(RelativeLayout.ALIGN_PARENT_START)
- lp.removeRule(RelativeLayout.ALIGN_PARENT_TOP)
- lp.removeRule(RelativeLayout.ALIGN_PARENT_END)
- lp.removeRule(RelativeLayout.ALIGN_PARENT_BOTTOM)
-
- lp.leftMargin = txPx.toInt()
- lp.topMargin = tyPx.toInt()
-
- if (alignParentStart) lp.addRule(RelativeLayout.ALIGN_PARENT_START)
- if (alignParentTop) lp.addRule(RelativeLayout.ALIGN_PARENT_TOP)
-
- view.layoutParams = lp
- }
-}
-
-internal fun restoreGridLayoutPosition(
- view: View,
- attrs: AttributeMap
-) {
- val lp = view.layoutParams as? GridLayout.LayoutParams ?: return
-
- val rowStr = attrs.getValue("android:layout_row")
- val colStr = attrs.getValue("android:layout_column")
- val gravityStr = attrs.getValue("android:layout_gravity")
- val rowSpanStr = attrs.getValue("android:layout_rowSpan")
- val colSpanStr = attrs.getValue("android:layout_columnSpan")
- val weightStr = attrs.getValue("android:layout_columnWeight")
-
- var changed = false
-
- val row = rowStr.toIntOrNull()
- val col = colStr.toIntOrNull()
- val rowSpan = rowSpanStr.toIntOrNull()?.coerceAtLeast(1) ?: 1
- val colSpan = colSpanStr.toIntOrNull()?.coerceAtLeast(1) ?: 1
- val weight = weightStr.toFloatOrNull() ?: 0f
-
- if (row != null) {
- lp.rowSpec = GridLayout.spec(row, rowSpan)
- changed = true
- }
-
- if (col != null) {
- lp.columnSpec = GridLayout.spec(col, colSpan, weight)
- changed = true
- }
-
- if (gravityStr.isNotEmpty()) {
- val gravity = parseGravityString(gravityStr)
- if (gravity != Gravity.NO_GRAVITY) {
- lp.setGravity(gravity)
- changed = true
- }
- }
-
- if (changed) {
- view.layoutParams = lp
- }
-}
-
-internal fun parseGravityString(gravityString: String): Int {
- if (gravityString.isBlank()) {
- return Gravity.NO_GRAVITY
- }
-
- var totalGravity = 0
-
- // Split by the '|' delimiter
- gravityString.lowercase().split('|').forEach { part ->
- val gravity = when (part.trim()) {
- "top" -> Gravity.TOP
- "bottom" -> Gravity.BOTTOM
- "start" -> Gravity.START
- "end" -> Gravity.END
- "left" -> Gravity.LEFT
- "right" -> Gravity.RIGHT
- "center" -> Gravity.CENTER
- "center_vertical" -> Gravity.CENTER_VERTICAL
- "center_horizontal" -> Gravity.CENTER_HORIZONTAL
- "fill" -> Gravity.FILL
- "fill_vertical" -> Gravity.FILL_VERTICAL
- "fill_horizontal" -> Gravity.FILL_HORIZONTAL
- "clip_vertical" -> Gravity.CLIP_VERTICAL
- "clip_horizontal" -> Gravity.CLIP_HORIZONTAL
- else -> Gravity.NO_GRAVITY
- }
-
- if (gravity != Gravity.NO_GRAVITY) {
- totalGravity = totalGravity or gravity
- }
- }
-
- // Return NO_GRAVITY. Otherwise, return the combined flags.
- return if (totalGravity == 0) Gravity.NO_GRAVITY else totalGravity
-}
-
-/**
- * A fallback position restore function for any [ViewGroup] that supports
- * [ViewGroup.MarginLayoutParams].
- *
- * This function reads standard margins and applies them directly to the
- * [view]'s `layoutParams`. It does not handle alignment or flow logic,
- * only margins.
- *
- * **Attributes Read:**
- * - `android:layout_marginLeft`
- * - `android:layout_marginTop`
- *
- * @param container The parent [ViewGroup].
- * @param view The child view to position.
- * @param attrs The [AttributeMap] containing the stored attributes.
- * @param density The screen density for px conversion.
- */
-fun restoreGenericMarginPosition(
- container: ViewGroup, view: View, attrs: AttributeMap, density: Float
-) {
- val lp = view.layoutParams as? ViewGroup.MarginLayoutParams ?: return
- val txStr = attrs.getValue("android:layout_marginLeft")
- val tyStr = attrs.getValue("android:layout_marginTop")
-
- if (txStr.isNotEmpty() || tyStr.isNotEmpty()) {
- val (txPx, tyPx) = calculateClampedPx(container, view, txStr, tyStr, density)
- lp.leftMargin = txPx.toInt()
- lp.topMargin = tyPx.toInt()
- view.layoutParams = lp
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/PositioningUtils.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/PositioningUtils.kt
deleted file mode 100644
index 419d6c0be8..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/positioning/PositioningUtils.kt
+++ /dev/null
@@ -1,147 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.positioning
-
-import android.view.View
-import android.view.ViewGroup
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-
-/**
- * A set of all positioning-related attributes that should be cleared
- * before applying new ones to prevent layout conflicts.
- */
-internal val POSITIONING_KEYS_TO_REMOVE = setOf(
- // ConstraintLayout
- "app:layout_constraintBottom_toBottomOf", "app:layout_constraintEnd_toEndOf",
- "app:layout_constraintStart_toStartOf", "app:layout_constraintTop_toTopOf",
- "android:layout_marginStart", "android:layout_marginTop", "android:layout_marginEnd", "android:layout_marginBottom",
-
- // GridLayout
- "android:layout_row",
- "android:layout_column",
- "android:layout_rowSpan",
- "android:layout_columnSpan",
- "android:layout_columnWeight",
-
- // FrameLayout and GridLayout
- "android:layout_gravity",
-
- // RelativeLayout
- "android:layout_alignParentStart", "android:layout_alignParentTop",
- "android:layout_alignParentEnd", "android:layout_alignParentBottom",
-
- // Most common
- "android:layout_marginLeft", "android:layout_marginTop",
- "android:layout_marginEnd", "android:layout_marginBottom"
-)
-
-/**
- * Holds calculated X and Y coordinates in Density-Independent Pixels (dp).
- */
-data class DpCoordinates(val xDp: Float, val yDp: Float)
-
-/**
- * Calculates the final (x, y) coordinates in Dp for the dropped view.
- * This function clamps the pixel values to ensure the [child] view remains
- * entirely within the [container] bounds, then converts the clamped
- * pixel values to Dp.
- *
- * @param container The parent ViewGroup.
- * @param child The view being dropped.
- * @param x The raw X coordinate of the drop in pixels.
- * @param y The raw Y coordinate of the drop in pixels.
- * @param density The screen density for px-to-dp conversion.
- * @return A [DpCoordinates] object holding the final, safe coordinates in Dp.
- */
-internal fun calculateDropCoordinatesInDp(
- container: ViewGroup,
- child: View,
- x: Float,
- y: Float,
- density: Float
-): DpCoordinates {
- val maxX = (container.width - child.width).coerceAtLeast(0).toFloat()
- val maxY = (container.height - child.height).coerceAtLeast(0).toFloat()
-
- val xPx = x.coerceIn(0f, maxX)
- val yPx = y.coerceIn(0f, maxY)
-
- return DpCoordinates(
- xDp = xPx / density,
- yDp = yPx / density
- )
-}
-
-/**
- * Clears all known positioning attributes from the [attributes] map.
- * This is crucial to prevent conflicts, e.g., having both
- * `android:layout_marginStart` (from ConstraintLayout) and
- * `android:layout_marginLeft` (from RelativeLayout) defined at the same time.
- *
- * @param attributes The AttributeMap for the view to be cleaned.
- */
-internal fun clearPositioningAttributes(attributes: AttributeMap) {
- POSITIONING_KEYS_TO_REMOVE.forEach { key ->
- if (attributes.contains(key)) {
- attributes.removeValue(key)
- }
- }
-}
-
-/**
- * Helper class to store a set of constraint changes for a single view.
- */
-data class ViewConstraintChange(
- val viewId: Int,
- val startMargin: Int,
- val topMargin: Int
-)
-
-/**
- * Converts a dimension string (e.g., `"12px"`, `"8dp"`, `"10dip"`, or `"14"`)
- * into pixels using the given [density].
- *
- * Supported suffixes:
- * - `"px"` → interpreted as raw pixels.
- * - `"dp"` or `"dip"` → multiplied by display density.
- * - No suffix → assumed to be dp and multiplied by density.
- *
- * @receiver The dimension string to convert.
- * @param density The display density for dp-to-px conversion.
- * @return The equivalent pixel value, or `0f` if parsing fails.
- */
-internal fun String.toPx(density: Float): Float {
- val value = trim().lowercase()
- val number = when {
- value.endsWith("px") -> value.removeSuffix("px").toFloatOrNull()
- value.endsWith("dp") -> value.removeSuffix("dp").toFloatOrNull()?.times(density)
- value.endsWith("dip") -> value.removeSuffix("dip").toFloatOrNull()?.times(density)
- else -> value.toFloatOrNull()?.times(density)
- }
-
- return number?.takeIf { it.isFinite() } ?: 0f
-}
-
-
-/**
- * Converts dimension strings (like "10dp" or "100px") into final, safe pixel values.
- *
- * This utility function performs two key actions:
- * 1. Converts the string dimensions to pixels using [toPx].
- * 2. Clamps the resulting pixel values to ensure the [view] remains
- * entirely within the bounds of the [container].
- *
- * @param container The parent [ViewGroup] used to determine bounds.
- * @param view The child [View] used to determine bounds.
- * @param txStr The horizontal dimension string (e.g., `layout_marginStart`).
- * @param tyStr The vertical dimension string (e.g., `layout_marginTop`).
- * @param density The display density for dp-to-px conversion.
- * @return A [Pair] containing the clamped (X, Y) pixel values.
- */
-internal fun calculateClampedPx(
- container: ViewGroup, view: View, txStr: String, tyStr: String, density: Float
-): Pair {
- val maxX = (container.width - view.width).coerceAtLeast(0).toFloat()
- val maxY = (container.height - view.height).coerceAtLeast(0).toFloat()
- val txPx = txStr.toPx(density).coerceIn(0f, maxX)
- val tyPx = tyStr.toPx(density).coerceIn(0f, maxY)
- return Pair(txPx, tyPx)
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/validation/HierarchyValidator.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/validation/HierarchyValidator.kt
deleted file mode 100644
index bc2e62b4b2..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/editor/validation/HierarchyValidator.kt
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.editor.validation
-
-import android.content.Context
-import android.view.ViewGroup
-import org.appdevforall.codeonthego.layouteditor.R
-import org.appdevforall.codeonthego.layouteditor.editor.palette.containers.ToolbarDesign
-import org.appdevforall.codeonthego.layouteditor.editor.palette.layouts.FrameLayoutDesign
-
-sealed class HierarchyResult {
- object Valid : HierarchyResult()
- data class Warning(val message: String) : HierarchyResult()
- data class Invalid(val errorMessage: String) : HierarchyResult()
-}
-
-private fun interface NestingRule {
- fun matches(child: String, parentName: String, parentView: ViewGroup): Boolean
-}
-
-class HierarchyValidator(private val context: Context) {
-
- /**
- * Rules that must block insertion because they are known to crash
- * or break the editor/runtime consistently.
- */
- private val blockingRules = listOf(
-
- // DrawerLayout / ViewPager inside restrictive parents
- NestingRule { child, _, parentView ->
- val needsExactly = child.contains("drawerlayout") || child.contains("viewpager")
- needsExactly && parentView.isCrashProneParent()
- }
- )
-
- /**
- * Rules that should not block insertion, but should inform the user
- * that the hierarchy may behave poorly.
- */
- private val warningRules = listOf(
-
- // Recycler-like views inside vertical ScrollView
- NestingRule { child, parentName, _ ->
- val isListOrGrid = child.contains("gridview") ||
- child.contains("listview") ||
- child.contains("recyclerview")
- val isVerticalScroll = parentName.contains("scrollview") &&
- !parentName.contains("horizontal")
- isListOrGrid && isVerticalScroll
- },
-
- // Vertical ScrollView inside vertical ScrollView
- NestingRule { child, parentName, _ ->
- val isVerticalScrollChild = child.contains("scrollview") &&
- !child.contains("horizontal")
- val isVerticalScrollParent = parentName.contains("scrollview") &&
- !parentName.contains("horizontal")
- isVerticalScrollChild && isVerticalScrollParent
- },
-
- // HorizontalScrollView inside HorizontalScrollView
- NestingRule { child, parentName, _ ->
- child.contains("horizontalscrollview") &&
- parentName.contains("horizontalscrollview")
- }
- )
-
- fun validate(childClassName: String, parent: ViewGroup): HierarchyResult {
- val cleanChild = childClassName.cleanWidgetName()
- val cleanParent = parent.cleanWidgetName()
-
- val lowerChild = cleanChild.lowercase()
- val lowerParent = cleanParent.lowercase()
-
- for (rule in blockingRules) {
- if (rule.matches(lowerChild, lowerParent, parent)) {
- val message = context.getString(
- R.string.error_incompatible_hierarchy,
- cleanChild,
- cleanParent
- )
- return HierarchyResult.Invalid(message)
- }
- }
-
- for (rule in warningRules) {
- if (rule.matches(lowerChild, lowerParent, parent)) {
- val message = context.getString(
- R.string.warning_problematic_hierarchy,
- cleanChild,
- cleanParent
- )
- return HierarchyResult.Warning(message)
- }
- }
-
- return HierarchyResult.Valid
- }
-
- private fun String.cleanWidgetName(): String =
- substringAfterLast('.').removeSuffix("Design")
-
- private fun ViewGroup.cleanWidgetName(): String = javaClass.name.cleanWidgetName()
-
- private fun ViewGroup.isCrashProneParent(): Boolean {
- val cleanParent = cleanWidgetName().lowercase()
- return this is ToolbarDesign ||
- this is FrameLayoutDesign ||
- cleanParent.contains("scrollview")
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/ColorFragment.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/ColorFragment.java
deleted file mode 100644
index 95b7171a23..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/ColorFragment.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.fragments.resources;
-
-import android.annotation.SuppressLint;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.google.android.material.dialog.MaterialAlertDialogBuilder;
-import com.google.android.material.textfield.TextInputEditText;
-import com.google.android.material.textfield.TextInputLayout;
-import com.skydoves.colorpickerview.ColorPickerDialog;
-import com.skydoves.colorpickerview.listeners.ColorEnvelopeListener;
-
-import org.appdevforall.codeonthego.layouteditor.ProjectFile;
-import org.appdevforall.codeonthego.layouteditor.R;
-import org.appdevforall.codeonthego.layouteditor.adapters.ColorResourceAdapter;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.ValuesItem;
-import org.appdevforall.codeonthego.layouteditor.databinding.FragmentResourcesBinding;
-import org.appdevforall.codeonthego.layouteditor.databinding.LayoutValuesItemDialogBinding;
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.tools.ColorPickerDialogFlag;
-import org.appdevforall.codeonthego.layouteditor.tools.ValuesResourceParser;
-import org.appdevforall.codeonthego.layouteditor.utils.NameErrorChecker;
-import org.appdevforall.codeonthego.layouteditor.utils.ProjectResolver;
-import org.appdevforall.codeonthego.layouteditor.utils.SBUtils;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @authors: @raredeveloperofc and @itsvks19;
- */
-public class ColorFragment extends Fragment {
-
- private FragmentResourcesBinding binding;
- private ColorResourceAdapter adapter;
- private List colorList = new ArrayList<>();
- ValuesResourceParser colorParser;
-
- public static ColorFragment newInstance(ProjectFile project) {
- ColorFragment fragment = new ColorFragment();
- Bundle args = new Bundle();
- args.putParcelable(Constants.EXTRA_KEY_PROJECT, project);
- fragment.setArguments(args);
- return fragment;
- }
-
- @Override
- public android.view.View onCreateView(
- @NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- binding = FragmentResourcesBinding.inflate(inflater, container, false);
- return binding.getRoot();
- }
-
- @Override
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- ProjectFile project = ProjectResolver.getValidProjectOrShowError(getArguments(), view);
- if (project == null) return;
-
- try {
- loadColorsFromXML(project.getColorsPath());
- } catch (FileNotFoundException e) {
- SBUtils.make(view, "An error occurred: " + e.getMessage())
- .setFadeAnimation()
- .setType(SBUtils.Type.INFO)
- .show();
- }
- RecyclerView mRecyclerView = binding.recyclerView;
- adapter = new ColorResourceAdapter(project, colorList);
- mRecyclerView.setAdapter(adapter);
- mRecyclerView.setLayoutManager(
- new LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false));
- }
-
- /**
- * @param filePath = Current project colors file path;
- */
- public void loadColorsFromXML(String filePath) throws FileNotFoundException {
- try (InputStream stream = new FileInputStream(filePath)) {
- colorParser = new ValuesResourceParser(stream, ValuesResourceParser.TAG_COLOR);
- colorList = colorParser.getValuesList();
- } catch (FileNotFoundException e) {
- throw e;
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private void setupDialogViews(LayoutValuesItemDialogBinding bind) {
- TextInputEditText etValue = bind.textinputValue;
- etValue.setFocusable(true);
- etValue.setFocusableInTouchMode(true);
- etValue.setOnClickListener(null);
- }
-
- private void setupColorPicker(TextInputLayout valueInputLayout, TextInputEditText valueEditText) {
- valueInputLayout.setEndIconOnClickListener(v -> showColorPickerDialog(valueEditText, valueInputLayout));
- }
-
- private void setupInputValidation(AlertDialog dialog, LayoutValuesItemDialogBinding bind) {
- TextWatcher validator = new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {}
- @Override
- public void afterTextChanged(Editable s) {
- validateInputs(dialog, bind);
- }
- };
-
- bind.textinputName.addTextChangedListener(validator);
- bind.textinputValue.addTextChangedListener(validator);
- }
-
- private void validateInputs(AlertDialog dialog, LayoutValuesItemDialogBinding bind) {
- String name = Objects.requireNonNull(bind.textinputName.getText()).toString();
- String value = Objects.requireNonNull(bind.textinputValue.getText()).toString();
-
- NameErrorChecker.checkForValues(name, bind.textInputLayoutName, dialog, colorList);
- boolean isNameValid = bind.textInputLayoutName.getError() == null && !name.trim().isEmpty();
-
- boolean isColorValid = checkColorValidity(value, bind.textInputLayoutValue);
-
- boolean isFormValid = isNameValid && isColorValid;
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(isFormValid);
- }
-
- private boolean checkColorValidity(String colorHex, TextInputLayout ilValue) {
- if (colorHex.trim().isEmpty()) {
- ilValue.setError(null);
- return false;
- }
-
- try {
- getSafeColor(colorHex);
- ilValue.setError(null);
- ilValue.setErrorEnabled(false);
- return true;
- } catch (IllegalArgumentException e) {
- ilValue.setError(getString(R.string.error_invalid_color));
- return false;
- }
- }
-
- private void setupSaveButton(AlertDialog dialog, LayoutValuesItemDialogBinding bind) {
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(v -> handleSaveColor(dialog, bind));
- }
-
- private void handleSaveColor(AlertDialog dialog, LayoutValuesItemDialogBinding bind) {
- String name = Objects.requireNonNull(bind.textinputName.getText()).toString().trim();
- String value = Objects.requireNonNull(bind.textinputValue.getText()).toString().trim();
-
- if (name.isEmpty()) {
- bind.textInputLayoutName.setError(getString(R.string.error_color_name_required));
- return;
- }
-
- try {
- String finalValue = getSafeColor(value);
- bind.textInputLayoutValue.setError(null);
-
- ValuesItem colorItem = new ValuesItem(name, finalValue);
- colorList.add(colorItem);
- adapter.notifyItemInserted(colorList.indexOf(colorItem));
- adapter.generateColorsXml();
-
- dialog.dismiss();
- } catch (IllegalArgumentException e) {
- bind.textInputLayoutValue.setError(getString(R.string.error_invalid_color));
- }
- }
-
- public void addColor() {
- LayoutValuesItemDialogBinding dialogBinding = LayoutValuesItemDialogBinding.inflate(getLayoutInflater());
- AlertDialog dialog = new MaterialAlertDialogBuilder(requireContext())
- .setTitle(R.string.new_color_dialog_title)
- .setView(dialogBinding.getRoot())
- .setPositiveButton(R.string.add, null)
- .setNegativeButton(R.string.cancel, null)
- .create();
-
- setupDialogViews(dialogBinding);
- dialog.show();
-
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
-
- setupColorPicker(dialogBinding.textInputLayoutValue, dialogBinding.textinputValue);
- setupInputValidation(dialog, dialogBinding);
- setupSaveButton(dialog, dialogBinding);
- }
-
- private void showColorPickerDialog(TextInputEditText etValue, TextInputLayout ilValue) {
- @SuppressLint("SetTextI18n")
- ColorPickerDialog.Builder builder = new ColorPickerDialog.Builder(requireContext())
- .setTitle(R.string.color_picker_dialog_title)
- .setPositiveButton(getString(R.string.confirm), (ColorEnvelopeListener) (envelope, fromUser) -> {
- etValue.setText("#" + envelope.getHexCode());
- ilValue.setError(null);
- })
- .setNegativeButton(getString(R.string.cancel), (d, i) -> d.dismiss())
- .attachAlphaSlideBar(true)
- .attachBrightnessSlideBar(true)
- .setBottomSpace(12);
-
- var colorView = builder.getColorPickerView();
- colorView.setFlagView(new ColorPickerDialogFlag(requireContext()));
-
- // Try to set initial color safely
- try {
- String colorStr = Objects.requireNonNull(etValue.getText()).toString();
- if (!colorStr.isEmpty()) {
- colorView.setInitialColor(Color.parseColor(getSafeColor(colorStr)));
- }
- } catch (Exception ignored) {}
-
- builder.show();
- }
-
- /**
- * Attempts to parse an input string and return a safe hexadecimal color string.
- * It first tries to parse the [input] as is. If that fails, it checks if the "#" prefix
- * is missing. If missing, it appends it and tries to parse again.
- *
- * @param input The raw color string (e.g., "FFFFFF" or "#FFFFFF").
- * @return The valid color string (including the "#" prefix if it was needed).
- * @throws IllegalArgumentException If the input cannot be parsed as a valid color even after correction.
- */
- private String getSafeColor(String input) throws IllegalArgumentException {
- try {
- Color.parseColor(input);
- return input;
- } catch (IllegalArgumentException ignored) {}
-
- String fixed = hexPrefixValidation(input);
- if (fixed != null) return fixed;
-
- throw new IllegalArgumentException("Unknown color");
- }
-
- @Nullable
- private static String hexPrefixValidation(String input) {
- if (!input.startsWith("#")) {
- String fixed = "#" + input;
- try {
- Color.parseColor(fixed);
- return fixed;
- } catch (IllegalArgumentException ignored) {}
- }
- return null;
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/DrawableFragment.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/DrawableFragment.kt
deleted file mode 100644
index 51cf6bb253..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/DrawableFragment.kt
+++ /dev/null
@@ -1,417 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.fragments.resources
-
-import android.content.Context
-import android.graphics.BitmapFactory
-import android.graphics.drawable.Drawable
-import android.net.Uri
-import android.os.Bundle
-import android.text.Editable
-import android.text.TextWatcher
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.view.WindowManager
-import android.view.inputmethod.InputMethodManager
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.lifecycleScope
-import androidx.recyclerview.widget.GridLayoutManager
-import androidx.recyclerview.widget.LinearLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
-import com.blankj.utilcode.util.ToastUtils
-import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import com.itsaky.androidide.eventbus.events.file.FileRenameEvent
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.withContext
-import org.apache.commons.io.FileUtils
-import org.appdevforall.codeonthego.layouteditor.ProjectFile
-import org.appdevforall.codeonthego.layouteditor.R
-import org.appdevforall.codeonthego.layouteditor.adapters.DPIsListAdapter
-import org.appdevforall.codeonthego.layouteditor.adapters.DrawableResourceAdapter
-import org.appdevforall.codeonthego.layouteditor.adapters.models.DrawableFile
-import org.appdevforall.codeonthego.layouteditor.databinding.DialogSelectDpisBinding
-import org.appdevforall.codeonthego.layouteditor.databinding.FragmentResourcesBinding
-import org.appdevforall.codeonthego.layouteditor.databinding.TextinputlayoutBinding
-import org.appdevforall.codeonthego.layouteditor.tools.ImageConverter
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil.getLastSegmentFromPath
-import org.appdevforall.codeonthego.layouteditor.utils.NameErrorChecker
-import org.appdevforall.codeonthego.layouteditor.utils.ProjectResolver
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-import org.greenrobot.eventbus.EventBus
-import org.slf4j.LoggerFactory
-import java.io.File
-import java.io.IOException
-
-class DrawableFragment : Fragment() {
- private var binding: FragmentResourcesBinding? = null
- private var mRecyclerView: RecyclerView? = null
-
- private var project: ProjectFile? = null
- private var drawableList: MutableList = mutableListOf()
-
- private var adapter: DrawableResourceAdapter? = null
- var dpiAdapter: DPIsListAdapter? = null
- private var dpiList = mutableListOf("ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi")
-
- private val logger = LoggerFactory.getLogger(DrawableFragment::class.java)
-
- companion object {
- fun newInstance(project: ProjectFile): DrawableFragment {
- val fragment = DrawableFragment()
- val args = Bundle()
- args.putParcelable(Constants.EXTRA_KEY_PROJECT, project)
- fragment.arguments = args
- return fragment
- }
- }
-
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
- ): View? {
- binding = FragmentResourcesBinding.inflate(inflater, container, false)
- return binding!!.getRoot()
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- project = ProjectResolver.getValidProjectOrShowError(arguments, view)
- if (project == null) return
-
- loadDrawables()
- mRecyclerView = binding!!.recyclerView
- // Create the adapter and set it to the RecyclerView
- adapter = DrawableResourceAdapter(
- drawableList,
- object : DrawableResourceAdapter.OnDrawableActionListener {
- override fun onRenameRequested(position: Int) {
- showRenameDialog(position)
- }
-
- override fun onDeleteRequested(position: Int) {
- deleteDrawable(position)
- }
- })
- mRecyclerView!!.setAdapter(adapter)
- mRecyclerView!!.setLayoutManager(
- LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false)
- )
- }
-
- fun loadDrawables() {
- val appContext = requireContext().applicationContext
-
- lifecycleScope.launch {
- try {
- val result = loadDrawableFiles(appContext)
-
- drawableList.clear()
- drawableList.addAll(result)
- adapter?.notifyDataSetChanged()
-
- } catch (e: Exception) {
- logger.error("Error loading drawables", e)
- }
- }
- }
-
- private suspend fun loadDrawableFiles(context: Context): List {
- val currentProject = project ?: return emptyList()
-
- return withContext(Dispatchers.IO) {
- val projectDir = File(currentProject.path)
- val baseDrawableFolder = File(projectDir, "drawable")
-
- if (!baseDrawableFolder.exists()) {
- return@withContext emptyList()
- }
-
- val dpiVersionMap = buildDpiVersionMap(projectDir)
-
- val drawableFiles = FileUtils.listFiles(
- baseDrawableFolder,
- arrayOf("png", "jpg", "jpeg", "gif", "xml"),
- false
- )
-
- drawableFiles.mapNotNull { file ->
- createDrawableFile(context, file, dpiVersionMap)
- }
- }
- }
-
- private fun buildDpiVersionMap(projectDir: File): Map {
- val dpiMap = mutableMapOf()
- dpiList.forEachIndexed { index, dpi ->
- val dpiFolder = File(projectDir, "drawable-$dpi")
- dpiFolder.listFiles()?.forEach { fileInDpiFolder ->
- dpiMap[fileInDpiFolder.name] = index
- }
- }
- return dpiMap
- }
-
- private fun createDrawableFile(
- context: Context,
- file: File,
- dpiVersionMap: Map
- ): DrawableFile? {
- val drawable = if (file.extension.equals("xml", ignoreCase = true)) {
- Utils.getVectorDrawableAsync(context, Uri.fromFile(file))
- } else {
- Drawable.createFromPath(file.path)
- }
-
- val versionIndex = dpiVersionMap[file.name] ?: 0
-
- return drawable?.let {
- DrawableFile(
- versions = versionIndex + 1,
- drawable = it,
- path = file.path
- )
- }
- }
-
- fun addDrawable(uri: Uri) {
- val path = FileUtil.convertUriToFilePath(requireContext(), uri)
- if (path.isEmpty()) {
- ToastUtils.showLong(R.string.invalid_data_intent)
- return
- }
-
- val lastSegment = getLastSegmentFromPath(path)
- val fileName = lastSegment.substring(0, lastSegment.lastIndexOf("."))
- val extension = lastSegment.substring(lastSegment.lastIndexOf("."))
-
- val builder = MaterialAlertDialogBuilder(requireContext())
- val dialogBinding = DialogSelectDpisBinding.inflate(builder.create().layoutInflater)
- val editText = dialogBinding.textinputEdittext
- val inputLayout = dialogBinding.textinputLayout
-
- inputLayout.setHint(R.string.msg_enter_new_name)
- editText.setText(fileName)
-
- if (!lastSegment.endsWith(".xml")) {
- Drawable.createFromPath(path)?.let { drawable ->
- dpiAdapter = DPIsListAdapter(drawable)
- }
- dialogBinding.listDpi.adapter = dpiAdapter
- dialogBinding.listDpi.layoutManager = GridLayoutManager(requireActivity(), 2)
- }
-
- dialogBinding.listDpi.visibility =
- if (lastSegment.endsWith(".xml")) View.GONE else View.VISIBLE
-
- builder.setView(dialogBinding.root)
- builder.setTitle(R.string.add_drawable)
- builder.setNegativeButton(R.string.cancel, null)
-
- builder.setPositiveButton(R.string.add) { _, _ ->
- val drawableName = editText.text.toString()
- val selectedDPIs = dpiAdapter?.selectedItems ?: emptyList()
- val isXml = lastSegment.endsWith(".xml")
- val appContext = requireContext().applicationContext
-
- lifecycleScope.launch {
- val newDrawableFile = withContext(Dispatchers.IO) {
- val drawablePath = project?.drawablePath ?: return@withContext null
-
- if (!isXml && selectedDPIs.isNotEmpty()) {
-
- try {
- ImageConverter.convertToDrawableDpis(
- drawableName + extension,
- BitmapFactory.decodeFile(path),
- selectedDPIs
- )
- } catch (e: IOException) {
- logger.error("Error converting drawable to different DPIs", e)
- }
- }
-
- val toPath = drawablePath + drawableName + extension
- FileUtil.copyFile(uri, toPath, appContext)
-
- val drawable =
- if (isXml)
- Utils.getVectorDrawableAsync(
- appContext,
- Uri.fromFile(File(toPath))
- )
- else
- Drawable.createFromPath(toPath)
-
- val version = selectedDPIs.size + 1
- drawable?.let {
- DrawableFile(version, it, toPath)
- }
- }
-
- newDrawableFile?.let {
- val insertPosition = drawableList.size
- drawableList.add(it)
- adapter?.notifyItemInserted(insertPosition)
- }
- }
- }
-
- val dialog = builder.create()
- dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
- dialog.show()
-
- editText.addTextChangedListener(object : TextWatcher {
- override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
- override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
- override fun afterTextChanged(s: Editable?) {
- NameErrorChecker.checkForDrawable(
- editText.text.toString(),
- inputLayout,
- dialog,
- drawableList
- )
- }
- })
-
- NameErrorChecker.checkForDrawable(fileName, inputLayout, dialog, drawableList)
-
- editText.requestFocus()
- val imm = dialogBinding.root.context
- .getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
- imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
-
- if (editText.text?.isNotEmpty() == true) {
- editText.setSelection(0, editText.text!!.length)
- }
- }
-
- private fun showRenameDialog(position: Int) {
- val drawableFile = drawableList[position]
- val segment = getLastSegmentFromPath(drawableFile.path)
-
- val fileName = segment.substring(0, segment.lastIndexOf("."))
- val extension = segment.substring(segment.lastIndexOf("."))
-
- val builder = MaterialAlertDialogBuilder(requireContext())
- val bind = TextinputlayoutBinding.inflate(builder.create().layoutInflater)
- val editText = bind.textinputEdittext
-
- editText.setText(fileName)
- builder.setTitle(R.string.rename_drawable)
- builder.setView(bind.root)
- builder.setNegativeButton(R.string.cancel, null)
- builder.setPositiveButton(R.string.rename) { _, _ ->
- lifecycleScope.launch {
- renameDrawable(position, editText.text.toString(), extension)
- }
- }
-
- val dialog = builder.create()
- dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
- dialog.show()
- }
-
- private suspend fun renameDrawable(
- position: Int,
- newName: String,
- extension: String
- ) = withContext(Dispatchers.IO) {
-
- val drawable = drawableList[position]
- val oldPath = drawable.path
- val oldName = drawable.name.substring(0, drawable.name.lastIndexOf("."))
-
- val oldFile = File(oldPath)
- val newPath = project?.drawablePath + newName + extension
- val newFile = File(newPath)
-
- if (!oldFile.renameTo(newFile)) {
- withContext(Dispatchers.Main) {
- ToastUtils.showLong(R.string.rename_failed)
- }
- return@withContext
- }
-
- EventBus.getDefault().post(FileRenameEvent(oldFile, newFile))
-
- val projectRoot = project?.let { File(it.path) }?.parentFile
- projectRoot?.let {
- renameDrawableReferences(
- it,
- oldName = oldName,
- newName = newName
- )
- }
-
- val updatedDrawable =
- if (extension.equals(".xml", ignoreCase = true) || extension.equals(".svg", ignoreCase = true))
- VectorDrawableCompat.createFromPath(newPath)
- else
- Drawable.createFromPath(newPath)
-
- drawable.path = newPath
- drawable.name = newName + extension
-
- withContext(Dispatchers.Main) {
- val item = adapter?.getItemAt(position)
- if (updatedDrawable != null) {
- item?.drawable = updatedDrawable
- }
- adapter?.notifyItemChanged(position)
- }
- }
-
- private suspend fun renameDrawableReferences(
- projectRoot: File,
- oldName: String,
- newName: String
- ) = withContext(Dispatchers.IO) {
-
- val xmlFiles = projectRoot.walkTopDown()
- .filter { it.isFile && it.extension.lowercase() == "xml" }
- .toList()
-
- val codeFiles = projectRoot.walkTopDown()
- .filter { it.isFile && (it.extension == "kt" || it.extension == "java") }
- .toList()
-
- val xmlPattern = "@drawable/$oldName"
- val xmlReplacement = "@drawable/$newName"
-
- val codePattern = "R.drawable.$oldName"
- val codeReplacement = "R.drawable.$newName"
-
- // Update XML references
- xmlFiles.forEach { file ->
- val text = file.readText()
- if (text.contains(xmlPattern)) {
- file.writeText(text.replace(xmlPattern, xmlReplacement))
- }
- }
-
- // Update Kotlin/Java references
- codeFiles.forEach { file ->
- val text = file.readText()
- if (text.contains(codePattern)) {
- file.writeText(text.replace(codePattern, codeReplacement))
- }
- }
- }
-
- private fun deleteDrawable(position: Int) {
- lifecycleScope.launch {
- val file = File(drawableList[position].path)
- val deleted = withContext(Dispatchers.IO) { file.delete() }
- if (deleted) {
- drawableList.removeAt(position)
- adapter?.notifyItemRemoved(position)
- } else {
- ToastUtils.showLong(R.string.delete_failed)
- }
- }
- }
-
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/FontFragment.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/FontFragment.java
deleted file mode 100644
index d78c6bb15a..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/FontFragment.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.fragments.resources;
-
-import static org.appdevforall.codeonthego.layouteditor.utils.Utils.isValidFontFile;
-
-import android.content.Context;
-import android.net.Uri;
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
-
-import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.blankj.utilcode.util.ToastUtils;
-import com.google.android.material.dialog.MaterialAlertDialogBuilder;
-import com.google.android.material.textfield.TextInputEditText;
-import com.google.android.material.textfield.TextInputLayout;
-
-import org.appdevforall.codeonthego.layouteditor.ProjectFile;
-import org.appdevforall.codeonthego.layouteditor.R;
-import org.appdevforall.codeonthego.layouteditor.adapters.FontResourceAdapter;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.FontItem;
-import org.appdevforall.codeonthego.layouteditor.databinding.FragmentResourcesBinding;
-import org.appdevforall.codeonthego.layouteditor.databinding.LayoutFontItemDialogBinding;
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil;
-import org.appdevforall.codeonthego.layouteditor.utils.NameErrorChecker;
-import org.appdevforall.codeonthego.layouteditor.utils.ProjectResolver;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class FontFragment extends Fragment {
-
- private FragmentResourcesBinding binding;
- private FontResourceAdapter adapter;
- private ProjectFile project;
- private List fontList = new ArrayList<>();
- private ExecutorService executor;
-
- public static FontFragment newInstance(ProjectFile project) {
- FontFragment fragment = new FontFragment();
- Bundle args = new Bundle();
- args.putParcelable(Constants.EXTRA_KEY_PROJECT, project);
- fragment.setArguments(args);
- return fragment;
- }
-
- @Override
- public android.view.View onCreateView(
- @NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- binding = FragmentResourcesBinding.inflate(inflater, container, false);
- return binding.getRoot();
- }
-
- @Override
- public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- project = ProjectResolver.getValidProjectOrShowError(getArguments(), view);
- if (project == null) return;
-
- executor = Executors.newSingleThreadExecutor();
- adapter = new FontResourceAdapter(fontList);
- RecyclerView mRecyclerView = binding.recyclerView;
- mRecyclerView.setAdapter(adapter);
- mRecyclerView.setLayoutManager(
- new LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false));
- loadFonts();
- }
-
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- if (executor != null) {
- executor.shutdownNow();
- binding = null;
- }
- }
-
- private void loadFonts() {
- executor.execute(() -> {
- File[] files = project.getFonts();
-
- if (files == null) {
- requireActivity().runOnUiThread(() -> ToastUtils.showShort(getString(R.string.msg_error_load_failed)));
- return;
- }
-
- List temp = new ArrayList<>();
- for (File file : files) {
- String name = file.getName();
-
- if (!isValidFontFile(file)) {
- requireActivity().runOnUiThread(() ->
- ToastUtils.showLong(getString(R.string.msg_font_load_invalid, name))
- );
- continue;
- }
- temp.add(new FontItem(name, file.getPath()));
- }
-
- requireActivity().runOnUiThread(() -> {
- fontList.clear();
- fontList.addAll(temp);
- if (adapter != null) adapter.notifyDataSetChanged();
- });
- });
- }
-
- private void postToast(String msg) {
- requireActivity().runOnUiThread(() -> ToastUtils.showLong(msg));
- }
-
- public void addFont(final Uri uri) {
- String path = FileUtil.convertUriToFilePath(this.getContext(),uri);
- if (TextUtils.isEmpty(path)) {
- ToastUtils.showLong(R.string.invalid_data_intent);
- return;
- }
- final String lastSegment = FileUtil.getLastSegmentFromPath(path);
- final String fileName = lastSegment.substring(0, lastSegment.lastIndexOf("."));
- final String extension =
- lastSegment.substring(lastSegment.lastIndexOf("."));
- final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext());
- final LayoutFontItemDialogBinding dialogBinding =
- LayoutFontItemDialogBinding.inflate(builder.create().getLayoutInflater());
- final TextInputEditText editTextName = dialogBinding.textinputName;
- final TextInputLayout inputLayoutName = dialogBinding.textInputLayoutName;
- inputLayoutName.setHint(R.string.msg_enter_new_name);
- editTextName.setText(fileName);
-
- builder.setView(dialogBinding.getRoot());
- builder.setTitle(R.string.add_font);
- builder.setNegativeButton(R.string.cancel, (di, which) -> {});
- builder.setPositiveButton(
- R.string.add,
- (di, which) -> {
- final String finalName = editTextName.getText().toString().trim();
- final String finalToPath = project.getFontPath() + finalName + extension;
- final String finalFileName = finalName + extension;
-
- executor.execute(() -> {
- String filePath = FileUtil.convertUriToFilePath(getContext(), uri);
- File original = new File(filePath);
-
- if (!isValidFontFile(original)) {
- postToast(getString(R.string.msg_font_add_invalid));
- return;
- }
-
- boolean copySucceeded = FileUtil.copyFile(uri, finalToPath, getContext());
-
- if (!copySucceeded) {
- File failedFile = new File(finalToPath);
- if (failedFile.exists()) failedFile.delete();
- postToast(getString(R.string.msg_font_copy_failed));
- return;
- }
-
- requireActivity().runOnUiThread(() -> {
- FontItem item = new FontItem(finalFileName + extension, finalToPath);
- fontList.add(item);
- adapter.notifyItemInserted(fontList.size() - 1);
- });
- });
- });
-
- final AlertDialog dialog = builder.create();
- dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
- dialog.show();
-
- editTextName.addTextChangedListener(
- new TextWatcher() {
-
- @Override
- public void beforeTextChanged(CharSequence p1, int p2, int p3, int p4) {}
-
- @Override
- public void onTextChanged(CharSequence p1, int p2, int p3, int p4) {}
-
- @Override
- public void afterTextChanged(Editable p1) {
- NameErrorChecker.checkForFont(
- editTextName.getText().toString(), inputLayoutName, dialog, fontList);
- }
- });
-
- NameErrorChecker.checkForFont(fileName, inputLayoutName, dialog, fontList);
-
- editTextName.requestFocus();
- InputMethodManager inputMethodManager =
- (InputMethodManager) requireContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- inputMethodManager.showSoftInput(editTextName, InputMethodManager.SHOW_IMPLICIT);
-
- if (!editTextName.getText().toString().isEmpty()) {
- editTextName.setSelection(0, editTextName.getText().toString().length());
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/StringFragment.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/StringFragment.java
deleted file mode 100644
index 648656dede..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/fragments/resources/StringFragment.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.fragments.resources;
-
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.google.android.material.dialog.MaterialAlertDialogBuilder;
-import com.google.android.material.textfield.TextInputEditText;
-import com.google.android.material.textfield.TextInputLayout;
-
-import org.appdevforall.codeonthego.layouteditor.ProjectFile;
-import org.appdevforall.codeonthego.layouteditor.R;
-import org.appdevforall.codeonthego.layouteditor.adapters.StringResourceAdapter;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.ValuesItem;
-import org.appdevforall.codeonthego.layouteditor.databinding.FragmentResourcesBinding;
-import org.appdevforall.codeonthego.layouteditor.databinding.LayoutValuesItemDialogBinding;
-import org.appdevforall.codeonthego.layouteditor.utils.Constants;
-import org.appdevforall.codeonthego.layouteditor.tools.ValuesResourceParser;
-import org.appdevforall.codeonthego.layouteditor.utils.NameErrorChecker;
-import org.appdevforall.codeonthego.layouteditor.utils.ProjectResolver;
-import org.appdevforall.codeonthego.layouteditor.utils.SBUtils;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-/*
- * @authors: @raredeveloperofc and @itsvks19;
- */
-public class StringFragment extends Fragment {
- private FragmentResourcesBinding binding;
- private StringResourceAdapter adapter;
- private RecyclerView mRecyclerView;
- private List stringList = new ArrayList<>();
- ValuesResourceParser stringParser;
-
- public static StringFragment newInstance(ProjectFile project) {
- StringFragment fragment = new StringFragment();
- Bundle args = new Bundle();
- args.putParcelable(Constants.EXTRA_KEY_PROJECT, project);
- fragment.setArguments(args);
- return fragment;
- }
-
- @Override
- public android.view.View onCreateView(
- @NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- binding = FragmentResourcesBinding.inflate(inflater, container, false);
- return binding.getRoot();
- }
-
- @Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- ProjectFile project = ProjectResolver.getValidProjectOrShowError(getArguments(), view);
- if (project == null) return;
-
- try {
- loadStringsFromXML(project.getStringsPath());
- } catch (FileNotFoundException e) {
- SBUtils.make(view, "An error occured: " + e.getMessage())
- .setFadeAnimation()
- .setType(SBUtils.Type.INFO)
- .show();
- }
- mRecyclerView = binding.recyclerView;
- adapter = new StringResourceAdapter(project, stringList);
- mRecyclerView.setAdapter(adapter);
- mRecyclerView.setLayoutManager(
- new LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false));
- }
-
- /*
- * @param filePath = Current project strings file path;
- */
- public void loadStringsFromXML(String filePath) throws FileNotFoundException {
- try (InputStream stream = new FileInputStream(filePath)) {
- stringParser = new ValuesResourceParser(stream, ValuesResourceParser.TAG_STRING);
- stringList = stringParser.getValuesList();
- } catch (FileNotFoundException e) {
- throw e;
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public void addString() {
- MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext());
- builder.setTitle("New String");
-
- LayoutValuesItemDialogBinding bind = LayoutValuesItemDialogBinding.inflate(getLayoutInflater());
- TextInputLayout ilName = bind.textInputLayoutName;
- TextInputLayout ilValue = bind.textInputLayoutValue;
- TextInputEditText etName = bind.textinputName;
- TextInputEditText etValue = bind.textinputValue;
-
- builder.setView(bind.getRoot());
-
- builder.setPositiveButton(
- R.string.add,
- (dlg, i) -> {
- // Create new StringItem(ValuesItem) instance
- var stringItem =
- new ValuesItem(etName.getText().toString(), etValue.getText().toString());
- // Add stringItem in stringList
- stringList.add(stringItem);
- adapter.notifyItemInserted(stringList.indexOf(stringItem));
- // Generate code from all strings in list
- adapter.generateStringsXml();
- });
- builder.setNegativeButton(R.string.cancel, null);
-
- AlertDialog dialog = builder.create();
- dialog.show();
-
- etName.addTextChangedListener(
- new TextWatcher() {
-
- @Override
- public void beforeTextChanged(CharSequence p1, int p2, int p3, int p4) {}
-
- @Override
- public void onTextChanged(CharSequence p1, int p2, int p3, int p4) {}
-
- @Override
- public void afterTextChanged(Editable p1) {
- NameErrorChecker.checkForValues(
- etName.getText().toString(), ilName, dialog, stringList);
- }
- });
- NameErrorChecker.checkForValues(etName.getText().toString(), ilName, dialog, stringList);
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/DrawableManager.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/DrawableManager.kt
deleted file mode 100644
index 9ecd2e112b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/DrawableManager.kt
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers
-
-import android.content.Context
-import android.graphics.drawable.Drawable
-import android.net.Uri
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil.getLastSegmentFromPath
-import org.appdevforall.codeonthego.layouteditor.utils.Utils
-import java.io.File
-
-object DrawableManager {
- private val items = HashMap()
-
- fun loadFromFiles(files: Array) {
- items.clear()
-
- for (f in files) {
- val path = f.path
- var name = getLastSegmentFromPath(path)
- val dotIndex = name.lastIndexOf(".")
- if (dotIndex > 0) {
- name = name.substring(0, dotIndex)
- }
- items.put(name, path)
- }
- }
-
- @JvmStatic
- fun contains(name: String?): Boolean {
- return items.containsKey(name)
- }
-
- @JvmStatic
- fun getDrawable(context: Context?, key: String?): Drawable? {
- val path = items[key] ?: return null
- return if (path.endsWith(".xml"))
- Utils.getVectorDrawableAsync(context, Uri.fromFile(File(path)))
- else
- Drawable.createFromPath(path)
- }
-
- fun clear() {
- items.clear()
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/FontManager.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/FontManager.java
deleted file mode 100644
index 7a6b4776e4..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/FontManager.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers;
-
-import android.graphics.Typeface;
-
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-public class FontManager {
- private static Map items = new HashMap<>();
-
- public static void loadFromFiles(File[] files) {
- items.clear();
-
- for (File f : files) {
- String path = f.getPath();
- String name = FileUtil.getLastSegmentFromPath(path);
- name = name.substring(0, name.lastIndexOf("."));
-
- items.put(name, path);
- }
- }
-
- public static boolean contains(String name) {
- return items.containsKey(name);
- }
-
- public static Typeface getFont(String key) {
- return Typeface.createFromFile(items.get(key));
- }
-
- public static Set keySet() {
- return items.keySet();
- }
-
- public static void clear() {
- items.clear();
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/IdManager.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/IdManager.kt
deleted file mode 100644
index 76d2468f7b..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/IdManager.kt
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers
-
-import android.view.View
-import android.view.ViewGroup
-import org.jetbrains.annotations.Contract
-
-/** This is IdManager class which is used for managing ids */
-object IdManager {
- /** This is hashmap for storing view and its ids */
- @get:JvmStatic
- val idMap = HashMap()
-
- /**
- * This method is used to add new id to view
- *
- * @param view View to which id needs to be added
- * @param id String id which needs to be added
- */
- @JvmStatic
- fun addNewId(view: View, id: String) {
- if (!idMap.containsKey(view)) {
- view.id = View.generateViewId()
- }
- idMap[view] = id.replace("@+id/", "")
- }
-
- /**
- * This method is used to add id to view with specified name and id
- *
- * @param view View to which id needs to be added
- * @param idName String name of the id
- * @param id Integer of the id
- */
- @JvmStatic
- fun addId(view: View, idName: String, id: Int) {
- view.id = id
- idMap[view] = idName.replace("@+id/", "")
- }
-
- /**
- * This method is used to remove the id for specified view
- *
- * @param view View to which id needs to be removed
- * @param removeChilds Boolean value to remove childs of ViewGroup
- */
- @JvmStatic
- fun removeId(view: View, removeChilds: Boolean) {
- idMap.remove(view)
- if (removeChilds && view is ViewGroup) {
- for (i in 0 until view.childCount) {
- removeId(view.getChildAt(i), true)
- }
- }
- }
-
- /**
- * This method is used to check if id exists for specified name
- *
- * @param name String name of the id
- * @return Boolean value true/false
- */
- fun containsId(name: String): Boolean {
- val mName = name.replace("@id/", "")
- for (view in idMap.keys) {
- if (idMap[view] == mName) {
- return true
- }
- }
- return false
- }
-
- /** This method is used to clear the HashMap ids */
- @JvmStatic
- fun clear() {
- idMap.clear()
- }
-
- /**
- * This method is used to get the view id for specified name
- *
- * @param name String name of the id
- * @return Integer of the view id
- */
- @JvmStatic
- fun getViewId(name: String): Int {
- val mName = name.replace("@id/", "")
- for (view in idMap.keys) {
- if (idMap[view] == mName) {
- return view.id
- }
- }
- return -1
- }
-
- /**
- * This method is used to get the list of ids
- *
- * @return List of ids
- */
- @JvmStatic
- @Contract(" -> new")
- fun getIds(): ArrayList {
- return ArrayList(idMap.values)
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/PreferencesManager.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/PreferencesManager.kt
deleted file mode 100644
index 0d5d1017c5..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/PreferencesManager.kt
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers
-
-import android.content.Context
-import android.content.SharedPreferences
-import androidx.appcompat.app.AppCompatDelegate
-import androidx.preference.PreferenceManager
-
-class PreferencesManager private constructor(context: Context) {
- private val appContext = context.applicationContext
-
- val prefs: SharedPreferences by lazy {
- PreferenceManager.getDefaultSharedPreferences(appContext)
- }
-
- companion object {
- @Volatile
- private var INSTANCE: PreferencesManager? = null
- fun getInstance(context: Context): PreferencesManager {
- return INSTANCE ?: synchronized(this) {
- INSTANCE ?: PreferencesManager(context).also { INSTANCE = it }
- }
- }
-
- operator fun invoke(context: Context): PreferencesManager {
- return getInstance(context)
- }
- }
-
- val isEnableVibration: Boolean
- get() = prefs.getBoolean(SharedPreferencesKeys.KEY_VIBRATION, false)
-
- val isShowStroke: Boolean
- get() = prefs.getBoolean(SharedPreferencesKeys.KEY_TOGGLE_STROKE, true)
-
- val isApplyDynamicColors: Boolean
- get() = prefs.getBoolean(SharedPreferencesKeys.KEY_DYNAMIC_COLORS, false)
-
- val currentTheme: Int
- get() = when (prefs.getString(SharedPreferencesKeys.KEY_APP_THEME, "Auto")) {
- "Light" -> AppCompatDelegate.MODE_NIGHT_NO
- "Dark" -> AppCompatDelegate.MODE_NIGHT_YES
- else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ProjectManager.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ProjectManager.kt
deleted file mode 100644
index 5cceaa69a0..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ProjectManager.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers
-
-import android.content.Context
-import android.util.Log
-import com.google.gson.Gson
-import com.google.gson.reflect.TypeToken
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.withContext
-import org.appdevforall.codeonthego.layouteditor.ProjectFile
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil
-import java.lang.reflect.Type
-import java.util.Locale
-import java.util.concurrent.CompletableFuture
-
-class ProjectManager private constructor() {
- private lateinit var context: Context
- private val paletteList: MutableList>> = ArrayList()
- var openedProject: ProjectFile? = null
- private set
-
- fun initManger(context: Context) {
- this.context = context
- CompletableFuture.runAsync { initPalette(context) }
- }
-
- suspend fun openProject(project: ProjectFile?) = withContext(Dispatchers.IO) {
- val safeProject = project ?: return@withContext
-
- val loadingResult = runCatching {
- safeProject.drawables.let { DrawableManager.loadFromFiles(it) }
- safeProject.layoutDesigns // just for the sake of creating folder
- safeProject.fonts?.let { FontManager.loadFromFiles(it) }
- }
- withContext(Dispatchers.Main) {
- loadingResult.onSuccess {
- openedProject = safeProject
- }.onFailure {
- Log.e("ProjectManager", "Failed to load project resources", it)
- throw it
- }
- }
- }
-
- fun closeProject() {
- openedProject = null
- DrawableManager.clear()
- FontManager.clear()
- }
-
- val colorsXml: String
- get() = FileUtil.readFile(openedProject!!.colorsPath)
- val stringsXml: String
- get() = FileUtil.readFile(openedProject!!.stringsPath)
- val formattedProjectName: String
- get() {
- var projectName = openedProject!!.name.lowercase(Locale.getDefault()).trim { it <= ' ' }
- if (projectName.contains(" ")) {
- projectName = projectName.replace(" ".toRegex(), "_")
- }
- if (!projectName.endsWith(".xml")) {
- projectName = "$projectName.xml"
- }
- return projectName
- }
-
- fun getPalette(position: Int): List> {
- return paletteList[position]
- }
-
- private fun initPalette(context: Context) {
- val gson = Gson()
- val type = object : TypeToken?>?>() {}.type
- paletteList.clear()
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_COMMON, context))
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_TEXT, context))
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_BUTTONS, context))
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_WIDGETS, context))
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_LAYOUTS, context))
- paletteList.add(convertJsonToJavaObject(gson, type, Constants.PALETTE_CONTAINERS, context))
- }
-
- private fun convertJsonToJavaObject(
- gson: Gson, type: Type, filePath: String, context: Context
- ): ArrayList> {
- return gson.fromJson(
- FileUtil.readFromAsset(filePath, context), type
- )
- }
-
- companion object {
-
- @JvmStatic
- @get:Synchronized
- val instance: ProjectManager by lazy { ProjectManager() }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/SharedPreferencesKeys.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/SharedPreferencesKeys.java
deleted file mode 100644
index a16c045b37..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/SharedPreferencesKeys.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers;
-
-public class SharedPreferencesKeys {
- public static final String KEY_APP_THEME = "app_theme";
- public static final String KEY_DYNAMIC_COLORS = "dynamic_colors";
- public static final String KEY_VIBRATION = "vibration";
- public static final String KEY_TOGGLE_STROKE = "toggle_stroke";
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/UndoRedoManager.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/UndoRedoManager.kt
deleted file mode 100644
index d37b7326fc..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/UndoRedoManager.kt
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers
-
-import android.view.MenuItem
-
-/** UndoRedoManager class is used to add XML to history and Undo/Redo the previous changes. */
-class UndoRedoManager(
- /** MenuItem for Undo Button */
- private val btnUndo: MenuItem?,
- /** MenuItem for Redo Button */
- private val btnRedo: MenuItem?
-) {
- /** Max size of the history */
- private val maxSize = 20
-
- /** History list to store the XMLs */
- private val history = arrayListOf()
-
- /** Index to track the current history */
- private var index = 0
-
- /**
- * Add XML to the history
- *
- * @param xml XML string to add to history
- */
- fun addToHistory(xml: String) {
- if (matchLastHistory(xml)) return
- history.add(xml)
- if (history.size == maxSize) {
- history.removeAt(0)
- }
- index = history.size - 1
- updateButtons()
- }
-
- /**
- * To get the previous XML from the history
- *
- * @return Previous XML from the history
- */
- fun undo(): String {
- if (index > 0) {
- index--
- updateButtons()
- return history[index]
- }
- return ""
- }
-
- /**
- * To get the next XML from the history
- *
- * @return Next XML from the history
- */
- fun redo(): String {
- if (index < history.size - 1) {
- index++
- updateButtons()
- return history[index]
- }
- return ""
- }
-
- /** To update the button's enabled state */
- fun updateButtons() {
- if (btnRedo == null || btnUndo == null) return
- btnUndo.icon!!.alpha = if (isUndoEnabled) 255 else 130
- btnUndo.setEnabled(isUndoEnabled)
- btnRedo.icon!!.alpha = if (isRedoEnabled) 255 else 130
- btnRedo.setEnabled(isRedoEnabled)
- }
-
- val isUndoEnabled: Boolean
- /**
- * To check if Undo is enabled or not
- *
- * @return true if undo is enabled
- */
- get() = history.size > 1 && index > 0
- val isRedoEnabled: Boolean
- /**
- * To check if Redo is enabled or not
- *
- * @return true if redo is enabled
- */
- get() = index < history.size - 1
-
- /**
- * To check if the last history is same as the current one
- *
- * @param xml Current XML
- * @return true if last history is same as the current one
- */
- private fun matchLastHistory(xml: String): Boolean {
- val lastIndex = history.size - 1
- if (lastIndex < 0) return false
- return xml == history[lastIndex]
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ValuesManager.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ValuesManager.java
deleted file mode 100644
index c57675f397..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/managers/ValuesManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.managers;
-
-import org.appdevforall.codeonthego.layouteditor.adapters.models.ValuesItem;
-import org.appdevforall.codeonthego.layouteditor.tools.ValuesResourceParser;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-public class ValuesManager {
-
- public static String getValueFromResources(String tag, String value, String path) {
- String resValueName = value.substring(value.indexOf("/") + 1);
- String result = null;
- try (FileInputStream stream = new FileInputStream(path)) {
- ValuesResourceParser parser = new ValuesResourceParser(stream, tag);
-
- for (ValuesItem item : parser.getValuesList()) {
- if (item.name.equals(resValueName)) {
- result = item.value;
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return result;
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ColorPickerDialogFlag.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ColorPickerDialogFlag.kt
deleted file mode 100644
index f619a8cb10..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ColorPickerDialogFlag.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.widget.TextView
-import com.skydoves.colorpickerview.AlphaTileView
-import com.skydoves.colorpickerview.ColorEnvelope
-import com.skydoves.colorpickerview.flag.FlagView
-import org.appdevforall.codeonthego.layouteditor.R
-
-class ColorPickerDialogFlag(context: Context) :
- FlagView(context, R.layout.layout_color_dialog_flag) {
-
- private val textView: TextView = findViewById(R.id.flag_color_code)
- private val alphaTileView: AlphaTileView = findViewById(R.id.flag_color_layout)
-
- @SuppressLint("SetTextI18n")
- override fun onRefresh(colorEnvelope: ColorEnvelope) {
- textView.text = "#${colorEnvelope.hexCode}"
- alphaTileView.setPaintColor(colorEnvelope.color)
- }
-
- override fun onFlipped(isFlipped: Boolean) {}
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ConvertToConstraintLayout.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ConvertToConstraintLayout.java
deleted file mode 100644
index 7a80093072..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ConvertToConstraintLayout.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.RelativeLayout;
-
-import androidx.constraintlayout.widget.ConstraintLayout;
-
-public class ConvertToConstraintLayout extends ConstraintLayout {
-
- public ConvertToConstraintLayout(Context context) {
- super(context);
- init(context, null);
- }
-
- public ConvertToConstraintLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- init(context, attrs);
- }
-
- public ConvertToConstraintLayout(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- init(context, attrs);
- }
-
- private void init(Context context, AttributeSet attrs) {
- setLayoutParams(
- new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
- if (getChildCount() > 0) {
- View view = getChildAt(0);
- removeView(view);
- addView(
- view,
- new LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
- }
- }
-
- public static ConstraintLayout convertLayout(ViewGroup viewGroup) {
- ConvertToConstraintLayout convertToConstraintLayout =
- new ConvertToConstraintLayout(viewGroup.getContext());
- ViewGroup.LayoutParams params = viewGroup.getLayoutParams();
- viewGroup.removeView(viewGroup);
- viewGroup.addView(convertToConstraintLayout, params);
- for (int i = 0; i < viewGroup.getChildCount(); i++) {
- View child = viewGroup.getChildAt(i);
- ViewGroup.LayoutParams childParams = child.getLayoutParams();
- if (childParams instanceof RelativeLayout.LayoutParams) {
- RelativeLayout.LayoutParams relativeParams = (RelativeLayout.LayoutParams) childParams;
- int[] rules = relativeParams.getRules();
- ConstraintLayout.LayoutParams newParams =
- new ConstraintLayout.LayoutParams(childParams.width, childParams.height);
- if (rules[RelativeLayout.ALIGN_PARENT_TOP] == RelativeLayout.TRUE) {
- newParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
- } else if (rules[RelativeLayout.ALIGN_PARENT_BOTTOM] == RelativeLayout.TRUE) {
- newParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
- } else if (rules[RelativeLayout.ALIGN_PARENT_LEFT] == RelativeLayout.TRUE) {
- newParams.leftToLeft = ConstraintLayout.LayoutParams.PARENT_ID;
- } else if (rules[RelativeLayout.ALIGN_PARENT_RIGHT] == RelativeLayout.TRUE) {
- newParams.rightToRight = ConstraintLayout.LayoutParams.PARENT_ID;
- } else if (rules[RelativeLayout.CENTER_HORIZONTAL] == RelativeLayout.TRUE) {
- newParams.horizontalBias = 0.5f;
- newParams.leftToLeft = ConstraintLayout.LayoutParams.PARENT_ID;
- newParams.rightToRight = ConstraintLayout.LayoutParams.PARENT_ID;
- } else if (rules[RelativeLayout.CENTER_VERTICAL] == RelativeLayout.TRUE) {
- newParams.verticalBias = 0.5f;
- newParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
- newParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
- }
- convertToConstraintLayout.addView(child, newParams);
- } else {
- convertToConstraintLayout.addView(child, childParams);
- }
- }
- return convertToConstraintLayout;
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ImageConverter.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ImageConverter.java
deleted file mode 100644
index 15f7dfd785..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ImageConverter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools;
-
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-
-import org.appdevforall.codeonthego.layouteditor.managers.ProjectManager;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-public class ImageConverter {
-
- public static void convertToDrawableDpis(
- String name, Bitmap originalImage, List selectedDpis) throws IOException {
-
- String[] dpis = {"ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"};
- int[] sizes = {36, 48, 72, 96, 144, 192}; // Corresponding sizes for each DPI
-
- for (int i = 0; i < selectedDpis.size(); i++) {
- String dpi = selectedDpis.get(i);
- int dpiIndex = Arrays.asList(dpis).indexOf(dpi);
- if (dpiIndex == -1) {
- throw new IllegalArgumentException("Unsupported DPI: " + dpi);
- }
- // Calculate the new width and height for the desired DPI
- int width = (int) (sizes[dpiIndex] * Resources.getSystem().getDisplayMetrics().density);
- int height = (int) (sizes[dpiIndex] * Resources.getSystem().getDisplayMetrics().density);
-
- // Create new resized image bitmap
- Bitmap resizedImage = Bitmap.createScaledBitmap(originalImage, width, height, true);
-
- // Save the resized image to the appropriate DPI folder
- String outputDirectoryPath =
- ProjectManager.getInstance().getOpenedProject().getPath() + "/drawable-" + dpi;
- File outputDirectory = new File(outputDirectoryPath);
- outputDirectory.mkdirs();
- FileOutputStream outputStream =
- new FileOutputStream(outputDirectory.getAbsolutePath() + "/".concat(name));
- resizedImage.compress(
- name.endsWith("png") ? Bitmap.CompressFormat.PNG : Bitmap.CompressFormat.JPEG,
- 100,
- outputStream);
- outputStream.close();
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ValuesResourceParser.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ValuesResourceParser.java
deleted file mode 100644
index f8cc58b757..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/ValuesResourceParser.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools;
-
-import android.widget.TextView;
-
-import org.appdevforall.codeonthego.layouteditor.adapters.models.ValuesItem;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ValuesResourceParser {
- public static final String TAG_STRING = "string";
- public static final String TAG_COLOR = "color";
-
- private List valuesList;
-
- public ValuesResourceParser(InputStream stream, String tag) {
- valuesList = new ArrayList<>();
- parseXML(stream, tag);
- }
-
- private void parseXML(InputStream stream, String tag) {
- String name = "";
- String value = "";
- try {
- XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
- factory.setNamespaceAware(true);
- XmlPullParser xpp = factory.newPullParser();
-
- xpp.setInput(stream, null);
-
- int eventType = xpp.getEventType();
- while (eventType != XmlPullParser.END_DOCUMENT) {
- if (eventType == XmlPullParser.START_TAG) {
- String tagName = xpp.getName();
- if (tagName.equalsIgnoreCase(tag)) {
- name = xpp.getAttributeValue(null, "name");
- }
- } else if (eventType == XmlPullParser.TEXT) {
- value = xpp.getText();
- } else if (eventType == XmlPullParser.END_TAG) {
- String tagName = xpp.getName();
- if (tagName.equalsIgnoreCase(tag)) {
- valuesList.add(new ValuesItem(name, value));
- }
- }
- eventType = xpp.next();
- }
- // createTextView(textView);
- } catch (XmlPullParserException | IOException e) {
- e.printStackTrace();
- }
- }
-
- public void createTextView(TextView textView) {
- StringBuilder builder = new StringBuilder();
- for (ValuesItem item : valuesList) {
- builder.append(item.name).append(" = ").append(item.value).append("\n");
- }
- textView.setText(builder.toString());
- }
-
- public List getValuesList() {
- return this.valuesList;
- }
-
- public void setValuesList(List valuesList) {
- this.valuesList = valuesList;
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XMLParserUtils.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XMLParserUtils.kt
deleted file mode 100644
index 04cde33780..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XMLParserUtils.kt
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools
-
-import android.content.Context
-import android.view.View
-import android.view.ViewGroup
-import android.view.ViewGroup.LayoutParams.MATCH_PARENT
-import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
-import android.widget.FrameLayout
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-import org.xmlpull.v1.XmlPullParser
-
-object XmlParserUtils {
-
- fun extractAttributes(parser: XmlPullParser): AttributeMap {
- val map = AttributeMap()
-
- for (i in 0 until parser.attributeCount) {
- map.putValue(
- parser.getAttributeName(i),
- parser.getAttributeValue(i)
- )
- }
-
- return map
- }
-
- fun getAttribute(
- parser: XmlPullParser,
- name: String
- ): String? =
- (0 until parser.attributeCount)
- .firstOrNull { parser.getAttributeName(it) == name }
- ?.let { parser.getAttributeValue(it) }
-
- fun applyAttributes(
- parser: XmlPullParser,
- target: View,
- attributeMap: MutableMap,
- marker: String,
- skip: String? = null
- ) {
- val map = attributeMap[target] ?: AttributeMap()
- map.putValue(marker, "true")
-
- for (i in 0 until parser.attributeCount) {
- val attrName = parser.getAttributeName(i)
- if (attrName == skip) continue
- map.putValue(attrName, parser.getAttributeValue(i))
- }
-
- attributeMap[target] = map
- }
-
- fun createIncludePlaceholder(
- context: Context,
- attributeMap: MutableMap,
- marker: String
- ): View = View(context).also {
- it.layoutParams = ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
- val attrs = AttributeMap().apply { putValue(marker, "true") }
- attributeMap[it] = attrs
- }
-
- fun createMergeWrapper(context: Context): FrameLayout =
- FrameLayout(context).apply {
- layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutGenerator.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutGenerator.java
deleted file mode 100644
index 67342a8893..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutGenerator.java
+++ /dev/null
@@ -1,202 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools;
-
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CalendarView;
-import android.widget.SearchView;
-
-import androidx.annotation.NonNull;
-
-import com.google.android.material.bottomnavigation.BottomNavigationView;
-import com.google.android.material.navigation.NavigationView;
-import com.google.android.material.tabs.TabLayout;
-
-import org.apache.commons.text.StringEscapeUtils;
-import org.appdevforall.codeonthego.layouteditor.editor.DesignEditor;
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Objects;
-
-public class XmlLayoutGenerator {
- final StringBuilder builder = new StringBuilder();
- String TAB = "\t";
- boolean useSuperclasses;
-
- public String generate(@NonNull DesignEditor editor, boolean useSuperclasses) {
- this.useSuperclasses = useSuperclasses;
-
- // Clear builder to avoid accumulating content from previous calls
- builder.setLength(0);
-
- if (editor.getChildCount() == 0) {
- return "";
- }
- builder.append("\n");
-
- peek(editor.getChildAt(0), editor.getViewAttributeMap(), 0);
- return builder.toString().trim();
- }
-
- private void peek(View view, HashMap attributeMap, int depth) {
- if (attributeMap == null || view == null) return;
-
- if (!attributeMap.containsKey(view)) {
- if (!(view instanceof ViewGroup group)) return;
-
- for (int i = 0; i < group.getChildCount(); i++) {
- peek(group.getChildAt(i), attributeMap, depth);
- }
- return;
- }
-
- if (tryWriteInclude(view, attributeMap, depth)) {
- return;
- }
- if (tryWriteFragment(view, attributeMap, depth)) {
- return;
- }
- if (tryWriteMerge(view, attributeMap, depth)) {
- return;
- }
- String indent = getIndent(depth);
-
- String className = getClassName(view, indent);
-
- List keys =
- (attributeMap.get(view) != null) ? new ArrayList<>(Objects.requireNonNull(attributeMap.get(view)).keySet()) : new ArrayList<>();
- for (String key : keys) {
- builder.append(TAB).append(indent).append(key).append("=\"").append(StringEscapeUtils.escapeXml11(Objects.requireNonNull(attributeMap.get(view)).getValue(key))).append("\"\n");
- }
-
- if (builder.charAt(builder.length() - 1) == '\n') {
- builder.deleteCharAt(builder.length() - 1);
- }
-
- if (!(view instanceof ViewGroup group)
- || group instanceof CalendarView
- || group instanceof SearchView
- || group instanceof NavigationView
- || group instanceof BottomNavigationView
- || group instanceof TabLayout
- || group.getChildCount() == 0) {
- builder.append(" />\n\n");
- return;
- }
-
- builder.append(">\n\n");
- int beforeLen = builder.length();
-
- for (int i = 0; i < group.getChildCount(); i++) {
- peek(group.getChildAt(i), attributeMap, depth + 1);
- }
-
- if (builder.length() == beforeLen) {
- builder.setLength(beforeLen - 3);
- builder.append(" />\n\n");
- } else {
- builder.append(indent).append("").append(className).append(">\n\n");
- }
- }
-
- @NonNull
- private String getClassName(View view, String indent) {
- String className =
- useSuperclasses ? view.getClass().getSuperclass().getName() : view.getClass().getName();
-
- if (useSuperclasses) {
- if (className.equals("android.widget.Toolbar")) {
- className = "androidx.appcompat.widget.Toolbar";
- }
- if (className.startsWith("android.widget.")) {
- className = className.replace("android.widget.", "");
- }
- }
-
- builder.append(indent).append("<").append(className).append("\n");
- return className;
- }
-
- private boolean tryWriteInclude(View view, HashMap attributeMap, int depth) {
- AttributeMap attrs = attributeMap.get(view);
-
- if (attrs != null && attrs.contains("tools:is_xml_include")) {
- String indent = getIndent(depth);
- builder.append(indent).append("\n\n");
- return true;
- }
- return false;
- }
-
- private boolean tryWriteFragment(View view, HashMap attributeMap, int depth) {
- AttributeMap attrs = attributeMap.get(view);
-
- if (attrs != null && attrs.contains("tools:is_xml_fragment")) {
- String indent = getIndent(depth);
- builder.append(indent).append("\n\n");
- return true;
- }
- return false;
- }
-
- private boolean tryWriteMerge(View view, HashMap attributeMap, int depth) {
- AttributeMap attrs = attributeMap.get(view);
-
- if (attrs != null && attrs.contains("tools:is_xml_merge")) {
- String indent = getIndent(depth);
- builder.append(indent).append(" 0) {
- builder.append(">\n\n");
-
- for (int i = 0; i < group.getChildCount(); i++) {
- peek(group.getChildAt(i), attributeMap, depth + 1);
- }
-
- builder.append(indent).append("\n\n");
- } else {
- // Handle empty merge
- builder.append(" />\n\n");
- }
- return true;
- }
- return false;
- }
-
- @NonNull
- private String getIndent(int depth) {
- return TAB.repeat(depth);
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutParser.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutParser.kt
deleted file mode 100644
index 4e656a926d..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/tools/XmlLayoutParser.kt
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.tools
-
-import android.content.Context
-import android.util.Log
-import android.view.View
-import android.view.ViewGroup
-import android.widget.FrameLayout
-import android.widget.HorizontalScrollView
-import android.widget.ScrollView
-import androidx.constraintlayout.widget.ConstraintLayout
-import com.google.gson.Gson
-import com.google.gson.reflect.TypeToken
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeInitializer
-import org.appdevforall.codeonthego.layouteditor.editor.initializer.AttributeMap
-import org.appdevforall.codeonthego.layouteditor.editor.positioning.restorePositionsAfterLoad
-import org.appdevforall.codeonthego.layouteditor.managers.IdManager.addNewId
-import org.appdevforall.codeonthego.layouteditor.managers.IdManager.clear
-import org.appdevforall.codeonthego.layouteditor.R
-import org.appdevforall.codeonthego.layouteditor.utils.Constants
-import org.appdevforall.codeonthego.layouteditor.utils.Constants.ATTR_INITIAL_POS
-import org.appdevforall.codeonthego.layouteditor.utils.FileUtil
-import org.appdevforall.codeonthego.layouteditor.editor.convert.ConvertImportedXml
-import org.appdevforall.codeonthego.layouteditor.utils.InvokeUtil.createView
-import org.appdevforall.codeonthego.layouteditor.utils.InvokeUtil.invokeMethod
-import org.xmlpull.v1.XmlPullParser
-import org.xmlpull.v1.XmlPullParserException
-import org.xmlpull.v1.XmlPullParserFactory
-import java.io.IOException
-import java.io.File
-import java.io.StringReader
-import androidx.core.view.isNotEmpty
-import androidx.core.widget.NestedScrollView
-
-
-sealed class ValidationResult {
- object Success : ValidationResult()
- data class Error(val errors: List) : ValidationResult() {
- val formattedMessage: String get() = errors.joinToString(separator = "\n\n• ", prefix = "• ")
- }
-}
-
-class XmlLayoutParser(
- context: Context,
- private val basePath: String? = null,
- private val isRoot: Boolean = true
-) {
- val viewAttributeMap: HashMap = HashMap()
- private val validationErrors = mutableListOf()
-
- private val initializer: AttributeInitializer
- private val listViews: MutableList = ArrayList()
-
- companion object {
- const val MARKER_IS_INCLUDE = "tools:is_xml_include"
- const val MARKER_IS_FRAGMENT = "tools:is_xml_fragment"
- const val MARKER_IS_MERGE = "tools:is_xml_merge"
- const val TAG = "XmlLayoutParser"
- }
-
- enum class CustomAttrs(val key: String) {
- INITIAL_POS(ATTR_INITIAL_POS),
- }
-
- init {
- val attributes =
- Gson()
- .fromJson>>>(
- FileUtil.readFromAsset(Constants.ATTRIBUTES_FILE, context),
- object : TypeToken>>>() {}.type,
- )
- val parentAttributes =
- Gson()
- .fromJson>>>(
- FileUtil.readFromAsset(Constants.PARENT_ATTRIBUTES_FILE, context),
- object : TypeToken>>>() {}.type,
- )
- initializer = AttributeInitializer(context, attributes, parentAttributes)
- }
-
- val root: View?
- get() = listViews.getOrNull(0)
-
- fun validateXml(
- xml: String,
- context: Context,
- ): ValidationResult {
- listViews.clear()
- viewAttributeMap.clear()
- validationErrors.clear()
- if (isRoot) clear()
-
- return try {
- val factory = XmlPullParserFactory.newInstance()
- val parser = factory.newPullParser()
- parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false)
- parser.setInput(StringReader(xml))
- parseFromXml(parser, context)
-
- if (validationErrors.isEmpty()) {
- ValidationResult.Success
- } else {
- ValidationResult.Error(validationErrors.toList())
- }
- } catch (e: XmlPullParserException) {
- ValidationResult.Error(listOf(context.getString(R.string.xml_error_parse, e.message ?: "")))
- } catch (e: IOException) {
- ValidationResult.Error(listOf(context.getString(R.string.xml_error_io, e.message ?: "")))
- } catch (e: Exception) {
- ValidationResult.Error(listOf(context.getString(R.string.xml_error_generic, e.message ?: "")))
- }
- }
-
- fun parseFromXml() {
- for ((view, map) in viewAttributeMap) {
- if (map.contains("android:id")) {
- addNewId(view, map.getValue("android:id"))
- }
- applyAttributes(view, map)
- }
- }
-
- fun processXml(xml: String, context: Context): ValidationResult {
- val result = validateXml(xml, context)
-
- if (result is ValidationResult.Success) {
- parseFromXml()
- } else if (result is ValidationResult.Error) {
- Log.e(TAG, "Failed to parse layout. Errors:\n${result.formattedMessage}")
- }
-
- return result
- }
-
- private fun parseFromXml(
- parser: XmlPullParser,
- context: Context,
- ) {
- while (parser.eventType != XmlPullParser.END_DOCUMENT) {
- when (parser.eventType) {
- XmlPullParser.START_TAG -> {
- val tagName = parser.name
-
- // Skip NavigationView to avoid invalid parent crash
- if (tagName == "com.google.android.material.navigation.NavigationView") {
- Log.w(
- TAG,
- "Skipping NavigationView tag to avoid drawer hierarchy crash",
- )
- parser.next()
- continue
- }
-
- var view: View? = null
-
- when (tagName) {
- "fragment" -> {
- val placeholder = FrameLayout(context).apply {
- id = View.generateViewId()
- layoutParams = ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT,
- )
- }
-
- val attrs = AttributeMap()
- for (i in 0 until parser.attributeCount) {
- attrs.putValue(parser.getAttributeName(i), parser.getAttributeValue(i))
- }
- attrs.putValue(MARKER_IS_FRAGMENT, "true")
-
- viewAttributeMap[placeholder] = attrs
- listViews.add(placeholder)
-
- parser.next()
- continue
- }
-
- "include" -> {
- val layoutAttr =
- XmlParserUtils.getAttribute(parser, "layout")
-
- val includedView = loadIncludedLayout(
- context,
- basePath,
- layoutAttr
- )
-
- val view =
- includedView ?: XmlParserUtils.createIncludePlaceholder(
- context,
- viewAttributeMap,
- MARKER_IS_INCLUDE
- )
-
- listViews.add(view)
-
- XmlParserUtils.applyAttributes(
- parser = parser,
- target = view,
- attributeMap = viewAttributeMap,
- marker = MARKER_IS_INCLUDE,
- skip = if (includedView != null) null else "layout"
- )
-
- parser.next()
- continue
- }
-
- "merge" -> {
-
- val wrapper =
- XmlParserUtils.createMergeWrapper(context)
-
- applyMergeAttributes(
- parser = parser,
- target = wrapper,
- attributeMap = viewAttributeMap,
- marker = MARKER_IS_MERGE
- )
-
- listViews.add(wrapper)
- }
-
- else -> {
- val result = createView(tagName, context)
- if (result is Exception) {
- throw result
- } else {
- view = result as? View
- view?.let {
- if (listViews.isEmpty()) {
- it.layoutParams = ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.WRAP_CONTENT,
- ViewGroup.LayoutParams.WRAP_CONTENT,
- )
- }
- listViews.add(it)
- }
- }
- }
- }
-
- if (view != null) {
- val map = AttributeMap()
- for (i in 0 until parser.attributeCount) {
- val fullName = parser.getAttributeName(i)
- val value = parser.getAttributeValue(i)
- map.putValue(fullName, value)
- }
- viewAttributeMap[view] = map
- }
- }
-
- /**
- * This method is responsible for:
- * 1) Finding ViewGroups.(that's why we are looking for end tag)
- * 2) Adding view to ViewGroup as a child.(viewGroup.addView)
- * 3) Removing the view that was added to it's parent from the list. As it is now stored in the parent,
- * and we do not need it in the list anymore.
- * END_TAG event is triggered when we reach the end of each ViewGroup. Top to bottom. Root ViewGroup is
- * triggered last.
- *
- * * Min XML depth for this scenario is 2. File = 0 -> ViewGroup = 1 -> View = 2
- *
- * Therefore we are not interested in anything with depth < 2.
- *
- * Let's assume depth is 3. File -> LinearLayout -> ConstraintLayout -> View
- * depth - 2 = 1. This will bring us to the correct parent.
- * depth - 1 = 1. This will bring us to correct child.
- *
- * After adding View to ConstraintLayout, View is removed from the listViews and is considered finished.
- * This process will repeat until all Views and ViewGroups will be added to corresponding parents and list
- * view will become empty.
- */
-
- XmlPullParser.END_TAG -> run {
- val depth = parser.depth
- if (depth < 2 || listViews.size < 2) return@run
-
- val parent = listViews.getOrNull(depth - 2) as? ViewGroup ?: return@run
- val child = listViews.getOrNull(depth - 1) ?: return@run
-
- parent.tryAddChild(child)
- listViews.removeAt(depth - 1)
- }
- }
- parser.next()
- }
-
- root?.let {
- restorePositionsAfterLoad(it, viewAttributeMap)
- }
- }
-
- private fun ViewGroup.tryAddChild(child: View) {
- if (isSingleChildContainer() && isNotEmpty()) {
- val errorMsg = context.getString(
- R.string.xml_error_single_child_container,
- this::class.simpleName
- )
- Log.w(TAG, errorMsg)
- validationErrors.add(errorMsg)
- viewAttributeMap.remove(child)
- return
- }
-
- runCatching {
- addView(child)
- }.onFailure { e ->
- val errorMsg = context.getString(
- R.string.xml_error_add_child_failed,
- child::class.simpleName,
- this::class.simpleName
- )
- Log.e(TAG, errorMsg, e)
- validationErrors.add(errorMsg)
- viewAttributeMap.remove(child)
- }
- }
-
- private fun ViewGroup.isSingleChildContainer(): Boolean {
- return this is ScrollView || this is HorizontalScrollView || this is NestedScrollView
- }
-
- private fun applyInitialPosition(target: View, attrs: AttributeMap) {
- if (attrs.contains("android:layout_marginStart")) return
-
- val initialPosition = attrs.getValue(ATTR_INITIAL_POS)
- if (shouldCenter(initialPosition, target)) {
- applyBaseCenterConstraints(target, attrs)
- centerAfterLayout(target, attrs)
- }
- }
-
- private fun applyCustomAttributes(
- target: View,
- attributeMap: AttributeMap
- ) {
- CustomAttrs.entries.forEach { attr ->
- if (!attributeMap.contains(attr.key)) return@forEach
-
- when (attr) {
- CustomAttrs.INITIAL_POS ->
- applyInitialPosition(target, attributeMap)
- }
- }
- }
-
- private fun applyAttributes(
- target: View,
- attributeMap: AttributeMap,
- ) {
- val allAttrs = initializer.getAllAttributesForView(target)
-
- val keys = attributeMap.keySet()
-
- applyCustomAttributes(target, attributeMap)
-
- for (i in keys.indices.reversed()) {
- val key = keys[i]
-
- if (key == "android:id") {
- continue
- }
-
- val attr = initializer.getAttributeFromKey(key, allAttrs)
- if (attr == null) {
- Log.w(
- TAG,
- "Could not find attribute $key for view ${target.javaClass.simpleName}",
- )
- continue
- }
-
- val methodName = attr[Constants.KEY_METHOD_NAME].toString()
- val className = attr[Constants.KEY_CLASS_NAME].toString()
- val value = attributeMap.getValue(key)
-
- Log.d(TAG, "Applying attribute $key to view $target with value $value")
- invokeMethod(methodName, className, target, value, target.context)
- }
- }
-
- private fun shouldCenter(initialPosition: String?, target: View): Boolean {
- return initialPosition == "center" && target.parent is ConstraintLayout
- }
-
- private fun applyBaseCenterConstraints(
- target: View,
- attributeMap: AttributeMap
- ) {
- val params = (target.layoutParams as? ConstraintLayout.LayoutParams) ?: return
-
- params.apply {
- startToStart = ConstraintLayout.LayoutParams.PARENT_ID
- topToTop = ConstraintLayout.LayoutParams.PARENT_ID
- endToEnd = ConstraintLayout.LayoutParams.UNSET
- bottomToBottom = ConstraintLayout.LayoutParams.UNSET
- setMargins(0, 0, 0, 0)
- }
- target.layoutParams = params
-
- attributeMap.apply {
- putValue("app:layout_constraintStart_toStartOf", "parent")
- putValue("app:layout_constraintTop_toTopOf", "parent")
-
- removeValue("app:layout_constraintEnd_toEndOf")
- removeValue("app:layout_constraintBottom_toBottomOf")
- removeValue("app:layout_constraintHorizontal_bias")
- removeValue("app:layout_constraintVertical_bias")
- }
- }
-
- private fun centerAfterLayout(
- target: View,
- attributeMap: AttributeMap
- ) {
- target.post {
- val parent = target.parent as View
- if (parent.width <= 0 || parent.height <= 0) return@post
-
- val centeredX = (parent.width - target.width) / 2
- val centeredY = (parent.height - target.height) / 2
-
- val layoutParams = (target.layoutParams as? ConstraintLayout.LayoutParams) ?: return@post
-
- layoutParams.apply {
- marginStart = centeredX
- topMargin = centeredY
- }.also { target.layoutParams = it }
-
- val density = target.resources.displayMetrics.density
- val startDp = (centeredX / density).toInt()
- val topDp = (centeredY / density).toInt()
-
- attributeMap.putValue("android:layout_marginStart", "${startDp}dp")
- attributeMap.putValue("android:layout_marginTop", "${topDp}dp")
- }
- }
-
- fun loadIncludedLayout(
- context: Context,
- basePath: String?,
- layoutAttr: String?
- ): View? {
- if (layoutAttr == null || basePath == null) {
- Log.w(
- TAG,
- "Skipping include. layoutAttr=$layoutAttr basePath=$basePath"
- )
- return null
- }
-
- val layoutName = layoutAttr.substringAfterLast("/")
- val file = File(basePath, "$layoutName.xml")
-
- if (!file.exists()) {
- Log.e(
- TAG,
- "Included file not found: ${file.absolutePath}"
- )
- return null
- }
-
- return try {
- val xml = file.readText()
-
- val converted = ConvertImportedXml(xml).getXmlConverted(context) ?: xml
-
- val parser = XmlLayoutParser(context, basePath, false)
-
- val result = parser.processXml(converted, context)
- if (result is ValidationResult.Error) {
- Log.e(TAG, "Included layout has errors: ${result.formattedMessage}")
- return null
- }
-
- parser.root
- } catch (e: Exception) {
- Log.e(
- TAG,
- "Failed to parse include: $layoutName",
- e
- )
- null
- }
- }
-
- fun applyMergeAttributes(
- parser: XmlPullParser,
- target: View,
- attributeMap: MutableMap,
- marker: String
- ) {
- val map = XmlParserUtils.extractAttributes(parser)
-
- map.putValue(marker, "true")
- map.putValue("android:layout_width", "match_parent")
- map.putValue("android:layout_height", "wrap_content")
-
- attributeMap[target] = map
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ArgumentUtil.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ArgumentUtil.kt
deleted file mode 100644
index 03e6f291dd..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ArgumentUtil.kt
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import java.util.regex.Pattern
-
-/** This class holds all utility methods related to arguments */
-object ArgumentUtil {
- /** Default color value */
- const val COLOR = "color"
-
- /** Default drawable value */
- const val DRAWABLE = "drawable"
- const val STRING = "string"
-
- /** Map used to store the patterns of color and drawable */
- val patterns = HashMap()
-
- init {
- patterns[COLOR] = "#[a-fA-F0-9]{6,8}"
- patterns[DRAWABLE] = "@drawable/.*"
- patterns[STRING] = "@string/.*"
- }
-
- /**
- * Method to parse the type of the value from given list of variants
- *
- * @param value The value to be parsed
- * @param variants The list of variants from which type should be parsed
- * @return The type of the value
- */
- @JvmStatic
- fun parseType(value: String?, variants: Array): String {
- for (variant in variants) {
- if (patterns.containsKey(variant)) if (Pattern.matches(
- patterns[variant], value
- )
- ) return variant
- }
- return "text"
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/BitmapUtil.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/BitmapUtil.kt
deleted file mode 100644
index f28bee1a63..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/BitmapUtil.kt
+++ /dev/null
@@ -1,249 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.content.Context
-import android.graphics.Bitmap
-import android.graphics.Bitmap.Config.ARGB_8888
-import android.graphics.BitmapFactory
-import android.graphics.Canvas
-import android.graphics.Color
-import android.graphics.drawable.AdaptiveIconDrawable
-import android.graphics.drawable.BitmapDrawable
-import android.graphics.drawable.ColorDrawable
-import android.graphics.drawable.Drawable
-import android.net.Uri
-import android.view.View
-import android.widget.ImageView
-import android.widget.TextView
-import androidx.cardview.widget.CardView
-import androidx.core.content.ContextCompat
-import androidx.core.graphics.ColorUtils
-import androidx.palette.graphics.Palette
-import java.io.IOException
-
-/** Utility class for manipulating bitmaps */
-object BitmapUtil {
- /**
- * Sets a tint on an [ImageView] according to the background color of a [View]
- *
- * @param imageView the ImageView whose tint will be set
- * @param background the view whose background color will be used to determine the tint
- */
- @JvmStatic
- fun setImageTintAccordingToBackground(imageView: ImageView, background: View) {
- // Check if the background View is a CardView
- val backgroundColor: Int = if (background is CardView) {
- // Get the color from the CardView
- background.cardBackgroundColor.defaultColor
- // Check if the background View is a ColorDrawable
- } else if (background.background is ColorDrawable) {
- (background.background as ColorDrawable).color
- } else {
- // Throw an exception if the background View is not a ColorDrawable
- throw IllegalArgumentException("Background must be a ColorDrawable")
- }
-
- // Calculate the luminance from the background color
- val luminance = ColorUtils.calculateLuminance(backgroundColor)
- // Set the image color to black or white depending on the luminance
- if (luminance >= 0.5) {
- imageView.setColorFilter(Color.BLACK)
- } else {
- imageView.setColorFilter(Color.WHITE)
- }
- }
-
- /**
- * Sets a background color on a [View] according to an [ImageView]
- *
- * @param context the context
- * @param view the view whose background color will be set
- * @param image the ImageView whose color will be used to determine the background color
- */
- fun setBackgroundAccordingToImage(context: Context?, view: View, image: ImageView) {
- val drawable = image.drawable
- setBackgroundAccordingToImage(context, view, drawable)
- }
-
- /**
- * Inverts a color by subtracting each color channel from 255
- *
- * @param color the color to invert
- * @return the inverted color
- */
- fun invertColor(color: Int): Int {
- val r = Color.red(color)
- val g = Color.green(color)
- val b = Color.blue(color)
- return Color.rgb(255 - r, 255 - g, 255 - b)
- }
-
- /**
- * Sets the text color of the TextView according to the background color provided.
- *
- * @param background The background color to use to determine the text color.
- * @param textView The TextView whose text color needs to be set.
- */
- @JvmStatic
- fun setTextColorAccordingToBackground(background: View, textView: TextView) {
- val backgroundColor: Int = if (background is CardView) {
- // Get the color from the CardView
- background.cardBackgroundColor.defaultColor
- } else if (background.background is ColorDrawable) {
- (background.background as ColorDrawable).color
- } else {
- // Throw an exception if the background View is not a ColorDrawable
- throw IllegalArgumentException("Background must be a ColorDrawable")
- }
-
- // Calculate the luminance from the background color
- val luminance = ColorUtils.calculateLuminance(backgroundColor)
- // Set the text color to black or white depending on the luminance
- if (luminance >= 0.5) {
- textView.setTextColor(Color.BLACK)
- } else {
- textView.setTextColor(Color.WHITE)
- }
- }
-
- @JvmStatic
- fun getLuminance(view: View): Double {
- val backgroundColor: Int = if (view is CardView) {
- // Get the color from the CardView
- view.cardBackgroundColor.defaultColor
- } else if (view.background is ColorDrawable) {
- (view.background as ColorDrawable).color
- } else {
- // Throw an exception if the background View is not a ColorDrawable
- throw IllegalArgumentException("Background must be a ColorDrawable")
- }
-
- // Calculate the luminance from the background color
- return ColorUtils.calculateLuminance(backgroundColor)
- }
-
- /**
- * Merges two bitmaps into a single bitmap
- *
- * @param background the background bitmap
- * @param foreground the foreground bitmap
- * @return the merged bitmap
- */
- fun mergeBitmaps(background: Bitmap, foreground: Bitmap): Bitmap? {
- // Create a new Bitmap with the width and height of the background
- val width = background.width
- val height = background.height
- val mergedBitmap = background.config?.let { Bitmap.createBitmap(width, height, it) }
-
- // Create a Canvas object with the new Bitmap
- val canvas = mergedBitmap?.let {
- Canvas(it).apply {
- // Draw the background on the Canvas
- drawBitmap(background, 0f, 0f, null)
-
- // Draw the foreground on the Canvas in the center of the background
- drawBitmap(
- foreground,
- ((width - foreground.width) / 2).toFloat(),
- ((height - foreground.height) / 2).toFloat(),
- null
- )
- }
- }
-
- // Return the merged Bitmap
- return mergedBitmap
- }
-
- /**
- * Sets a background color on a [View] according to a [Drawable]
- *
- * @param context the context
- * @param view the view whose background color will be set
- * @param drawable the Drawable whose color will be used to determine the background color
- */
- fun setBackgroundAccordingToImage(context: Context?, view: View, drawable: Drawable?) {
- // Check the drawable type
- val bitmap: Bitmap? = when (drawable) {
- is BitmapDrawable -> {
- // Get the bitmap from the BitmapDrawable
- drawable.bitmap
- }
-
- is AdaptiveIconDrawable -> {
- // Get the background and foreground drawables from the AdaptiveIconDrawable
- val backgroundDr = drawable.background
- val foregroundDr = drawable.foreground
- // Get the bitmaps from the drawables
- val background = (backgroundDr as BitmapDrawable).bitmap
- val foreground = (foregroundDr as BitmapDrawable).bitmap
- // Merge the bitmaps
- mergeBitmaps(background, foreground)
- }
-
- else -> {
- // Handle other drawable types as needed
- return
- }
- }
-
- // Generate a palette from the bitmap
- bitmap?: return
- val palette = Palette.from(bitmap).generate()
-
- // Get the background color from the palette
- val backgroundColor: Int = when {
- palette.getDarkVibrantColor(0) != 0 -> {
- palette.getDarkVibrantColor(0)
- }
-
- palette.getDarkMutedColor(0) != 0 -> {
- palette.getDarkMutedColor(0)
- }
-
- palette.getLightVibrantColor(0) != 0 -> {
- palette.getLightVibrantColor(0)
- }
-
- palette.getLightMutedColor(0) != 0 -> {
- palette.getLightMutedColor(0)
- }
-
- palette.getVibrantColor(0) != 0 -> {
- palette.getVibrantColor(0)
- }
-
- palette.getMutedColor(0) != 0 -> {
- palette.getMutedColor(0)
- }
-
- else -> {
- ContextCompat.getColor(context!!, android.R.color.white)
- }
- }
-
- // Set the background color of the view
- if (view is CardView) {
- view.setCardBackgroundColor(backgroundColor)
- } else {
- view.setBackgroundColor(backgroundColor)
- }
- }
-
- @JvmStatic
- fun createBitmapFromView(view: View): Bitmap {
- val bitmap = Bitmap.createBitmap(view.width, view.height, ARGB_8888)
- val canvas = Canvas(bitmap)
- view.draw(canvas)
- return bitmap
- }
-
- @Throws(IOException::class)
- fun loadBitmapFromUri(context: Context, uri: Uri): Bitmap? {
- val inputStream = context.contentResolver.openInputStream(uri)
- val options = BitmapFactory.Options()
- options.inPreferredConfig = ARGB_8888
- val bitmap = BitmapFactory.decodeStream(inputStream, null, options)
- inputStream!!.close()
- return bitmap
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Constants.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Constants.kt
deleted file mode 100644
index 2d58be84d5..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Constants.kt
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.graphics.Color
-import android.graphics.Typeface
-import android.os.Build
-import android.text.InputType
-import android.view.Gravity
-import android.view.View
-
-object Constants {
- const val CURRENT_LAYOUT: String = "currentLayout"
- const val CURRENT_LAYOUT_DESIGN: String = "currentLayoutDesign"
- const val ATTR_INITIAL_POS = "tools:layout_initialPosition"
-
- @JvmField
- val gravityMap = HashMap()
- @JvmField
- val inputTypes = HashMap()
- @JvmField
- val imeOptions = HashMap()
- @JvmField
- val visibilityMap = HashMap()
- @JvmField
- val textStyleMap = HashMap()
- const val ATTRIBUTES_FILE = "attributes/attributes.json"
- const val PARENT_ATTRIBUTES_FILE = "attributes/parent_attributes.json"
- const val PALETTE_COMMON = "palette/common.json"
- const val PALETTE_TEXT = "palette/text.json"
- const val PALETTE_BUTTONS = "palette/buttons.json"
- const val PALETTE_WIDGETS = "palette/widgets.json"
- const val PALETTE_LAYOUTS = "palette/layouts.json"
- const val PALETTE_CONTAINERS = "palette/containers.json"
- const val TAB_TITLE_VIEWS = "Views"
- const val TAB_TITLE_ANDROIDX = "AndroidX"
- const val TAB_TITLE_MATERIAL = "Material Design"
- const val TAB_TITLE_COMMON = "Common"
- const val TAB_TITLE_TEXT = "Text"
- const val TAB_TITLE_BUTTONS = "Buttons"
- const val TAB_TITLE_WIDGETS = "Widgets"
- const val TAB_TITLE_LAYOUTS = "Layouts"
- const val TAB_TITLE_CONTAINERS = "Containers"
- const val TAB_TITLE_GOOGLE = "Google"
- const val TAB_TITLE_LEGACY = "Legacy"
- const val KEY_ATTRIBUTE_NAME = "attributeName"
- const val KEY_CLASS_NAME = "className"
- const val KEY_METHOD_NAME = "methodName"
- const val KEY_ARGUMENT_TYPE = "argumentType"
- const val KEY_CAN_DELETE = "canDelete"
- const val KEY_CONSTANT = "constant"
- const val KEY_DEFAULT_VALUE = "defaultValue"
- const val KEY_DEFAULT_ATTRS = "defaultAttributes"
- const val ARGUMENT_TYPE_SIZE = "size"
- const val ARGUMENT_TYPE_DIMENSION = "dimension"
- const val ARGUMENT_TYPE_ID = "id"
- const val ARGUMENT_TYPE_VIEW = "view"
- const val ARGUMENT_TYPE_BOOLEAN = "boolean"
- const val ARGUMENT_TYPE_DRAWABLE = "drawable"
- const val ARGUMENT_TYPE_STRING = "string"
- const val ARGUMENT_TYPE_TEXT = "text"
- const val ARGUMENT_TYPE_INT = "int"
- const val ARGUMENT_TYPE_FLOAT = "float"
- const val ARGUMENT_TYPE_FLAG = "flag"
- const val ARGUMENT_TYPE_ENUM = "enum"
- const val ARGUMENT_TYPE_COLOR = "color"
- const val BLUEPRINT_DASH_COLOR = Color.WHITE
- @JvmField
- val BLUEPRINT_BACKGROUND_COLOR = Color.parseColor("#235C6F")
- @JvmField
- val DESIGN_DASH_COLOR = Color.parseColor("#1689F6")
- const val DESIGN_BACKGROUND_COLOR = Color.WHITE
- const val GITHUB_URL = "https://github.com/itsvks19/LayoutEditor"
- const val EXTRA_KEY_PROJECT = "project"
- const val EXTRA_KEY_LAYOUT = "layout"
-
- //Path and project keys when passed with intend from beyound
- const val EXTRA_KEY_FILE_PATH = "EXTRA_KEY_FILE_PATH"
- const val EXTRA_KEY_LAYOUT_FILE_NAME = "EXTRA_KEY_LAYOUT_FILE_NAME"
-
- init {
- gravityMap["left"] = Gravity.START
- gravityMap["right"] = Gravity.END
- gravityMap["top"] = Gravity.TOP
- gravityMap["bottom"] = Gravity.BOTTOM
- gravityMap["center"] = Gravity.CENTER
- gravityMap["center_horizontal"] = Gravity.CENTER_HORIZONTAL
- gravityMap["center_vertical"] = Gravity.CENTER_VERTICAL
- gravityMap["fill"] = Gravity.FILL
- gravityMap["fill_horizontal"] = Gravity.FILL_HORIZONTAL
- gravityMap["fill_vertical"] = Gravity.FILL_VERTICAL
- gravityMap["clip_horizontal"] = Gravity.CLIP_HORIZONTAL
- gravityMap["clip_vertical"] = Gravity.CLIP_VERTICAL
- gravityMap["start"] = Gravity.START
- gravityMap["end"] = Gravity.END
-
- inputTypes["date"] =
- InputType.TYPE_DATETIME_VARIATION_DATE
- inputTypes["datetime"] = InputType.TYPE_CLASS_DATETIME
- inputTypes["none"] = InputType.TYPE_NULL
- inputTypes["number"] = InputType.TYPE_CLASS_NUMBER
- inputTypes["numberDecimal"] = InputType.TYPE_NUMBER_FLAG_DECIMAL
- inputTypes["numberSigned"] =
- InputType.TYPE_NUMBER_FLAG_SIGNED
- inputTypes["numberPassword"] =
- InputType.TYPE_NUMBER_VARIATION_PASSWORD
- inputTypes["phone"] = InputType.TYPE_CLASS_PHONE
- inputTypes["text"] = InputType.TYPE_CLASS_TEXT
- inputTypes["textAutoComplete"] =
- InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE
- inputTypes["textAutoCorrect"] =
- InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
- inputTypes["textCapCharacters"] =
- InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS
- inputTypes["textCapSentences"] = InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
- inputTypes["textCapWords"] = InputType.TYPE_TEXT_FLAG_CAP_WORDS
- inputTypes["textEmailAddress"] = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
- inputTypes["textEmailSubject"] = InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT
- inputTypes["textFilter"] =
- InputType.TYPE_TEXT_VARIATION_FILTER
- inputTypes["textImeMultiLine"] = InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE
- inputTypes["textLongMessage"] = InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE
- inputTypes["textMultiLine"] =
- InputType.TYPE_TEXT_FLAG_MULTI_LINE
- inputTypes["textNoSuggestions"] =
- InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
- inputTypes["textPassword"] =
- InputType.TYPE_TEXT_VARIATION_PASSWORD
- inputTypes["textPersonName"] = InputType.TYPE_TEXT_VARIATION_PERSON_NAME
- inputTypes["textPhonetic"] =
- InputType.TYPE_TEXT_VARIATION_PHONETIC
- inputTypes["textPostalAddress"] = InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS
- inputTypes["textShortMessage"] = InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE
- inputTypes["textUri"] =
- InputType.TYPE_TEXT_VARIATION_URI
- inputTypes["textVisiblePassword"] = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
- inputTypes["textWebEditText"] =
- InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT
- inputTypes["textWebEmailAddress"] =
- InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS
- inputTypes["textWebPassword"] =
- InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD
- inputTypes["time"] =
- InputType.TYPE_DATETIME_VARIATION_TIME
-
- // Add Tiramisu-specific input types conditionally
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
- inputTypes["textEnableTextConversionSuggestions"] =
- InputType.TYPE_TEXT_FLAG_ENABLE_TEXT_CONVERSION_SUGGESTIONS
- }
-
- visibilityMap["visible"] = View.VISIBLE
- visibilityMap["invisible"] = View.INVISIBLE
- visibilityMap["gone"] = View.GONE
-
- textStyleMap["normal"] = Typeface.NORMAL
- textStyleMap["bold"] = Typeface.BOLD
- textStyleMap["italic"] = Typeface.ITALIC
- textStyleMap["bold|italic"] = Typeface.BOLD_ITALIC
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/DimensionUtil.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/DimensionUtil.kt
deleted file mode 100644
index 9b25ac791e..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/DimensionUtil.kt
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.content.Context
-import android.util.TypedValue
-import android.view.ViewGroup
-import java.util.regex.Pattern
-
-/**
- * This class is used to perform Dimension Utility operations.
- */
-object DimensionUtil {
- /**
- * Constant variable for Dimension Unit type DP
- */
- const val DP: String = "dp"
-
- /**
- * Constant variable for Dimension Unit type SP
- */
- const val SP: String = "sp"
-
- /**
- * A map containing dimension unit type and its related integer value
- */
- private val dimensMap = HashMap()
-
- // Initializing dimensMap with Dimension Unit type and its related integer value
- init {
- dimensMap[DP] = TypedValue.COMPLEX_UNIT_DIP
- dimensMap[SP] = TypedValue.COMPLEX_UNIT_SP
- }
-
- /**
- * Pattern for matching Dimension Unit type
- */
- private val pattern: Pattern = Pattern.compile("dp|sp")
-
- /**
- * Method to parse the input string and return the related dimension value
- *
- * @param input string for parsing
- * @param contxt context
- * @return dimension value
- */
- @JvmStatic
- fun parse(input: String, contxt: Context): Float {
- when (input) {
- "match_parent" -> return ViewGroup.LayoutParams.MATCH_PARENT.toFloat()
- "wrap_content" -> return ViewGroup.LayoutParams.WRAP_CONTENT.toFloat()
- else -> {
- val matcher = pattern.matcher(input)
- var dimen = DP
-
- // Finding dimension unit type from input string
- while (matcher.find()) {
- dimen = input.substring(matcher.start(), matcher.end())
- }
-
- // Getting dimension number from input string
- val number = input.substring(0, input.lastIndexOf(dimen)).toFloat()
-
-
- // Returning calculated dimension value
- return TypedValue.applyDimension(
- dimensMap[dimen]!!, number, contxt.resources.displayMetrics
- )
- }
- }
- }
-
- /**
- * Method to get the dimension value without the suffix, i.e Dimension Unit type
- *
- * @param input string for parsing
- * @return dimension value without suffix
- */
- @JvmStatic
- fun getDimenWithoutSuffix(input: String): String = when {
- input.endsWith(DP) -> input.removeSuffix(DP)
- input.endsWith(SP) -> input.removeSuffix(SP)
- else -> input
- }
-
- /**
- * Method to get the dimension value in DIP
- *
- * @param value dimension number
- * @param ctx context
- * @return dimension value in DIP
- */
- fun getDip(value: Float, ctx: Context): Float {
- return TypedValue.applyDimension(
- TypedValue.COMPLEX_UNIT_DIP, value, ctx.resources.displayMetrics
- )
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileCreator.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileCreator.kt
deleted file mode 100644
index 7d4838f1e5..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileCreator.kt
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.net.Uri
-import androidx.activity.result.ActivityResultLauncher
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.appcompat.app.AppCompatActivity
-
-/**
- * FileCreator Class is used to create a file with given name and MIME Type.
- */
-abstract class FileCreator(actvty: AppCompatActivity) {
- /** To create a file */
- private val createFile: ActivityResultLauncher
-
- /** MIME Type of file */
- private var mimeType = "*/*"
-
- /**
- * Constructor of class
- *
- * @param actvty Instance of AppCompatActivity
- */
- init {
- // Set MIME type
- // Register activity result for CreateDocument
- this.createFile =
- actvty.registerForActivityResult(
- ActivityResultContracts.CreateDocument(mimeType)
- ) { onCreateFile(it) }
- }
-
- /**
- * Abstract method onCreateFile to call on result
- */
- abstract fun onCreateFile(uri: Uri)
-
- /**
- * Method to create file
- *
- * @param fileName The name of the file
- * @param mimeType The MIME type of the file
- */
- fun create(fileName: String, mimeType: String) {
- this.mimeType = mimeType // Set MIME type
- createFile.launch(fileName) // Launch file
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FilePicker.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FilePicker.kt
deleted file mode 100644
index 2a6034c699..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FilePicker.kt
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.Manifest
-import android.content.pm.PackageManager
-import android.net.Uri
-import androidx.activity.result.ActivityResultLauncher
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.appcompat.app.AppCompatActivity
-import org.appdevforall.codeonthego.layouteditor.LayoutEditor.Companion.instance
-import org.appdevforall.codeonthego.layouteditor.R
-import org.appdevforall.codeonthego.layouteditor.utils.SBUtils.Companion.make
-
-/**
- * Class for FilePicker
- */
-abstract class FilePicker(private val actvty: AppCompatActivity) {
- private val getFile: ActivityResultLauncher
- private val reqPermission: ActivityResultLauncher
-
- /**
- * Constructor for FilePicker, takes in an AppCompatActivity as a parameter
- *
- * @param actvty AppCompatActivity instance
- */
- init {
- // Create an instance of ActivityResultContracts.GetContent and register it with actvty
- // when the result is returned, call the onPickFile method with the returned uri
- this.getFile =
- actvty.registerForActivityResult(
- ActivityResultContracts.GetContent()
- ) { onPickFile(it) }
-
- // Create an instance of ActivityResultContracts.RequestPermission and register it with actvty
- // when the result is returned, call the onRequestPermission method with the granted boolean
- this.reqPermission =
- actvty.registerForActivityResult(
- ActivityResultContracts.RequestPermission()
- ) { onRequestPermission(it) }
- }
-
- private fun onRequestPermission(isGranted: Boolean) {
- if (isGranted) make(actvty.findViewById(android.R.id.content), R.string.permission_granted)
- .setSlideAnimation()
- .showAsSuccess()
- else make(actvty.findViewById(android.R.id.content), R.string.permission_denied)
- .setSlideAnimation()
- .showAsError()
- }
-
- /**
- * Abstract method called onPickFile, takes in a Nullable Uri as a parameter
- *
- * @param uri Nullable Uri
- */
- abstract fun onPickFile(uri: Uri?)
-
- /**
- * Method launch, takes in a String MIME type as a parameter
- */
- fun launch(mimeType: String) {
- checkPermissions(mimeType)
- // If the app has the permission, launch the getFile instance
- getFile.launch(mimeType)
- }
-
- private fun checkPermissions(mimeType: String) {
- val isImageType =
- mimeType == "image/*" || mimeType == "image/png" || mimeType == "image/jpg" || mimeType == "image/jpeg"
-
- if (isImageType) {
- if (instance!!.isAtLeastTiramisu) {
- if (actvty.checkSelfPermission(Manifest.permission.READ_MEDIA_IMAGES)
- == PackageManager.PERMISSION_DENIED
- ) {
- reqPermission.launch(Manifest.permission.READ_MEDIA_IMAGES)
- }
- } else if (actvty.checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
- == PackageManager.PERMISSION_DENIED
- ) {
- reqPermission.launch(Manifest.permission.READ_EXTERNAL_STORAGE)
- }
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileUtil.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileUtil.kt
deleted file mode 100644
index 4ea5ea8980..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/FileUtil.kt
+++ /dev/null
@@ -1,682 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.annotation.SuppressLint
-import android.content.ContentResolver
-import android.content.Context
-import android.net.Uri
-import android.os.Environment
-import android.provider.DocumentsContract
-import android.provider.MediaStore
-import android.text.TextUtils
-import com.blankj.utilcode.util.ToastUtils
-import com.itsaky.androidide.eventbus.events.editor.ReportCaughtExceptionEvent
-import org.appdevforall.codeonthego.layouteditor.LayoutEditor.Companion.instance
-import org.greenrobot.eventbus.EventBus
-import java.io.BufferedReader
-import java.io.ByteArrayOutputStream
-import java.io.File
-import java.io.FileInputStream
-import java.io.FileOutputStream
-import java.io.FileReader
-import java.io.FileWriter
-import java.io.IOException
-import java.io.InputStream
-import java.io.InputStreamReader
-import java.io.OutputStream
-import java.net.URLDecoder
-import java.nio.file.Files
-import java.nio.file.Paths
-
-private const val BUFFER_SIZE = 1024
-
-object FileUtil {
- fun readFromUri(uri: Uri, context: Context): String? {
- try {
- val inputStream = context.contentResolver.openInputStream(uri)
-
- // Creates a BufferedReader to read the contents of the InputStream
- val reader = BufferedReader(InputStreamReader(inputStream))
-
- // Creates a StringBuilder to store the file's contents
- val sb = StringBuilder()
- var line: String?
-
- // Reads each line from the file and adds it to StringBuilder
- while ((reader.readLine().also { line = it }) != null) {
- sb.append(line)
- }
-
- // Closes the InputStream and the BufferedReader
- inputStream!!.close()
- reader.close()
-
- // Returns the string containing the content of the XML file
- return sb.toString()
- } catch (e: Exception) {
- e.printStackTrace()
- }
-
- return null
- }
-
- @JvmStatic
- fun copyFile(uri: Uri, destinationPath: String, context: Context): Boolean {
- var inputStream: InputStream? = null
- var outputStream: OutputStream? = null
-
- try {
- inputStream = context.contentResolver.openInputStream(uri)
- outputStream = FileOutputStream(File(destinationPath))
-
- val buffer = ByteArray(BUFFER_SIZE)
- var length: Int
-
- while ((inputStream!!.read(buffer).also { length = it }) > 0) {
- outputStream.write(buffer, 0, length)
- }
-
- return true
- } catch (e: IOException) {
- e.printStackTrace()
- ToastUtils.showLong(e.toString())
-
- EventBus.getDefault().post(
- ReportCaughtExceptionEvent(
- throwable = e,
- message = "copyFile failed",
- extras = mapOf(
- "module" to "layouteditor",
- "where" to "utils.FileUtil.copyFile",
- "dest" to destinationPath,
- "uri" to uri.toString()
- )
- )
- )
-
- return false
- } finally {
- try {
- inputStream?.close()
- outputStream?.close()
- } catch (e: Exception) {
- e.printStackTrace()
- ToastUtils.showLong(e.toString())
- EventBus.getDefault().post(
- ReportCaughtExceptionEvent(
- throwable = e,
- message = "copyFile unexpected error",
- extras = mapOf(
- "module" to "layouteditor",
- "where" to "utils.FileUtil.copyFile",
- "dest" to destinationPath,
- "uri" to uri.toString()
- )
- ))
- }
- }
- }
-
- /**
- * Reads from an asset file and returns its content as a String.
- *
- * @param path The path to the asset file
- * @param ctx The context from which the asset should be read
- * @return The content of the asset file as a String
- */
- fun readFromAsset(path: String?, ctx: Context): String {
- try {
- // Get the input stream from the asset
- val inputStream = ctx.assets.open(path!!)
-
- // Create a byte array output stream to store the read bytes
- val outputStream = ByteArrayOutputStream()
-
- // Create a buffer of 1024 bytes
- val _buf = ByteArray(BUFFER_SIZE)
- var i: Int
-
- // Read the bytes from the input stream, write them to the output stream and close the streams
- while ((inputStream.read(_buf).also { i = it }) != -1) {
- outputStream.write(_buf, 0, i)
- }
- outputStream.close()
- inputStream.close()
-
- // Return the content of the output stream as a String
- return outputStream.toString()
- } catch (e: Exception) {
- e.printStackTrace()
- }
-
- // If an exception occurred, return an empty String
- return ""
- }
-
- /**
- * This method is used to copy file from assets folder to target path.
- *
- * @param filename - File name with extension to copy from assets folder.
- * @param outPath - Target path where you want to copy the file.
- */
- fun copyFileFromAsset(filename: String, outPath: String) {
- // Get asset manager instance from application context
- val assetManager = instance!!.context.assets
-
- // Create streams for read and write
- val `in`: InputStream
- val out: OutputStream
-
- try {
- // Create InputStream from assets folder
- `in` = assetManager.open(filename)
- // Create OutputStream to target path
- val newFileName = "$outPath/$filename"
- out = FileOutputStream(newFileName)
-
- // Buffer for read and write
- val buffer = ByteArray(BUFFER_SIZE)
- var read: Int
-
- // Read from InputStream and write to OutputStream
- while ((`in`.read(buffer).also { read = it }) != -1) {
- out.write(buffer, 0, read)
- }
-
- // Close input and output streams
- `in`.close()
- out.flush()
- out.close()
- } catch (e: IOException) {
- // Print exception stack trace
- e.printStackTrace()
- }
- }
-
- /**
- * Creates a new file in the specified directory path if it does not already exist
- *
- * @param path the directory path in which to create the new file
- */
- private fun createNewFile(path: String) {
- // Get the last index of the file separator
- val lastSep = path.lastIndexOf(File.separator)
- // If there is a path, call makeDir to create the directory
- if (lastSep > 0) {
- val dirPath = path.substring(0, lastSep)
- makeDir(dirPath)
- }
-
- // Create a new file in the specified path
- val file = File(path)
-
- try {
- // Only create the file if it does not already exist
- if (!file.exists()) file.createNewFile()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
-
- /**
- * Reads the contents of a file in the specified path
- *
- * @param path the directory path of the file to read
- * @return the contents of the file as a string
- */
- @JvmStatic
- fun readFile(path: String): String {
- // Create the file if it does not exist
- createNewFile(path)
-
- val sb = StringBuilder()
- var fr: FileReader? = null
- try {
- fr = FileReader(File(path))
-
- val buff = CharArray(BUFFER_SIZE)
- var length = 0
-
- // Read the contents of the file and append them to the StringBuilder
- while ((fr.read(buff).also { length = it }) > 0) {
- sb.append(String(buff, 0, length))
- }
- } catch (e: IOException) {
- e.printStackTrace()
- } finally {
- if (fr != null) {
- try {
- fr.close()
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
- }
-
- // Return the contents of the file
- return sb.toString()
- }
-
- /**
- * Method to write a file with the given path and string.
- *
- * @param path Path of the file to write.
- * @param str String to write in the file.
- */
- @JvmStatic
- fun writeFile(path: String, str: String?) {
- val filePath = Paths.get(path)
-
- try {
- filePath.parent?.let { Files.createDirectories(it) }
-
- FileWriter(filePath.toFile(), false).use { writer ->
- writer.write(str ?: "")
- }
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
-
- /**
- * Method to copy a file from source to destination.
- *
- * @param sourcePath Path of the file to copy from.
- * @param destPath Path of the file to copy to.
- */
- fun copyFile(sourcePath: String, destPath: String) {
- // Check if file exist in source path.
- if (isNotExistFile(sourcePath)) return
- // Create a new file in destination path.
- createNewFile(destPath)
-
- var fis: FileInputStream? = null
- var fos: FileOutputStream? = null
-
- try {
- // Create input and output stream objects.
- fis = FileInputStream(sourcePath)
- fos = FileOutputStream(destPath, false)
-
- val buff = ByteArray(BUFFER_SIZE)
- var length = 0
-
- // Read and write the bytes from source path to destination path.
- while ((fis.read(buff).also { length = it }) > 0) {
- fos.write(buff, 0, length)
- }
- } catch (e: IOException) {
- e.printStackTrace()
- } finally {
- // Close the input and output stream objects.
- if (fis != null) {
- try {
- fis.close()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- if (fos != null) {
- try {
- fos.close()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- }
- }
-
- @Throws(IOException::class)
- fun copyFile(`in`: InputStream, out: OutputStream) {
- val buffer = ByteArray(BUFFER_SIZE)
- var read: Int
- while ((`in`.read(buffer).also { read = it }) != -1) {
- out.write(buffer, 0, read)
- }
- }
-
- /**
- * copyDir() Copies a directory from one path to another
- *
- * @param oldPath the path of the directory to be copied
- * @param newPath the path of the directory to be created
- */
- fun copyDir(oldPath: String, newPath: String) {
- val oldFile = File(oldPath)
- val files = oldFile.listFiles()
- val newFile = File(newPath)
- if (!newFile.exists()) {
- newFile.mkdirs()
- }
- for (file in files!!) {
- if (file.isFile) {
- copyFile(file.path, newPath + "/" + file.name)
- } else if (file.isDirectory) {
- copyDir(file.path, newPath + "/" + file.name)
- }
- }
- }
-
- /**
- * moveFile() Moves a file from one path to another
- *
- * @param sourcePath the path of the file to be moved
- * @param destPath the path of the destination
- */
- fun moveFile(sourcePath: String, destPath: String) {
- copyFile(sourcePath, destPath)
- deleteFile(sourcePath)
- }
-
- /**
- * deleteFile() Deletes a file with the given path
- *
- * @param path the path of the file to be deleted
- */
- @JvmStatic
- fun deleteFile(path: String) {
- val file = File(path)
-
- if (!file.exists()) return
-
- if (file.isFile) {
- file.delete()
- return
- }
-
- val fileArr = file.listFiles()
-
- if (fileArr != null) {
- for (subFile in fileArr) {
- if (subFile.isDirectory) {
- deleteFile(subFile.absolutePath)
- }
-
- if (subFile.isFile) {
- subFile.delete()
- }
- }
- }
-
- file.delete()
- }
-
- /**
- * Checks if a file exists at the given path.
- *
- * @param path the path to check
- * @return true if the file exists, false otherwise
- */
- fun isNotExistFile(path: String): Boolean {
- val file = File(path)
- return !file.exists()
- }
-
- /**
- * Creates a directory at the given path, if it doesn't exist.
- *
- * @param path the path at which the directory should be created
- */
- fun makeDir(path: String) {
- if (isNotExistFile(path)) {
- val file = File(path)
- file.mkdirs()
- }
- }
-
- /**
- * Lists all the files in the given directory, and adds them to the given list.
- *
- * @param path the directory to list the files from
- * @param list the list to which the files should be added
- */
- fun listDir(path: String, list: ArrayList?) {
- val dir = File(path)
- if (!dir.exists() || dir.isFile) return
-
- val listFiles = dir.listFiles()
- if (listFiles == null || listFiles.isEmpty()) return
-
- if (list == null) return
- list.clear()
- for (file in listFiles) {
- list.add(file.absolutePath)
- }
- }
-
- /**
- * This method is used to convert the Uri to File Path.
- *
- * @param uri Uri of the file
- * @return Returns the File Path of Uri
- */
- @JvmStatic
- fun convertUriToFilePath(context: Context, uri: Uri): String {
- var path = ""
- // Check if the Uri is provided by documents contract
- if (DocumentsContract.isDocumentUri(context, uri)) {
- // Check if Uri is External Storage Document
- if (isExternalStorageDocument(uri)) {
- val docId = DocumentsContract.getDocumentId(uri)
- // Split the document Id into two parts
- val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
- val type = split[0]
-
- // Check if it is primary storage
- if ("primary".equals(type, ignoreCase = true)) {
- // Append the split[1] to Environment.getExternalStorageDirectory() to get File Path
- path = Environment.getExternalStorageDirectory().toString() + "/" + split[1]
- }
- } else if (isDownloadsDocument(uri)) {
- val id = DocumentsContract.getDocumentId(uri)
-
- // Check if the Id is empty
- if (!TextUtils.isEmpty(id)) {
- // Replace 'raw:' from Id to get File Path
- if (id.startsWith("raw:")) {
- return id.replaceFirst("raw:".toRegex(), "")
- }
- }
- } else if (isMediaDocument(uri)) {
- val docId = DocumentsContract.getDocumentId(uri)
- val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
- val type = split[0]
-
- var contentUri: Uri? = null
- // Check the type of Media
- when (type) {
- "image" -> {
- contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI
- }
- "video" -> {
- contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI
- }
- "audio" -> {
- contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI
- }
- }
-
- val selection = "_id=?"
- val selectionArgs = arrayOf(split[1])
-
- // Get Data Column from content Uri
- path = getDataColumn(contentUri, selection, selectionArgs, context).toString()
- }
- } else if (ContentResolver.SCHEME_CONTENT.equals(uri.scheme, ignoreCase = true)) {
- // Get Data Column from content Uri
- path = getDataColumn(uri, null, null, context).toString()
- } else if (ContentResolver.SCHEME_FILE.equals(uri.scheme, ignoreCase = true)) {
- // Get File Path from Uri
- path = uri.path.toString()
- }
-
- // Check if path is not empty
- return try {
- // Decode the File Path using 'UTF-8'
- URLDecoder.decode(path, "UTF-8")
- } catch (e: Exception) {
- null
- }.toString()
- }
-
- /**
- * This method is used to get the data column of a particular URI.
- *
- * @param uri The URI of the data column to be retrieved.
- * @param selection The selection argument for the query.
- * @param selectionArgs The selection arguments for the query.
- * @return The data column retrieved from the specified URI.
- */
- @SuppressLint("Recycle")
- private fun getDataColumn(uri: Uri?, selection: String?, selectionArgs: Array?, context: Context): String? {
- val column =
- MediaStore.Images.Media.DATA // Column name of the data column to be retrieved
- val projection = arrayOf(column) // Projection of the data column to be retrieved
-
- try {
- val cursor =
- context // Get the application context
- .contentResolver // Get the content resolver
- .query(uri!!, projection, selection, selectionArgs, null) // Query the content resolver
- if (cursor != null && cursor.moveToFirst()) {
- val column_index =
- cursor.getColumnIndexOrThrow(column) // Get the index of the data column
- return cursor.getString(column_index) // Return the data column
- }
- } catch (ignored: Exception) {
- }
- return null
- }
-
- /**
- * Checks whether the Uri authority is ExternalStorageProvider.
- *
- * @param uri The Uri to check.
- * @return Whether the Uri authority is ExternalStorageProvider.
- */
- fun isExternalStorageDocument(uri: Uri): Boolean {
- return "com.android.externalstorage.documents" == uri.authority
- }
-
- /**
- * Checks whether the Uri authority is DownloadsProvider.
- *
- * @param uri The Uri to check.
- * @return Whether the Uri authority is DownloadsProvider.
- */
- fun isDownloadsDocument(uri: Uri?): Boolean {
- if (uri != null) {
- return "com.android.providers.downloads.documents" == uri.authority
- }
- return false
- }
-
- /**
- * Checks whether the Uri authority is MediaProvider.
- *
- * @param uri The Uri to check.
- * @return Whether the Uri authority is MediaProvider.
- */
- fun isMediaDocument(uri: Uri): Boolean {
- return "com.android.providers.media.documents" == uri.authority
- }
-
- /**
- * Checks whether the file is a directory.
- *
- * @param path The path of the file.
- * @return Whether the file is a directory.
- */
- fun isDirectory(path: String): Boolean {
- if (isNotExistFile(path)) return false
- return File(path).isDirectory
- }
-
- /**
- * Checks whether the file is a file.
- *
- * @param path The path of the file.
- * @return Whether the file is a file.
- */
- fun isFile(path: String): Boolean {
- if (isNotExistFile(path)) return false
- return File(path).isFile
- }
-
- /**
- * Gets the file length.
- *
- * @param path The path of the file.
- * @return The file length.
- */
- fun getFileLength(path: String): Long {
- if (isNotExistFile(path)) return 0
- return File(path).length()
- }
-
- val externalStorageDir: String
- /**
- * Gets the absolute path of the external storage directory.
- *
- * @return The absolute path of the external storage directory.
- */
- get() = Environment.getExternalStorageDirectory().absolutePath
-
- /**
- * Gets the absolute path of the application-specific directory.
- *
- * @param ctx The application context.
- * @return The absolute path of the application-specific directory.
- */
- fun getPackageDataDir(ctx: Context): String {
- return ctx.getExternalFilesDir("")!!.absolutePath
- }
-
- /**
- * Gets the absolute path of the public directory.
- *
- * @param type The type of the public directory.
- * @return The absolute path of the public directory.
- */
- fun getPublicDir(type: String): String {
- return Environment.getExternalStoragePublicDirectory(type).absolutePath
- }
-
- /**
- * Gets the last segment from the path.
- *
- * @param path The path to get the last segment.
- * @return The last segment from the path.
- */
- @JvmStatic
- fun getLastSegmentFromPath(path: String): String {
- return path.substring(path.lastIndexOf("/") + 1)
- }
-
- /**
- * Saves the file with given Uri and data.
- *
- * @param uri URI of the file to be saved
- * @param data Data to be written in the file
- * @return boolean True if file is saved successfully, else false
- */
- fun saveFile(context: Context, uri: Uri, data: String): Boolean {
- try {
- // Open the file descriptor in read-write-truncate mode
- val pfd =
- context.contentResolver.openFileDescriptor(uri, "rwt")
- // Initialize file output stream with the file descriptor
- val fos = FileOutputStream(pfd!!.fileDescriptor)
- // Write the data in the file
- fos.write(data.toByteArray())
- // Close the output stream
- fos.close()
- // Close the file descriptor
- pfd.close()
- return true
- } catch (e: IOException) {
- // Print the stacktrace for the exception
- e.printStackTrace()
- return false
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/InvokeUtil.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/InvokeUtil.kt
deleted file mode 100644
index 543e600d41..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/InvokeUtil.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.content.Context
-import android.view.View
-import org.appdevforall.codeonthego.layouteditor.R.mipmap
-import java.lang.reflect.InvocationTargetException
-
-object InvokeUtil {
- @JvmStatic
- fun createView(className: String, context: Context): Any? {
- try {
- val clazz = Class.forName(className)
- val constructor = clazz.getConstructor(Context::class.java)
- return constructor.newInstance(context)
- } catch (e: ClassNotFoundException) {
- e.printStackTrace()
- } catch (e: NoSuchMethodException) {
- e.printStackTrace()
- } catch (e: InstantiationException) {
- e.printStackTrace()
- } catch (e: InvocationTargetException) {
- e.printStackTrace()
- } catch (e: IllegalAccessException) {
- e.printStackTrace()
- }
-
- return null
- }
-
- @JvmStatic
- fun invokeMethod(
- methodName: String, className: String, target: View, value: String, context: Context
- ) {
- try {
- val clazz = Class.forName("org.appdevforall.codeonthego.layouteditor.editor.callers.$className")
- val method =
- clazz.getMethod(methodName, View::class.java, String::class.java, Context::class.java)
- method.invoke(clazz, target, value, context)
- } catch (e: ClassNotFoundException) {
- e.printStackTrace()
- } catch (e: NoSuchMethodException) {
- e.printStackTrace()
- } catch (e: InvocationTargetException) {
- e.printStackTrace()
- } catch (e: IllegalAccessException) {
- e.printStackTrace()
- }
- }
-
- @JvmStatic
- fun getMipmapId(name: String): Int {
- try {
- val cls = mipmap::class.java
- val field = cls.getField(name)
- return field.getInt(cls)
- } catch (e: NoSuchFieldException) {
- e.printStackTrace()
- } catch (e: IllegalAccessException) {
- e.printStackTrace()
- }
-
- return 0
- }
-
- @JvmStatic
- fun getSuperClassName(clazz: String): String? {
- return try {
- Class.forName(clazz).superclass.name
- } catch (e: ClassNotFoundException) {
- null
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/LetExtension.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/LetExtension.kt
deleted file mode 100644
index 88d8c5bb99..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/LetExtension.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 .
- */
-
-package org.appdevforall.codeonthego.layouteditor.utils
-
-inline fun doubleArgSafeLet(p1: T1?, p2: T2?,
- block: (T1, T2) -> R?): R? {
- val lock = Any()
- return synchronized(lock) {
- if (p1 != null && p2 != null) block(p1, p2) else null
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/NameErrorChecker.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/NameErrorChecker.java
deleted file mode 100644
index 2f8d418c95..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/NameErrorChecker.java
+++ /dev/null
@@ -1,248 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils;
-
-import androidx.annotation.NonNull;
-import androidx.appcompat.app.AlertDialog;
-
-import com.google.android.material.textfield.TextInputLayout;
-
-import org.appdevforall.codeonthego.layouteditor.LayoutFile;
-import org.appdevforall.codeonthego.layouteditor.R;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.DrawableFile;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.FontItem;
-import org.appdevforall.codeonthego.layouteditor.adapters.models.ValuesItem;
-
-import java.util.List;
-import java.util.regex.Pattern;
-
-/**
- * This class is used to check the name error conditions.
- */
-public class NameErrorChecker {
-
- /**
- * This method checks if the name provided by the user is valid.
- *
- * @param name the name provided by the user
- * @param inputLayout object of TextInputLayout
- * @param dialog object of AlertDialog
- * @param drawableList list of DrawableFile objects
- */
- public static void checkForDrawable(
- @NonNull String name,
- TextInputLayout inputLayout,
- AlertDialog dialog,
- List drawableList,
- int position) {
- // Check if name is not empty
- if (!name.isEmpty()) {
- // First character should not be a number
- if (Character.isDigit(name.charAt(0))) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_first_letter_not_number));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should not have space
- if (name.contains(" ")) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_space_not_allowed));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should contain only letters and numbers
- if (!Pattern.matches("[a-z][a-z0-9_]*", name)) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_only_letters_and_numbers));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- } else {
- // Name cannot be empty
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_cannnot_empty));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
-
- // Check if the name already exists in the valuesList
- for (DrawableFile item : drawableList) {
- if (item.getName().substring(0, item.getName().lastIndexOf(".")).equals(name)
- && drawableList.indexOf(item) != position) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_current_name_unavailable));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- }
-
- // Name is valid
- inputLayout.setErrorEnabled(false);
- inputLayout.setError("");
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
- }
-
- public static void checkForValues(
- String name, TextInputLayout inputLayout, AlertDialog dialog, List valuesList) {
- checkForValues(name, inputLayout, dialog, valuesList, -1);
- }
-
- public static void checkForFont(
- String name, TextInputLayout inputLayout, AlertDialog dialog, List fontList) {
- checkForFont(name, inputLayout, dialog, fontList, -1);
- }
-
- public static void checkForDrawable(
- String name, TextInputLayout inputLayout, AlertDialog dialog, List drawableList) {
- checkForDrawable(name, inputLayout, dialog, drawableList, -1);
- }
-
- public static void checkForValues(
- @NonNull String name,
- TextInputLayout inputLayout,
- AlertDialog dialog,
- List valuesList,
- int position) {
- // Check if name is not empty
- if (!name.isEmpty()) {
- // First character should not be a number
- if (Character.isDigit(name.charAt(0))) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_first_letter_not_number));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should not have space
- if (name.contains(" ")) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_space_not_allowed));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should contain only letters and numbers
- if (!Pattern.matches("[a-z][a-z0-9_]*", name)) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_only_letters_and_numbers));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- } else {
- // Name cannot be empty
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_cannnot_empty));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
-
- // Check if the name already exists in the valuesList
- for (ValuesItem item : valuesList) {
- if (item.name.equals(name) && valuesList.indexOf(item) != position) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_current_name_unavailable));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- }
-
- // Name is valid
- inputLayout.setErrorEnabled(false);
- inputLayout.setError("");
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
- }
-
- public static void checkForFont(
- @NonNull String name,
- TextInputLayout inputLayout,
- AlertDialog dialog,
- List fontList,
- int position) {
- // Check if name is not empty
- if (!name.isEmpty()) {
- // First character should not be a number
- if (Character.isDigit(name.charAt(0))) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_first_letter_not_number));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should not have space
- if (name.contains(" ")) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_space_not_allowed));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- // Name should contain only letters and numbers
- if (!Pattern.matches("[a-z][a-z0-9_]*", name)) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_only_letters_and_numbers));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- } else {
- // Name cannot be empty
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_cannnot_empty));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
-
- // Check if the name already exists in the fontList
- for (FontItem item : fontList) {
- if (item.name.substring(0, item.name.lastIndexOf(".")).equals(name)
- && fontList.indexOf(item) != position) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_current_name_unavailable));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- }
-
- // Name is valid
- inputLayout.setErrorEnabled(false);
- inputLayout.setError("");
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
- }
-
- public static void checkForLayouts(
- @NonNull String name,
- TextInputLayout inputLayout,
- AlertDialog dialog,
- List layoutFiles,
- int position) {
- if (!name.isEmpty()) {
- if (Character.isDigit(name.charAt(0))) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_first_letter_not_number));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- if (!Pattern.matches("[a-z][A-Za-z0-9_\\s]*", name)) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_symbol_not_allowed));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- } else {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_cannnot_empty));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
-
- for (LayoutFile item : layoutFiles) {
- if (item.getName().contains(".")) {
- if (item.getName().substring(0, item.getName().lastIndexOf(".")).equals(name)
- && layoutFiles.indexOf(item) != position) {
- inputLayout.setErrorEnabled(true);
- inputLayout.setError(dialog.getContext().getString(R.string.msg_current_name_unavailable));
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
- return;
- }
- }
- }
-
- inputLayout.setErrorEnabled(false);
- inputLayout.setError("");
- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ProjectResolver.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ProjectResolver.java
deleted file mode 100644
index e71ae78dbb..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/ProjectResolver.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils;
-
-import android.os.Bundle;
-import android.view.View;
-
-import androidx.annotation.Nullable;
-
-import org.appdevforall.codeonthego.layouteditor.ProjectFile;
-import org.appdevforall.codeonthego.layouteditor.R;
-import org.appdevforall.codeonthego.layouteditor.managers.ProjectManager;
-
-public class ProjectResolver {
- @Nullable
- public static ProjectFile resolveProject(@Nullable Bundle arguments) {
- if (arguments != null && arguments.containsKey(Constants.EXTRA_KEY_PROJECT)) {
- return arguments.getParcelable(Constants.EXTRA_KEY_PROJECT);
- }
- return ProjectManager.getInstance().getOpenedProject();
- }
-
- @Nullable
- public static ProjectFile getValidProjectOrShowError(@Nullable Bundle arguments, @Nullable View view) {
- ProjectFile project = resolveProject(arguments);
- if (project == null && view != null) {
- SBUtils.make(view, R.string.msg_error_opening_project).showAsError();
- }
- return project;
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/SBUtils.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/SBUtils.kt
deleted file mode 100644
index dca5380de0..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/SBUtils.kt
+++ /dev/null
@@ -1,168 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils
-
-import android.view.View
-import androidx.annotation.StringRes
-import com.google.android.material.R
-import com.google.android.material.color.MaterialColors
-import com.google.android.material.snackbar.Snackbar
-import org.jetbrains.annotations.Contract
-
-/**
- * SBUtils is a utility class for creating and displaying snackbars.
- */
-class SBUtils private constructor(
- private val snackbar: Snackbar
-) {
- /**
- * Enum for the types of snackbars that can be created.
- */
- enum class Type {
- ERROR,
- SUCCESS,
- INFO
- }
-
- private var type: Type? = null
-
- /**
- * Sets the type of the snackbar.
- *
- * @param type The type of snackbar to set
- * @return The SBUtils instance
- */
- fun setType(type: Type?): SBUtils {
- this.type = type
- return this
- }
-
- /**
- * Sets the background color and text color of the snackbar.
- *
- * @param colorBg The background color of the snackbar
- * @param colorTxt The text color of the snackbar
- * @return The SBUtils instance
- */
- fun setColors(colorBg: Int, colorTxt: Int): SBUtils {
- snackbar.setBackgroundTint(colorBg).setTextColor(colorTxt).setActionTextColor(colorTxt)
- return this
- }
-
- /**
- * Sets the animation mode of the snackbar to Fade.
- *
- * @return The SBUtils instance
- */
- fun setFadeAnimation(): SBUtils {
- snackbar.setAnimationMode(Snackbar.ANIMATION_MODE_FADE)
- return this
- }
-
- /**
- * Sets the animation mode of the snackbar to Slide.
- *
- * @return The SBUtils instance
- */
- fun setSlideAnimation(): SBUtils {
- snackbar.setAnimationMode(Snackbar.ANIMATION_MODE_SLIDE)
- return this
- }
-
- /**
- * Sets the anchor view for the snackbar.
- *
- * @param anchorView The anchor view for the snackbar
- * @return The SBUtils instance
- */
- fun setAnchorView(anchorView: View?): SBUtils {
- snackbar.setAnchorView(anchorView)
- return this
- }
-
- /**
- * Shows the snackbar. The colors will be set based on the type if a type has been set.
- */
- fun show() {
- when (type) {
- Type.ERROR -> setColors(
- MaterialColors.getColor(snackbar.context, R.attr.colorErrorContainer, ""),
- MaterialColors.getColor(snackbar.context, R.attr.colorOnErrorContainer, "")
- )
-
- Type.SUCCESS -> setColors(
- MaterialColors.getColor(snackbar.context, R.attr.colorPrimaryContainer, ""),
- MaterialColors.getColor(snackbar.context, R.attr.colorOnPrimaryContainer, "")
- )
-
- Type.INFO -> setColors(
- MaterialColors.getColor(snackbar.context, R.attr.colorSecondaryContainer, ""),
- MaterialColors.getColor(snackbar.context, R.attr.colorOnSecondaryContainer, "")
- )
-
- null -> {
- showAsSuccess()
- return
- }
- }
- snackbar.show()
- }
-
- /**
- * Sets the type of snackbar to ERROR and shows it.
- */
- fun showAsError() {
- setType(Type.ERROR).show()
- }
-
- /**
- * Sets the type of snackbar to SUCCESS and shows it.
- */
- fun showAsSuccess() {
- setType(Type.SUCCESS).show()
- }
-
- /**
- * Sets the duration of snackbar to LONG and sets the type of snackbar to ERROR and shows it.
- */
- fun showLongAsError() {
- snackbar.setDuration(Snackbar.LENGTH_LONG)
- setType(Type.ERROR).show()
- }
-
- /**
- * Sets the duration of snackbar to LONG and sets the type of snackbar to SUCCESS and shows it.
- */
- fun showLongAsSuccess() {
- snackbar.setDuration(Snackbar.LENGTH_LONG)
- setType(Type.SUCCESS).show()
- }
-
- companion object {
- /**
- * Creates and returns a new instance of SBUtils with a Snackbar with the given message for the
- * given view.
- *
- * @param v The view where the snackbar should be displayed
- * @param msg The message to display in the snackbar
- * @return a new instance of SBUtils
- */
- @JvmStatic
- @Contract("_, _ -> new")
- fun make(v: View, msg: CharSequence): SBUtils {
- return SBUtils(Snackbar.make(v, msg, Snackbar.LENGTH_SHORT))
- }
-
- /**
- * Creates and returns a new instance of SBUtils with a Snackbar with the given string resource
- * ID for the given view.
- *
- * @param v The view where the snackbar should be displayed
- * @param msgResId The string resource ID to display in the snackbar
- * @return a new instance of SBUtils
- */
- @JvmStatic
- @Contract("_, _ -> new")
- fun make(v: View, @StringRes msgResId: Int): SBUtils {
- return SBUtils(Snackbar.make(v, msgResId, Snackbar.LENGTH_SHORT))
- }
- }
-}
\ No newline at end of file
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Utils.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Utils.java
deleted file mode 100644
index 4fe0aa4aaf..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/utils/Utils.java
+++ /dev/null
@@ -1,259 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.utils;
-
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.DashPathEffect;
-import android.graphics.Paint;
-import android.net.Uri;
-import android.os.Environment;
-import android.provider.MediaStore;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.View;
-
-import androidx.annotation.NonNull;
-
-import com.google.android.material.R;
-import com.google.android.material.color.MaterialColors;
-
-import org.appdevforall.codeonthego.layouteditor.R.string;
-import org.appdevforall.codeonthego.vectormaster.VectorMasterDrawable;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Date;
-import java.util.Locale;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.FutureTask;
-
-public class Utils {
- /**
- * This method is used to convert the input into the equivalent dip value.
- */
- public static int pxToDp(@NonNull Context context, int input) {
- return (int)
- TypedValue.applyDimension(
- TypedValue.COMPLEX_UNIT_DIP, input, context.getResources().getDisplayMetrics());
- }
-
- public static boolean isDarkMode(@NonNull Context context) {
- int uiMode =
- context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
- return uiMode == Configuration.UI_MODE_NIGHT_YES;
- }
-
- public static int getOnSurfaceColor(Context context) {
- return MaterialColors.getColor(context, R.attr.colorOnSurface, 0);
- }
-
- public static int getSurfaceColor(Context context) {
- return MaterialColors.getColor(context, R.attr.colorSurface, 0);
- }
-
- public static int getPrimaryColor(Context context) {
- return MaterialColors.getColor(context, R.attr.colorPrimary, 0);
- }
-
- public static int getSecondaryColor(Context context) {
- return MaterialColors.getColor(context, R.attr.colorSecondary, 0);
- }
-
- public static void drawDashPathStroke(@NonNull View view, @NonNull Canvas canvas, @NonNull Paint paint) {
- paint.setAntiAlias(true);
- paint.setStyle(Paint.Style.STROKE);
- paint.setPathEffect(new DashPathEffect(new float[]{10, 7}, 0));
- canvas.drawRect(0, 0, view.getWidth(), view.getHeight(), paint);
- }
-
- public static void drawDashPathStroke(View view, Canvas canvas) {
- drawDashPathStroke(view, canvas, getDefaultPaint(view.getContext()));
- }
-
- public static void drawDashPathStroke(@NonNull View view, Canvas canvas, int paintColor) {
- Paint paint = getDefaultPaint(view.getContext());
- paint.setColor(paintColor);
- drawDashPathStroke(view, canvas, paint);
- }
-
- @NonNull
- private static Paint getDefaultPaint(Context context) {
- Paint paint = new Paint();
- paint.setColor(isDarkMode(context) ? Color.WHITE : getOnSurfaceColor(context));
- paint.setStrokeWidth(pxToDp(context, 2));
- return paint;
- }
-
- public static boolean saveBitmapAsImageToGallery(@NonNull Context context, Bitmap bitmap, String title) {
- String savedImageURL = null;
-
- // Get the directory for the user's public pictures directory.
- File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
- // Create a new directory for your app
- File appDir = new File(path, context.getString(string.app_name));
- if (!appDir.exists()) {
- appDir.mkdir();
- }
-
- // Generate a unique file name for your image
- String fileName =
- context.getString(string.app_name).concat(" ").concat(title).concat(" ")
- + new Date().getTime()
- + ".jpg";
- fileName = fileName.replaceAll(" ", "_").toLowerCase(Locale.getDefault());
- File file = new File(appDir, fileName);
-
- // Save the image to the directory
- try {
- OutputStream fOut = new FileOutputStream(file);
- bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
- fOut.flush();
- fOut.close();
- } catch (IOException e) {
- e.printStackTrace();
- Log.d("MediaUtils", "Error saving image to gallery: " + e.getMessage());
- return false;
- }
-
- // Add the image to the Android gallery
- try {
- ContentResolver contentResolver = context.getContentResolver();
- ContentValues values = new ContentValues();
- values.put(MediaStore.Images.Media.TITLE, fileName);
- values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName);
- values.put(
- MediaStore.Images.Media.DESCRIPTION,
- "Image saved from ".concat(context.getString(string.app_name)));
- values.put(MediaStore.Images.Media.DATE_ADDED, System.currentTimeMillis());
- values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
- values.put(MediaStore.Images.Media.ORIENTATION, 0);
- values.put(MediaStore.Images.Media.DATA, file.getAbsolutePath());
-
- Uri uri = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
- savedImageURL = uri.toString();
-
- Log.d("MediaUtils", "Image saved to gallery: " + savedImageURL);
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- Log.d("MediaUtils", "Error saving image to gallery: " + e.getMessage());
- return false;
- }
- }
-
- public static int getScreenWidth() {
- DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
- return displayMetrics.widthPixels;
- }
-
- /**
- * Basic validation of a TTF/OTF file.
- * Checks:
- * 1. File exists and is not empty
- * 2. Valid TTF/OTF header (scaler type)
- * 3. Directory table has a reasonable number of entries
- */
- public static boolean isValidFontFile(File file) {
- final int MAX_FONT_TABLES = 100;
- final int FONT_HEADER_SIZE = 12;
- final int TABLE_DIRECTORY_ENTRY_SIZE = 16;
-
- if (!file.exists() || file.length() < FONT_HEADER_SIZE) {
- return false;
- }
-
- try (FileInputStream stream = new FileInputStream(file)) {
- byte[] header = new byte[FONT_HEADER_SIZE];
- if (stream.read(header) != FONT_HEADER_SIZE) {
- return false;
- }
-
- ByteBuffer buf = ByteBuffer.wrap(header).order(ByteOrder.BIG_ENDIAN);
-
- // --- Validate scaler type ---
- int scalerType = buf.getInt();
- boolean validScaler =
- scalerType == 0x00010000 || // TTF
- scalerType == 0x4F54544F; // OTTO
-
- if (!validScaler) return false;
-
- // --- Number of tables ---
- int numTables = buf.getShort() & 0xFFFF;
- if (numTables == 0 || numTables > MAX_FONT_TABLES) {
- return false;
- }
-
- int directorySize = numTables * TABLE_DIRECTORY_ENTRY_SIZE;
- byte[] tableDir = new byte[directorySize];
-
- return stream.read(tableDir) == directorySize;
-
- } catch (IOException e) {
- Log.e("Utils", "Error validating font file: " + file.getName(), e);
- return false;
- }
- }
-
- public static VectorMasterDrawable getVectorDrawableAsync(Context context, Uri uri) {
- Callable callable =
- new Callable() {
- @Override
- public VectorMasterDrawable call() throws Exception {
- // Load the drawable from file
- InputStream is = context.getContentResolver().openInputStream(uri);
- VectorMasterDrawable drawable = new VectorMasterDrawable(context);
- drawable.setInputStream(is);
- is.close();
- return drawable;
- }
- };
-
- FutureTask futureTask = new FutureTask<>(callable);
- new Thread(futureTask).start();
-
- try {
- VectorMasterDrawable drawable = futureTask.get();
- return drawable;
- } catch (ExecutionException | InterruptedException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- @NonNull
- public static String toCamelCase(@NonNull String s) {
- int ctr = 0;
- int n = s.length();
- char[] ch = s.toCharArray();
- int c = 0;
-
- for (int i = 0; i < n; i++) {
- if (i == 0) {
- ch[i] = Character.toLowerCase(ch[i]);
- }
- if (ch[i] == ' ') {
- ctr++;
- ch[i+1] = Character.toUpperCase(ch[i+1]);
- continue;
- } else {
- ch[c++] = ch[i];
- }
- }
-
- return String.valueOf(ch, 0, n - ctr);
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/AlphaPatternDrawable.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/AlphaPatternDrawable.kt
deleted file mode 100644
index 20ed6cd9d4..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/AlphaPatternDrawable.kt
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.views
-
-import android.graphics.Bitmap
-import android.graphics.Canvas
-import android.graphics.ColorFilter
-import android.graphics.Paint
-import android.graphics.PixelFormat
-import android.graphics.Rect
-import android.graphics.drawable.Drawable
-
-/**
- * This drawable will draw a simple white and gray chessboard pattern. It's the pattern you will
- * often see as a background behind a partly transparent image in many applications.
- */
-class AlphaPatternDrawable(private val rectangleSize: Int) : Drawable() {
- private val paint = Paint()
- private val paintWhite = Paint()
- private val paintGray = Paint()
-
- private var numRectanglesHorizontal = 0
- private var numRectanglesVertical = 0
-
- /**
- * Bitmap in which the pattern will be cached. This is so the pattern will not have to be
- * recreated each time draw() gets called. Because recreating the pattern i rather expensive. I
- * will only be recreated if the size changes.
- */
- private var bitmap: Bitmap? = null
-
- init {
- paintWhite.color = -0xbdbdbe
- paintGray.color = -0xdededf
- }
-
- override fun draw(canvas: Canvas) {
- if (bitmap != null && !bitmap!!.isRecycled) {
- canvas.drawBitmap(bitmap!!, null, bounds, paint)
- }
- }
-
- override fun setAlpha(alpha: Int) {
- throw UnsupportedOperationException("Alpha is not supported by this drawable.")
- }
-
- override fun setColorFilter(cf: ColorFilter?) {
- throw UnsupportedOperationException("ColorFilter is not supported by this drawable.")
- }
-
- override fun getOpacity(): Int {
- return PixelFormat.UNKNOWN
- }
-
- override fun onBoundsChange(bounds: Rect) {
- super.onBoundsChange(bounds)
- val height = bounds.height()
- val width = bounds.width()
- numRectanglesHorizontal = (width / rectangleSize).toDouble().toInt()
- numRectanglesVertical = (height / rectangleSize).toDouble().toInt()
- generatePatternBitmap()
- }
-
- /**
- * This will generate a bitmap with the pattern as big as the rectangle we were allow to draw on.
- * We do this to chache the bitmap so we don't need to recreate it each time draw() is called
- * since it takes a few milliseconds
- */
- private fun generatePatternBitmap() {
- if (bounds.width() <= 0 || bounds.height() <= 0) {
- return
- }
-
- bitmap =
- Bitmap.createBitmap(bounds.width(), bounds.height(), Bitmap.Config.ARGB_8888)
- val canvas = Canvas(bitmap!!)
-
- val r = Rect()
- var verticalStartWhite = true
- for (i in 0..numRectanglesVertical) {
- var isWhite = verticalStartWhite
- for (j in 0..numRectanglesHorizontal) {
- r.top = i * rectangleSize
- r.left = j * rectangleSize
- r.bottom = r.top + rectangleSize
- r.right = r.left + rectangleSize
- canvas.drawRect(r, if (isWhite) paintWhite else paintGray)
- isWhite = !isWhite
- }
- verticalStartWhite = !verticalStartWhite
- }
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/ColorView.java b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/ColorView.java
deleted file mode 100644
index 983dd2f9ae..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/ColorView.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.views;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.view.View;
-
-import androidx.annotation.NonNull;
-
-import java.util.Locale;
-
-/** ColorView extends View class. It is used to draw a colored rectangle. */
-public class ColorView extends View {
- /** Alpha, red, green, blue value of the color. */
- private int a = 255, r = 255, g = 255, b = 255;
-
- /** Drawable object to draw transparent background. */
- private final Drawable transparent;
- /** Paint object to draw color bitmap. */
- private Paint bitmapPaint;
- /** Paint object to draw color. */
- private final Paint colorPaint;
-
- /**
- * Constructor for ColorView class.
- *
- * @param context The Context the view is running in, through which it can access the current
- * theme, resources, etc.
- * @param attrs The attributes of the XML tag that is inflating the view.
- */
- public ColorView(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- transparent = new AlphaPatternDrawable(16);
-
- colorPaint = new Paint();
- colorPaint.setARGB(a, r, g, b);
- }
-
- /**
- * This is called during layout when the size of this view has changed.
- *
- * @param w Current width of this view.
- * @param h Current height of this view.
- * @param oldw Old width of this view.
- * @param oldh Old height of this view.
- */
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- transparent.setBounds(0, 0, w, h);
- }
-
- /**
- * Called when the view should render its content.
- *
- * @param canvas the Canvas object on which the view will draw.
- */
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- transparent.draw(canvas);
- canvas.drawRect(0, 0, getWidth(), getHeight(), colorPaint);
- }
-
- /**
- * Set the color of the rectangle.
- *
- * @param color The color, packed as ARGB in a 32-bit int.
- */
- public void setColor(int color) {
- a = Color.alpha(color);
- r = Color.red(color);
- g = Color.green(color);
- b = Color.blue(color);
-
- colorPaint.setARGB(a, r, g, b);
- invalidate();
- }
-
- /**
- * Set the alpha value of the color.
- *
- * @param value The value of alpha.
- */
- public void setAlpha(int value) {
- a = value;
- colorPaint.setARGB(a, r, g, b);
- invalidate();
- }
-
- /**
- * Set the red value of the color.
- *
- * @param value The value of red.
- */
- public void setRed(int value) {
- r = value;
- colorPaint.setARGB(a, r, g, b);
- invalidate();
- }
-
- /**
- * Set the green value of the color.
- *
- * @param value The value of green.
- */
- public void setGreen(int value) {
- g = value;
- colorPaint.setARGB(a, r, g, b);
- invalidate();
- }
-
- /**
- * Set the blue value of the color.
- *
- * @param value The value of blue.
- */
- public void setBlue(int value) {
- b = value;
- colorPaint.setARGB(a, r, g, b);
- invalidate();
- }
-
- /**
- * Get the color.
- *
- * @return The color, packed as ARGB in a 32-bit int.
- */
- public int getColor() {
- return Color.argb(a, r, g, b);
- }
-
- /**
- * Get the inverted rgb color.
- *
- * @return The inverted color, packed as RGB in a 32-bit int.
- */
- public int getInvertedRGB() {
- return 0xFFFFFF ^ Color.rgb(r, g, b);
- }
-
- /**
- * Get the hex value of the color.
- *
- * @return The hex value of the color.
- */
- public String getHexColor() {
- return getHex(Color.argb(a, r, g, b));
- }
-
- /**
- * Get the hex value of the given color.
- *
- * @param c The color, packed as ARGB in a 32-bit int.
- * @return The hex value of the given color.
- */
- @NonNull
- private String getHex(int c) {
- return String.format(
- "%02x%02x%02x%02x", Color.alpha(c), Color.red(c), Color.green(c), Color.blue(c))
- .toUpperCase(Locale.US);
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/CustomDrawerLayout.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/CustomDrawerLayout.kt
deleted file mode 100644
index d1ca432399..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/CustomDrawerLayout.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.views
-
-import android.content.Context
-import android.graphics.Rect
-import android.util.AttributeSet
-import android.view.MotionEvent
-import android.view.View
-import android.view.ViewGroup
-import androidx.drawerlayout.widget.DrawerLayout
-
-/** Allows horizontally scrolling child of drawer layouts to intercept the touch event. */
-class CustomDrawerLayout : DrawerLayout {
- private val rect = Rect()
-
- constructor(context: Context) : super(context)
-
- constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
-
- constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
- context,
- attrs,
- defStyleAttr
- )
-
- override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
- val scrollingChild = findScrollingChild(this, ev.x, ev.y)
- if (scrollingChild != null) {
- return false
- }
- return super.onInterceptTouchEvent(ev)
- }
-
- /**
- * Recursively finds the view that can scroll horizontally to the end
- *
- * @param parent The starting parent to search
- * @param x The x point in the screen
- * @param y The y point in the screen
- * @return The scrolling view, null if no view is found
- */
- private fun findScrollingChild(parent: ViewGroup, x: Float, y: Float): View? {
- val n = parent.childCount
- if (parent === this && n <= 1) {
- return null
- }
-
- var start = 0
- if (parent === this) {
- start = 1
- }
-
- for (i in start until n) {
- val child = parent.getChildAt(i)
- if (child.visibility != VISIBLE) {
- continue
- }
- child.getHitRect(rect)
- if (rect.contains(x.toInt(), y.toInt())) {
- if (child.canScrollHorizontally(1)) {
- return child
- } else if (child is ViewGroup) {
- val v = findScrollingChild(child, x - rect.left, y - rect.top)
- if (v != null) {
- return v
- }
- }
- }
- }
- return null
- }
-}
diff --git a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/StructureView.kt b/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/StructureView.kt
deleted file mode 100644
index 982884fbb9..0000000000
--- a/layouteditor/src/main/java/org/appdevforall/codeonthego/layouteditor/views/StructureView.kt
+++ /dev/null
@@ -1,408 +0,0 @@
-package org.appdevforall.codeonthego.layouteditor.views
-
-import android.content.Context
-import android.graphics.Canvas
-import android.graphics.Paint
-import android.util.AttributeSet
-import android.util.TypedValue
-import android.view.LayoutInflater
-import android.view.SurfaceView
-import android.view.TextureView
-import android.view.View
-import android.view.ViewGroup
-import android.view.ViewStub
-import android.webkit.WebView
-import android.widget.AutoCompleteTextView
-import android.widget.Button
-import android.widget.CalendarView
-import android.widget.CheckBox
-import android.widget.CheckedTextView
-import android.widget.EditText
-import android.widget.FrameLayout
-import android.widget.GridLayout
-import android.widget.GridView
-import android.widget.HorizontalScrollView
-import android.widget.ImageButton
-import android.widget.ImageView
-import android.widget.LinearLayout
-import android.widget.ListView
-import android.widget.MultiAutoCompleteTextView
-import android.widget.ProgressBar
-import android.widget.RadioButton
-import android.widget.RadioGroup
-import android.widget.RatingBar
-import android.widget.RelativeLayout
-import android.widget.ScrollView
-import android.widget.SearchView
-import android.widget.SeekBar
-import android.widget.Space
-import android.widget.Spinner
-import android.widget.Switch
-import android.widget.TabHost
-import android.widget.TableLayout
-import android.widget.TableRow
-import android.widget.TextClock
-import android.widget.TextView
-import android.widget.ToggleButton
-import android.widget.VideoView
-import androidx.appcompat.widget.LinearLayoutCompat
-import androidx.cardview.widget.CardView
-import androidx.constraintlayout.widget.ConstraintLayout
-import androidx.coordinatorlayout.widget.CoordinatorLayout
-import androidx.core.widget.NestedScrollView
-import androidx.drawerlayout.widget.DrawerLayout
-import androidx.recyclerview.widget.RecyclerView
-import androidx.viewpager.widget.ViewPager
-import androidx.viewpager2.widget.ViewPager2
-import com.google.android.material.appbar.AppBarLayout
-import com.google.android.material.bottomnavigation.BottomNavigationView
-import com.google.android.material.chip.Chip
-import com.google.android.material.chip.ChipGroup
-import com.google.android.material.color.MaterialColors
-import com.google.android.material.textfield.TextInputLayout
-import com.google.android.material.floatingactionbutton.FloatingActionButton
-import com.google.android.material.navigation.NavigationView
-import com.google.android.material.tabs.TabLayout
-import com.google.android.material.textfield.TextInputEditText
-import org.appdevforall.codeonthego.layouteditor.R
-import org.appdevforall.codeonthego.layouteditor.databinding.LayoutStructureViewItemBinding
-import org.appdevforall.codeonthego.layouteditor.managers.IdManager.idMap
-
-class StructureView(
- context: Context?,
- attrs: AttributeSet?,
-) : LinearLayoutCompat(
- context!!,
- attrs,
- ),
- View.OnClickListener,
- View.OnLongClickListener {
- private val inflater: LayoutInflater = LayoutInflater.from(context)
- private val paint = Paint()
- private val pointRadius: Int
- private val textViewMap: MutableMap = HashMap()
- private val viewTextMap: MutableMap = HashMap()
-
- var onItemClickListener: ((View) -> Unit)? = null
- var onItemLongClickListener: ((View) -> Unit)? = null
-
- /**
- * This is the constructor of the StructureView class which takes context and attributeSet as
- * parameters. It creates a new Paint object, sets its color and anti-alias. It also sets the
- * orientation of this view to VERTICAL and sets the default OnItemClickListener.
- */
- init {
- val primaryColor =
- MaterialColors.getColor(this, com.google.android.material.R.attr.colorPrimary)
- paint.color = primaryColor
- paint.isAntiAlias = true
- paint.strokeWidth = getDip(1).toFloat()
-
- pointRadius = getDip(3)
-
- orientation = VERTICAL
- }
-
- /** This method clears all Views and HashMaps stored in this view. */
- fun clear() {
- removeAllViews()
- textViewMap.clear()
- viewTextMap.clear()
- }
-
- /**
- * This method sets a View to this view. It clears all the stored views and hashmaps, and then
- * calls the peek() method to peek into the View.
- */
- fun setView(view: View) {
- textViewMap.clear()
- viewTextMap.clear()
- removeAllViews()
- peek(view, 1)
- }
-
- /**
- * This method recursively calls itself to add TextViews for each View inside the ViewGroup. It
- * also stores the TextViews and Views in their respective hashmaps.
- */
- private fun peek(
- view: View,
- depth: Int,
- ) {
- var nextDepth = depth
- val binding =
- LayoutStructureViewItemBinding.inflate(inflater, null, false)
- val viewName = binding.viewName
- val viewId = binding.viewId
- val icon = binding.icon
- if (view.id == -1 || idMap[view] == null) {
- viewId.visibility = GONE
- viewName.translationY = 0f
- viewId.translationY = 0f
- } else {
- viewName.translationY = getDip(-7).toFloat()
- viewId.translationY = getDip(-3).toFloat()
- viewId.visibility = VISIBLE
- viewId.text = idMap[view]
- }
- if (view is LinearLayout && view !is RadioGroup && view !is TextInputLayout) {
- val orientation =
- if (view.orientation == LinearLayout.HORIZONTAL) "horizontal" else "vertical"
- val imgResId = imgMap[LinearLayout::class.java.simpleName + orientation]!!
-
- icon.setImageResource(imgResId)
- viewName.text = String.format("%s (%s)", LinearLayout::class.java.simpleName, orientation)
- } else {
- val viewSimpleName = view.javaClass.superclass.simpleName
- var imageResource = imgMap[viewSimpleName]
- if (imageResource == null) {
- imageResource = imgMap["_unknown"]
- }
- icon.setImageResource(imageResource!!)
- viewName.text = viewSimpleName
- }
-
- binding.mainView.setOnClickListener(this)
- binding.mainView.setOnLongClickListener(this)
-
- addView(binding.root)
-
- val params =
- binding.root.layoutParams as LayoutParams
- params.leftMargin = depth * getDip(15)
-
- textViewMap[viewName] = view
- viewTextMap[view] = viewName
-
- if (view is ViewGroup) {
- val group = view
- if (group !is CalendarView &&
- group !is SearchView &&
- group !is NavigationView &&
- group !is BottomNavigationView &&
- group !is TabLayout &&
- group !is TextInputLayout
- ) {
- nextDepth++
-
- for (i in 0 until group.childCount) {
- val child = group.getChildAt(i)
- peek(child, nextDepth)
- }
- } else if (group is TextInputLayout) {
- nextDepth++
- val editText = group.editText
- if (editText != null) {
- peek(editText, nextDepth)
- }
- }
- }
- }
-
- /** This method is called to draw rectangles, lines, and circles for each TextView in the view. */
- override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
-
- for (text in textViewMap.keys) {
- val view = textViewMap[text] ?: continue
- val parent = (text.parent?.parent as? ViewGroup) ?: continue
-
- val centerX = parent.x
- val centerY = parent.y + parent.height.toFloat() / 2
-
- fun drawCircle() {
- canvas.drawCircle(
- centerX,
- centerY,
- pointRadius.toFloat(),
- paint,
- )
- }
-
- fun drawRectangle() {
- canvas.drawRect(
- centerX - pointRadius,
- centerY - pointRadius,
- centerX + pointRadius,
- centerY + pointRadius,
- paint,
- )
- }
-
- fun drawLine(targetParent: ViewGroup) {
- val targetY = targetParent.y + targetParent.height.toFloat() / 2
-
- canvas.drawLine(
- centerX,
- centerY,
- centerX,
- targetY,
- paint,
- )
-
- canvas.drawLine(
- centerX,
- targetY,
- targetParent.x,
- targetY,
- paint,
- )
- }
-
- if (view !is ViewGroup || view.childCount <= 0) {
- drawCircle()
- continue
- }
-
- when (view) {
- is CalendarView,
- is SearchView,
- is NavigationView,
- is BottomNavigationView,
- is TabLayout -> { drawCircle() }
- is TextInputLayout -> {
- drawRectangle()
-
- val editText = view.editText ?: continue
- val current = viewTextMap[editText] ?: continue
- val currentParent = (current.parent?.parent as? ViewGroup) ?: continue
-
- drawLine(currentParent)
- }
-
- else -> {
- drawRectangle()
-
- for (i in 0 until view.childCount) {
- val child = view.getChildAt(i)
- val current = viewTextMap[child] ?: continue
- val currentParent = (current.parent?.parent as? ViewGroup) ?: continue
-
- drawLine(currentParent)
- }
- }
- }
- }
- }
-
- /**
- * This method is called when a TextView is clicked, and it calls the OnItemClickListener's
- * onItemClick method.
- */
- override fun onClick(v: View) {
- if (v is ViewGroup) {
- for (i in 0 until v.childCount) {
- val child = v.getChildAt(i)
- if (child.id == R.id.view_name) {
- textViewMap[child as TextView]?.let {
- onItemClickListener?.invoke(
- it,
- )
- }
- }
- }
- }
- }
-
- override fun onLongClick(view: View): Boolean {
- val parent = view as? ViewGroup ?: return false
- val textView = parent.findViewById(R.id.view_name) ?: return false
-
- val associatedView = textViewMap[textView] ?: return false
-
- onItemLongClickListener?.invoke(associatedView)
-
- return true
- }
-
- /** This method is used to convert the input into the equivalent dip value. */
- private fun getDip(input: Int): Int =
- TypedValue
- .applyDimension(
- TypedValue.COMPLEX_UNIT_DIP,
- input.toFloat(),
- context.resources.displayMetrics,
- ).toInt()
-
- companion object {
- var imgMap: MutableMap = HashMap()
-
- init {
- imgMap["_unknown"] = R.mipmap.ic_palette_unknown_view
- imgMap[TextView::class.java.simpleName] = R.mipmap.ic_palette_text_view
- imgMap[EditText::class.java.simpleName] = R.mipmap.ic_palette_edit_text
- imgMap[Button::class.java.simpleName] =
- R.mipmap.ic_palette_button
- imgMap[ImageButton::class.java.simpleName] =
- R.mipmap.ic_palette_image_button
- imgMap[ImageView::class.java.simpleName] = R.mipmap.ic_palette_image_view
- imgMap[VideoView::class.java.simpleName] = R.mipmap.ic_palette_video_view
- imgMap[AutoCompleteTextView::class.java.simpleName] =
- R.mipmap.ic_palette_auto_complete_text_view
- imgMap[MultiAutoCompleteTextView::class.java.simpleName] =
- R.mipmap.ic_palette_multi_auto_complete_text_view
- imgMap[CheckedTextView::class.java.simpleName] =
- R.mipmap.ic_palette_checked_text_view
- imgMap[CheckBox::class.java.simpleName] = R.mipmap.ic_palette_check_box
- imgMap[RadioButton::class.java.simpleName] = R.mipmap.ic_palette_radio_button
- imgMap[RadioGroup::class.java.simpleName] =
- R.mipmap.ic_palette_radio_group
- imgMap[ToggleButton::class.java.simpleName] = R.mipmap.ic_palette_toggle_button
- imgMap[Switch::class.java.simpleName] = R.mipmap.ic_palette_switch
- imgMap[View::class.java.simpleName] = R.mipmap.ic_palette_view
- imgMap[WebView::class.java.simpleName] = R.mipmap.ic_palette_web_view
- imgMap[CalendarView::class.java.simpleName] = R.mipmap.ic_palette_calendar_view
- imgMap[ProgressBar::class.java.simpleName] = R.mipmap.ic_palette_progress_bar
- imgMap[ProgressBar::class.java.simpleName + "horizontal"] =
- R.mipmap.ic_palette_progress_bar_horizontal
- imgMap[SeekBar::class.java.simpleName] = R.mipmap.ic_palette_seek_bar
- imgMap[RatingBar::class.java.simpleName] = R.mipmap.ic_palette_rating_bar
- imgMap[TextureView::class.java.simpleName] =
- R.mipmap.ic_palette_texture_view
- imgMap[SurfaceView::class.java.simpleName] = R.mipmap.ic_palette_surface_view
- imgMap[SearchView::class.java.simpleName] =
- R.mipmap.ic_palette_search_view
- imgMap[LinearLayout::class.java.simpleName + "horizontal"] =
- R.mipmap.ic_palette_linear_layout_horz
- imgMap[LinearLayout::class.java.simpleName + "vertical"] =
- R.mipmap.ic_palette_linear_layout_vert
- imgMap[FrameLayout::class.java.simpleName] = R.mipmap.ic_palette_frame_layout
- imgMap[TableLayout::class.java.simpleName] = R.mipmap.ic_palette_table_layout
- imgMap[TableRow::class.java.simpleName] = R.mipmap.ic_palette_table_row
- imgMap[Space::class.java.simpleName] = R.mipmap.ic_palette_space
- imgMap[Spinner::class.java.simpleName] = R.mipmap.ic_palette_spinner
- imgMap[ScrollView::class.java.simpleName] = R.mipmap.ic_palette_scroll_view
- imgMap[HorizontalScrollView::class.java.simpleName] =
- R.mipmap.ic_palette_horizontal_scroll_view
- imgMap[ViewStub::class.java.simpleName] = R.mipmap.ic_palette_view_stub
- imgMap["include"] = R.mipmap.ic_palette_include
- imgMap[GridLayout::class.java.simpleName] =
- R.mipmap.ic_palette_grid_layout
- imgMap[GridView::class.java.simpleName] = R.mipmap.ic_palette_grid_view
- imgMap[RecyclerView::class.java.simpleName] = R.mipmap.ic_palette_recycler_view
- imgMap[ListView::class.java.simpleName] = R.mipmap.ic_palette_list_view
- imgMap[TabHost::class.java.simpleName] = R.mipmap.ic_palette_tab_host
- imgMap[RelativeLayout::class.java.simpleName] = R.mipmap.ic_palette_relative_layout
- imgMap[Chip::class.java.simpleName] = R.mipmap.ic_palette_chip
- imgMap[ChipGroup::class.java.simpleName] = R.mipmap.ic_palette_chip_group
- imgMap[FloatingActionButton::class.java.simpleName] =
- R.mipmap.ic_palette_floating_action_button
- imgMap[NestedScrollView::class.java.simpleName] = R.mipmap.ic_palette_nested_scroll_view
- imgMap[ViewPager::class.java.simpleName] = R.mipmap.ic_palette_view_pager
- imgMap[ViewPager2::class.java.simpleName] = R.mipmap.ic_palette_view_pager
- imgMap[CardView::class.java.simpleName] = R.mipmap.ic_palette_card_view
- imgMap[TextClock::class.java.simpleName] = R.mipmap.ic_palette_text_clock
- imgMap[AppBarLayout::class.java.simpleName] = R.mipmap.ic_palette_app_bar_layout
- imgMap[NavigationView::class.java.simpleName] = R.mipmap.ic_palette_navigation_view
- imgMap[ConstraintLayout::class.java.simpleName] =
- R.mipmap.ic_palette_constraint_layout
- imgMap[BottomNavigationView::class.java.simpleName] =
- R.mipmap.ic_palette_bottom_navigation_view
- imgMap[CoordinatorLayout::class.java.simpleName] =
- R.mipmap.ic_palette_coordinator_layout
- imgMap[DrawerLayout::class.java.simpleName] = R.mipmap.ic_palette_drawer_layout
- imgMap[TextInputLayout::class.java.simpleName] = R.mipmap.ic_palette_linear_layout_vert
- imgMap[TextInputEditText::class.java.simpleName] = R.mipmap.ic_palette_edit_text
- }
- }
-}
diff --git a/layouteditor/src/main/play_store.png b/layouteditor/src/main/play_store.png
deleted file mode 100644
index 72c8bd4250..0000000000
Binary files a/layouteditor/src/main/play_store.png and /dev/null differ
diff --git a/layouteditor/src/main/res/drawable/android.xml b/layouteditor/src/main/res/drawable/android.xml
deleted file mode 100644
index c622e01a5c..0000000000
--- a/layouteditor/src/main/res/drawable/android.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/backburger.xml b/layouteditor/src/main/res/drawable/backburger.xml
deleted file mode 100644
index bc464a5d48..0000000000
--- a/layouteditor/src/main/res/drawable/backburger.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/background_drawer_left.xml b/layouteditor/src/main/res/drawable/background_drawer_left.xml
deleted file mode 100644
index 41f0590796..0000000000
--- a/layouteditor/src/main/res/drawable/background_drawer_left.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/background_drawer_right.xml b/layouteditor/src/main/res/drawable/background_drawer_right.xml
deleted file mode 100644
index 59aebdf358..0000000000
--- a/layouteditor/src/main/res/drawable/background_drawer_right.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/background_stroke_dash.xml b/layouteditor/src/main/res/drawable/background_stroke_dash.xml
deleted file mode 100644
index d1937be6ba..0000000000
--- a/layouteditor/src/main/res/drawable/background_stroke_dash.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/drawable/brightness_4.xml b/layouteditor/src/main/res/drawable/brightness_4.xml
deleted file mode 100644
index fb3b4fb1da..0000000000
--- a/layouteditor/src/main/res/drawable/brightness_4.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/cellphone_play.xml b/layouteditor/src/main/res/drawable/cellphone_play.xml
deleted file mode 100644
index af0447db84..0000000000
--- a/layouteditor/src/main/res/drawable/cellphone_play.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/cellphone_screenshot.xml b/layouteditor/src/main/res/drawable/cellphone_screenshot.xml
deleted file mode 100644
index 9eeba90b68..0000000000
--- a/layouteditor/src/main/res/drawable/cellphone_screenshot.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/close.xml b/layouteditor/src/main/res/drawable/close.xml
deleted file mode 100644
index 05119ad73c..0000000000
--- a/layouteditor/src/main/res/drawable/close.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/cog.xml b/layouteditor/src/main/res/drawable/cog.xml
deleted file mode 100644
index 1ed8446423..0000000000
--- a/layouteditor/src/main/res/drawable/cog.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
diff --git a/layouteditor/src/main/res/drawable/content_copy.xml b/layouteditor/src/main/res/drawable/content_copy.xml
deleted file mode 100644
index dafde37b39..0000000000
--- a/layouteditor/src/main/res/drawable/content_copy.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/content_save.xml b/layouteditor/src/main/res/drawable/content_save.xml
deleted file mode 100644
index e802c413d3..0000000000
--- a/layouteditor/src/main/res/drawable/content_save.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/content_save_outline.xml b/layouteditor/src/main/res/drawable/content_save_outline.xml
deleted file mode 100644
index 538de28947..0000000000
--- a/layouteditor/src/main/res/drawable/content_save_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/delete.xml b/layouteditor/src/main/res/drawable/delete.xml
deleted file mode 100644
index 0ba99555b9..0000000000
--- a/layouteditor/src/main/res/drawable/delete.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/delete_outline.xml b/layouteditor/src/main/res/drawable/delete_outline.xml
deleted file mode 100644
index ba1b7df0eb..0000000000
--- a/layouteditor/src/main/res/drawable/delete_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/drawer_home_selected_item.xml b/layouteditor/src/main/res/drawable/drawer_home_selected_item.xml
deleted file mode 100644
index 2871b1c317..0000000000
--- a/layouteditor/src/main/res/drawable/drawer_home_selected_item.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- -
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/drawer_home_unselected_item.xml b/layouteditor/src/main/res/drawable/drawer_home_unselected_item.xml
deleted file mode 100644
index 9408e86288..0000000000
--- a/layouteditor/src/main/res/drawable/drawer_home_unselected_item.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/file_export.xml b/layouteditor/src/main/res/drawable/file_export.xml
deleted file mode 100644
index f96f387566..0000000000
--- a/layouteditor/src/main/res/drawable/file_export.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/file_import.xml b/layouteditor/src/main/res/drawable/file_import.xml
deleted file mode 100644
index 4e60665039..0000000000
--- a/layouteditor/src/main/res/drawable/file_import.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/file_tree.xml b/layouteditor/src/main/res/drawable/file_tree.xml
deleted file mode 100644
index 43608f8544..0000000000
--- a/layouteditor/src/main/res/drawable/file_tree.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/folder_outline.xml b/layouteditor/src/main/res/drawable/folder_outline.xml
deleted file mode 100644
index a61e015ab2..0000000000
--- a/layouteditor/src/main/res/drawable/folder_outline.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/folder_settings_outline.xml b/layouteditor/src/main/res/drawable/folder_settings_outline.xml
deleted file mode 100644
index 4087c74a63..0000000000
--- a/layouteditor/src/main/res/drawable/folder_settings_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/format_font.xml b/layouteditor/src/main/res/drawable/format_font.xml
deleted file mode 100644
index ecdad7babe..0000000000
--- a/layouteditor/src/main/res/drawable/format_font.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/format_letter_case.xml b/layouteditor/src/main/res/drawable/format_letter_case.xml
deleted file mode 100644
index 603b6013b8..0000000000
--- a/layouteditor/src/main/res/drawable/format_letter_case.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/home_outline.xml b/layouteditor/src/main/res/drawable/home_outline.xml
deleted file mode 100644
index d2923822e1..0000000000
--- a/layouteditor/src/main/res/drawable/home_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_card.xml b/layouteditor/src/main/res/drawable/ic_card.xml
deleted file mode 100644
index 25bab598c4..0000000000
--- a/layouteditor/src/main/res/drawable/ic_card.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_checkbox_marked.xml b/layouteditor/src/main/res/drawable/ic_checkbox_marked.xml
deleted file mode 100644
index 646f26703d..0000000000
--- a/layouteditor/src/main/res/drawable/ic_checkbox_marked.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_color_picker.xml b/layouteditor/src/main/res/drawable/ic_color_picker.xml
deleted file mode 100644
index 2f0ecdf61b..0000000000
--- a/layouteditor/src/main/res/drawable/ic_color_picker.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/layouteditor/src/main/res/drawable/ic_constraint.xml b/layouteditor/src/main/res/drawable/ic_constraint.xml
deleted file mode 100644
index 791196e5a8..0000000000
--- a/layouteditor/src/main/res/drawable/ic_constraint.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_coordinator.xml b/layouteditor/src/main/res/drawable/ic_coordinator.xml
deleted file mode 100644
index 213f930207..0000000000
--- a/layouteditor/src/main/res/drawable/ic_coordinator.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_cursor_text.xml b/layouteditor/src/main/res/drawable/ic_cursor_text.xml
deleted file mode 100644
index a1590429af..0000000000
--- a/layouteditor/src/main/res/drawable/ic_cursor_text.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_edittext.xml b/layouteditor/src/main/res/drawable/ic_edittext.xml
deleted file mode 100644
index 837c0ef786..0000000000
--- a/layouteditor/src/main/res/drawable/ic_edittext.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_frame.xml b/layouteditor/src/main/res/drawable/ic_frame.xml
deleted file mode 100644
index 703c598c61..0000000000
--- a/layouteditor/src/main/res/drawable/ic_frame.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_image_outline.xml b/layouteditor/src/main/res/drawable/ic_image_outline.xml
deleted file mode 100644
index f99da1a7cf..0000000000
--- a/layouteditor/src/main/res/drawable/ic_image_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_linear_vertical.xml b/layouteditor/src/main/res/drawable/ic_linear_vertical.xml
deleted file mode 100644
index 011acf3682..0000000000
--- a/layouteditor/src/main/res/drawable/ic_linear_vertical.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_progress_check.xml b/layouteditor/src/main/res/drawable/ic_progress_check.xml
deleted file mode 100644
index f6a763e844..0000000000
--- a/layouteditor/src/main/res/drawable/ic_progress_check.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_radiobox_marked.xml b/layouteditor/src/main/res/drawable/ic_radiobox_marked.xml
deleted file mode 100644
index 58e2f3129a..0000000000
--- a/layouteditor/src/main/res/drawable/ic_radiobox_marked.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_radiogroup.xml b/layouteditor/src/main/res/drawable/ic_radiogroup.xml
deleted file mode 100644
index 0e1430f245..0000000000
--- a/layouteditor/src/main/res/drawable/ic_radiogroup.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_relative_layout_outline.xml b/layouteditor/src/main/res/drawable/ic_relative_layout_outline.xml
deleted file mode 100644
index 56eb3a7676..0000000000
--- a/layouteditor/src/main/res/drawable/ic_relative_layout_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_seekbar.xml b/layouteditor/src/main/res/drawable/ic_seekbar.xml
deleted file mode 100644
index e211677427..0000000000
--- a/layouteditor/src/main/res/drawable/ic_seekbar.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_textview.xml b/layouteditor/src/main/res/drawable/ic_textview.xml
deleted file mode 100644
index 603b6013b8..0000000000
--- a/layouteditor/src/main/res/drawable/ic_textview.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/ic_toggle_switch.xml b/layouteditor/src/main/res/drawable/ic_toggle_switch.xml
deleted file mode 100644
index 0488e5de1f..0000000000
--- a/layouteditor/src/main/res/drawable/ic_toggle_switch.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/image_broken.xml b/layouteditor/src/main/res/drawable/image_broken.xml
deleted file mode 100644
index 77fa647a6a..0000000000
--- a/layouteditor/src/main/res/drawable/image_broken.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/image_filter_center_focus.xml b/layouteditor/src/main/res/drawable/image_filter_center_focus.xml
deleted file mode 100644
index 8cc7a36448..0000000000
--- a/layouteditor/src/main/res/drawable/image_filter_center_focus.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/image_outline.xml b/layouteditor/src/main/res/drawable/image_outline.xml
deleted file mode 100644
index f99da1a7cf..0000000000
--- a/layouteditor/src/main/res/drawable/image_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/information.xml b/layouteditor/src/main/res/drawable/information.xml
deleted file mode 100644
index b0bdf2e1e8..0000000000
--- a/layouteditor/src/main/res/drawable/information.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/menu.xml b/layouteditor/src/main/res/drawable/menu.xml
deleted file mode 100644
index 2d9b5deca6..0000000000
--- a/layouteditor/src/main/res/drawable/menu.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/palette_advanced.xml b/layouteditor/src/main/res/drawable/palette_advanced.xml
deleted file mode 100644
index 05a96b3ae0..0000000000
--- a/layouteditor/src/main/res/drawable/palette_advanced.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/palette_outline.xml b/layouteditor/src/main/res/drawable/palette_outline.xml
deleted file mode 100644
index e584cefde7..0000000000
--- a/layouteditor/src/main/res/drawable/palette_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/plus.xml b/layouteditor/src/main/res/drawable/plus.xml
deleted file mode 100644
index ff301507fc..0000000000
--- a/layouteditor/src/main/res/drawable/plus.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/redo_variant.xml b/layouteditor/src/main/res/drawable/redo_variant.xml
deleted file mode 100644
index 9c0076a3b9..0000000000
--- a/layouteditor/src/main/res/drawable/redo_variant.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/rounded_rect.xml b/layouteditor/src/main/res/drawable/rounded_rect.xml
deleted file mode 100644
index 72b647b349..0000000000
--- a/layouteditor/src/main/res/drawable/rounded_rect.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/shape.xml b/layouteditor/src/main/res/drawable/shape.xml
deleted file mode 100644
index 60bdd1ae3f..0000000000
--- a/layouteditor/src/main/res/drawable/shape.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/shape_outline.xml b/layouteditor/src/main/res/drawable/shape_outline.xml
deleted file mode 100644
index 0123e6e3c6..0000000000
--- a/layouteditor/src/main/res/drawable/shape_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/share_variant.xml b/layouteditor/src/main/res/drawable/share_variant.xml
deleted file mode 100644
index 4a647bc88d..0000000000
--- a/layouteditor/src/main/res/drawable/share_variant.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/source_merge.xml b/layouteditor/src/main/res/drawable/source_merge.xml
deleted file mode 100644
index 36922a75e1..0000000000
--- a/layouteditor/src/main/res/drawable/source_merge.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/transparent.png b/layouteditor/src/main/res/drawable/transparent.png
deleted file mode 100644
index 84daafbfc0..0000000000
Binary files a/layouteditor/src/main/res/drawable/transparent.png and /dev/null differ
diff --git a/layouteditor/src/main/res/drawable/transparent_background.xml b/layouteditor/src/main/res/drawable/transparent_background.xml
deleted file mode 100644
index 838534f6b5..0000000000
--- a/layouteditor/src/main/res/drawable/transparent_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/layouteditor/src/main/res/drawable/undo_variant.xml b/layouteditor/src/main/res/drawable/undo_variant.xml
deleted file mode 100644
index cb3faa8bfc..0000000000
--- a/layouteditor/src/main/res/drawable/undo_variant.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/view_type.xml b/layouteditor/src/main/res/drawable/view_type.xml
deleted file mode 100644
index dc180fa857..0000000000
--- a/layouteditor/src/main/res/drawable/view_type.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/drawable/xml.xml b/layouteditor/src/main/res/drawable/xml.xml
deleted file mode 100644
index 2e06675660..0000000000
--- a/layouteditor/src/main/res/drawable/xml.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/font/jetbrains_mono_regular.ttf b/layouteditor/src/main/res/font/jetbrains_mono_regular.ttf
deleted file mode 100644
index 8da8aa4051..0000000000
Binary files a/layouteditor/src/main/res/font/jetbrains_mono_regular.ttf and /dev/null differ
diff --git a/layouteditor/src/main/res/font/poppins_regular.ttf b/layouteditor/src/main/res/font/poppins_regular.ttf
deleted file mode 100644
index 9f0c71b70a..0000000000
Binary files a/layouteditor/src/main/res/font/poppins_regular.ttf and /dev/null differ
diff --git a/layouteditor/src/main/res/font/source_sans_pro_regular.ttf b/layouteditor/src/main/res/font/source_sans_pro_regular.ttf
deleted file mode 100644
index 98e8579745..0000000000
Binary files a/layouteditor/src/main/res/font/source_sans_pro_regular.ttf and /dev/null differ
diff --git a/layouteditor/src/main/res/font/ubuntu_regular.ttf b/layouteditor/src/main/res/font/ubuntu_regular.ttf
deleted file mode 100644
index f98a2dab85..0000000000
Binary files a/layouteditor/src/main/res/font/ubuntu_regular.ttf and /dev/null differ
diff --git a/layouteditor/src/main/res/layout/activity_crash.xml b/layouteditor/src/main/res/layout/activity_crash.xml
deleted file mode 100644
index 1a434aab9f..0000000000
--- a/layouteditor/src/main/res/layout/activity_crash.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/activity_drawable_manager.xml b/layouteditor/src/main/res/layout/activity_drawable_manager.xml
deleted file mode 100644
index afa4060407..0000000000
--- a/layouteditor/src/main/res/layout/activity_drawable_manager.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_editor.xml b/layouteditor/src/main/res/layout/activity_editor.xml
deleted file mode 100644
index 5d1cd610fe..0000000000
--- a/layouteditor/src/main/res/layout/activity_editor.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_help.xml b/layouteditor/src/main/res/layout/activity_help.xml
deleted file mode 100644
index 7caf6c2f6c..0000000000
--- a/layouteditor/src/main/res/layout/activity_help.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_layout_editor.xml b/layouteditor/src/main/res/layout/activity_layout_editor.xml
deleted file mode 100644
index 163e49a5a1..0000000000
--- a/layouteditor/src/main/res/layout/activity_layout_editor.xml
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_preview_drawable.xml b/layouteditor/src/main/res/layout/activity_preview_drawable.xml
deleted file mode 100644
index 6d044bbd49..0000000000
--- a/layouteditor/src/main/res/layout/activity_preview_drawable.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_preview_layout.xml b/layouteditor/src/main/res/layout/activity_preview_layout.xml
deleted file mode 100644
index 93de36df12..0000000000
--- a/layouteditor/src/main/res/layout/activity_preview_layout.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/activity_resource_manager.xml b/layouteditor/src/main/res/layout/activity_resource_manager.xml
deleted file mode 100644
index c6db09b81f..0000000000
--- a/layouteditor/src/main/res/layout/activity_resource_manager.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/activity_show_x_m_l.xml b/layouteditor/src/main/res/layout/activity_show_x_m_l.xml
deleted file mode 100644
index aefc1001c9..0000000000
--- a/layouteditor/src/main/res/layout/activity_show_x_m_l.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/dialog_available_attributes.xml b/layouteditor/src/main/res/layout/dialog_available_attributes.xml
deleted file mode 100644
index fe0ed562fe..0000000000
--- a/layouteditor/src/main/res/layout/dialog_available_attributes.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/dialog_select_dpis.xml b/layouteditor/src/main/res/layout/dialog_select_dpis.xml
deleted file mode 100644
index 66db0135b7..0000000000
--- a/layouteditor/src/main/res/layout/dialog_select_dpis.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/fragment_resources.xml b/layouteditor/src/main/res/layout/fragment_resources.xml
deleted file mode 100644
index 221b5205ac..0000000000
--- a/layouteditor/src/main/res/layout/fragment_resources.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_boolean_dialog.xml b/layouteditor/src/main/res/layout/layout_boolean_dialog.xml
deleted file mode 100644
index 1da7463608..0000000000
--- a/layouteditor/src/main/res/layout/layout_boolean_dialog.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_color_dialog.xml b/layouteditor/src/main/res/layout/layout_color_dialog.xml
deleted file mode 100644
index 4e5a26f8ad..0000000000
--- a/layouteditor/src/main/res/layout/layout_color_dialog.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_color_dialog_flag.xml b/layouteditor/src/main/res/layout/layout_color_dialog_flag.xml
deleted file mode 100644
index 28548e438b..0000000000
--- a/layouteditor/src/main/res/layout/layout_color_dialog_flag.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_color_item.xml b/layouteditor/src/main/res/layout/layout_color_item.xml
deleted file mode 100644
index b011cc88af..0000000000
--- a/layouteditor/src/main/res/layout/layout_color_item.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_drawable_grid_item.xml b/layouteditor/src/main/res/layout/layout_drawable_grid_item.xml
deleted file mode 100644
index 70f85775d6..0000000000
--- a/layouteditor/src/main/res/layout/layout_drawable_grid_item.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_drawable_item.xml b/layouteditor/src/main/res/layout/layout_drawable_item.xml
deleted file mode 100644
index 203241aaa6..0000000000
--- a/layouteditor/src/main/res/layout/layout_drawable_item.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_font_item.xml b/layouteditor/src/main/res/layout/layout_font_item.xml
deleted file mode 100644
index b8f34ee778..0000000000
--- a/layouteditor/src/main/res/layout/layout_font_item.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_font_item_dialog.xml b/layouteditor/src/main/res/layout/layout_font_item_dialog.xml
deleted file mode 100644
index ec9f05067b..0000000000
--- a/layouteditor/src/main/res/layout/layout_font_item_dialog.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_navigation_header.xml b/layouteditor/src/main/res/layout/layout_navigation_header.xml
deleted file mode 100644
index 3aa46beb54..0000000000
--- a/layouteditor/src/main/res/layout/layout_navigation_header.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_palette_item.xml b/layouteditor/src/main/res/layout/layout_palette_item.xml
deleted file mode 100644
index a0b94f7f06..0000000000
--- a/layouteditor/src/main/res/layout/layout_palette_item.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_preview_drawable.xml b/layouteditor/src/main/res/layout/layout_preview_drawable.xml
deleted file mode 100644
index fcf654f5e1..0000000000
--- a/layouteditor/src/main/res/layout/layout_preview_drawable.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_project_layout_item.xml b/layouteditor/src/main/res/layout/layout_project_layout_item.xml
deleted file mode 100644
index d1e46cfab7..0000000000
--- a/layouteditor/src/main/res/layout/layout_project_layout_item.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_select_dpi_item.xml b/layouteditor/src/main/res/layout/layout_select_dpi_item.xml
deleted file mode 100644
index e0b7226f50..0000000000
--- a/layouteditor/src/main/res/layout/layout_select_dpi_item.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_size_dialog.xml b/layouteditor/src/main/res/layout/layout_size_dialog.xml
deleted file mode 100644
index ee8e00bb1d..0000000000
--- a/layouteditor/src/main/res/layout/layout_size_dialog.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_structure_view_item.xml b/layouteditor/src/main/res/layout/layout_structure_view_item.xml
deleted file mode 100644
index 065d70d51d..0000000000
--- a/layouteditor/src/main/res/layout/layout_structure_view_item.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/layout_values_item.xml b/layouteditor/src/main/res/layout/layout_values_item.xml
deleted file mode 100644
index f420fcb38b..0000000000
--- a/layouteditor/src/main/res/layout/layout_values_item.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/layout/layout_values_item_dialog.xml b/layouteditor/src/main/res/layout/layout_values_item_dialog.xml
deleted file mode 100644
index 48a845d884..0000000000
--- a/layouteditor/src/main/res/layout/layout_values_item_dialog.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/list_project_file.xml b/layouteditor/src/main/res/layout/list_project_file.xml
deleted file mode 100644
index 32630b3be3..0000000000
--- a/layouteditor/src/main/res/layout/list_project_file.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/preference_switch_style.xml b/layouteditor/src/main/res/layout/preference_switch_style.xml
deleted file mode 100644
index fbae8da4d9..0000000000
--- a/layouteditor/src/main/res/layout/preference_switch_style.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/layout/show_attribute_item.xml b/layouteditor/src/main/res/layout/show_attribute_item.xml
deleted file mode 100644
index bd2b653e42..0000000000
--- a/layouteditor/src/main/res/layout/show_attribute_item.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/layout/show_attributes_dialog.xml b/layouteditor/src/main/res/layout/show_attributes_dialog.xml
deleted file mode 100644
index 7e4f18d701..0000000000
--- a/layouteditor/src/main/res/layout/show_attributes_dialog.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/layouteditor/src/main/res/menu/menu_device_size.xml b/layouteditor/src/main/res/menu/menu_device_size.xml
deleted file mode 100644
index aafeb256fa..0000000000
--- a/layouteditor/src/main/res/menu/menu_device_size.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_drawable.xml b/layouteditor/src/main/res/menu/menu_drawable.xml
deleted file mode 100644
index 1d03c79dca..0000000000
--- a/layouteditor/src/main/res/menu/menu_drawable.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_editor.xml b/layouteditor/src/main/res/menu/menu_editor.xml
deleted file mode 100644
index d428e82c75..0000000000
--- a/layouteditor/src/main/res/menu/menu_editor.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_font.xml b/layouteditor/src/main/res/menu/menu_font.xml
deleted file mode 100644
index 75c96a17a4..0000000000
--- a/layouteditor/src/main/res/menu/menu_font.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_layout_file_options.xml b/layouteditor/src/main/res/menu/menu_layout_file_options.xml
deleted file mode 100644
index 89f768a871..0000000000
--- a/layouteditor/src/main/res/menu/menu_layout_file_options.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/menu/menu_project_file_options.xml b/layouteditor/src/main/res/menu/menu_project_file_options.xml
deleted file mode 100644
index 813444b1f5..0000000000
--- a/layouteditor/src/main/res/menu/menu_project_file_options.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_resource_manager.xml b/layouteditor/src/main/res/menu/menu_resource_manager.xml
deleted file mode 100644
index cd33152e37..0000000000
--- a/layouteditor/src/main/res/menu/menu_resource_manager.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_values.xml b/layouteditor/src/main/res/menu/menu_values.xml
deleted file mode 100644
index 135d330d9a..0000000000
--- a/layouteditor/src/main/res/menu/menu_values.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/menu/menu_view_type.xml b/layouteditor/src/main/res/menu/menu_view_type.xml
deleted file mode 100644
index f66be375e4..0000000000
--- a/layouteditor/src/main/res/menu/menu_view_type.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/layouteditor/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/layouteditor/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index 345888d26e..0000000000
--- a/layouteditor/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher.png b/layouteditor/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index d7b1dd9872..0000000000
Binary files a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_background.png b/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_background.png
deleted file mode 100644
index 4b2d3f253c..0000000000
Binary files a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_background.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
deleted file mode 100644
index c38d468b5b..0000000000
Binary files a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 17ed15807b..0000000000
Binary files a/layouteditor/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher.png b/layouteditor/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index eb187334f8..0000000000
Binary files a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_background.png b/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_background.png
deleted file mode 100644
index 179cc6a9cf..0000000000
Binary files a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_background.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
deleted file mode 100644
index 37b6039c8c..0000000000
Binary files a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 5279ae622a..0000000000
Binary files a/layouteditor/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_button.xml
deleted file mode 100644
index 20803056bd..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_button.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_button_2.png b/layouteditor/src/main/res/mipmap-xhdpi/ic_button_2.png
deleted file mode 100644
index 040475f069..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xhdpi/ic_button_2.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_card.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_card.xml
deleted file mode 100644
index 25bab598c4..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_card.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_checkbox_marked.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_checkbox_marked.xml
deleted file mode 100644
index 646f26703d..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_checkbox_marked.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_constraint.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_constraint.xml
deleted file mode 100644
index 791196e5a8..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_constraint.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_coordinator.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_coordinator.xml
deleted file mode 100644
index 213f930207..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_coordinator.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_cursor_text.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_cursor_text.xml
deleted file mode 100644
index a1590429af..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_cursor_text.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_edittext.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_edittext.xml
deleted file mode 100644
index 837c0ef786..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_edittext.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_fab.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_fab.xml
deleted file mode 100644
index 5acd65552b..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_fab.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_frame.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_frame.xml
deleted file mode 100644
index 703c598c61..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_frame.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_image_outline.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_image_outline.xml
deleted file mode 100644
index f99da1a7cf..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_image_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher.png b/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfaa9441dd..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_background.png
deleted file mode 100644
index 51c90d02d1..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_background.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 1db3fb4e00..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index d03c861263..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_horizontal.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_horizontal.xml
deleted file mode 100644
index 011acf3682..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_horizontal.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_vertical.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_vertical.xml
deleted file mode 100644
index 5e68373af8..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_linear_vertical.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_ad_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_ad_view.xml
deleted file mode 100644
index 05312e9d72..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_ad_view.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_adapter_view_flipper.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_adapter_view_flipper.xml
deleted file mode 100644
index 02242dd25f..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_adapter_view_flipper.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_analog_clock.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_analog_clock.xml
deleted file mode 100644
index ced0f38bb2..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_analog_clock.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_app_bar_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_app_bar_layout.xml
deleted file mode 100644
index 0b057db07d..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_app_bar_layout.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_auto_complete_text_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_auto_complete_text_view.xml
deleted file mode 100644
index 18837fe2b5..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_auto_complete_text_view.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_horizontal.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_horizontal.xml
deleted file mode 100644
index 531e353c2a..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_horizontal.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_vertical.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_vertical.xml
deleted file mode 100644
index 1831e9d2f1..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_barrier_vertical.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_app_bar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_app_bar.xml
deleted file mode 100644
index 14724ec5d7..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_app_bar.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_navigation_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_navigation_view.xml
deleted file mode 100644
index 16235931ab..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_bottom_navigation_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_button.xml
deleted file mode 100644
index e3f6465bfa..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_button.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_calendar_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_calendar_view.xml
deleted file mode 100644
index 2445f9618d..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_calendar_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_card_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_card_view.xml
deleted file mode 100644
index ed10102233..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_card_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_check_box.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_check_box.xml
deleted file mode 100644
index c394bfd4bb..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_check_box.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_checked_text_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_checked_text_view.xml
deleted file mode 100644
index 25bf610adf..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_checked_text_view.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip.xml
deleted file mode 100644
index f01ea32f14..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip_group.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip_group.xml
deleted file mode 100644
index e38ac73959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chip_group.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chronometer.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chronometer.xml
deleted file mode 100644
index c4692397a3..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_chronometer.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_collapsing_toolbar_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_collapsing_toolbar_layout.xml
deleted file mode 100644
index 345aa5e385..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_collapsing_toolbar_layout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_constraint_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_constraint_layout.xml
deleted file mode 100644
index 1b547edfe9..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_constraint_layout.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_coordinator_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_coordinator_layout.xml
deleted file mode 100644
index e31c5960ad..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_coordinator_layout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_custom_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_custom_view.xml
deleted file mode 100644
index 0d61589ebd..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_custom_view.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_picker.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_picker.xml
deleted file mode 100644
index f0735aa114..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_picker.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_textfield.xml
deleted file mode 100644
index e887fc368d..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_date_textfield.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_drawer_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_drawer_layout.xml
deleted file mode 100644
index a928815923..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_drawer_layout.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_edit_text.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_edit_text.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_edit_text.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_email_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_email_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_email_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_expandable_list_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_expandable_list_view.xml
deleted file mode 100644
index b7064ab9fe..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_expandable_list_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_floating_action_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_floating_action_button.xml
deleted file mode 100644
index 1376a96456..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_floating_action_button.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_fragment.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_fragment.xml
deleted file mode 100644
index f3a9357437..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_fragment.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_frame_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_frame_layout.xml
deleted file mode 100644
index fb3418b888..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_frame_layout.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout.xml
deleted file mode 100644
index f2e68ddeb1..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout_compat.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout_compat.xml
deleted file mode 100644
index 21affadca0..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_layout_compat.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_view.xml
deleted file mode 100644
index f2e68ddeb1..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_grid_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_horizontal.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_horizontal.xml
deleted file mode 100644
index 8b98e2466c..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_horizontal.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_vertical.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_vertical.xml
deleted file mode 100644
index 56a6570a03..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_guideline_vertical.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_divider.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_divider.xml
deleted file mode 100644
index d7f1a9890a..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_divider.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_scroll_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_scroll_view.xml
deleted file mode 100644
index d1f6d3fc54..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_horizontal_scroll_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_button.xml
deleted file mode 100644
index 19758b08a4..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_button.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_switcher.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_switcher.xml
deleted file mode 100644
index db1262b2df..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_switcher.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_view.xml
deleted file mode 100644
index 1595fc7b60..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_image_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_include.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_include.xml
deleted file mode 100644
index adca2f8892..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_include.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_horz.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_horz.xml
deleted file mode 100644
index ed88a79413..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_horz.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_vert.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_vert.xml
deleted file mode 100644
index e72d689d7a..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_linear_layout_vert.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_list_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_list_view.xml
deleted file mode 100644
index 50a6ca4598..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_list_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_fragment.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_fragment.xml
deleted file mode 100644
index bd80588ce9..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_fragment.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_view.xml
deleted file mode 100644
index bd80588ce9..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_map_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_menu.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_menu.xml
deleted file mode 100644
index cd84a135b5..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_menu.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_merge.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_merge.xml
deleted file mode 100644
index 19f2c596ea..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_merge.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_multi_auto_complete_text_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_multi_auto_complete_text_view.xml
deleted file mode 100644
index 06de5285d8..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_multi_auto_complete_text_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nav_host_fragment.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nav_host_fragment.xml
deleted file mode 100644
index 6be5ae89d1..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nav_host_fragment.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_navigation_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_navigation_view.xml
deleted file mode 100644
index ffa6052bf0..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_navigation_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nested_scroll_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nested_scroll_view.xml
deleted file mode 100644
index 984ece13ec..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_nested_scroll_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_decimal_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_decimal_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_decimal_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_picker.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_picker.xml
deleted file mode 100644
index dea32a0a64..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_picker.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_signed_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_signed_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_signed_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_number_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_numeric_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_numeric_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_numeric_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_password_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_phone_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_phone_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_phone_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_postal_address_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_postal_address_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_postal_address_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar.xml
deleted file mode 100644
index 28399e86ce..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar_horizontal.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar_horizontal.xml
deleted file mode 100644
index e345d22257..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_progress_bar_horizontal.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_quick_contact_badge.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_quick_contact_badge.xml
deleted file mode 100644
index 9d7df61b37..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_quick_contact_badge.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_button.xml
deleted file mode 100644
index 6b2a1e19ea..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_button.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_group.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_group.xml
deleted file mode 100644
index 6b2a1e19ea..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_radio_group.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_rating_bar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_rating_bar.xml
deleted file mode 100644
index d30d97ec34..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_rating_bar.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_recycler_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_recycler_view.xml
deleted file mode 100644
index 50a6ca4598..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_recycler_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_relative_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_relative_layout.xml
deleted file mode 100644
index 3b42668499..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_relative_layout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_request_focus.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_request_focus.xml
deleted file mode 100644
index 040e325c7a..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_request_focus.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_scroll_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_scroll_view.xml
deleted file mode 100644
index 984ece13ec..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_scroll_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_search_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_search_view.xml
deleted file mode 100644
index 0c158379e9..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_search_view.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar.xml
deleted file mode 100644
index a347677c43..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar_discrete.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar_discrete.xml
deleted file mode 100644
index 09beeb2143..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_seek_bar_discrete.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_space.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_space.xml
deleted file mode 100644
index d6bc801e3c..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_space.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_spinner.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_spinner.xml
deleted file mode 100644
index 961b20cbf7..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_spinner.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_stack_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_stack_view.xml
deleted file mode 100644
index dc2e214105..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_stack_view.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_surface_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_surface_view.xml
deleted file mode 100644
index d18386d9cf..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_surface_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_switch.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_switch.xml
deleted file mode 100644
index 8c536c42a2..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_switch.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_host.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_host.xml
deleted file mode 100644
index c87e009044..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_host.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_item.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_item.xml
deleted file mode 100644
index c87e009044..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_item.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_layout.xml
deleted file mode 100644
index 37f0db11db..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_layout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_widget.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_widget.xml
deleted file mode 100644
index c87e009044..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_tab_widget.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_layout.xml
deleted file mode 100644
index 6923f90d1e..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_layout.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_row.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_row.xml
deleted file mode 100644
index f981552adf..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_table_row.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_clock.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_clock.xml
deleted file mode 100644
index ced0f38bb2..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_clock.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_input_layout.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_input_layout.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_input_layout.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_switcher.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_switcher.xml
deleted file mode 100644
index d0daa1eee9..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_switcher.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_view.xml
deleted file mode 100644
index 7388b61cb5..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_text_view.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield_multiline.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield_multiline.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_textfield_multiline.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_texture_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_texture_view.xml
deleted file mode 100644
index e26bb95ad2..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_texture_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_picker.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_picker.xml
deleted file mode 100644
index 31916ccb4e..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_picker.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_textfield.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_textfield.xml
deleted file mode 100644
index b93f4a4959..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_time_textfield.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toggle_button.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toggle_button.xml
deleted file mode 100644
index 4aca3b91d0..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toggle_button.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toolbar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toolbar.xml
deleted file mode 100644
index 345aa5e385..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_toolbar.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_unknown_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_unknown_view.xml
deleted file mode 100644
index 3729867c14..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_unknown_view.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_vertical_divider.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_vertical_divider.xml
deleted file mode 100644
index 448ef0d1dd..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_vertical_divider.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_video_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_video_view.xml
deleted file mode 100644
index d49bd74320..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_video_view.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view.xml
deleted file mode 100644
index 7c1bf8ff55..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_animator.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_animator.xml
deleted file mode 100644
index 863ef54ff2..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_animator.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_flipper.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_flipper.xml
deleted file mode 100644
index 1892371d26..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_flipper.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_pager.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_pager.xml
deleted file mode 100644
index 87b1b9de59..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_pager.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_stub.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_stub.xml
deleted file mode 100644
index f9a5c95939..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_stub.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_switcher.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_switcher.xml
deleted file mode 100644
index 9d646fff43..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_view_switcher.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_web_view.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_web_view.xml
deleted file mode 100644
index 3af3f71a64..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_palette_web_view.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_progress_check.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_progress_check.xml
deleted file mode 100644
index f6a763e844..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_progress_check.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_radiobox_marked.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_radiobox_marked.xml
deleted file mode 100644
index 58e2f3129a..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_radiobox_marked.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_radiogroup.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_radiogroup.xml
deleted file mode 100644
index 0e1430f245..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_radiogroup.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_relative_layout_outline.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_relative_layout_outline.xml
deleted file mode 100644
index 56eb3a7676..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_relative_layout_outline.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_seekbar.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_seekbar.xml
deleted file mode 100644
index e211677427..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_seekbar.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_textview.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_textview.xml
deleted file mode 100644
index 603b6013b8..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_textview.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xhdpi/ic_toggle_switch.xml b/layouteditor/src/main/res/mipmap-xhdpi/ic_toggle_switch.xml
deleted file mode 100644
index 0488e5de1f..0000000000
--- a/layouteditor/src/main/res/mipmap-xhdpi/ic_toggle_switch.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher.png b/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 59d9dc79ef..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
deleted file mode 100644
index c7292b5e72..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_background.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index e85a7253e4..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index b57baeb1ed..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index d860a598eb..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
deleted file mode 100644
index 88ae25587c..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 3d99fa7794..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png
deleted file mode 100644
index 8647c63b83..0000000000
Binary files a/layouteditor/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png and /dev/null differ
diff --git a/layouteditor/src/main/res/values-in/strings.xml b/layouteditor/src/main/res/values-in/strings.xml
deleted file mode 100644
index 4ba18df7b4..0000000000
--- a/layouteditor/src/main/res/values-in/strings.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
- TENTANG
- Preferensi
- Tentang
- Buka laci navigasi
- Tutup laci navigasi
- Proyek telah disimpan.
- Proyek baru
- Layout telah disimpan
- Gagal menyimpan layout
- Layout baru
- Layout kosong! Tambahkan tampilan sebelum menyimpan…
- Tambah baru
- Hapus
- Salin
- Pengelola Drawable
- Pratinjau XML
- Klik ikon + untuk membuat proyek baru.
- Izin diberikan…
- Izin ditolak…
- Pratinjau Layout
- Telah disalin ke papan klip
- Apakah Anda yakin ingin menghapus proyek ini?
- Apakah Anda yakin ingin menghapus layout ini?
- Hapus proyek
- Buat proyek
- Hapus layout
- Buat layout
- Ya
- Tidak
- Ubah nama
- Batal
- Buat
- Masukkan nama proyek baru
- Ubah nama proyek
- Masukkan nama layout baru
- Ubah nama Layout
- Nama saat ini tidak tersedia!
- Kolom ini tidak boleh kosong!
- Opsi
- Hapus drawable
- Hapus font
- Apakah Anda yakin ingin menghapus drawable ini?
- Apakah Anda yakin ingin menghapus font ini?
- Masukkan nama baru
- Tambah drawable
- Tambah
- Hanya huruf kecil (a–z) dan angka!
- Anda tidak dapat mengubah nama %1$s yang sudah ditentukan secara default…
- Anda tidak dapat menghapus %1$s yang sudah ditentukan secara default…
- Fitur ini belum tersedia. Akan segera tersedia.
- Tidak ada…
- Tambahkan beberapa widget
- Catatan
- Oke
- Aplikasi crash (rusak)
- Tutup
- Tutup aplikasi
- Urung
- Ulang
- Simpan
- Tampilkan struktur
- Keluar
- Tampilkan XML
- Simpan XML
- Hapus tampilan
- Apakah Anda yakin ingin menghapus tampilan ini?
- Layout ini tidak mendukung %1$s di dalam %2$s. Pindahkan ke induk yang lain.
- %1$s di dalam %2$s mungkin berperilaku tidak seperti yang diharapkan di editor.
- Pilih tipe argumen
- Pilih tipe drawable
- Gelap
- Terang
- Otomatis
- Ini akan menutup aplikasi beserta semua tugasnya!
- Ekspor Layout
- Data yang diterima tidak valid.
- Pilih file dari Penyimpanan Utama.
- Huruf pertama tidak boleh berisi angka!
- Nama tersebut tidak boleh mengandung spasi.
- Konfirmasi
- Konfirmasi
- Apakah Anda yakin ingin menyimpan proyek ini?
- Jangan simpan
- Pengelola Resources
- Font
- String
- Drawable
- Color
- Edit XML
- Pratinjau Drawable
- Ubah nama Drawable
- Salin nama
- Impor
- Skema Warna
- Warna baru
- Hapus warna
- Apakah Anda yakin ingin menghapus %1$s?
- Pilih warna
- Edit warna
- Warna tidak valid
- Nama wajib diisi
- Pilih
- Palette
- Common
- Texts
- Buttons
- Widgets
- Layouts
- Containers
- Google
- Legacy
- Pratinjau Drawable
- Ekspor sebagai Gambar
- Tambah font
- Ubah nama font
- Desain
- Blueprint
- Kecil
- Sedang
- Besar
- Nama tidak valid
- ¯\\_(ツ)_/¯
- Nama tersebut tidak boleh mengandung simbol.
- Simpan layout
- Apakah Anda yakin ingin menyimpan layout ini?
- Apakah Anda yakin ingin mengekspor layout atau gambar?
- Nilai
- Nama
- Simpan perubahan
- Apakah Anda yakin ingin menyimpan perubahan pada layout?
- Simpan perubahan dan keluar
- Batalkan perubahan dan keluar
- Batalkan dan tetap di Editor Layout
- Gagal memuat font %1$s. File kosong atau tidak valid.
- Gagal menambahkan font. File kosong atau rusak.
- Gagal memuat daftar file.
-
-
- File yang dipilih bukan file layout XML Android
- Gagal memuat palet
- Gagal menginisialisasi palet
- Gagal memuat layout
- Anda tidak dapat menghapus layout utama.
- Diimpor!
- Gagal mengimpor!
- Berhasil!
- Gagal menyimpan!
- Tambahkan beberapa tampilan…
- Telah disimpan ke galeri.
- Gagal menyimpan…
- Dimuat!
- Palette
- Layouts
- Buat layout baru
- Tipe tampilan
- Ukuran
- *Perlu diperhatikan bahwa proses impor akan gagal jika Anda mencoba mengimpor file layout dengan tampilan yang berbeda dari set tampilan LayoutEditor!
- layout_new
-
- Kunci API Gemini
- Simpan kunci
- Hapus
- Edit
- Kunci API Gemini telah disimpan di %s
-
- Agen AI
- Obrolan baru
- Histori
- Pengaturan AI
- Tutup
- Kunci API telah disimpan.
-
- Kunci API telah dihapus.
- Kunci API tidak boleh kosong.
- Kunci API telah disimpan dengan aman.
- ••••••••••••••••••••
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values-night/themes.xml b/layouteditor/src/main/res/values-night/themes.xml
deleted file mode 100644
index dffa2bc70f..0000000000
--- a/layouteditor/src/main/res/values-night/themes.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values-pt-rBR/strings.xml b/layouteditor/src/main/res/values-pt-rBR/strings.xml
deleted file mode 100644
index e0c95fb805..0000000000
--- a/layouteditor/src/main/res/values-pt-rBR/strings.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
- SOBRE
- Preferências
- Sobre
- Abra a gaveta de navegação
- Fechar gaveta de navegação
- Projeto salvo.
- Novo projeto
- Projeto vazio! Adicionar uma visualização antes de salvar…
- Adicionar novo
- Excluir
- Copiar
- Gerenciador de drawable
- Visualização XML
- Clique no ícone + para criar um novo projeto.
- Permissão garantida…
- Permissão negada…
- Visualizar o Layout
- Copiado para a área de transferência
- Tem certeza de que deseja excluir o projeto?
- Excluir projeto
- Criar projeto
- Sim
- Não
- Renomear
- Cancelar
- Criar
- Digite o novo nome do projeto
- Renomear projeto
- O nome atual não está disponível!
- O campo não pode estar vazio!
- Opções
- Comum
- Remover drawable
- Deseja remover os drawables?
- Digite o novo nome
- Adicionar drawable
- Adicionar
- Apenas letras minúsculas (a-z) e números!
- Este recurso ainda não está disponível. Estará disponível em breve.
- Nada…
- Adicionar alguns widgets
- Ok
- O aplicativo travou
- Fechar
- Fechar aplicativo
- Desfazer
- refazer
- Salvar
- Mostrar estrutura
- Mostrar xml
- Salvar xml
- Excluir visualização
- Deseja excluir a visualização?
- Selecione o tipo de argumento
- Escuro
- Claro
- Auto
- Tema
- Exportar Layout
- ¯\\_(ツ)_/¯
- Você deseja exportar layout ou imagem
-
diff --git a/layouteditor/src/main/res/values-ru/strings.xml b/layouteditor/src/main/res/values-ru/strings.xml
deleted file mode 100644
index 7baff8b85f..0000000000
--- a/layouteditor/src/main/res/values-ru/strings.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-
- О ПРИЛОЖЕНИИ
- Настройки
- О приложении
- Открыть блок навигации
- Закрыть блок навигации
- Проект сохранен.
- Новый проект
- Проект пуст! Добавьте обзор перед сохранением…
- Добавить новый
- Удаление
- Копирование
- Управление отрисовкой
- Предпросмотр XML
- Клик + значок для создания нового проекта.
- Разрешение предоставлено…
- Разрешения нет…
- Просмотр макета
- Скопировано в буфер
- Удалить проект? Вы уверены?
- Удалить проект
- Создать проект
- Да
- Нет
- Переименовать
- Отменить
- Создать
- Введите имя нового проекта
- Переименовать проект
- Текущее имя недоступно!
- Поле не может быть пустым!
- Возможности
- Удалить отрисовку
- Удалить шрифт
- Удалить отрисовку?
- Удалить шрифт?
- Введите новое имя
- Добавить отрисовку
- Добавить
- Только строчные буквы(a-z) и цифры!
- Нельзя удалить по уиолчанию %1$s…
- Эта функция пока не доступна, скоро будет.
- Ничего…
- Добавить виджеты
- Ок
- Аварийное завершение
- Закрыть
- Закрыть приложение
- Вернуть
- Заново
- Сохранить
- Показать структуру
- Показать XML
- Сохранить XML
- Удаление представлния
- Удалить представление?
- Выбор типа аргумента
- Выбор типа отрисовки
- Темная
- Светлая
- Авто
- Тема
- Экспорт макета
- Интент вернул некорректные данные.
- Выберите файл из основного хранилища.
- Первый символ не должен быть цифрой!
- Имя не может содержать пробелы.
- Подтверждение
- Сохранить проект?
- Не сохранять
- Менеджер ресурсов
- Шрифт
- Строка
- Отрисовка
- Цвет
- Правка XML
- Предпросмотр отрисовки
- Переименовать отрисовку
- Копия имени
- Импорт
- цветовой схемы
- Выбор
- Палитра
- Общее
- Текст
- Кнопки
- Виджеты
- Макеты
- Контейнеры
- Гугл
- Наследование
- Смотреть Отрисовку
- Экспорт картинки
- Добавить шрифт
- Переименовать шрифт
- Дизайн
- Чертеж
- Малый
- Средний
- Большой
- ¯\\_(ツ)_/¯
- Вы хотите экспортировать макет или изображение?
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values-tr/strings.xml b/layouteditor/src/main/res/values-tr/strings.xml
deleted file mode 100644
index 8876059f99..0000000000
--- a/layouteditor/src/main/res/values-tr/strings.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
- HAKKINDA
- Tercihler
- Hakkında
- Gezinme çekmecesini aç
- Gezinme çekmecesini kapat
- Proje kaydedildi.
- Yeni proje
- Düzen Kaydedildi
- Yeni Düzen
- Düzen boş! Kaydetmeden önce bir görünüm ekle…
- Yeni ekle
- Sil
- Kopyala
- Çizilebilir Yönetici
- XML Önizlemesi
- Yeni bir proje oluşturmak için + simgesine tıklayın.
- İzin verildi…
- İzin reddedildi…
- Düzeni Önizle
- Panoya kopyalandı
- Projeyi kaldırmak istediğinizden emin misiniz?
- Düzeni kaldırmak istediğinizden emin misiniz?
- Projeyi sil
- Proje oluştur
- Düzeni Sil
- Düzen oluştur
- Evet
- Hayır
- Yeniden adlandır
- İptal
- Oluştur
- Yeni proje adı girin
- Projeyi yeniden adlandır
- Yeni düzen adı girin
- Düzeni Yeniden Adlandır
- Geçerli ad kullanılamıyor!
- Alan boş bırakılamaz!
- Seçenekler
- Çizilebiliri kaldır
- Yazı tipini kaldır
- Çizilebiliri kaldırmak istiyor musunuz?
- Yazı tipini kaldırmak istiyor musunuz?
- Yeni ad girin
- Çizilebilir ekle
- Ekle
- Yalnızca küçük harfler (a-z) ve sayılar!
- Varsayılan %1$s öğesini yeniden adlandıramazsınız…
- Varsayılan %1$s\'ı silemezsiniz…
- Bu özellik henüz mevcut değil. Yakında hazır olacak.
- Boş…
- Bazı widget\'lar ekleyin
- Not
- Tamam
- Uygulama çöktü
- Kapat
- Uygulamayı kapat
- Geri al
- Yinele
- Kaydet
- Yapıyı göster
- XML göster
- XML olarak kaydet
- Görünümü sil
- Görünümü kaldırmak istiyor musunuz?
- Bağımsız değişken türünü seçin
- Çizilebilir türü seçin
- Koyu
- Açık
- Otomatik
- Bu, uygulamayı tüm görevlerle kapatacak!.
- Düzeni Dışa Aktar
- Intent tarafından döndürülen Geçersiz Veri.
- Birincil Depolama\'dan dosya seçin.
- İlk harf bir sayı olmamalıdır!
- Ad boşluk içermemelidir.
- Onayla
- Onay
- Bu projeyi kaydetmek istiyor musunuz?
- Kaydetme
- Kaynaklar Yöneticisi
- Yazı tipi
- Dizi
- Çizilebilir
- Renk
- XML\'i düzenle
- Çizilebilir Önizleme
- Çizilebiliri Yeniden Adlandır
- Adı Kopyala
- İçe Aktar
- Renk uyumu
- Seç
- Palet
- Yaygın
- Metinler
- Butonlar
- Widget\'lar
- Düzenler
- Kaplar
- Google
- Miras
- Çizilebilir Önizleme
- Görüntü Olarak Dışa Aktar
- Yazı tipi ekle
- Yazı tipini yeniden adlandır
- Tasarım
- Taslak
- Küçük
- Orta
- Büyük
- Geçersiz İsim
- ¯\\_(ツ)_/¯
- Ad sembol içermemelidir.
- Düzeni kaydet
- Düzeni kaydetmek istiyor musunuz?
- Düzeni mi yoksa görüntüyü mi dışa aktarmak istiyorsunuz?
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values-zh-rCN/strings.xml b/layouteditor/src/main/res/values-zh-rCN/strings.xml
deleted file mode 100644
index c121df426c..0000000000
--- a/layouteditor/src/main/res/values-zh-rCN/strings.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
- 关于
- 偏好
- 关于
- 打开导航抽屉
- 关闭导航抽屉
- 项目已保存。
- 新项目
- 布局已保存
- 新布局
- 布局是空的!请在保存前添加视图…
- 添加新的
- 删除
- 复制
- 绘制资源管理
- XML 预览
- 点击 + 图标创建一个新项目
- 已授予权限…
- 没有权限…
- 预览布局
- 已复制到剪贴板
- 确定要删除这个项目吗?
- 确定要删除这个布局吗?
- 删除项目
- 创建项目
- 删除布局
- 创建布局
- 是的
- 不了
- 重命名
- 取消
- 创建
- 输入新项目名称
- 重命名项目
- 输入新布局名称
- 重命名布局
- 当前名称不可用!
- 字段不能为空!
- 选项
- 删除drawable
- 删除字体
- 您想删除绘制资源吗?
- 您想删除字体吗?
- 输入新名称
- 添加绘制资源
- 添加
- 仅限小写字母 (a-z) 和数字!
- 无法重命名默认的 %1$s…
- 无法删除默认的 %1$s…
- 此功能尚不可用。即将推出。
- 啥都没有…
- 添加一些小部件
- 注意
- 好的
- 程序崩溃了):
- 关闭
- 关闭程序
- 撤消
- 重做
- 保存
- 显示结构
- 显示 XML
- 保存 XML
- 删除视图
- 您想删除视图吗?
- 选择参数类型
- 选择绘制资源类型
- 暗色
- 亮色
- 自动
- 这将关闭包含所有任务的应用程序!
- 导出布局
- Intent 返回的数据无效。
- 从内部存储中选择文件。
- 第一个字符不能是数字!
- 这个名称不能包含空格。
- 确认
- 确认
- 您想保存该项目吗?
- 不保存
- 资源管理
- 字体
- 字符串
- Drawable
- 颜色
- 编辑XML
- 绘制资源预览
- 重命名绘制资源
- 复制名字
- 导入
- 配色方案
- 选择
- 调色板
- 常规
- 文本
- 按钮
- 部件
- 布局
- 容器
- Google
- Legacy
- 预览绘制资源
- 导出为图像
- 添加字体
- 重命名字体
- 设计
- 蓝图
- 小
- 中
- 大
- 名称无效
- ¯\\_(ツ)_/¯
- 这个名字不能包含符号。
- 保存布局
- 您想保存布局吗?
- 您要导出布局还是图像
-
diff --git a/layouteditor/src/main/res/values-zh-rTW/strings.xml b/layouteditor/src/main/res/values-zh-rTW/strings.xml
deleted file mode 100644
index 5d9f8edf7c..0000000000
--- a/layouteditor/src/main/res/values-zh-rTW/strings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
- 關於
- 偏好設定
- 關於
- 開啟導航欄
- 關閉導航欄
- 專案已儲存。
- 新增專案
- 專案是空的! 請於儲存前添加視圖…
- 新增
- 刪除
- 複製
- 繪圖管理器
- 點擊 + 圖示創建一個新專案。
- 已准許權限…
- 沒有權限…
- 預覽佈局
- 已複製到剪貼簿
- ¯\\_(ツ)_/¯
- 您要匯出佈局還是圖像
-
diff --git a/layouteditor/src/main/res/values/arrays.xml b/layouteditor/src/main/res/values/arrays.xml
deleted file mode 100644
index a8b391dccf..0000000000
--- a/layouteditor/src/main/res/values/arrays.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- - @string/theme_light
- - @string/theme_dark
- - @string/theme_auto
-
-
-
- - 1
- - 2
- - -1
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values/colors.xml b/layouteditor/src/main/res/values/colors.xml
deleted file mode 100644
index afced4215a..0000000000
--- a/layouteditor/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
- #666666
- #555555
- #FFFFFF
- #E0E0E0
- #1A1A1A
- #666666
- #FFFFFF
- #E8E8E8
- #1A1A1A
- #666666
- #FFFFFF
- #E8E8E8
- #1A1A1A
- #B3261E
- #FFFFFF
- #F9DEDC
- #410E0B
- #79747E
- #FFFBFE
- #1C1B1F
- #FFFBFE
- #1C1B1F
- #E7E0EC
- #49454F
- #313033
- #F4EFF4
- #AAAAAA
- #000000
- #555555
- #CAC4D0
- #000000
- #AAAAAA
- #1A1A1A
- #404040
- #E8E8E8
- #999999
- #1A1A1A
- #4A4A4A
- #E8E8E8
- #AAAAAA
- #1A1A1A
- #333333
- #E8E8E8
- #F2B8B5
- #601410
- #8C1D18
- #F9DEDC
- #938F99
- #1C1B1F
- #E6E1E5
- #1C1B1F
- #E6E1E5
- #49454F
- #CAC4D0
- #E6E1E5
- #313033
- #555555
- #000000
- #AAAAAA
- #49454F
- #000000
-
diff --git a/layouteditor/src/main/res/values/dimens.xml b/layouteditor/src/main/res/values/dimens.xml
deleted file mode 100644
index ef6925a9bb..0000000000
--- a/layouteditor/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- 8dp
- 16dp
-
- 16dp
- 16dp
- 8dp
- 176dp
- 16dp
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values/strings.xml b/layouteditor/src/main/res/values/strings.xml
deleted file mode 100644
index be4e7a84fc..0000000000
--- a/layouteditor/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
- ABOUT
- Preferences
- About
- Open navigation drawer
- Close navigation drawer
- Project saved.
- New project
- Layout Saved
- Failed to save layout
- New Layout
- Layout empty! Add a view before saving…
- Add new
- Delete
- Copy
- Drawable Manager
- XML Preview
- Click + icon to create a new project.
- Permission granted…
- Permission denied…
- Preview Layout
- Copied to clipboard
- Are you sure want to remove the project?
- Are you sure, want to remove the layout?
- Delete project
- Create project
- Delete Layout
- Create layout
- Yes
- No
- Rename
- Cancel
- Create
- Enter new project name
- Rename project
- Enter new layout name
- Rename Layout
- Current name is unavailable!
- Field cannot be empty!
- Options
- Remove drawable
- Remove font
- Do you want to remove the drawable?
- Do you want to remove the font?
- Enter new name
- Add drawable
- Add
- Only small letters(a-z) and numbers!
- You cannot rename the default %1$s…
- You cannot delete the default %1$s…
- This feature is not available yet. Will be available soon.
- Nothing…
- Add some widgets
- Note
- Okay
- App crashed
- Close
- Close app
- Undo
- Redo
- Save
- Show structure
- Exit
- Show XML
- Save XML
- Delete view
- Do you want to remove the view?
- This layout doesn’t support %1$s inside %2$s. Move it to another parent.
- %1$s inside %2$s may behave unexpectedly in the editor.
- Select argument type
- Select drawable type
- Dark
- Light
- Auto
- This will close the application with all tasks!
- Export Layout
- Invalid Data returned by Intent.
- Select file from Primary Storage.
- The first letter must not be a number!
- The name must not contain spaces.
- Confirm
- Confirmation
- Do you want to save this project?
- Don\'t Save
- Resources Manager
- Font
- String
- Drawable
- Color
- Edit XML
- Drawable Preview
- Rename Drawable
- Copy Name
- Import
- Color Scheme
- New Color
- Remove Color
- Do you want to remove %1$s?
- Choose Color
- Edit Color
- Invalid color
- Name required
- Select
- Palette
- Common
- Texts
- Buttons
- Widgets
- Layouts
- Containers
- Google
- Legacy
- Preview Drawable
- Export as Image
- Add font
- Rename font
- Design
- Blueprint
- Small
- Medium
- Large
- Invalid Name
- ¯\\_(ツ)_/¯
- The name must not contain symbols.
- Save layout
- Do you want to save the layout?
- Do you want to export layout or image?
- Value
- Name
- Save Changes
- Do you want to save changes to the layout?
- Save changes and exit
- Discard changes and exit
- Cancel and stay in Layout Editor
- Failed to load font %1$s. File is empty or invalid.
- Failed to add font. The file is empty or corrupt.
- Failed to load file list.
-
-
- Selected file is not an Android XML layout file
- Failed to load palette
- Failed to initialize palette
- Failed to load layouts
- You can\'t delete main layout.
- Imported!
- Failed to import!
- Success!
- Failed to save!
- Add some views…
- Saved to gallery.
- Failed to save…
- Loaded!
- Palette
- Layouts
- Create new layout
- View Type
- Size
- *Be aware it will fail to import when you try to import the layout file with view, different from LayoutEditor view set!
- layout_new
-
- Gemini API Key
- Save Key
- Clear
- Edit
- Gemini API Key saved on %s
-
- AI Agent
- New Chat
- History
- AI Settings
- Close
- API Key is saved.
-
- API Key cleared.
- API Key cannot be empty.
- API Key saved securely.
- ••••••••••••••••••••
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/values/themes.xml b/layouteditor/src/main/res/values/themes.xml
deleted file mode 100644
index 0683c0b3a0..0000000000
--- a/layouteditor/src/main/res/values/themes.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/layouteditor/src/main/res/anim/project_list_animation.xml b/resources/src/main/res/anim/project_list_animation.xml
similarity index 100%
rename from layouteditor/src/main/res/anim/project_list_animation.xml
rename to resources/src/main/res/anim/project_list_animation.xml
diff --git a/layouteditor/src/main/res/drawable/arrow_left.xml b/resources/src/main/res/drawable/arrow_left.xml
similarity index 100%
rename from layouteditor/src/main/res/drawable/arrow_left.xml
rename to resources/src/main/res/drawable/arrow_left.xml
diff --git a/layouteditor/src/main/res/drawable/circle_shape.xml b/resources/src/main/res/drawable/circle_shape.xml
similarity index 100%
rename from layouteditor/src/main/res/drawable/circle_shape.xml
rename to resources/src/main/res/drawable/circle_shape.xml
diff --git a/layouteditor/src/main/res/drawable/dots_vertical.xml b/resources/src/main/res/drawable/dots_vertical.xml
similarity index 100%
rename from layouteditor/src/main/res/drawable/dots_vertical.xml
rename to resources/src/main/res/drawable/dots_vertical.xml
diff --git a/layouteditor/src/main/res/drawable/edit.xml b/resources/src/main/res/drawable/edit.xml
similarity index 100%
rename from layouteditor/src/main/res/drawable/edit.xml
rename to resources/src/main/res/drawable/edit.xml
diff --git a/layouteditor/src/main/res/drawable/ic_launcher.xml b/resources/src/main/res/drawable/ic_launcher.xml
similarity index 100%
rename from layouteditor/src/main/res/drawable/ic_launcher.xml
rename to resources/src/main/res/drawable/ic_launcher.xml
diff --git a/resources/src/main/res/values/layouteditor_migrated.xml b/resources/src/main/res/values/layouteditor_migrated.xml
new file mode 100644
index 0000000000..2f1f85f00d
--- /dev/null
+++ b/resources/src/main/res/values/layouteditor_migrated.xml
@@ -0,0 +1,42 @@
+
+
+
+ AI Agent
+ Cancel
+ Clear
+ Delete
+ Edit
+ Gemini API Key
+ Gemini API Key saved on %s
+ ¯\\_(ツ)_/¯
+ Rename
+ Save Key
+ AI Settings
+ History
+ Delete project
+ Rename project
+ Options
+ Create
+ Enter new project name
+ Are you sure want to remove the project?
+ Current name is unavailable!
+ Field cannot be empty!
+ ••••••••••••••••••••
+ API Key saved securely.
+ API Key is saved.
+ API Key cleared.
+ API Key cannot be empty.
+
+ 8dp
+
+
+
diff --git a/settings.gradle.kts b/settings.gradle.kts
index cba17f59b1..b6dc38b9bb 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -128,7 +128,6 @@ include(
":gradle-plugin",
":gradle-plugin-config",
":idetooltips",
- ":layouteditor",
":lexers",
":logger",
":logsender",
@@ -141,7 +140,6 @@ include(
":templates-impl",
":treeview",
":uidesigner",
- ":vectormaster",
":xml-inflater",
":lsp:api",
":lsp:models",