Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser White
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Browser White
Commits
f58bb0b0
Commit
f58bb0b0
authored
Aug 28, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
eed0620b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
3 deletions
+53
-3
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-0
Splash2Activity.kt
...m/base/browserwhite/ui/activity/splash/Splash2Activity.kt
+49
-3
activity_splash_2.xml
app/src/main/res/layout/activity_splash_2.xml
+2
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
f58bb0b0
...
...
@@ -15,6 +15,8 @@
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_DATA_SYNC"
/>
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<uses-permission
android:name=
"com.android.launcher.permission.INSTALL_SHORTCUT"
/>
<queries>
<intent>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/base/browserwhite/ui/activity/splash/Splash2Activity.kt
View file @
f58bb0b0
...
...
@@ -2,13 +2,20 @@ package com.base.browserwhite.ui.activity.splash
import
CloseNotificationReceiver
import
android.Manifest
import
android.R.attr.duration
import
android.animation.Animator
import
android.animation.ObjectAnimator
import
android.animation.PropertyValuesHolder
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.graphics.Color
import
android.os.Build
import
android.os.Handler
import
android.util.Log
import
android.view.KeyEvent
import
android.view.animation.LinearInterpolator
import
androidx.activity.result.contract.ActivityResultContracts
import
androidx.lifecycle.lifecycleScope
import
com.base.browserwhite.R
import
com.base.browserwhite.ads.AdmobMaxHelper
import
com.base.browserwhite.bean.ConstObject.ifAgreePrivacy
...
...
@@ -19,6 +26,10 @@ import com.base.browserwhite.help.WeatherUtils
import
com.base.browserwhite.service.StayNotificationService.Companion.startStayNotification
import
com.base.browserwhite.ui.activity.BaseActivity
import
com.base.browserwhite.utils.BarUtils
import
com.base.browserwhite.utils.LogEx
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
@SuppressLint
(
"CustomSplashScreen"
)
class
Splash2Activity
:
BaseActivity
<
ActivitySplash2Binding
>(),
...
...
@@ -66,7 +77,8 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
PrivacyManager
(
binding
,
this
,
this
)
}
Thread
{
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
if
(!
WeatherUtils
.
hasWeatherDataToday
())
{
WeatherUtils
.
requestWeatherData
()
...
...
@@ -75,7 +87,11 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
val
weatherCityBean
=
WeatherUtils
.
getWeatherEntity
()
val
weather
=
weatherCityBean
?.
list
?.
random
()
if
(
weather
!=
null
)
{
binding
.
root
.
post
{
launch
(
Dispatchers
.
Main
)
{
LogEx
.
logDebug
(
TAG
,
"weather 开始 ${weather.fxDate}"
)
binding
.
tvDate
.
text
=
weather
.
fxDate
binding
.
tvTemperature
.
text
=
weather
.
tempMin
+
"℃"
+
" / "
+
weather
.
tempMax
+
"℃"
...
...
@@ -89,12 +105,42 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
else
->
R
.
mipmap
.
x_qing
}
binding
.
ivWeather
.
setImageResource
(
icon
)
val
alphaHolder
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
// 创建ObjectAnimator对象,设置动画持续时间和插值器
val
animator
:
ObjectAnimator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
binding
.
llWeather
,
alphaHolder
)
animator
.
setDuration
(
duration
.
toLong
())
animator
.
interpolator
=
LinearInterpolator
()
animator
.
addListener
(
object
:
Animator
.
AnimatorListener
{
override
fun
onAnimationStart
(
animation
:
Animator
)
{
LogEx
.
logDebug
(
TAG
,
"onAnimationStart"
)
}
override
fun
onAnimationEnd
(
animation
:
Animator
)
{
}
override
fun
onAnimationCancel
(
animation
:
Animator
)
{
}
override
fun
onAnimationRepeat
(
animation
:
Animator
)
{
}
})
// 开始动画
animator
.
start
()
}
}
}.
start
()
}
private
fun
closeNotification
()
{
...
...
@@ -111,7 +157,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
AdmobMaxHelper
.
preloadAd
(
this
)
mTaskManager
?.
startProgress
()
loadAd
()
//
loadAd()
}
...
...
app/src/main/res/layout/activity_splash_2.xml
View file @
f58bb0b0
...
...
@@ -10,6 +10,8 @@
<LinearLayout
android:visibility=
"invisible"
android:id=
"@+id/ll_weather"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment