class MainActivity : AppCompatActivity
Activity where everything goes down
inner class MessageRunnable : Runnable
A Runnable that is run by our flashing Thread that takes care of flashing the morse code with the correct timings and delays. There is probably a more optimal way of doing this |
|
inner class StateObserver : LifecycleObserver
A LifeCycleObserver that ensures our program looks and behaves correctly with lifecycle changes i.e. ensure the right FloatingActionButton icon is set and ensure we don't flash when the user leaves the app |
MainActivity()
Activity where everything goes down |
fun attachBaseContext(base: Context?): Unit
Used to inject our custom font into the activity |
|
fun flashControlOnClick(view: View): Unit
onClick function for flashControl that changes the state and kicks off the thread |
|
fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Unit
Necessary for when the user denies permissions forever and we return from the app's Settings page |
|
fun onCreate(savedInstanceState: Bundle?): Unit
Called when activity is created, we can request permissions here |