main activity ui and events