部门快要年会了,最近做了个小软件,“年度优秀员工”apk。

需求:部门的七个小组每组推荐两名候选人,部门所有员工投票选出七名优秀员工。每人必须选不是同一组的两人,不能多选或者少选,必须是本部门的员工才有资格选,选定两个后最终本软件以短信的形式向同一个手机号发送过去,最终通过短信数据库导出表格,统计即可。

实现界面如下:

【小软件】年度优秀员工

 

代码如下:

activity_main.xml

  1 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2     xmlns:tools="http://schemas.android.com/tools"
  3     android:id="@+id/layout"
  4     android:layout_width="match_parent"
  5     android:layout_height="match_parent"
  6     tools:context="${relativePackage}.${activityClass}" >
  7 
  8 <TableRow>
  9     <TextView
 10         android:id="@+id/text_view"
 11         android:layout_width="wrap_content"
 12         android:layout_height="wrap_content"
 13         android:text="@string/name"
 14         android:textSize="10pt" 
 15         android:background="#CCCCCC" 
 16         android:paddingLeft="20dip" 
 17         android:paddingRight="20dip"
 18         android:paddingTop="10dip" 
 19         android:paddingBottom="10dip"
 20         android:layout_marginRight="5dip"
 21         android:layout_marginLeft="25dip"  
 22         android:layout_marginTop="5dip"
 23         android:layout_marginBottom="5dip"/>
 24     <EditText 
 25         android:id="@+id/edit_text"
 26         android:layout_width="wrap_content"
 27         android:layout_height="wrap_content"
 28         android:inputType="number"
 29         android:hint="@string/nameber"
 30         android:background="#CCCCCC"
 31         android:paddingLeft="20dip" 
 32         android:paddingRight="20dip"
 33         android:paddingTop="10dip" 
 34         android:paddingBottom="10dip"
 35         android:layout_marginRight="5dip"
 36         android:layout_marginLeft="5dip"  
 37         android:layout_marginTop="5dip"
 38         android:layout_marginBottom="5dip"/>
 39 </TableRow>
 40 <TableRow>
 41     <RadioGroup 
 42         android:id="@+id/radio_group1"
 43         android:layout_width="wrap_content"
 44         android:layout_height="wrap_content"
 45         android:background="#CAE1FF"
 46         android:paddingLeft="20dip" 
 47         android:paddingRight="20dip"
 48         android:paddingTop="10dip" 
 49         android:paddingBottom="10dip"
 50         android:layout_marginRight="5dip"
 51         android:layout_marginLeft="25dip"  
 52         android:layout_marginTop="5dip"
 53         android:layout_marginBottom="5dip">
 54         <TextView 
 55             android:layout_width="wrap_content"
 56             android:layout_height="wrap_content"
 57             android:text="@string/n1"/>
 58         <RadioButton 
 59             android:id="@+id/radiob1"
 60             android:layout_width="wrap_content"
 61             android:layout_height="wrap_content"
 62             android:text="@string/name1"/>
 63         <RadioButton 
 64             android:id="@+id/radiob2"
 65             android:layout_width="wrap_content"
 66             android:layout_height="wrap_content"
 67             android:text="@string/name2"/>
 68     </RadioGroup>
 69     <RadioGroup 
 70         android:id="@+id/radio_group2"
 71         android:layout_width="wrap_content"
 72         android:layout_height="wrap_content"
 73         android:background="#CAE1FF"
 74         android:paddingLeft="20dip" 
 75         android:paddingRight="20dip" 
 76         android:paddingTop="10dip" 
 77         android:paddingBottom="10dip"
 78         android:layout_marginRight="5dip" 
 79         android:layout_marginLeft="5dip" 
 80         android:layout_marginTop="5dip"
 81         android:layout_marginBottom="5dip">
 82         <TextView 
 83             android:layout_width="wrap_content"
 84             android:layout_height="wrap_content"
 85             android:text="@string/n2"/>
 86         <RadioButton 
 87             android:id="@+id/radiob3"
 88             android:layout_width="wrap_content"
 89             android:layout_height="wrap_content"
 90             android:text="@string/name3"/>
 91         <RadioButton 
 92             android:id="@+id/radiob4"
 93             android:layout_width="wrap_content"
 94             android:layout_height="wrap_content"
 95             android:text="@string/name4"/>
 96     </RadioGroup>
 97     </TableRow>
 98     <TableRow>
 99     <RadioGroup 
