{"id":13605444,"url":"https://github.com/Daio-io/dresscode","last_synced_at":"2025-04-12T05:33:03.941Z","repository":{"id":84741885,"uuid":"146452779","full_name":"Daio-io/dresscode","owner":"Daio-io","description":"👔 Tiny lightweight Kotlin Android library to change theme at runtime.","archived":false,"fork":false,"pushed_at":"2020-06-28T16:32:39.000Z","size":174,"stargazers_count":341,"open_issues_count":0,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-07T10:41:29.328Z","etag":null,"topics":["android","android-library","kotlin-android","theme"],"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/Daio-io.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}},"created_at":"2018-08-28T13:36:34.000Z","updated_at":"2024-08-14T06:28:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"755db00a-4bc7-4d79-9628-054740328c36","html_url":"https://github.com/Daio-io/dresscode","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daio-io%2Fdresscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daio-io%2Fdresscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daio-io%2Fdresscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daio-io%2Fdresscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daio-io","download_url":"https://codeload.github.com/Daio-io/dresscode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248524257,"owners_count":21118610,"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","android-library","kotlin-android","theme"],"created_at":"2024-08-01T19:00:58.754Z","updated_at":"2025-04-12T05:33:03.636Z","avatar_url":"https://github.com/Daio-io.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# dresscode 👔 \n[![](https://jitpack.io/v/Daio-io/dresscode.svg)](https://jitpack.io/#Daio-io/dresscode) [![codebeat badge](https://codebeat.co/badges/c4f32440-60e4-4878-820b-b258c1cb8fc8)](https://codebeat.co/projects/github-com-daio-io-dresscode-master) [![build status](https://travis-ci.org/Daio-io/dresscode.svg?branch=master)](https://travis-ci.org/Daio-io/dresscode)\n\nTiny lightweight Kotlin Android library to change theme at runtime. \n\n- Tiny 🔍\n- Very simple to use. \n- DressCode uses only extension functions to enable runtime theme changes avoiding the need to create some kind of `BaseThemeActivity` class.\n- Declare your Themes as normal in `styles.xml`\n- Automatically updates activity themes.\n- Remembers the current theme between app launches.\n\n#### Used By:\n\u003ca href =\"https://play.google.com/store/apps/details?id=studio.goodegg.capsule\"\u003e\n  \u003cimg width=\"70\" src=\"https://lh3.googleusercontent.com/YjY4BpK9K9M_GzdJE-16MftRKZMbp51yHTSXVjMJ1pT2tqlnNE6ype2yAG7VRrOFgnE=s360\"\u003e\n\u003c/a\u003e\n\nMake a pull request if you want your app in this section\n\n## Add DressCode\n\n```groovy\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n`implementation 'com.github.Daio-io:dresscode:{latest-release}'`\n\n## Setting your App DressCode\n\nIn your Android Application class `onCreate` call the library function to set your dress codes \n\n```kotlin\ndeclareDressCode(DressCode(\"themeone\", R.style.ThemeOne),\n                DressCode(\"themetwo\", R.style.ThemeTwo),\n                DressCode(\"themethree\", R.style.ThemeThree))\n```\n\nThen from your Activities simply call `matchDressCode` before `setContentView`.\n\n```kotlin\n    override fun onCreate(savedInstanceState: Bundle?) {\n        matchDressCode() // Call me first or someone may come dressed as a 🤡 \n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n    }\n```\nDressCode will automatically manage applying the new theme when it has been changed. So a simple call from within an Activity to:\n\n`dressCodeStyleId = R.style.ThemeTwo`\n\nWill just apply the new theme to all Activities that call `matchDressCode()`.\n\nCheck out the sample app in the project for a simple implementation.\n\n## Contributing Info \nComing soon\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaio-io%2Fdresscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDaio-io%2Fdresscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaio-io%2Fdresscode/lists"}