SelectDeviceFragment

class SelectDeviceFragment : RotationFragment

RotationFragment to connect to a matching server (= pc/laptop)

Constructors

SelectDeviceFragment
Link copied to clipboard
fun SelectDeviceFragment()

Functions

clearGarbage
Link copied to clipboard
open override fun clearGarbage()

Set all listeners, ViewModels and shared references to null.

initServerList
Link copied to clipboard
private fun initServerList()

Registers an observer for ServerConnectionViewModel.getServerUrlListLiveData, which updates mServerList and refreshes adapter on data change.

initViews
Link copied to clipboard
private fun initViews()

Initiates all views and sets their listeners.

onViewCreated
Link copied to clipboard
open override fun onViewCreated(view: View, savedInstanceState: Bundle?)

Called when the fragment is created, calls initServerList and initViews.

removeThisFragment
Link copied to clipboard
open override fun removeThisFragment(removeBackground: Boolean)

Removes this fragment.

Properties

adapter
Link copied to clipboard
private lateinit var adapter: ArrayAdapter<String>

The adapter to fill up mListView

lastSelectedItem
Link copied to clipboard
private lateinit var lastSelectedItem: TextView

The last selected item in mListView, green highlight

mListView
Link copied to clipboard
private lateinit var mListView: ListView

The list view containing all available servers

mSelectDeviceButton
Link copied to clipboard
private lateinit var mSelectDeviceButton: ImageButton

The select device button of com/pda/screenshotmatcher2/views/activities/CameraActivity.kt, opens/closes this fragment

mServerList
Link copied to clipboard
private var mServerList: ArrayList<String>

The list of all available servers, updated by ServerConnectionViewModel

serverConnectionViewModel
Link copied to clipboard
private var serverConnectionViewModel: ServerConnectionViewModel? = null