Closed blonsky95 closed 3 years ago
so using this as a general guide https://developer.android.com/training/testing
and right now at the first step https://developer.android.com/training/testing/fundamentals
upload document to spreadsheet or google drive at some point
familiarize myself with codelabs
https://developer.android.com/codelabs/advanced-android-kotlin-training-testing-basics#3
So in this project there is extensive use of overkill architechture such as the navigation component and the extreme databinding.
The navigation component handles the navigation actions through an xml component in which the possible paths and arguments are described, as well as what the fragments correspond to (their actual classes). There is a navigation host fragment which hosts the different fragments that can be moved in and out of that host container window. The navigation graph has all the info for the library to build a file, which depending on the name of the file where you are writing the actions, will add "Directions" to the end of it. in this file you can call the method that will generate the action that performs the navigation event - you then use this action to tell the navcontroller to perform it:
view.findNavController().navigate(action)
The databinding is basically that this guy passes the viewmodel as a parameter in the databinding, so the xml file now makes all the calls to the viewmodel directly, aka no onClickListeners, there is no intermediate between view and viewmodel. The xml makes the calls to viewmodel, and in the fragment what it does is observe the livedata in the viewmodel to perform any actions. To detect navigation from buttons, the button tap updates the value of mutablelivedata in viewmodel, which is observed from the fragment class, and then calls the navigation pattern to process it. You can also access from the fragment, all the components with an id, by calling them as properties of viewDataBinding, which is a generated class/file based on the fragment you are performing the binding on. So you can provide the adapter by for example doing viewDataBinding.adapterLayout.adapter = whatever There is also pop up menus and shit to have 2 icons display 2 menus on the action/support bar above
Check the viewmodel, and repo and its sources and look at testing
So this might not be the best app to do testing with because:
Most of the functionalities rely on a video being selected and on visual response to actions (e.g. slow motion or frame-by-frame)
Leave for another app or project for now, if anything instrumented testing when more wary and knowing
https://developer.android.com/studio/test