Commit a7501d9b authored by wanglei's avatar wanglei

...

parent 2e4405e8
......@@ -162,4 +162,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
}
}
\ No newline at end of file
......@@ -86,7 +86,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
fun startPbAnimation(callback: () -> Unit) {
AnimationUtils.startAlphaAnimation(binding.pb, 800, null) {
AnimationUtils.startAlphaAnimation(binding.pb, 400, null) {
callback.invoke()
}
}
......@@ -120,23 +120,23 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
else -> R.mipmap.d_qing
}
binding.ivWeather.setImageResource(icon)
AnimationUtils.startAlphaAnimation(binding.ivWeather, 800, null) {
AnimationUtils.startAlphaAnimation(binding.tvDate, 800, null) {
AnimationUtils.startAlphaAnimation(binding.tvTemperature, 800, null) {
AnimationUtils.startAlphaAnimation(binding.ivWeather, 400, null) {
AnimationUtils.startAlphaAnimation(binding.tvDate, 400, null) {
AnimationUtils.startAlphaAnimation(binding.tvTemperature, 400, null) {
if (isAgree) {
AnimationUtils.startAlphaAnimation(binding.pb, 800, null) {
AnimationUtils.startAlphaAnimation(binding.pb, 400, null) {
callback.invoke()
}
} else {
AnimationUtils.startAlphaAnimation(binding.idTvStart, 1200, {
AnimationUtils.startAlphaAnimation(binding.idTvStart, 400, {
val set1 = AnimatorSet()
// 创建缩放动画的ObjectAnimator
val scaleUpAnimator1 = ObjectAnimator.ofFloat(binding.idTvStart, "scaleX", 1f, 0.95f, 1.05f)
val scaleUpAnimator2 = ObjectAnimator.ofFloat(binding.idTvStart, "scaleY", 1f, 0.95f, 1.05f)
scaleUpAnimator1.duration = 1200 // 动画持续500毫秒
scaleUpAnimator1.duration = 400 // 动画持续500毫秒
scaleUpAnimator1.repeatCount = 1 // 重复次数
scaleUpAnimator1.repeatMode = ValueAnimator.REVERSE // 反向重复,实现缩小效果
scaleUpAnimator2.duration = 1200 // 动画持续500毫秒
scaleUpAnimator2.duration = 400 // 动画持续500毫秒
scaleUpAnimator2.repeatCount = 1 // 重复次数
set1.playTogether(scaleUpAnimator1, scaleUpAnimator2)
set1.start()
......@@ -159,10 +159,10 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
// 创建缩放动画的ObjectAnimator
val scaleUpAnimator1 = ObjectAnimator.ofFloat(binding.idTvStart, "scaleX", 1f, 0.95f, 1.05f)
val scaleUpAnimator2 = ObjectAnimator.ofFloat(binding.idTvStart, "scaleY", 1f, 0.95f, 1.05f)
scaleUpAnimator1.duration = 1200 // 动画持续500毫秒
scaleUpAnimator1.duration = 400 // 动画持续500毫秒
scaleUpAnimator1.repeatCount = 1 // 重复次数
scaleUpAnimator1.repeatMode = ValueAnimator.REVERSE // 反向重复,实现缩小效果
scaleUpAnimator2.duration = 1200 // 动画持续500毫秒
scaleUpAnimator2.duration = 400 // 动画持续500毫秒
scaleUpAnimator2.repeatCount = 1 // 重复次数
set1.playTogether(scaleUpAnimator1, scaleUpAnimator2)
set1.start()
......
......@@ -81,5 +81,8 @@ object PermissionDialog {
}
})
}
binding.tvLater.setOnClickListener {
dialog.dismiss()
}
}
}
\ No newline at end of file
package com.base.browserwhite.ui.widget
import android.app.PendingIntent
import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProvider
import android.content.Context
import android.content.Intent
import android.widget.RemoteViews
import com.base.browserwhite.R
import com.base.browserwhite.bean.ConstObject
import com.base.browserwhite.ui.activity.splash.Splash2Activity
import kotlin.random.Random
/**
* Implementation of App Widget functionality.
......@@ -31,7 +36,45 @@ internal fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManage
val views = RemoteViews(context.packageName, R.layout.browser_app_widget)
views.setTextViewText(R.id.tv_app_name, context.resources.getString(R.string.app_name))
views.setTextViewText(R.id.tv_percent, "80%")
views.setTextViewText(R.id.tv_percent, "88%...")
//清理
val requestCode1 = Random.nextInt(1800)
val intent1 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_JUNK_CLEANER)
}
val pendingIntent1 =
PendingIntent.getActivity(context, requestCode1, intent1, PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.tv_clean, pendingIntent1)
//进程
val requestCode2 = Random.nextInt(1800)
val intent2 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_APP_PROCESS)
}
val pendingIntent2 =
PendingIntent.getActivity(context, requestCode2, intent2, PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.ll_process, pendingIntent2)
//新闻
val requestCode3 = Random.nextInt(1800)
val intent3 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_NEWS)
}
val pendingIntent3 =
PendingIntent.getActivity(context, requestCode3, intent3, PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.ll_news, pendingIntent3)
//扫描
val requestCode4 = Random.nextInt(1800)
val intent4 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_SCAN_CODE)
}
val pendingIntent4 =
PendingIntent.getActivity(context, requestCode4, intent4, PendingIntent.FLAG_IMMUTABLE)
views.setOnClickPendingIntent(R.id.ll_scanqr, pendingIntent4)
// Instruct the widget manager to update the widget
......
......@@ -79,10 +79,11 @@
<LinearLayout
android:layout_width="180dp"
android:layout_height="match_parent"
android:orientation="horizontal">
android:orientation="horizontal"
tools:ignore="DisableBaselineAlignment">
<LinearLayout
android:id="@+id/ll_4"
android:id="@+id/ll_process"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......@@ -109,7 +110,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_2"
android:id="@+id/ll_news"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......@@ -135,7 +136,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_3"
android:id="@+id/ll_scanqr"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......
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