Skip to content

Commit

Permalink
TECH: try to fix tests on Api33
Browse files Browse the repository at this point in the history
  • Loading branch information
Areyana committed Jul 25, 2023
1 parent f56329c commit 08e9475
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import com.kaspersky.kaspresso.kautomatorsample.databinding.ActivityFlakyBinding

class FlakyActivity : AppCompatActivity() {

companion object {
private const val FIRST_DELAY = 2_000L
private const val SECOND_DELAY = 15_000L
}

private lateinit var binding: ActivityFlakyBinding

override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -26,16 +21,20 @@ class FlakyActivity : AppCompatActivity() {

override fun onResume() {
super.onResume()
startAsync(FIRST_DELAY, SECOND_DELAY)
startAsync(FIRST_DELAY)
}

@Suppress("SameParameterValue")
private fun startAsync(firstDelayMs: Long, secondDelayMs: Long) {
private fun startAsync(firstDelayMs: Long) {
Handler(mainLooper).apply {
postDelayed(
{ binding.flakyButton1.text = getString(R.string.menu_item_2) },
firstDelayMs
)
}
}

companion object {
private const val FIRST_DELAY = 3_500L
}
}

0 comments on commit 08e9475

Please sign in to comment.