Commit 213cb577 authored by wanglei's avatar wanglei

...

parent cbb5acdd
......@@ -5,6 +5,7 @@ import android.graphics.Typeface
import android.os.Build
import androidx.activity.OnBackPressedCallback
import androidx.annotation.RequiresApi
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.viewpager2.adapter.FragmentStateAdapter
......@@ -44,6 +45,7 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
EventUtils.event("page_home")
if (!hasNotifications()) {
NotifyTips(this) {}.show()
......
package com.test.easy.easycleanerjunk.activity.scanjunk
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.view.View
import android.widget.Toast
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.test.easy.easycleanerjunk.databinding.ActivityLayoutScanJunkBinding
import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.BarUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
/**
* 清理动画页面
......@@ -18,6 +27,9 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
}
override fun initView() {
// BarUtils.setStatusBarLightMode(this, true)
// BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
}
override fun initListener() {
......@@ -36,7 +48,7 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
override fun onResume() {
super.onResume()
if (isPause) {
binding.idJunkScan.resumeAnimation()
binding.lottie.resumeAnimation()
}
isPause = false
}
......@@ -46,7 +58,7 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
animator1?.cancel()
animator2?.cancel()
animator3?.cancel()
binding.idJunkScan.cancelAnimation()
binding.lottie.cancelAnimation()
}
override fun onPause() {
......@@ -55,7 +67,7 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
animator1?.pause()
animator2?.pause()
animator3?.pause()
binding.idJunkScan.pauseAnimation()
binding.lottie.pauseAnimation()
}
var isplay = 0
......@@ -70,17 +82,25 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
}
}
@SuppressLint("SetTextI18n")
private fun playLottie() {
binding.idJunkScan.imageAssetsFolder = "easy_junk_scan/images/"
binding.idJunkScan.setAnimation("easy_junk_scan/data.json")
binding.idJunkScan.playAnimation()
binding.root.postDelayed({
AdmobUtils.showInterstitialAd(this) {
startActivity(Intent(this, CleanJunkActivity::class.java))
binding.lottie.imageAssetsFolder = "easy_junk_scan/images/"
binding.lottie.setAnimation("easy_junk_scan/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch(Dispatchers.Main) {
delay(5000)
binding.lottie.visibility = View.GONE
binding.ivWancheng.visibility = View.VISIBLE
binding.tv.text = "Completed!"
delay(1000)
AdmobUtils.showInterstitialAd(this@ScanJunkActivity) {
startActivity(Intent(this@ScanJunkActivity, CleanJunkActivity::class.java))
finish()
}
}
}, 5000)
}
private var animator1: ValueAnimator? = null
......
......@@ -3,22 +3,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
<FrameLayout
android:id="@+id/id_top_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/id_tv_title_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:gravity="center"
android:text="Clean Junk"
android:textColor="#333333"
......@@ -26,35 +25,49 @@
android:textStyle="bold"
tools:ignore="HardcodedText" />
</RelativeLayout>
</FrameLayout>
<com.test.easy.easycleanerjunk.view.XmlLottieAnimationView
android:id="@+id/id_junk_scan"
<FrameLayout
android:layout_width="300dp"
android:layout_height="300dp"
android:adjustViewBounds="true"
app:layout_constraintBottom_toTopOf="@id/tv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
app:layout_constraintVertical_bias="0.65">
<com.test.easy.easycleanerjunk.view.XmlLottieAnimationView
android:id="@+id/lottie"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
<ImageView
android:id="@+id/iv_wancheng"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:importantForAccessibility="no"
android:src="@mipmap/wancheng_blue"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="295dp"
android:layout_marginBottom="275dp"
android:text="Wait a moment..."
android:textColor="#333333"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment