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
77import androidx.core.widget.doAfterTextChanged
88import kotlinx.android.synthetic.main.ports_list.*
99import kotlinx.coroutines.*
10+ import java.util.*
1011
1112val DEFAULT_PORTS = setOf (
1213 80 , // HTTP
@@ -22,13 +23,14 @@ const val SELECTED_PORTS_EXTRA = "tech.httptoolkit.android.SELECTED_PORTS_EXTRA"
2223
2324class PortListActivity : AppCompatActivity (), CoroutineScope by MainScope() {
2425
25- private lateinit var ports: MutableSet <Int >
26+ private lateinit var ports: TreeSet <Int > // TreeSet = Mutable + Sorted
2627
2728 override fun onCreate (savedInstanceState : Bundle ? ) {
2829 super .onCreate(savedInstanceState)
2930 setContentView(R .layout.ports_list)
3031
31- ports = intent.getIntArrayExtra(SELECTED_PORTS_EXTRA )!! .toMutableSet()
32+ ports = intent.getIntArrayExtra(SELECTED_PORTS_EXTRA )!!
33+ .toCollection(TreeSet ())
3234
3335 ports_list_recyclerView.adapter =
3436 PortListAdapter (
You can’t perform that action at this time.
0 commit comments