diff --git a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt index 86b326ee1..44054f192 100644 --- a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt @@ -1,7 +1,5 @@ package io.legado.app.ui.welcome -import android.animation.Animator -import android.animation.ValueAnimator import android.content.Intent import android.os.Bundle import io.legado.app.R @@ -16,34 +14,19 @@ import org.jetbrains.anko.startActivity open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { override fun onActivityCreated(savedInstanceState: Bundle?) { - iv_bg.setColorFilter(accentColor) + iv_book.setColorFilter(accentColor) // 避免从桌面启动程序后,会重新实例化入口类的activity if (intent.flags and Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT != 0) { finish() return } - val welAnimator = ValueAnimator.ofFloat(1f, 0f).setDuration(800) - welAnimator.startDelay = 100 - welAnimator.addUpdateListener { animation -> - val alpha = animation.animatedValue as Float - iv_bg.alpha = alpha - } - welAnimator.addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(animation: Animator) { - startActivity() - if (getPrefBoolean(getString(R.string.pk_default_read))) { - startActivity() - } - finish() + root_view.postDelayed({ + startActivity() + if (getPrefBoolean(getString(R.string.pk_default_read))) { + startActivity() } - - override fun onAnimationEnd(animation: Animator) = Unit - - override fun onAnimationCancel(animation: Animator) = Unit - - override fun onAnimationRepeat(animation: Animator) = Unit - }) - welAnimator.start() + finish() + }, 200) } } diff --git a/app/src/main/res/layout/activity_welcome.xml b/app/src/main/res/layout/activity_welcome.xml index e8e320279..6013c90b1 100644 --- a/app/src/main/res/layout/activity_welcome.xml +++ b/app/src/main/res/layout/activity_welcome.xml @@ -1,15 +1,71 @@ - + android:layout_height="match_parent" + android:gravity="center_horizontal"> - + + + + + + + android:contentDescription="@string/welcome" + app:layout_constraintBottom_toTopOf="@+id/tv_gzh" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" /> + + - \ No newline at end of file + \ No newline at end of file