Skip to content

Commit

Permalink
refactor: 💡 [DSY-1423] fixing lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mlcsouza committed Sep 1, 2020
1 parent 857cb3e commit 060c999
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class SplashScreenFunctionalTestsTests {
class SplashScreenFunctionalTests {
@Before
fun setup() {
ActivityScenario.launch(SplashActivity::class.java)
Expand All @@ -29,5 +29,4 @@ class SplashScreenFunctionalTestsTests {
onView(withId(R.id.naturaCoLogo))
.check(matches(isDisplayed()))
}

}
}
18 changes: 7 additions & 11 deletions sample/src/main/java/com/natura/android/sample/SplashActivity.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package com.natura.android.sample

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.view.View
import android.view.animation.AccelerateInterpolator
import android.view.animation.AlphaAnimation
import android.view.animation.DecelerateInterpolator
import kotlinx.android.synthetic.main.activity_logo.*
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_splash.*

class SplashActivity : AppCompatActivity() {
lateinit var mDelayHandler: Handler

private val mRunnable: Runnable = Runnable {
private val mRunnable: Runnable = Runnable {
if (!isFinishing) {
val intent = Intent(applicationContext, BrandSelectorActivity::class.java)
startActivity(intent)
Expand All @@ -26,8 +24,8 @@ class SplashActivity : AppCompatActivity() {
setContentView(R.layout.activity_splash)

val fadeIn = AlphaAnimation(0f, 1f)
fadeIn.interpolator = DecelerateInterpolator()
fadeIn.duration = 1500
fadeIn.interpolator = AccelerateInterpolator()
fadeIn.duration = 2000

splashContainer.apply {
animation = fadeIn
Expand All @@ -36,7 +34,6 @@ class SplashActivity : AppCompatActivity() {
mDelayHandler = Handler()

mDelayHandler?.postDelayed(mRunnable, SPLASH_DELAY)

}

public override fun onDestroy() {
Expand All @@ -45,7 +42,6 @@ class SplashActivity : AppCompatActivity() {
}

companion object {
private const val SPLASH_DELAY: Long = 2000
private const val SPLASH_DELAY: Long = 3000
}

}
}

0 comments on commit 060c999

Please sign in to comment.