{"id":13396417,"url":"https://github.com/lucasr/dspec","last_synced_at":"2025-03-13T23:31:04.894Z","repository":{"id":20511699,"uuid":"23790365","full_name":"lucasr/dspec","owner":"lucasr","description":"[DEPRECATED] Define and render UI specs on top of your Android UI","archived":true,"fork":false,"pushed_at":"2016-09-04T16:53:58.000Z","size":589,"stargazers_count":551,"open_issues_count":12,"forks_count":53,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-07-31T18:17:27.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/lucasr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-08T12:46:20.000Z","updated_at":"2024-06-10T15:47:03.000Z","dependencies_parsed_at":"2022-08-05T08:16:13.149Z","dependency_job_id":null,"html_url":"https://github.com/lucasr/dspec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasr%2Fdspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasr%2Fdspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasr%2Fdspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasr%2Fdspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasr","download_url":"https://codeload.github.com/lucasr/dspec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221421540,"owners_count":16817825,"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":[],"created_at":"2024-07-30T18:00:50.682Z","updated_at":"2024-10-25T11:30:32.209Z","avatar_url":"https://github.com/lucasr.png","language":"Java","readme":"dspec\n=====\n\nA simple way to define and render UI specs on top of your Android UI.\n\n![](images/sample.png)\n\n\n\nUsage\n-----\n\nEnclose the target UI with a `DesignSpecFrameLayout`, usually the root of your view hierarchy.\nGet the associated `DesignSpec` instance with `getDesignSpec` and then you can:\n\n * Toggle baseline grid visibility with `setBaselineGridVisible(boolean)`.\n * Change baseline grid cell width with `setBaselineGridCellSize(int)`.\n * Change baseline grid color with `setBaselineGridColor(int)`.\n * Toggle keylines visibility with `setKeylinesVisible(boolean)`.\n * Change keylines color with `setKeylinesColor(int)`.\n * Add keylines with `addKeyline(int, From)`.\n * Toggle spacing markers visibility with `setSpacingsVisible(boolean)`.\n * Change spacing markers color with `setSpacingsColor(int)`.\n * Add spacing marker with `addSpacing(int, int, From)`.\n\nYou can also specify the design spec in a raw JSON resource like:\n\n```json\n{\n    \"baselineGridVisible\": true,\n    \"baselineGridCellSize\": 8,\n    \"keylines\": [\n        { \"offset\": 16,\n          \"from\": \"LEFT\" },\n        { \"offset\": 72,\n          \"from\": \"LEFT\" },\n        { \"offset\": 16,\n          \"from\": \"RIGHT\" }\n    ],\n    \"spacings\": [\n        { \"offset\": 0,\n          \"size\": 16,\n          \"from\": \"LEFT\" },\n        { \"offset\": 56,\n          \"size\": 16,\n          \"from\": \"LEFT\" },\n        { \"offset\": 0,\n          \"size\": 16,\n          \"from\": \"RIGHT\" }\n    ]\n}\n```\n\nBecause `DesignSpec` is a `Drawable`, you can simply add it to a\n`ViewOverlay` if you're running your app on API level \u003e= 18:\n\n```java\nDesignSpec designSpec = DesignSpec.fromResource(someView, R.raw.some_spec);\nsomeView.getOverlay().add(designSpec);\n```\n\n\n\nDownload\n--------\n\nDownload [the latest JAR][1] or grab via Gradle:\n```groovy\ncompile 'org.lucasr.dspec:dspec:0.1.1'\n```\nor Maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.lucasr.dspec\u003c/groupId\u003e\n  \u003cartifactId\u003edspec\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n\nLicense\n--------\n\n    Copyright 2014 Lucas Rocha\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n [1]: https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases\u0026g=org.lucasr.dspec\u0026a=dspec\u0026e=aar\u0026v=LATEST\n","funding_links":[],"categories":["Index `(light-weight pages)`","Index","Java","Libs","Uncategorized"],"sub_categories":["\u003cA NAME=\"Utility\"\u003e\u003c/A\u003eUtility","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasr%2Fdspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasr%2Fdspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasr%2Fdspec/lists"}