Commit a809e3e57161c79ebba2a09afadf073c3630aee4

Authored by shixianjie
1 parent 926c5e84b3
Exists in master

dialog布局调整

app/src/main/res/layout/dialog_add_homework.xml
1 <FrameLayout 1 <FrameLayout
2 xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="match_parent" 6 android:layout_height="match_parent"
7 tools:ignore="HardcodedText,ContentDescription,UselessParent" > 7 tools:ignore="HardcodedText,ContentDescription,UselessParent" >
8 8
9 <LinearLayout 9 <LinearLayout
10 android:orientation="vertical" 10 android:orientation="vertical"
11 android:background="@drawable/shape_radius_top_10" 11 android:background="@drawable/shape_radius_top_10"
12 android:layout_marginTop="80dp" 12 android:layout_gravity="bottom"
13 android:layout_width="match_parent" 13 android:layout_width="match_parent"
14 android:layout_height="match_parent"> 14 android:layout_height="wrap_content">
15 15
16 <FrameLayout 16 <FrameLayout
17 android:layout_marginTop="8dp" 17 android:layout_marginTop="8dp"
18 android:layout_marginBottom="8dp" 18 android:layout_marginBottom="8dp"
19 android:layout_width="match_parent" 19 android:layout_width="match_parent"
20 android:layout_height="wrap_content"> 20 android:layout_height="wrap_content">
21 21
22 <TextView 22 <TextView
23 android:id="@+id/tvTitle" 23 android:id="@+id/tvTitle"
24 android:text="录入作业" 24 android:text="录入作业"
25 android:textSize="17sp" 25 android:textSize="17sp"
26 android:textStyle="bold" 26 android:textStyle="bold"
27 android:layout_gravity="center" 27 android:layout_gravity="center"
28 android:textColor="@color/text_title" 28 android:textColor="@color/text_title"
29 android:layout_width="wrap_content" 29 android:layout_width="wrap_content"
30 android:layout_height="wrap_content" /> 30 android:layout_height="wrap_content" />
31 31
32 <ImageView 32 <ImageView
33 android:id="@+id/btnClose" 33 android:id="@+id/btnClose"
34 android:padding="12dp" 34 android:padding="12dp"
35 android:src="@mipmap/ic_close" 35 android:src="@mipmap/ic_close"
36 android:layout_gravity="end|center_vertical" 36 android:layout_gravity="end|center_vertical"
37 android:layout_width="35dp" 37 android:layout_width="35dp"
38 android:layout_height="35dp" /> 38 android:layout_height="35dp" />
39 </FrameLayout> 39 </FrameLayout>
40 40
41 <androidx.core.widget.NestedScrollView 41 <androidx.core.widget.NestedScrollView
42 android:layout_width="match_parent" 42 android:layout_width="match_parent"
43 android:layout_height="match_parent"> 43 android:layout_height="match_parent">
44 <LinearLayout 44 <LinearLayout
45 android:orientation="vertical" 45 android:orientation="vertical"
46 android:layout_marginTop="-20dp" 46 android:layout_marginTop="-20dp"
47 android:layout_width="match_parent" 47 android:layout_width="match_parent"
48 android:layout_height="wrap_content"> 48 android:layout_height="wrap_content">
49 49
50 <TextView 50 <TextView
51 android:id="@+id/tvStu" 51 android:id="@+id/tvStu"
52 android:layout_marginTop="20dp" 52 android:layout_marginTop="20dp"
53 android:layout_width="wrap_content" 53 android:layout_width="wrap_content"
54 android:layout_height="wrap_content" 54 android:layout_height="wrap_content"
55 android:layout_marginHorizontal="15dp" 55 android:layout_marginHorizontal="15dp"
56 android:text="学生" 56 android:text="学生"
57 android:textColor="@color/text_title" 57 android:textColor="@color/text_title"
58 android:textSize="14sp" 58 android:textSize="14sp"
59 android:textStyle="bold" /> 59 android:textStyle="bold" />
60 60
61 <androidx.appcompat.widget.AppCompatSpinner 61 <androidx.appcompat.widget.AppCompatSpinner
62 android:id="@+id/spStudent" 62 android:id="@+id/spStudent"
63 style="@style/customSpinnerStyle" 63 style="@style/customSpinnerStyle"
64 android:layout_width="match_parent" 64 android:layout_width="match_parent"
65 android:layout_height="40dp" 65 android:layout_height="40dp"
66 android:layout_marginTop="10dp" 66 android:layout_marginTop="10dp"
67 android:layout_marginHorizontal="15dp" 67 android:layout_marginHorizontal="15dp"
68 android:background="@drawable/selector_for_input_spinner" 68 android:background="@drawable/selector_for_input_spinner"
69 android:popupBackground="@drawable/shape_for_input_spinner" 69 android:popupBackground="@drawable/shape_for_input_spinner"
70 android:scrollbars="none" /> 70 android:scrollbars="none" />
71 71
72 <TextView 72 <TextView
73 android:layout_width="wrap_content" 73 android:layout_width="wrap_content"
74 android:layout_height="wrap_content" 74 android:layout_height="wrap_content"
75 android:layout_marginHorizontal="15dp" 75 android:layout_marginHorizontal="15dp"
76 android:layout_marginTop="20dp" 76 android:layout_marginTop="20dp"
77 android:text="年级" 77 android:text="年级"
78 android:textColor="@color/text_title" 78 android:textColor="@color/text_title"
79 android:textSize="14sp" 79 android:textSize="14sp"
80 android:textStyle="bold" /> 80 android:textStyle="bold" />
81 81
82 <androidx.appcompat.widget.AppCompatSpinner 82 <androidx.appcompat.widget.AppCompatSpinner
83 android:id="@+id/spGrade" 83 android:id="@+id/spGrade"
84 style="@style/customSpinnerStyle" 84 style="@style/customSpinnerStyle"
85 android:layout_width="match_parent" 85 android:layout_width="match_parent"
86 android:layout_height="40dp" 86 android:layout_height="40dp"
87 android:layout_marginTop="10dp" 87 android:layout_marginTop="10dp"
88 android:layout_marginHorizontal="15dp" 88 android:layout_marginHorizontal="15dp"
89 android:background="@drawable/selector_for_input_spinner" 89 android:background="@drawable/selector_for_input_spinner"
90 android:popupBackground="@drawable/shape_for_input_spinner" 90 android:popupBackground="@drawable/shape_for_input_spinner"
91 android:scrollbars="none" /> 91 android:scrollbars="none" />
92 92
93 <TextView 93 <TextView
94 android:layout_width="wrap_content" 94 android:layout_width="wrap_content"
95 android:layout_height="wrap_content" 95 android:layout_height="wrap_content"
96 android:layout_marginHorizontal="15dp" 96 android:layout_marginHorizontal="15dp"
97 android:layout_marginTop="20dp" 97 android:layout_marginTop="20dp"
98 android:text="学期" 98 android:text="学期"
99 android:textColor="@color/text_title" 99 android:textColor="@color/text_title"
100 android:textSize="14sp" 100 android:textSize="14sp"
101 android:textStyle="bold" /> 101 android:textStyle="bold" />
102 102
103 <androidx.appcompat.widget.AppCompatSpinner 103 <androidx.appcompat.widget.AppCompatSpinner
104 android:id="@+id/spTerm" 104 android:id="@+id/spTerm"
105 style="@style/customSpinnerStyle" 105 style="@style/customSpinnerStyle"
106 android:layout_width="match_parent" 106 android:layout_width="match_parent"
107 android:layout_height="40dp" 107 android:layout_height="40dp"
108 android:layout_marginTop="10dp" 108 android:layout_marginTop="10dp"
109 android:layout_marginHorizontal="15dp" 109 android:layout_marginHorizontal="15dp"
110 android:background="@drawable/selector_for_input_spinner" 110 android:background="@drawable/selector_for_input_spinner"
111 android:entries="@array/grade_array" 111 android:entries="@array/grade_array"
112 android:popupBackground="@drawable/shape_for_input_spinner" 112 android:popupBackground="@drawable/shape_for_input_spinner"
113 android:scrollbars="none" /> 113 android:scrollbars="none" />
114 114
115 <TextView 115 <TextView
116 android:layout_width="wrap_content" 116 android:layout_width="wrap_content"
117 android:layout_height="wrap_content" 117 android:layout_height="wrap_content"
118 android:layout_marginHorizontal="15dp" 118 android:layout_marginHorizontal="15dp"
119 android:layout_marginTop="20dp" 119 android:layout_marginTop="20dp"
120 android:text="科目" 120 android:text="科目"
121 android:textColor="@color/text_title" 121 android:textColor="@color/text_title"
122 android:textSize="14sp" 122 android:textSize="14sp"
123 android:textStyle="bold" /> 123 android:textStyle="bold" />
124 124
125 <androidx.appcompat.widget.AppCompatSpinner 125 <androidx.appcompat.widget.AppCompatSpinner
126 android:id="@+id/spSubject" 126 android:id="@+id/spSubject"
127 style="@style/customSpinnerStyle" 127 style="@style/customSpinnerStyle"
128 android:layout_width="match_parent" 128 android:layout_width="match_parent"
129 android:layout_height="40dp" 129 android:layout_height="40dp"
130 android:layout_marginTop="10dp" 130 android:layout_marginTop="10dp"
131 android:layout_marginHorizontal="15dp" 131 android:layout_marginHorizontal="15dp"
132 android:background="@drawable/selector_for_input_spinner" 132 android:background="@drawable/selector_for_input_spinner"
133 android:popupBackground="@drawable/shape_for_input_spinner" 133 android:popupBackground="@drawable/shape_for_input_spinner"
134 android:scrollbars="none" /> 134 android:scrollbars="none" />
135 135
136 <TextView 136 <TextView
137 android:layout_width="wrap_content" 137 android:layout_width="wrap_content"
138 android:layout_height="wrap_content" 138 android:layout_height="wrap_content"
139 android:layout_marginHorizontal="15dp" 139 android:layout_marginHorizontal="15dp"
140 android:layout_marginTop="20dp" 140 android:layout_marginTop="20dp"
141 android:text="日期" 141 android:text="日期"
142 android:textColor="@color/text_title" 142 android:textColor="@color/text_title"
143 android:textSize="14sp" 143 android:textSize="14sp"
144 android:textStyle="bold" /> 144 android:textStyle="bold" />
145 145
146 <TextView 146 <TextView
147 android:id="@+id/tvDate" 147 android:id="@+id/tvDate"
148 tools:text="2024-09-18" 148 tools:text="2024-09-18"
149 android:textSize="16sp" 149 android:textSize="16sp"
150 android:textColor="#333" 150 android:textColor="#333"
151 android:gravity="center_vertical" 151 android:gravity="center_vertical"
152 android:paddingHorizontal="16dp" 152 android:paddingHorizontal="16dp"
153 android:layout_width="match_parent" 153 android:layout_width="match_parent"
154 android:layout_height="40dp" 154 android:layout_height="40dp"
155 android:layout_marginTop="10dp" 155 android:layout_marginTop="10dp"
156 android:layout_marginHorizontal="15dp" 156 android:layout_marginHorizontal="15dp"
157 android:background="@drawable/selector_for_input_spinner" /> 157 android:background="@drawable/selector_for_input_spinner" />
158 158
159 <TextView 159 <TextView
160 android:layout_width="wrap_content" 160 android:layout_width="wrap_content"
161 android:layout_height="wrap_content" 161 android:layout_height="wrap_content"
162 android:layout_marginHorizontal="15dp" 162 android:layout_marginHorizontal="15dp"
163 android:layout_marginTop="20dp" 163 android:layout_marginTop="20dp"
164 android:text="作业名称" 164 android:text="作业名称"
165 android:textColor="@color/text_title" 165 android:textColor="@color/text_title"
166 android:textSize="14sp" 166 android:textSize="14sp"
167 android:textStyle="bold" /> 167 android:textStyle="bold" />
168 168
169 <EditText 169 <EditText
170 android:id="@+id/etName" 170 android:id="@+id/etName"
171 android:layout_width="match_parent" 171 android:layout_width="match_parent"
172 android:layout_height="40dp" 172 android:layout_height="40dp"
173 android:layout_marginTop="10dp" 173 android:layout_marginTop="10dp"
174 android:layout_marginHorizontal="15dp" 174 android:layout_marginHorizontal="15dp"
175 android:background="@drawable/shape_for_input_spinner" 175 android:background="@drawable/shape_for_input_spinner"
176 android:fillViewport="true" 176 android:fillViewport="true"
177 android:gravity="center_vertical" 177 android:gravity="center_vertical"
178 android:maxLength="50" 178 android:maxLength="50"
179 android:paddingHorizontal="16dp" 179 android:paddingHorizontal="16dp"
180 android:textColor="@color/text_title" 180 android:textColor="@color/text_title"
181 android:textSize="13sp" 181 android:textSize="13sp"
182 android:inputType="text" 182 android:inputType="text"
183 tools:ignore="Autofill,LabelFor" /> 183 tools:ignore="Autofill,LabelFor" />
184 184
185 <TextView 185 <TextView
186 android:id="@+id/btnConfirm" 186 android:id="@+id/btnConfirm"
187 android:text="确认录入" 187 android:text="确认录入"
188 android:gravity="center" 188 android:gravity="center"
189 android:textSize="16sp" 189 android:textSize="16sp"
190 android:textColor="@color/white" 190 android:textColor="@color/white"
191 android:background="@drawable/shape_radius_5" 191 android:background="@drawable/shape_radius_5"
192 android:backgroundTint="#1C90F3" 192 android:backgroundTint="#1C90F3"
193 android:layout_gravity="center_horizontal" 193 android:layout_gravity="center_horizontal"
194 android:layout_marginVertical="24dp" 194 android:layout_marginVertical="24dp"
195 android:layout_width="224dp" 195 android:layout_width="224dp"
196 android:layout_height="36dp"/> 196 android:layout_height="36dp"/>
197 </LinearLayout> 197 </LinearLayout>
198 </androidx.core.widget.NestedScrollView> 198 </androidx.core.widget.NestedScrollView>
199 199
200 </LinearLayout> 200 </LinearLayout>
201 </FrameLayout> 201 </FrameLayout>