{"id":25483153,"url":"https://github.com/trinnguyen/android-segmentview","last_synced_at":"2025-04-09T18:21:09.213Z","repository":{"id":72996354,"uuid":"226962512","full_name":"trinnguyen/Android-SegmentView","owner":"trinnguyen","description":"Simple Segment Control cloned from iOS 13 for Android Native (Java) and Xamarin.Android (C#)","archived":false,"fork":false,"pushed_at":"2020-02-20T16:24:13.000Z","size":226,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T16:07:33.001Z","etag":null,"topics":["android","segmentcontrol","segmentview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinnguyen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-09T20:34:50.000Z","updated_at":"2024-05-08T23:04:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad495181-58e0-46e2-b1cb-190d07dd2644","html_url":"https://github.com/trinnguyen/Android-SegmentView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2FAndroid-SegmentView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2FAndroid-SegmentView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2FAndroid-SegmentView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2FAndroid-SegmentView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinnguyen","download_url":"https://codeload.github.com/trinnguyen/Android-SegmentView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085450,"owners_count":21045164,"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","segmentcontrol","segmentview"],"created_at":"2025-02-18T17:01:47.989Z","updated_at":"2025-04-09T18:21:09.195Z","avatar_url":"https://github.com/trinnguyen.png","language":"Java","readme":"## SegmentView \n[![NuGet Badge](https://buildstats.info/nuget/Xamarin.SegmentView)](https://www.nuget.org/packages/Xamarin.SegmentView/)\n\nSimple Android Segment Control cloned from iOS 13\n\n\u003cimg src=\"https://raw.githubusercontent.com/trinnguyen/Android-SegmentView/master/segment_view_sample.jpg\" alt=\"Sample Android SegmentView\" width=\"360\"/\u003e\n\n## Usage in Android Gradle Module using JitPack.io\n- Add it in your root `build.gradle` at the end of repositories:\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n- Add the dependency to module's build.gradle\n```\ndependencies {\n    ....\n    implementation 'com.github.trinnguyen:Android-SegmentView:master-SNAPSHOT'\n}\n```\n\n## XML layout code\n```xml\n\u003ccom.trinnguyen.SegmentView\n    android:id=\"@+id/segment_2\"\n    android:layout_width=\"300dp\"\n    android:layout_height=\"36dp\"\n    app:separateLineColor=\"#D6D6D9\"\n    app:unselectedTextColor=\"#7F7F7F\"\n    app:selectedTextColor=\"#FFFFFF\"\n    app:unselectedBackgroundColor=\"#EEEEEF\"\n    app:selectedBackgroundColor=\"@color/colorPrimary\"\n    app:textAppearance=\"@style/TextAppearance.AppCompat.Body1\"\n    app:numSegments=\"3\"\n    app:selectedIndex=\"1\"/\u003e\n```\n\n## Usage in Android\n\n### Update title\n```java\nSegmentView segmentView = findViewById(R.id.segment_2);\nsegmentView.setText(0, \"Map\");\nsegmentView.setText(1, \"Transit\");\nsegmentView.setText(2, \"Satellite\");\n```\n\n### Listener\n```\n@Override\nprotected void onStart() {\n    super.onStart();\n    segmentView.setOnSegmentItemSelectedListener(this);\n}\n\n@Override\nprotected void onStop() {\n    super.onStop();\n    segmentView.setOnSegmentItemSelectedListener(null);\n}\n```\n\n## Usage in Xamarin.Android\n\n### Nuget\n\n```\ndotnet add package Xamarin.SegmentView\n```\n\n\n### Update title\n```java\nSegmentView segmentView = FindViewById\u003cSegmentView\u003e(Resource.Id.segment_2);\nsegmentView.SetText(0, \"Map\");\nsegmentView.SetText(1, \"Transit\");\nsegmentView.SetText(2, \"Satellite\");\n```\n\n### Listener\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinnguyen%2Fandroid-segmentview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinnguyen%2Fandroid-segmentview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinnguyen%2Fandroid-segmentview/lists"}