{"id":27635093,"url":"https://github.com/vipulasri/aspecto","last_synced_at":"2025-04-23T19:43:54.122Z","repository":{"id":271821391,"uuid":"890126775","full_name":"vipulasri/aspecto","owner":"vipulasri","description":"Aspect-Perfect Grid for Jetpack Compose / Compose Multiplatform: Achieve precise aspect ratios and seamless layout consistency.","archived":false,"fork":false,"pushed_at":"2025-03-23T13:11:35.000Z","size":255,"stargazers_count":113,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T14:22:37.365Z","etag":null,"topics":["android","aspect-ratio","compose","compose-multiplatform","grid-layout","jetpack-compose","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/vipulasri.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":"2024-11-18T03:09:47.000Z","updated_at":"2025-03-23T13:11:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"713ce4ea-a075-459d-a0bd-418e90b75f33","html_url":"https://github.com/vipulasri/aspecto","commit_stats":null,"previous_names":["vipulasri/aspecto"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulasri%2Faspecto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulasri%2Faspecto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulasri%2Faspecto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vipulasri%2Faspecto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vipulasri","download_url":"https://codeload.github.com/vipulasri/aspecto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250501473,"owners_count":21441028,"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":["android","aspect-ratio","compose","compose-multiplatform","grid-layout","jetpack-compose","kotlin"],"created_at":"2025-04-23T19:43:53.334Z","updated_at":"2025-04-23T19:43:54.116Z","avatar_url":"https://github.com/vipulasri.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Aspecto Graphics](https://github.com/user-attachments/assets/27b8e750-cc42-4e99-b8ff-ea549f118aa5)\u003cbr\u003e\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.vipulasri.aspecto/aspecto)](https://search.maven.org/search?q=g:com.vipulasri.aspecto)\n[![Build status](https://github.com/vipulasri/aspecto/actions/workflows/publish.yml/badge.svg)](https://github.com/vipulasri/aspecto/actions)\n[![AndroidWeekly](https://androidweekly.net/issues/issue-657/badge)](https://androidweekly.net/issues/issue-657)\n\n[Aspecto](https://github.com/vipulasri/aspecto) is a grid layout that perfectly preserves each item's aspect ratio for the [Jetpack Compose](https://developer.android.com/compose) / [Compose Multiplatform](https://www.jetbrains.com/compose-multiplatform/).\n\n✨ Just as the 🪄 Patronus charm protects its caster, Aspecto protects image layouts from distortion!\u003cbr\u003e\n\n## Showcase\n![Comparison-2](https://github.com/user-attachments/assets/dc7a23f5-ba2c-469a-a5d4-e0ea7dd03b7d)\n\nhttps://github.com/user-attachments/assets/58cd864b-0a82-431b-ac6e-de755f885b98\n\n## Features\n\n- **Aspect Ratio Preservation** - Maintains natural dimensions of images\n- **Smart Row Distribution** - Magically arranges items for optimal space utilization\n- ️**Efficient Updates** - Uses incremental calculations for smooth performance\n- **Height Protection** - Guards against overly tall items disrupting layouts\n- **Responsive Layout** - Adapts gracefully to different screen sizes\n\n### Multiplatform Support\n- Android\n- iOS\n\n## Installation\n\nAdd the dependency to your project:\n\n### Compose Multiplatform\n```kotlin\nimplementation(\"com.vipulasri.aspecto:aspecto:\u003clatest-version\u003e\")\n```\n\n### Android Only\n```groovy\nimplementation(\"com.vipulasri.aspecto:aspecto-android:\u003clatest-version\u003e\")\n```\n\n## Usage\n\n```kotlin\nAspectoGrid(\n    modifier = Modifier.fillMaxWidth(),\n    contentPadding = PaddingValues(16.dp)\n) {\n    items(\n        items = images,\n        key = { it.id },\n        aspectRatio = { it.width.toFloat() / it.height }\n    ) { image -\u003e\n        // content\n    }\n}\n```\n[Android](https://github.com/vipulasri/aspecto/tree/main/sample) \u0026 \n[iOS](https://github.com/vipulasri/aspecto/tree/main/iosApp) samples.\nBoth samples use the same [shared code](https://github.com/vipulasri/aspecto/tree/main/sample/src/commonMain/kotlin/com/vipulasri/aspecto/sample/App.kt) to demonstrate the Compose Multiplatform capabilities.\n\n## Inspired by\n\n* [Greedo Layout](https://github.com/500px/greedo-layout-for-android) from [500px](https://github.com/500px)\n\n## License\n\n```\nCopyright 2025 Vipul Asri\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvipulasri%2Faspecto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvipulasri%2Faspecto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvipulasri%2Faspecto/lists"}