File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/src/main/java/tech/httptoolkit/android Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import androidx.appcompat.app.AppCompatActivity
7
7
import androidx.core.widget.doAfterTextChanged
8
8
import kotlinx.android.synthetic.main.ports_list.*
9
9
import kotlinx.coroutines.*
10
+ import java.util.*
10
11
11
12
val DEFAULT_PORTS = setOf (
12
13
80 , // HTTP
@@ -22,13 +23,14 @@ const val SELECTED_PORTS_EXTRA = "tech.httptoolkit.android.SELECTED_PORTS_EXTRA"
22
23
23
24
class PortListActivity : AppCompatActivity (), CoroutineScope by MainScope() {
24
25
25
- private lateinit var ports: MutableSet <Int >
26
+ private lateinit var ports: TreeSet <Int > // TreeSet = Mutable + Sorted
26
27
27
28
override fun onCreate (savedInstanceState : Bundle ? ) {
28
29
super .onCreate(savedInstanceState)
29
30
setContentView(R .layout.ports_list)
30
31
31
- ports = intent.getIntArrayExtra(SELECTED_PORTS_EXTRA )!! .toMutableSet()
32
+ ports = intent.getIntArrayExtra(SELECTED_PORTS_EXTRA )!!
33
+ .toCollection(TreeSet ())
32
34
33
35
ports_list_recyclerView.adapter =
34
36
PortListAdapter (
You can’t perform that action at this time.
0 commit comments