androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.07k stars 176 forks source link

[DSL] Enable Grid with DSL syntax #781

Closed jswong65 closed 1 year ago

jswong65 commented 1 year ago

This PR mainly enable Grid, Row, and Column with DSL syntax. It also includes some fixes for some demos.

  1. Updates ConstraintLayoutBaseScope.kt and ConstraintSetParser.java to enable Grid using DSL.
  2. Add demos - GridDslDemo.kt and RowColumnDslDemo.kt
  3. Add tests - GridDslTest.kt and RowColumnDslTestkt
  4. Update existing demos for Grid with JSON by making the type in lowercase.
  5. Update the build.gradle - same as #780

There is an issue with padding that I need to investigate more. Also, there are some build issues with ComposeConstraintlayout project that I had to comment out some of the files.

Some of the demos Demo1

image

Demo4

image

Test results

Screenshot 2023-01-12 at 2 24 16 PM