|
40 | 40 |
|
41 | 41 | import net.ilexiconn.magister.Magister; |
42 | 42 | import net.ilexiconn.magister.container.Appointment; |
| 43 | +import net.ilexiconn.magister.container.type.AppointmentType; |
43 | 44 | import net.ilexiconn.magister.container.type.InfoType; |
44 | 45 | import net.ilexiconn.magister.handler.AppointmentHandler; |
45 | 46 | import net.ilexiconn.magister.util.DateUtil; |
@@ -142,15 +143,18 @@ private void setupDetailscard(Appointment appointment) { |
142 | 143 | periodImageView.setImageDrawable(drawable); |
143 | 144 | periodTextInput.setText(appointment.periodFrom + ""); |
144 | 145 |
|
145 | | - |
146 | | - try { |
147 | | - String teacher = appointment.teachers[0].name; |
148 | | - drawable = new IconicsDrawable(this, GoogleMaterial.Icon.gmd_person); |
149 | | - teacherLayout.setVisibility(View.VISIBLE); |
150 | | - teacherImageView.setImageDrawable(drawable); |
151 | | - teacherTextInput.setText(teacher); |
152 | | - } catch (ArrayIndexOutOfBoundsException e) { |
153 | | - e.printStackTrace(); |
| 146 | + if (appointment.type != AppointmentType.PERSONAL) { |
| 147 | + try { |
| 148 | + String teacher = appointment.teachers[0].name; |
| 149 | + drawable = new IconicsDrawable(this, GoogleMaterial.Icon.gmd_person); |
| 150 | + teacherLayout.setVisibility(View.VISIBLE); |
| 151 | + teacherImageView.setImageDrawable(drawable); |
| 152 | + teacherTextInput.setText(teacher); |
| 153 | + } catch (ArrayIndexOutOfBoundsException e) { |
| 154 | + e.printStackTrace(); |
| 155 | + } |
| 156 | + } else { |
| 157 | + teacherLayout.setVisibility(View.GONE); |
154 | 158 | } |
155 | 159 |
|
156 | 160 |
|
@@ -244,6 +248,10 @@ public void run() { |
244 | 248 | } |
245 | 249 | }); |
246 | 250 |
|
| 251 | + if (appointment.type == AppointmentType.PERSONAL) { |
| 252 | + lastEdited.setVisibility(View.GONE); |
| 253 | + return; |
| 254 | + } |
247 | 255 | lastEdited.setText(String.format(getString(R.string.msg_last_edited), getString(R.string.msg_loading))); |
248 | 256 | new Thread(new Runnable() { |
249 | 257 | @Override |
|
0 commit comments