Skip to content

Commit

Permalink
Merge pull request #220 from sora-xor/fix/removal-of-splash-screen-ni…
Browse files Browse the repository at this point in the history
…ght-mode

Removed night mode from splash screen
  • Loading branch information
arvifox authored Oct 9, 2023
2 parents 8197769 + bcfc6ad commit da4a3ee
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package jp.co.soramitsu.sora.splash.presentation

import android.animation.ValueAnimator
import android.graphics.PorterDuff
import android.graphics.PorterDuffColorFilter
import android.os.Bundle
import android.view.View
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import com.airbnb.lottie.LottieProperty
import com.airbnb.lottie.model.KeyPath
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.getColorFromAttrs
import jp.co.soramitsu.feature_main_api.launcher.MainStarter
import jp.co.soramitsu.feature_multiaccount_api.MultiaccountStarter
import jp.co.soramitsu.sora.databinding.ActivitySplashBinding
Expand Down Expand Up @@ -84,27 +78,7 @@ class SplashActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(ActivitySplashBinding.inflate(layoutInflater).also { viewBinding = it }.root)

val currentPageColorTypedValue = getColorFromAttrs(R.attr.baseBackground)

viewBinding.animationView.apply {
addValueCallback(
KeyPath(
LOTTIE_WILDCARD_GLOBSTAR,
WAVE_ANIMATION_RINGS_PATH,
LOTTIE_WILDCARD_GLOBSTAR,
),
LottieProperty.COLOR_FILTER
) {
PorterDuffColorFilter(
currentPageColorTypedValue.data,
PorterDuff.Mode.MULTIPLY
)
}

addAnimatorUpdateListener(
animatorUpdateListener
)
}
viewBinding.animationView.addAnimatorUpdateListener(animatorUpdateListener)

splashViewModel.runtimeInitiated.observe(
this
Expand Down Expand Up @@ -142,9 +116,4 @@ class SplashActivity : AppCompatActivity() {
viewBinding.animationView.removeUpdateListener(animatorUpdateListener)
splashViewModel.nextScreen()
}

private companion object {
const val LOTTIE_WILDCARD_GLOBSTAR = "*"
const val WAVE_ANIMATION_RINGS_PATH = "Ellipse 1"
}
}

0 comments on commit da4a3ee

Please sign in to comment.