Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed night mode from splash screen #220

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}