An open API service indexing awesome lists of open source software.

https://github.com/trinnguyen/android-segmentview

Simple Segment Control cloned from iOS 13 for Android Native (Java) and Xamarin.Android (C#)
https://github.com/trinnguyen/android-segmentview

android segmentcontrol segmentview

Last synced: 21 days ago
JSON representation

Simple Segment Control cloned from iOS 13 for Android Native (Java) and Xamarin.Android (C#)

Awesome Lists containing this project

README

        

## SegmentView
[![NuGet Badge](https://buildstats.info/nuget/Xamarin.SegmentView)](https://www.nuget.org/packages/Xamarin.SegmentView/)

Simple Android Segment Control cloned from iOS 13

Sample Android SegmentView

## Usage in Android Gradle Module using JitPack.io
- Add it in your root `build.gradle` at the end of repositories:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

- Add the dependency to module's build.gradle
```
dependencies {
....
implementation 'com.github.trinnguyen:Android-SegmentView:master-SNAPSHOT'
}
```

## XML layout code
```xml

```

## Usage in Android

### Update title
```java
SegmentView segmentView = findViewById(R.id.segment_2);
segmentView.setText(0, "Map");
segmentView.setText(1, "Transit");
segmentView.setText(2, "Satellite");
```

### Listener
```
@Override
protected void onStart() {
super.onStart();
segmentView.setOnSegmentItemSelectedListener(this);
}

@Override
protected void onStop() {
super.onStop();
segmentView.setOnSegmentItemSelectedListener(null);
}
```

## Usage in Xamarin.Android

### Nuget

```
dotnet add package Xamarin.SegmentView
```

### Update title
```java
SegmentView segmentView = FindViewById(Resource.Id.segment_2);
segmentView.SetText(0, "Map");
segmentView.SetText(1, "Transit");
segmentView.SetText(2, "Satellite");
```

### Listener