-
Notifications
You must be signed in to change notification settings - Fork 62
/
activity_tab.xml
166 lines (149 loc) · 5.55 KB
/
activity_tab.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#506E7A"
tools:context=".activity.TabActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="使用矩形 RECT,规定了大小,自动缩放"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/rectflow"
android:layout_width="300dp"
android:layout_marginTop="5dp"
app:tab_type="rect"
app:tab_color="@color/colorPrimary"
app:tab_height="3dp"
app:tab_width="20dp"
app:tab_margin_b="3dp"
android:background="@color/black_ff_bg"
app:tab_scale_factor="1.2"
app:tab_item_autoScale="true"
app:tab_visual_count="4"
android:layout_marginStart="20dp"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="使用矩形 RECT,不限制大小"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/rectflow2"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
app:tab_type="rect"
app:tab_color="@color/colorPrimary"
app:tab_height="3dp"
app:tab_margin_b="3dp"
android:background="@color/black_ff_bg"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="使用三角形 tri"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/triflow"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
app:tab_type="tri"
app:tab_color="@color/colorPrimary"
app:tab_height="3dp"
app:tab_width="10dp"
app:tab_margin_b="3dp"
android:background="@color/black_ff_bg"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="使用圆角矩形 round"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/roundflow"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
app:tab_type="round"
android:background="#6D8FB0"
app:tab_color="#b01a1a1a"
app:tab_round_size="4dp"
app:tab_margin_t="3dp"
app:tab_margin_b="3dp"
app:tab_margin_l="2dp"
app:tab_margin_r="2dp"
app:tab_click_animTime="250"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="资源res,可以是shape,bitmap,这里使用TabBean动态配置"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/resflow"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:background="#6D8FB0"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="颜色渐变 color,可以和上面的属性结合"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/colorflow"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:background="#a0f3ecec"
app:tab_type="rect"
app:tab_height="2dp"
app:tab_color="@color/colorAccent"
app:tab_margin_b="3dp"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/unselect"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:text="用户自定义tab,继承BaseAction,写个小圆点"
/>
<com.zhengsr.tablib.view.flow.TabFlowLayout
android:id="@+id/cusflow"
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:background="#6D8FB0"
app:tab_click_animTime="250"
app:tab_color="@color/white"
app:tab_height="5dp"
app:tab_width="5dp"
app:tab_margin_b="2dp"
android:layout_height="wrap_content"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_margin="10dp"
android:background="#15323232"
android:layout_height="100dp"/>
</LinearLayout>