use of de.tum.in.tumcampusapp.component.tumui.person.model.Person in project TumCampusApp by TCA-Team.
the class PersonsSearchActivity method getRecents.
private ArrayList<Person> getRecents() {
List<Recent> recentList = recentsDao.getAll(RecentsDao.PERSONS);
ArrayList<Person> personList = new ArrayList<>(recentList.size());
for (Recent r : recentList) {
personList.add(Person.Companion.fromRecent(r));
}
return personList;
}
use of de.tum.in.tumcampusapp.component.tumui.person.model.Person in project TumCampusApp by TCA-Team.
the class PersonsSearchActivity method onItemClick.
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Person person = (Person) lvPersons.getItemAtPosition(position);
// store selected person ID in bundle to get in in StaffDetails
Bundle bundle = new Bundle();
bundle.putSerializable("personObject", person);
// show detailed information in new activity
Intent intent = new Intent(this, PersonsDetailsActivity.class);
intent.putExtras(bundle);
startActivity(intent);
String lastSearch = person.getId() + "$" + person.toString().trim();
recentsDao.insert(new Recent(lastSearch, RecentsDao.PERSONS));
}
use of de.tum.in.tumcampusapp.component.tumui.person.model.Person in project TumCampusApp by TCA-Team.
the class PersonsDetailsActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// get person from staff activity
Bundle bundle = this.getIntent().getExtras();
Person person = (Person) bundle.getSerializable("personObject");
// make sure not both person is not null (error occurred)
if (person == null) {
// no query text specified
Utils.showToast(this, R.string.no_person_set);
return;
}
// Sets the current name as a title
setTitle(person.getName() + ' ' + person.getSurname());
requestHandler.setParameter("pIdentNr", person.getId());
super.requestFetch();
}