Skip to content

Commit 78d6826

Browse files
authored
Create README.md
1 parent e17737d commit 78d6826

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Android-SegmentView
2+
Simple Android Segment Control cloned from iOS 13
3+
4+
5+
6+
## XML layout code
7+
```
8+
<com.trinnguyen.SegmentView
9+
android:id="@+id/segment_2"
10+
android:layout_width="300dp"
11+
android:layout_height="36dp"
12+
android:layout_marginTop="100dp"
13+
android:layout_marginStart="24dp"
14+
app:separateLineColor="#D6D6D9"
15+
app:unselectedTextColor="#7F7F7F"
16+
app:selectedTextColor="#FFFFFF"
17+
app:unselectedBackgroundColor="#EEEEEF"
18+
app:selectedBackgroundColor="@color/colorPrimary"
19+
app:textAppearance="@style/TextAppearance.AppCompat.Body1"
20+
app:numSegments="3"
21+
app:selectedIndex="1"/>
22+
```
23+
24+
## Update title
25+
```
26+
segmentView.setText(0, "Map");
27+
segmentView.setText(1, "Transit");
28+
segmentView.setText(2, "Satellite");
29+
```

0 commit comments

Comments
 (0)