From 67904102b1a82ca1bfeee51ac1537f44535a59b8 Mon Sep 17 00:00:00 2001 From: Jonathan Trowbridge Date: Tue, 31 Jul 2018 20:48:33 -0400 Subject: [PATCH] master - documentation. --- .../activities/MainActivity.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/masterwok/demosimpletorrentandroid/activities/MainActivity.kt b/app/src/main/java/com/masterwok/demosimpletorrentandroid/activities/MainActivity.kt index 3fd4b2b..f6159e5 100644 --- a/app/src/main/java/com/masterwok/demosimpletorrentandroid/activities/MainActivity.kt +++ b/app/src/main/java/com/masterwok/demosimpletorrentandroid/activities/MainActivity.kt @@ -21,6 +21,13 @@ import com.masterwok.simpletorrentandroid.models.TorrentSessionStatus import com.nononsenseapps.filepicker.FilePickerActivity +/** + * This activity is responsible for creating and presenting multiple torrent fragments. + * The [@see TorrentSession] and its associated [@see TorrentSessionListener] exist within + * [@see TorrentFragment]. In the real world, you would want to have the + * [@see TorrentSession] live in a foreground service so its not interrupted when the device + * goes to sleep. + */ class MainActivity : AppCompatActivity() { private lateinit var tabLayout: TabLayout @@ -72,7 +79,7 @@ class MainActivity : AppCompatActivity() { private fun subscribeToViewComponents() { buttonAddTorrent.setOnClickListener { - // startFilePickerActivity() + // startFilePickerActivity() // Be sure to comment the two lines below if you uncomment this. val tabFragment = createTabWithUri(Uri.parse(torrentUrls[torrentSessionPagerAdapter.count])) torrentSessionPagerAdapter.addTab(tabFragment) @@ -99,6 +106,10 @@ class MainActivity : AppCompatActivity() { buttonAddTorrent = findViewById(R.id.button_add_torrent) } + /** + * This method can be invoked in the buttonAddTorrent click listener to select + * a torrent file. + */ @Suppress("unused") private fun startFilePickerActivity() { val intent: Intent