100         android:id="@+id/radio_group3"
101         android:layout_width="wrap_content"
102         android:layout_height="wrap_content"
103         android:background="#CAE1FF"
104         android:paddingLeft="20dip" 
105         android:paddingRight="20dip"
106         android:paddingTop="10dip" 
107         android:paddingBottom="10dip"
108         android:layout_marginRight="5dip" 
109         android:layout_marginLeft="25dip" 
110         android:layout_marginTop="5dip"
111         android:layout_marginBottom="5dip">
112         <TextView 
113             android:layout_width="wrap_content"
114             android:layout_height="wrap_content"
115             android:text="@string/n3"/>
116         <RadioButton 
117             android:id="@+id/radiob5"
118             android:layout_width="wrap_content"
119             android:layout_height="wrap_content"
120             android:text="@string/name5"/>
121         <RadioButton 
122             android:id="@+id/radiob6"
123             android:layout_width="wrap_content"
124             android:layout_height="wrap_content"
125             android:text="@string/name6"/>
126     </RadioGroup>
127     <RadioGroup 
128         android:id="@+id/radio_group4"
129         android:layout_width="wrap_content"
130         android:layout_height="wrap_content"
131         android:background="#CAE1FF"
132         android:paddingLeft="20dip" 
133         android:paddingRight="20dip"
134         android:paddingTop="10dip" 
135         android:paddingBottom="10dip"
136         android:layout_marginRight="5dip" 
137         android:layout_marginLeft="5dip" 
138         android:layout_marginTop="5dip"
139         android:layout_marginBottom="5dip">
140         <TextView 
141             android:layout_width="wrap_content"
142             android:layout_height="wrap_content"
143             android:text="@string/n4"/>
144         <RadioButton 
145             android:id="@+id/radiob7"
146             android:layout_width="wrap_content"
147             android:layout_height="wrap_content"
148             android:text="@string/name7"/>
149         <RadioButton 
150             android:id="@+id/radiob8"
151             android:layout_width="wrap_content"
152             android:layout_height="wrap_content"
153             android:text="@string/name8"/>
154     </RadioGroup>
155     </TableRow>
156     <TableRow>
157     <RadioGroup 
158         android:id="@+id/radio_group5"
159         android:layout_width="wrap_content"
160         android:layout_height="wrap_content"
161         android:background="#CAE1FF"
162         android:paddingLeft="20dip" 
163         android:paddingRight="20dip" 
164         android:paddingTop="10dip" 
165         android:paddingBottom="10dip"
166         android:layout_marginRight="5dip" 
167         android:layout_marginLeft="25dip" 
168         android:layout_marginTop="5dip"
169         android:layout_marginBottom="5dip" >
170         <TextView 
171             android:layout_width="wrap_content"
172             android:layout_height="wrap_content"
173             android:text="@string/n5"/>
174         <RadioButton 
175             android:id="@+id/radiob9"
176             android:layout_width="wrap_content"
177             android:layout_height="wrap_content"
178             android:text="@string/name9"/>
179         <RadioButton 
180             android:id="@+id/radiob10"
181             android:layout_width="wrap_content"
182             android:layout_height="wrap_content"
183             android:text="@string/name10"/>
184     </RadioGroup>
185     <RadioGroup 
186         android:id="@+id/radio_group6"
187         android:layout_width="wrap_content"
188         android:layout_height="wrap_content"
189         android:background="#CAE1FF"
190         android:paddingLeft="20dip" 
191         android:paddingRight="20dip"
192         android:paddingTop="10dip" 
193         android:paddingBottom="10dip"
194         android:layout_marginRight="5dip"
195         android:layout_marginLeft="5dip"  
196         android:layout_marginTop="5dip"
197         android:layout_marginBottom="5dip">
198         <TextView 
199             android:layout_width="wrap_content"
200             android:layout_height="wrap_content"
201             android:text="@string/n6"/>
202         <RadioButton 
203             android:id="@+id/radiob11"
204             android:layout_width="wrap_content"
205             android:layout_height="wrap_content"
206             android:text="@string/name11"/>
207         <RadioButton 
208             android:id="@+id/radiob12"
209             android:layout_width="wrap_content"
210             android:layout_height="wrap_content"
211             android:text="@string/name12"/>
212     </RadioGroup>
213     </TableRow>
214     <TableRow>
215     <RadioGroup 
216         android:id="@+id/radio_group7"
217         android:layout_width="wrap_content"
218         android:layout_height="wrap_content"
219         android:background="#CAE1FF"
220         android:layout_marginRight="5dip"
221         android:layout_marginLeft="25dip"  
222         android:layout_marginTop="5dip"
223         android:layout_marginBottom="5dip"
224         android:paddingLeft="20dip" 
225         android:paddingRight="20dip"
226         android:paddingTop="10dip" 
227         android:paddingBottom="10dip">
228         <TextView 
229             android:layout_width="wrap_content"
230             android:layout_height="wrap_content"
231             android:text="@string/n7"/>
232         <RadioButton 
233             android:id="@+id/radiob13"
234             android:layout_width="wrap_content"
235             android:layout_height="wrap_content"
236             android:text="@string/name13"/>
237         <RadioButton 
238             android:id="@+id/radiob14"
239             android:layout_width="wrap_content"
240             android:layout_height="wrap_content"
241             android:text="@string/name14"/>
242     </RadioGroup>
243     </TableRow>
244     <TableRow>
245     <Button 
246         android:id="@+id/button1"
247         android:layout_width="wrap_content"
248         android:layout_height="wrap_content"
249         android:text="@string/confirm"
250         android:background="#CCCCCC"
251         android:layout_marginRight="5dip" 
252         android:layout_marginLeft="25dip" 
253         android:layout_marginTop="5dip"
254         android:layout_marginBottom="5dip"
255         android:paddingLeft="20dip" 
256         android:paddingRight="20dip"
257         android:paddingTop="10dip" 
258         android:paddingBottom="10dip"/>
259     <Button 
260         android:id="@+id/button2"
261         android:layout_width="wrap_content"
262         android:layout_height="wrap_content"
263         android:background="#CCCCCC"
264         android:text="@string/cancel"
265         android:layout_marginRight="5dip"
266         android:layout_marginLeft="5dip"  
267         android:layout_marginTop="5dip"
268         android:layout_marginBottom="5dip"
269         android:paddingLeft="20dip" 
270         android:paddingRight="20dip"
271         android:paddingTop="10dip" 
272         android:paddingBottom="10dip"/>
273     </TableRow>
274 </TableLayout>
View Code

相关文章:

  • 2021-09-12
  • 2021-11-13
  • 2021-05-09
  • 2021-08-17
  • 2022-01-17
  • 2022-01-02
  • 2022-02-08
  • 2021-11-02
猜你喜欢
  • 2021-05-18
  • 2021-12-14
  • 2021-12-02
  • 2022-02-10
  • 2021-06-27
  • 2021-12-23
  • 2022-02-07
相关资源
相似解决方案