{"id":25352664,"url":"https://github.com/mutkuensert/android-phase","last_synced_at":"2025-10-29T21:31:11.049Z","repository":{"id":190419986,"uuid":"681778139","full_name":"mutkuensert/Android-Phase","owner":"mutkuensert","description":"An Android library to hold any data within states.","archived":false,"fork":false,"pushed_at":"2023-08-29T15:24:41.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-29T22:29:02.943Z","etag":null,"topics":["android","android-library","library"],"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/mutkuensert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-22T18:30:15.000Z","updated_at":"2023-08-23T19:53:25.000Z","dependencies_parsed_at":"2023-08-24T15:45:47.387Z","dependency_job_id":null,"html_url":"https://github.com/mutkuensert/Android-Phase","commit_stats":null,"previous_names":["mutkuensert/android-phase"],"tags_count":11,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroid-Phase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroid-Phase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroid-Phase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutkuensert%2FAndroid-Phase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutkuensert","download_url":"https://codeload.github.com/mutkuensert/Android-Phase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238895164,"owners_count":19548554,"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","library"],"created_at":"2025-02-14T18:57:12.150Z","updated_at":"2025-10-29T21:31:10.737Z","avatar_url":"https://github.com/mutkuensert.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Phase\n\n## Table of Contents\n* [About The Library](#about-the-library)\n* [Adding The Dependency](#adding-the-dependency)\n* [Example Use](#example-use)\n* [License](#license)\n* [Contact](#contact)\n\n## About The Library\nAn Android library to hold any data within states.\nFor the example use of this library, you can look at my [Movee](https://github.com/mutkuensert/Movee) project on Github.\nIf you want, you can also use this class [GetPhaseFlow](https://gist.github.com/mutkuensert/11093b3c8b48fa130b0b35bcb5e9faf1).\n\n## Adding The Dependency\nAdd jitpack into the repositories\n\n```gradle\nmaven { url 'https://jitpack.io' }\n```\n\nAdd the dependency in build.gradle file.\n```gradle\nimplementation 'com.github.mutkuensert:Android-Phase:v2.0.0'\n```\n\n**You can also add the library locally. To do that:**\n\nClone the project.\n\nRun in the terminal:\n```gradle\n./gradlew build\n```\nFind generated aar file under build folder and copy \u0026 paste it into your project. You can create a directory called \"libs\" under your app module and paste the file into there.\nThen you can add the dependency:\n\n```gradle\nimplementation files('libs/AndroidPhase-release.aar')\n```\n\n## Example Use\n```kotlin\nsuspend fun getTvShowDetails(tvShowId: Int): Phase\u003cTvShowDetails\u003e {\n    val response = tvShowsApi.getTvShowDetails(tvShowId)\n\n    return if (response.isSuccessful) {\n        Phase.Success(data = response.body()?.mapToDomainModel())\n    } else {\n        Phase.Error(message = \"Unsuccessful response.\")\n    }\n}\n```\n\nYou can use Compose extension: [Phase Compose Extension](https://github.com/mutkuensert/Android-Phase-Compose-Extension)\n```kotlin\n@Composable\nprivate fun TvShowDetails(\n    phase: Phase\u003cTvShowDetails\u003e,\n    loadTvCastIfSuccessful: () -\u003e Unit\n) {\n    phase.Execute(\n        onLoading = { Loading() },\n        onSuccess = { //it: TvShowDetails\n            TvDetailsItem(it)\n            LaunchedEffect(Unit) { loadTvCastIfSuccessful() }\n        },\n        onError = { //it: Phase.Error\u003cTvShowDetails\u003e\n            LocalContext.current.showToastIfNotNull(it.message)\n        })\n}\n```\n\n\n## License\n```xml\nCopyright 2023 Mustafa Utku Ensert\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\n## Contact\n[ensertyazilim@gmail.com](#)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutkuensert%2Fandroid-phase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutkuensert%2Fandroid-phase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutkuensert%2Fandroid-phase/lists"}