Modify Attributes
System or extension generated attributes can be overridden preceding finalization. They will only be visible on the declared framework.
Tip
Default namespace is android.
Settings
squared.settings.showAttributes = {
"hyphenationFrequency": "full", // Replace all
"android:fontFeatureSettings": null, // Delete all
"app:menu": [
"@menu/menu_1", "@menu/menu_2", // Replace with "@menu/menu_2" when value is "@menu/menu_1"
"@menu/menu_3", null // Delete attribute when value is "@menu/menu_3"
],
/* OR */
"app:menu": {
"@menu/menu_1": "@menu/menu_2",
"@menu/menu_3": null
}
};
Method
squared.parseDocument().then(() => {
const node = squared.findDocumentNode("customId");
node.android("layout_width", "match_parent");
node.android("layout_height", "match_parent");
node.app("layout_scrollFlags", "scroll|exitUntilCollapsed");
});
Inline
data-android-attr-{namespace}?
<div id="customId"
data-android-attr="layout_width::match_parent;layout_height::match_parent"
data-android-attr-app="layout_scrollFlags::scroll|exitUntilCollapsed">
</div>
Output
<LinearLayout
android:id="@+id/customId"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed" />