{"id":13537861,"url":"https://github.com/ManuelPeinado/ImageLayout","last_synced_at":"2025-04-02T04:31:59.538Z","repository":{"id":7728601,"uuid":"9094838","full_name":"ManuelPeinado/ImageLayout","owner":"ManuelPeinado","description":"Android - A layout that arranges its children in relation to a background image","archived":false,"fork":false,"pushed_at":"2016-06-02T17:45:42.000Z","size":20938,"stargazers_count":422,"open_issues_count":6,"forks_count":96,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-30T05:05:48.157Z","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/ManuelPeinado.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":"2013-03-29T08:20:24.000Z","updated_at":"2023-12-27T16:07:36.000Z","dependencies_parsed_at":"2022-09-26T21:41:19.319Z","dependency_job_id":null,"html_url":"https://github.com/ManuelPeinado/ImageLayout","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelPeinado%2FImageLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelPeinado%2FImageLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelPeinado%2FImageLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelPeinado%2FImageLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManuelPeinado","download_url":"https://codeload.github.com/ManuelPeinado/ImageLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246757525,"owners_count":20828914,"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-08-01T09:01:04.391Z","updated_at":"2025-04-02T04:31:54.523Z","avatar_url":"https://github.com/ManuelPeinado.png","language":"Java","funding_links":[],"categories":["Java","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"ImageLayout\n===========\n\nA layout that arranges its children in relation to a background image. The layout of each  child is specified in image coordinates (pixels), and the conversion to screen coordinates is performed automatically.   \n\nThe background image is adjusted so that it fills the available space.  \n\nFor some applications this might be a useful replacement for the now deprecated AbsoluteLayout.\n\n![Example Image][1]\n\nTry out the sample application:\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.manuelpeinado.imagelayout.demo\"\u003e\n  \u003cimg alt=\"Android app on Google Play\"\n       src=\"https://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\n\u003c/a\u003e\n\nOr browse the [source code of the sample application][2] for a complete example of use.\n\nIncluding in your project\n-------------------------\n\nIf you’re using Eclipse with the ADT plugin you can include ImageLayout as a library project. Just create a new Android project in Eclipse using the library/ folder as the existing source, and add a reference to it to your application project.\n\nIf you use gradle to build your Android project you can simply add a dependency for this library:\n\n```\n\ndependencies {  \n    mavenCentral()\n    compile 'com.github.manuelpeinado.imagelayout:imagelayout:1.1.0'\n}\n\n```\n\nUsage\n-----\n\n### Adding to your layout\n\n\nAdd an element named \u003ctt\u003ecom.manuelpeinado.imagelayout.ImageLayout\u003c/tt\u003e to  your XML layout. This element should have the following attributes:\n\n| Attribute              | Description                        |\n|------------------------|------------------------------------|\n| \u003ctt\u003ecustom:image\u003c/tt\u003e | The drawable to be used as the background for the view.|\n| \u003ctt\u003ecustom:imageWidth\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:imageHeight\u003c/tt\u003e | The dimensions of the image in which the layout coordinates of the children are expressed. |\n\nIn addition, you can use the following optional attributes:\n\n| Attribute              | Description                        |\n|------------------------|------------------------------------|\n| \u003ctt\u003ecustom:fit\u003c/tt\u003e | Determines how the background image is drawn. Accepted values are \u003ctt\u003evertical\u003c/tt\u003e, \u003ctt\u003ehorizontal\u003c/tt\u003e, \u003ctt\u003eboth\u003c/tt\u003e and \u003ctt\u003eauto\u003c/tt\u003e (the default). Check the \"Fit attribute\" sample in the demo application to see these different modes in action.|\n\t\n\n### Adding children\n\nYou can add child views to your ImageLayout just like you would to any other ViewGroup. But instead of using the \u003ctt\u003eandroid:layout_width\u003c/tt\u003e and \u003ctt\u003eandroid:layout_height\u003c/tt\u003e attributes to control the layout of children, you should use the following:\n\n|Attribute                 |Description  |\n|--------------------------|-------------|\n| \u003ctt\u003ecustom:layout_width\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_height\u003c/tt\u003e | Similar to android:layout_width/height, but expressed in image coordinates |\n|\u003ctt\u003ecustom:layout_maxWidth\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_maxHeight\u003c/tt\u003e| Similar to android:layout_maxWidth/maxHeight, but expressed in image coordinates. |\n| \u003ctt\u003ecustom:layout_centerX\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_centerY\u003c/tt\u003e|Center of the child view, in image coordinates.|\n|\u003ctt\u003ecustom:layout_left\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_top\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_right\u003c/tt\u003e\u003cbr\u003e\u003ctt\u003ecustom:layout_bottom\u003c/tt\u003e|Bounds of the child view, in image coordinates.|\n\nNote that depending of your application you will use a different combination of these attributes. You might for example specify a value for \u003ctt\u003ecustom:right\u003c/tt\u003e in order to align the right side of your view with a given feature of the image, and \u003ctt\u003ecustom:centerY\u003c/tt\u003e to align the same view vertically with another feature.\n\nAlso note that the size-related attributes such as \u003ctt\u003ecustom:layout_width\u003c/tt\u003e are not mandatory. If you don't specify any of them for a given dimension, the view is measured in the traditional \"wrap content\" fashion.\n\n\n### View size adjustment\n\nYou can have your ImageLayout fill its parent by specifying \u003ctt\u003ematch_parent\u003c/tt\u003e in both its \u003ctt\u003eandroid:layout_width\u003c/tt\u003e and \u003ctt\u003eandroid:layout_height\u003c/tt\u003e attributes. But, since the aspect ratio of the image will typically differ from the aspect of ratio of the parent view, this will result in a  waste of screen real state in the form of blank margins around the image.\n\nTo prevent this, simply use \u003ctt\u003ewrap_content\u003c/tt\u003e in either \u003ctt\u003eandroid:layout_width\u003c/tt\u003e or \u003ctt\u003eandroid:layout_height\u003c/tt\u003e. This will cause the ImageLayout to adopt a size which matches the aspect ratio of its image.\n\nPlease note that the result of using \u003ctt\u003ewrap_content\u003c/tt\u003e for *both* \u003ctt\u003eandroid:layout_width\u003c/tt\u003e and \u003ctt\u003eandroid:layout_height\u003c/tt\u003e is unspecified.\n\nWho's using it\n--------------\n \n*Does your app use ImageLayout? If you want to be featured on this list drop me a line.*\n\nDeveloped By\n--------------------\n\nManuel Peinado Gallego - \u003cmanuel.peinado@gmail.com\u003e\n\n\u003ca href=\"https://twitter.com/mpg2\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://raw.github.com/ManuelPeinado/NumericPageIndicator/master/art/twitter.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://plus.google.com/106514622630861903655\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://raw.github.com/ManuelPeinado/NumericPageIndicator/master/art/google-plus.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.linkedin.com/pub/manuel-peinado-gallego/1b/435/685\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://raw.github.com/ManuelPeinado/NumericPageIndicator/master/art/linkedin.png\" /\u003e\n\nLicense\n-------\n\n    Copyright 2013 Manuel Peinado\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[1]: https://raw.github.com/ManuelPeinado/ImageLayout/master/art/readme_pic.png\n[2]: https://github.com/ManuelPeinado/ImageLayout/tree/master/sample\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FManuelPeinado%2FImageLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FManuelPeinado%2FImageLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FManuelPeinado%2FImageLayout/lists"}