{"id":21130246,"url":"https://github.com/ssomai/ScalableLayout","last_synced_at":"2025-07-09T01:32:54.696Z","repository":{"id":11383598,"uuid":"13824226","full_name":"ssomai/ScalableLayout","owner":"ssomai","description":"Scalable Layout For Android","archived":false,"fork":false,"pushed_at":"2024-04-09T14:33:01.000Z","size":5322,"stargazers_count":269,"open_issues_count":30,"forks_count":90,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-04-09T18:07:25.625Z","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/ssomai.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-10-24T06:24:18.000Z","updated_at":"2024-04-02T00:49:06.000Z","dependencies_parsed_at":"2022-07-18T16:28:52.950Z","dependency_job_id":null,"html_url":"https://github.com/ssomai/ScalableLayout","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssomai%2FScalableLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssomai%2FScalableLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssomai%2FScalableLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssomai%2FScalableLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssomai","download_url":"https://codeload.github.com/ssomai/ScalableLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476371,"owners_count":17480215,"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-11-20T05:32:28.548Z","updated_at":"2024-11-20T05:32:37.217Z","avatar_url":"https://github.com/ssomai.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"ScalableLayout for Android.\n====================\n\nClass: com.ssomai.android.scalablelayout.ScalableLayout\n한글버전 README.md: https://github.com/ssomai/ScalableLayout/blob/master/README_ko.md\n\nJust one layout for every different Android device size!\u003cbr/\u003e\n====================\n\nScalableLayout is a new layout that helps you keep a consistent UI across any screen size and any layout size.\u003cbr/\u003e\n\u003cbr/\u003e\nScalableLayout can be usable in replace of Layouts (i.e. FrameLayout, LinearLayout, etc.) and does the work of scaling all of the child views correctly for you.\u003cbr/\u003e\n\u003cbr/\u003e\nUI Widgets like TextView or Imageview get relative (x,y) coordinates and relative (width, height) values from the ScalableLayout.\u003cbr/\u003e\nScalableLayout then places and resizes the widgets according to these values.\u003cbr/\u003e\n\u003cbr/\u003e\nYou can use ScalableLayout by importing just one java file.\u003cbr/\u003e\nYou can use ScalableLayout with either Java or XML in your project.\u003cbr/\u003e\n\u003cbr/\u003e\nScalableLayout is used on the EverySing Karaoke app, which was awarded in the Google Play App Awards 2013.\u003cbr/\u003e\n\u003cbr/\u003e\n\nThe library is pushed to Maven Central as a AAR, so you just need to add the following dependency to your build.gradle.\u003cbr/\u003e\n```groovy\ndependencies {\n  compile 'com.ssomai:android.scalablelayout:2.1.6'\n}\n```\n\n# Simple example in Java\n```java\n// Initiate ScalableLayout instance with 400 width and 200 height.\n// It's a relative unit, not pixels or dip.\nScalableLayout sl = new ScalableLayout(this, 400, 200);\n\n// Place a TextView instance inside ScalableLayout instance.\nTextView tv = new TextView(this);\n\n// Placing a TextView with following parameters. left: 20, top: 40, width: 100, height: 30.\n// It will place and scale automatically according to the size of its parent ScalableLayout.\nsl.addView(tv, 20f, 40f, 100f, 30f);\n\n// Set the text size of TextView as 20. It will scale automatically.\nsl.setScale_TextSize(tv, 20f);\n\n// All of the original methods of TextView work properly.\ntv.setText(\"test\");\ntv.setBackgroundColor(Color.YELLOW);\n\n\n// Place an ImageView instance inside a ScalableLayout instance.\nImageView iv = new ImageView(this);\n\n// Placing an ImageView with following parameters. left: 200, top: 30, width: 50, height: 50.\n// It will place and scale automatically according to the size of its parent ScalableLayout.\nsl.addView(iv, 200f, 30f, 50f, 50f);\n\n// All of the original methods of ImageView work properly, of course.\niv.setImageResource(R.drawable.ic_launcher);\n```\n\n# Simple example in XML\n```xml\n\u003cFrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    \u003e\n\t\u003ccom.ssomai.android.scalablelayout.ScalableLayout\n\t  android:layout_width=\"match_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@android:color/darker_gray\"\n\t  android:layout_above=\"@+id/main_textview\"\n\t  app:scale_base_width=\"400\"\n\t  app:scale_base_height=\"200\"\u003e\n\t  \u003cTextView\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tapp:scale_left=\"20\"\n\t\tapp:scale_top=\"40\"\n\t\tapp:scale_width=\"100\"\n\t\tapp:scale_height=\"30\"\n\t\tapp:scale_textsize=\"20\"\n\t\tandroid:text=\"@string/hello_world\"\n\t\tandroid:textColor=\"@android:color/white\"\n\t\tandroid:background=\"@android:color/black\" /\u003e\n\t  \u003cImageView\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tapp:scale_left=\"200\"\n\t\tapp:scale_top=\"30\"\n\t\tapp:scale_width=\"50\"\n\t\tapp:scale_height=\"50\"\n\t\tandroid:src=\"@drawable/ic_launcher\" /\u003e\n\t\u003c/com.ssomai.android.scalablelayout.ScalableLayout\u003e\n\u003c/FrameLayout\u003e\n```\n\nExamples of ScalableLayout on different resolutions of Android devices.\n====================\nFrom left. Samsung Galaxy S4 (1920 x 1080. 16:9), LG Optimus View2 (1024 x 768. 4:3), Samsung Galaxy Note 10.1 (1280 x 800. 8:5)\u003cbr/\u003e\u003cbr/\u003e\n![alt tag](https://raw.github.com/ssomai/ScalableLayout/master/images/sl_01_main.jpg)\nAll the UIs are placed correctly on different resolutions.\u003cbr/\u003e\u003cbr/\u003e\n\n![alt tag](https://raw.github.com/ssomai/ScalableLayout/master/images/sl_02_singtop100.jpg)\nAll the UIs in ListView are placed correctly on different resolutions.\u003cbr/\u003e\u003cbr/\u003e\n\n![alt tag](https://raw.github.com/ssomai/ScalableLayout/master/images/sl_03_singoption.jpg)\nUIs in Dialog are also placed correctly on different resolutions. You can notice there are more left and right margins on Optimus View 2 to layout correctly.\u003cbr/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssomai%2FScalableLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssomai%2FScalableLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssomai%2FScalableLayout/lists"}