app / io.geeteshk.dot.ui.main / MainActivity

MainActivity

class MainActivity : AppCompatActivity

Activity where everything goes down

Types

MessageRunnable

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

StateObserver

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

Constructors

<init>

MainActivity()

Activity where everything goes down

Functions

attachBaseContext

fun attachBaseContext(base: Context?): Unit

Used to inject our custom font into the activity

flashControlOnClick

fun flashControlOnClick(view: View): Unit

onClick function for flashControl that changes the state and kicks off the thread

onActivityResult

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

onCreate

fun onCreate(savedInstanceState: Bundle?): Unit

Called when activity is created, we can request permissions here