Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
467cee2b
Commit
467cee2b
authored
Jan 23, 2025
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【调整】调整天气显示逻辑。
parent
13ab945d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+2
-0
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+22
-1
fragment_home_3.xml
app/src/main/res/layout/fragment_home_3.xml
+1
-0
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
467cee2b
...
...
@@ -15,6 +15,7 @@ import com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BlackUtils
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.InstallHelps
import
com.base.filerecoveryrecyclebin.help.WeatherUtils
import
com.base.filerecoveryrecyclebin.service.StayJobService.Companion.startJob
import
com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
...
...
@@ -81,6 +82,7 @@ class MyApplication : BaseApplication() {
initLifeListener
()
schedulePeriodicWork
(
this
)
startJob
()
WeatherUtils
.
requestWeatherData
()
}
if
(
ifAgreePrivacy
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
467cee2b
...
...
@@ -15,6 +15,7 @@ import android.view.View
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.lifecycleScope
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.activity.MainActivity
import
com.base.filerecoveryrecyclebin.activity.SettingActivity
import
com.base.filerecoveryrecyclebin.activity.XzLoadingActivity
...
...
@@ -40,6 +41,7 @@ import com.base.filerecoveryrecyclebin.view.WeatherInterface
import
kotlinx.coroutines.flow.collectLatest
import
kotlinx.coroutines.launch
import
java.io.File
import
kotlin.random.Random
class
HomeFragment
:
BaseFragment
<
FragmentHome3Binding
>()
{
private
val
TAG
=
"HomeFragment"
...
...
@@ -54,7 +56,26 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
binding
.
tvTitle
.
text
=
"Dumpster"
val
bean
=
WeatherUtils
.
getWeatherEntity
()
?.
list
?.
get
(
0
)
bean
?.
let
{
binding
.
tvWendu
.
text
=
(
it
.
tempMax
.
toInt
()
+
it
.
tempMin
.
toInt
()
/
2
).
toString
()
var
value
=
22
val
min
=
bean
.
tempMin
.
toInt
()
val
max
=
bean
.
tempMax
.
toInt
()
if
(
min
==
max
)
{
value
=
max
}
if
(
min
<
max
)
{
value
=
Random
.
nextInt
(
min
,
max
)
}
val
icon
=
when
(
WeatherUtils
.
getWeatherType
(
bean
.
iconDay
.
toInt
()))
{
"Sunny day"
->
R
.
mipmap
.
x_qing
"Cloudy day"
->
R
.
mipmap
.
x_yin
"Rainy day"
->
R
.
mipmap
.
x_dayu
"Snowy day"
->
R
.
mipmap
.
x_xiaxue
"Greasy day"
->
R
.
mipmap
.
x_wumaishachengbao
"Unknown"
->
R
.
mipmap
.
x_qing
else
->
R
.
mipmap
.
x_qing
}
binding
.
tvWendu
.
text
=
value
.
toString
()
binding
.
ivWeather
.
setImageResource
(
icon
)
}
binding
.
lottie
.
repeatCount
=
ValueAnimator
.
INFINITE
...
...
app/src/main/res/layout/fragment_home_3.xml
View file @
467cee2b
...
...
@@ -45,6 +45,7 @@
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_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