{"id":13691864,"url":"https://github.com/xtuzy/SharpConstraintLayout","last_synced_at":"2025-05-02T16:30:41.501Z","repository":{"id":37010892,"uuid":"432406945","full_name":"xtuzy/SharpConstraintLayout","owner":"xtuzy","description":"C# port of ConstraintLayout, for Maui(Android, iOS, Windows)","archived":false,"fork":false,"pushed_at":"2024-05-07T09:13:44.000Z","size":10649,"stargazers_count":17,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T06:12:30.408Z","etag":null,"topics":["autolayout","constraintlayout","cross-platform","csharp","dotnet","maui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtuzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-27T08:25:10.000Z","updated_at":"2024-10-21T11:19:16.000Z","dependencies_parsed_at":"2024-04-08T02:10:11.058Z","dependency_job_id":"03c9bd74-de1d-4377-92f4-a76b394f4dfb","html_url":"https://github.com/xtuzy/SharpConstraintLayout","commit_stats":{"total_commits":174,"total_committers":3,"mean_commits":58.0,"dds":0.06321839080459768,"last_synced_commit":"3a2344ef62df6c2c1df048441ead011e53902442"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtuzy%2FSharpConstraintLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtuzy%2FSharpConstraintLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtuzy%2FSharpConstraintLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtuzy%2FSharpConstraintLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtuzy","download_url":"https://codeload.github.com/xtuzy/SharpConstraintLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224319398,"owners_count":17291838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autolayout","constraintlayout","cross-platform","csharp","dotnet","maui"],"created_at":"2024-08-02T17:00:51.112Z","updated_at":"2024-11-12T17:32:14.467Z","avatar_url":"https://github.com/xtuzy.png","language":"C#","funding_links":[],"categories":["UI"],"sub_categories":[],"readme":"# SharpConstraintLayout 🗜️📏\n\nThis is a C# port of [ConstraintLayout](https://github.com/androidx/constraintlayout), it convert [constraintlayout.core](https://github.com/androidx/constraintlayout/tree/main/constraintlayout/core) and create ConstraintLayout for dotnet UI framework. Now, you can use ConstraintLayout in C# world 🎆\n\n[![NuGet version(SharpConstraintLayout.Core)](https://img.shields.io/nuget/v/SharpConstraintLayout.Core?label=SharpConstraintLayout.Core)](https://www.nuget.org/packages/SharpConstraintLayout.Core/), it contain core logic of constraintlayout, you can base on it create your ConstraintLayout for other dotnet UI framework.\n\n[![NuGet version(SharpConstraintLayout.Maui)](https://img.shields.io/nuget/v/SharpConstraintLayout.Maui?label=SharpConstraintLayout.Maui)](https://www.nuget.org/packages/SharpConstraintLayout.Maui/), it contain layout for Maui, ConstraintLayout is powerful, you can use it instead other layout\n\n*Notice*：I stop update SharpConstraintLayout.Maui.Native, because dealing with difference of different platform is tiresome.\n\n[![NuGet version(SharpConstraintLayout.Maui.Native)](https://img.shields.io/nuget/v/SharpConstraintLayout.Maui.Native?label=SharpConstraintLayout.Maui.Native)](https://www.nuget.org/packages/SharpConstraintLayout.Maui.Native/), it contain layout for net6-android,net6-ios,winui3, such as at android, you can use it instead [Xamarin.AndroidX.ConstraintLayout](https://www.nuget.org/packages/Xamarin.AndroidX.ConstraintLayout/)\n## Using SharpConstraintLayout\nDocument see [wiki](https://github.com/xtuzy/SharpConstraintLayout/wiki)\n\n[![Maui SharpConstraintLayout Example](https://youtube-md.vercel.app/d5nUq7CQuck/640/360)](https://www.youtube.com/watch?v=d5nUq7CQuck)\n\n**Installation**\n\nSearch and install nuget **SharpConstraintLayout.Maui** (For Maui) or  **SharpConstraintLayout.Maui.Native** (For net6-android,net6-ios,WinUI3)\n\n**Notice**\n1. Now you create constraint only by code.\n2. Here all example use Maui\n3. Run example app, you can find more example\n\n**Basis Align**\nFirst you need create layout and add controls to layout,\n```\nvar layout = new ConstraintLayout();\nvar firstButton = new Button(){ Text = \"first\"};\nvar secondButton = new Button(){ Text = \"second\"};\nlayout.AddElement(firstButton,secondButton)\n```\nthen set first button at center of layout.\n```\nusing(var set = FluentConstraintSet())\n{\n  set.Clone(layout);\n  set.Select(firstButton).CenterTo()\n  set.ApplyTo(layout);\n}\n```\nor you can set second button align first button\n```\nusing(var set = FluentConstraintSet())\n{\n  set.Clone(layout);\n  set.Select(firstButton).CenterTo()\n  .Select(secondButton).LeftToRight(firstButton).CenterYTo(firstButton)\n  set.ApplyTo(layout);\n}\n```\n\n## Current Features\n- [x] Align Left,Right,Top,Bottom,Center\n- [x] **Ratio of Width with Height**\nRatio defines one dimension of a widget as a ratio of the other one. If both `width` and `height` are set to `0dp` the system sets the largest dimensions that satisfy all constraints while maintaining the aspect ratio.\n\n- [x] **Chains** \nChains provide group-like behavior in a single axis (horizontally or vertically). The other axis can be constrained independently.\n\n- [x] **Guideline** \nGuideline allow reactive layout behavior with fixed or percentage based positioning for multiple widgets.\n\n- [x] **Barrier** \nBarrier references multiple widgets to create a virtual guideline based on the most extreme widget on the specified side.\n\n- [x] **Flow** \nFlow is a VirtualLayout that allows positioning of referenced widgets horizontally or vertically similar to a Chain. If the referenced elements do not fit within the given bounds it has the ability to wrap them and create multiple chains.\n- [x] **Group** \nGroup can control visibility of multiple views.\n- [ ] RTL\n- [ ] Align Baseline\n\n## 💻 Authors of ConstraintLayout\n\n- **John Hoford** : MotionLayout ([jafu888](https://github.com/jafu888))\n- **Nicolas Roard** : ConstraintLayout ([camaelon](https://github.com/camaelon))\n\nSee also the list of [contributors](https://github.com/androidx/constraintlayout/graphs/contributors) who participated in this project.\n\n## 🔖 License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtuzy%2FSharpConstraintLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtuzy%2FSharpConstraintLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtuzy%2FSharpConstraintLayout/lists"}