Skip to content

Commit c301f7f

Browse files
committed
attr modify
2 parents c721f28 + 360f196 commit c301f7f

File tree

8 files changed

+404
-13
lines changed

8 files changed

+404
-13
lines changed

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# TextGroupView
2+
ImageView + TextView + TextView +TextView+ EditText +ImageView + ImageView 实现的组合控件
3+
## JitPack依赖
4+
### A.项目/build.grade
5+
```
6+
allprojects {
7+
repositories {
8+
...
9+
maven { url 'https://jitpack.io' }
10+
}
11+
}
12+
```
13+
### B.项目/app/build.grade
14+
```
15+
dependencies {
16+
implementation 'com.github.RelinRan:TextGroupView:1.0.0'
17+
}
18+
```
19+
# 效果图
20+
![img](https://github.com/RelinRan/TextGroupView/blob/master/ic_rendering.png)
21+
# xml布局
22+
```
23+
<com.android.view.TextGroupView
24+
android:layout_width="match_parent"
25+
android:layout_height="60dp"
26+
android:layout_marginLeft="20dp"
27+
android:layout_marginRight="20dp"
28+
android:layout_marginTop="20dp"
29+
app:left_imageMarginLeft="10dp"
30+
app:left_imageSrc="@drawable/text_group_view_ic_head"
31+
app:left_imageWidth="50dp"
32+
app:left_textPaddingLeft="10dp"
33+
app:radius="8dp"
34+
app:right_imagePaddingRight="10dp"
35+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
36+
app:right_text="更换头像"
37+
app:right_textColor="#FFFFFF"
38+
app:solid="#161538"></com.android.view.TextGroupView>
39+
40+
<com.android.view.TextGroupView
41+
android:layout_width="match_parent"
42+
android:layout_height="60dp"
43+
android:layout_marginLeft="20dp"
44+
android:layout_marginRight="20dp"
45+
android:layout_marginTop="20dp"
46+
app:edit_hintText="输入昵称"
47+
app:edit_hintTextColor="#FFFFFF"
48+
app:edit_textColor="#FFFFFF"
49+
app:left_text="昵称"
50+
app:left_textColor="#FFFFFF"
51+
app:left_textPaddingLeft="10dp"
52+
app:radius="8dp"
53+
app:right_imagePaddingRight="10dp"
54+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
55+
app:solid="#161538"></com.android.view.TextGroupView>
56+
57+
<com.android.view.TextGroupView
58+
android:layout_width="match_parent"
59+
android:layout_height="60dp"
60+
android:layout_marginLeft="20dp"
61+
android:layout_marginRight="20dp"
62+
android:layout_marginTop="20dp"
63+
app:left_imagePaddingLeft="10dp"
64+
app:left_imageSrc="@drawable/text_group_view_ic_item"
65+
app:left_text="基本信息"
66+
app:left_textColor="#FFFFFF"
67+
app:radius="8dp"
68+
app:right_imagePaddingRight="10dp"
69+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
70+
app:solid="#161538"></com.android.view.TextGroupView>
71+
72+
73+
<com.android.view.TextGroupView
74+
android:layout_width="match_parent"
75+
android:layout_height="60dp"
76+
android:layout_marginLeft="20dp"
77+
android:layout_marginRight="20dp"
78+
android:layout_marginTop="20dp"
79+
app:center_imagePaddingRight="10dp"
80+
app:center_imageSrc="@drawable/text_group_view_ic_head"
81+
app:left_text="头像"
82+
app:left_textColor="#FFFFFF"
83+
app:left_textPaddingLeft="10dp"
84+
app:radius="8dp"
85+
app:right_imagePaddingRight="10dp"
86+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
87+
app:solid="#161538"></com.android.view.TextGroupView>
88+
```
89+
90+

app/src/main/java/com/android/view/TextGroupView.java

Lines changed: 208 additions & 13 deletions
Large diffs are not rendered by default.
Loading
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:orientation="vertical">
7+
8+
<com.android.view.TextGroupView
9+
android:layout_width="match_parent"
10+
android:layout_height="60dp"
11+
android:layout_marginLeft="20dp"
12+
android:layout_marginRight="20dp"
13+
android:layout_marginTop="20dp"
14+
app:left_imageMarginLeft="10dp"
15+
app:left_imageSrc="@drawable/text_group_view_ic_head"
16+
app:left_imageWidth="50dp"
17+
app:left_textPaddingLeft="10dp"
18+
app:radius="8dp"
19+
app:right_imagePaddingRight="10dp"
20+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
21+
app:right_text="更换头像"
22+
app:right_textColor="#FFFFFF"
23+
app:solid="#161538"></com.android.view.TextGroupView>
24+
25+
<com.android.view.TextGroupView
26+
android:layout_width="match_parent"
27+
android:layout_height="60dp"
28+
android:layout_marginLeft="20dp"
29+
android:layout_marginRight="20dp"
30+
android:layout_marginTop="20dp"
31+
app:edit_hintText="输入昵称"
32+
app:edit_hintTextColor="#FFFFFF"
33+
app:edit_textColor="#FFFFFF"
34+
app:left_text="昵称"
35+
app:left_textColor="#FFFFFF"
36+
app:left_textPaddingLeft="10dp"
37+
app:radius="8dp"
38+
app:right_imagePaddingRight="10dp"
39+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
40+
app:solid="#161538"></com.android.view.TextGroupView>
41+
42+
<com.android.view.TextGroupView
43+
android:layout_width="match_parent"
44+
android:layout_height="60dp"
45+
android:layout_marginLeft="20dp"
46+
android:layout_marginRight="20dp"
47+
android:layout_marginTop="20dp"
48+
app:left_imagePaddingLeft="10dp"
49+
app:left_imageSrc="@drawable/text_group_view_ic_item"
50+
app:left_text="基本信息"
51+
app:left_textColor="#FFFFFF"
52+
app:radius="8dp"
53+
app:right_imagePaddingRight="10dp"
54+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
55+
app:solid="#161538"></com.android.view.TextGroupView>
56+
57+
58+
<com.android.view.TextGroupView
59+
android:layout_width="match_parent"
60+
android:layout_height="60dp"
61+
android:layout_marginLeft="20dp"
62+
android:layout_marginRight="20dp"
63+
android:layout_marginTop="20dp"
64+
app:center_imagePaddingRight="10dp"
65+
app:center_imageSrc="@drawable/text_group_view_ic_head"
66+
app:left_text="头像"
67+
app:left_textColor="#FFFFFF"
68+
app:left_textPaddingLeft="10dp"
69+
app:radius="8dp"
70+
app:right_imagePaddingRight="10dp"
71+
app:right_imageSrc="@drawable/text_group_view_ic_arrow"
72+
app:solid="#161538"></com.android.view.TextGroupView>
73+
74+
</LinearLayout>

app/src/main/res/values/attrs.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
<attr name="edit_background" format="reference" />
166166
<attr name="edit_singleLine" format="boolean" />
167167
<attr name="edit_maxLines" format="integer" />
168+
<attr name="edit_maxLength" format="integer" />
168169
<attr name="edit_digits" format="string" />
169170
<attr name="edit_ellipsize">
170171
<flag name="start" value="0" />
@@ -203,6 +204,37 @@
203204
<attr name="edit_paddingTop" format="dimension" />
204205
<attr name="edit_paddingRight" format="dimension" />
205206
<attr name="edit_paddingBottom" format="dimension" />
207+
<!--############中间图片############-->
208+
<attr name="center_imageSrc" format="reference" />
209+
<attr name="center_imageBackground" format="reference" />
210+
<attr name="center_imageWidth" format="dimension">
211+
<enum name="match_parent" value="-1" />
212+
<enum name="wrap_content" value="-2" />
213+
</attr>
214+
<attr name="center_imageHeight" format="dimension">
215+
<enum name="match_parent" value="-1" />
216+
<enum name="wrap_content" value="-2" />
217+
</attr>
218+
<attr name="center_imageScaleType">
219+
<flag name="matrix" value="0" />
220+
<flag name="fit_xy" value="1" />
221+
<flag name="fit_start" value="2" />
222+
<flag name="fit_center" value="3" />
223+
<flag name="fit_end" value="4" />
224+
<flag name="center" value="5" />
225+
<flag name="center_crop" value="6" />
226+
<flag name="center_inside" value="7" />
227+
</attr>
228+
<attr name="center_imageMargin" format="dimension" />
229+
<attr name="center_imageMarginLeft" format="dimension" />
230+
<attr name="center_imageMarginTop" format="dimension" />
231+
<attr name="center_imageMarginRight" format="dimension" />
232+
<attr name="center_imageMarginBottom" format="dimension" />
233+
<attr name="center_imagePadding" format="dimension" />
234+
<attr name="center_imagePaddingLeft" format="dimension" />
235+
<attr name="center_imagePaddingTop" format="dimension" />
236+
<attr name="center_imagePaddingRight" format="dimension" />
237+
<attr name="center_imagePaddingBottom" format="dimension" />
206238
<!--############右边图片############-->
207239
<attr name="right_imageSrc" format="reference" />
208240
<attr name="right_imageBackground" format="reference" />

ic_rendering.png

28.2 KB
Loading

0 commit comments

Comments
 (0)