Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
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
swiftcleanerphonehelper
Commits
1f6a927d
Commit
1f6a927d
authored
Feb 10, 2025
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
迭代
parent
835e717e
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
132 additions
and
284 deletions
+132
-284
CleanApplication.kt
...src/main/java/com/swiftcleaner/chovey/CleanApplication.kt
+2
-0
NotificationUtils.kt
...om/swiftcleaner/chovey/business/push/NotificationUtils.kt
+69
-47
MainActivity.java
.../main/java/com/swiftcleaner/chovey/view/MainActivity.java
+28
-16
FullscreenDialog.java
...com/swiftcleaner/chovey/view/dialog/FullscreenDialog.java
+6
-0
notification_weather_big.xml
app/src/main/res/layout/notification_weather_big.xml
+7
-202
notification_weather_small.xml
app/src/main/res/layout/notification_weather_small.xml
+20
-19
xiaoqing1.png
app/src/main/res/mipmap-xxhdpi/xiaoqing1.png
+0
-0
xiaoshachenbao1.png
app/src/main/res/mipmap-xxhdpi/xiaoshachenbao1.png
+0
-0
xiaoxuetian1.png
app/src/main/res/mipmap-xxhdpi/xiaoxuetian1.png
+0
-0
xiaoyinyu1.png
app/src/main/res/mipmap-xxhdpi/xiaoyinyu1.png
+0
-0
xiaoyutian_bg1.png
app/src/main/res/mipmap-xxhdpi/xiaoyutian_bg1.png
+0
-0
No files found.
app/src/main/java/com/swiftcleaner/chovey/CleanApplication.kt
View file @
1f6a927d
...
@@ -39,6 +39,7 @@ import com.swiftcleaner.chovey.util.SPUtils
...
@@ -39,6 +39,7 @@ import com.swiftcleaner.chovey.util.SPUtils
import
com.swiftcleaner.chovey.view.activity.StartActivity
import
com.swiftcleaner.chovey.view.activity.StartActivity
import
com.tool.elite.battery.business.push.BadgeUtils
import
com.tool.elite.battery.business.push.BadgeUtils
import
com.swiftcleaner.chovey.view.function.constellation.ActivityManagerUtils
import
com.swiftcleaner.chovey.view.function.constellation.ActivityManagerUtils
import
com.swiftcleaner.chovey.view.function.weather.WeatherUtils
import
org.json.JSONObject
import
org.json.JSONObject
import
java.util.Calendar
import
java.util.Calendar
import
java.util.UUID
import
java.util.UUID
...
@@ -64,6 +65,7 @@ class CleanApplication : Application() {
...
@@ -64,6 +65,7 @@ class CleanApplication : Application() {
override
fun
onCreate
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
super
.
onCreate
()
context
=
this
context
=
this
WeatherUtils
.
requestWeatherData
()
DeviceUtils
.
init
()
DeviceUtils
.
init
()
registerActivityLifecycle
()
registerActivityLifecycle
()
...
...
app/src/main/java/com/swiftcleaner/chovey/business/push/NotificationUtils.kt
View file @
1f6a927d
...
@@ -73,10 +73,6 @@ object NotificationUtils {
...
@@ -73,10 +73,6 @@ object NotificationUtils {
@SuppressLint
(
"RemoteViewLayout"
)
@SuppressLint
(
"RemoteViewLayout"
)
fun
sendNotification
(
context
:
Context
,
id
:
Int
,
type
:
String
)
{
fun
sendNotification
(
context
:
Context
,
id
:
Int
,
type
:
String
)
{
val
(
iconRes
,
contentRes
)
=
getNotificationDetails
(
id
)
if
(
iconRes
==
0
||
contentRes
==
0
)
return
if
(
id
==
ID_XINGZUO
)
{
if
(
id
==
ID_XINGZUO
)
{
//val icon = R.mipmap.xingzuoicon
//val icon = R.mipmap.xingzuoicon
...
@@ -91,13 +87,18 @@ object NotificationUtils {
...
@@ -91,13 +87,18 @@ object NotificationUtils {
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
id_title
,
btn
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
id_title
,
btn
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
// sendCustomNotification(context, actionId, intent, bigRemoteViewsVar, smallRemoteViewsVar)
// sendCustomNotification(context, actionId, intent, bigRemoteViewsVar, smallRemoteViewsVar)
sendNotification
(
val
content
=
context
.
getString
(
contentRes
)
context
,
sendNotification
(
context
,
content
,
getLaunchIntent
(
context
,
id
),
smallRemoteViewsVar
,
bigRemoteViewsVar
,
id
,
type
)
btn
,
getLaunchIntent
(
context
,
id
),
smallRemoteViewsVar
,
bigRemoteViewsVar
,
id
,
type
)
return
return
}
}
if
(
id
==
ID_WHEATHER
)
{
if
(
id
==
ID_WHEATHER
)
{
val
weatherBean
:
WeatherBean
=
WeatherUtils
.
getWeatherEntity
()
?:
return
val
weatherBean
:
WeatherBean
=
WeatherUtils
.
getWeatherEntity
()
?:
return
if
(
weatherBean
.
list
.
isEmpty
())
return
if
(
weatherBean
.
list
.
isEmpty
())
return
val
subBean
=
weatherBean
.
list
[
0
]
val
subBean
=
weatherBean
.
list
[
0
]
...
@@ -120,48 +121,51 @@ object NotificationUtils {
...
@@ -120,48 +121,51 @@ object NotificationUtils {
else
->
R
.
mipmap
.
d_qing
else
->
R
.
mipmap
.
d_qing
}
}
val
icon1
=
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
var
xiaoIcon
=
0
"Sunny day"
->
R
.
mipmap
.
d_qing
var
imageBg
=
0
"Cloudy day"
->
R
.
mipmap
.
d_yin
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
"Rainy day"
->
R
.
mipmap
.
d_dayu
"Sunny day"
->
{
"Snowy day"
->
R
.
mipmap
.
d_xiaxue
xiaoIcon
=
R
.
mipmap
.
xiaoqing1
"Greasy day"
->
R
.
mipmap
.
d_wumaishachengbao
imageBg
=
R
.
mipmap
.
qingtian_bg
"Unknown"
->
R
.
mipmap
.
d_qing
}
else
->
R
.
mipmap
.
d_qing
"Cloudy day"
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoyinyu1
imageBg
=
R
.
mipmap
.
yintian_bg
}
"Rainy day"
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoyinyu1
imageBg
=
R
.
mipmap
.
yutian_bg
}
}
"Snowy day"
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoxuetian1
imageBg
=
R
.
mipmap
.
xuetian
}
"Greasy day"
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoshachenbao1
imageBg
=
R
.
mipmap
.
shachenbao
}
"Unknown"
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoyinyu1
imageBg
=
R
.
mipmap
.
yintian_bg
}
else
->
{
xiaoIcon
=
R
.
mipmap
.
xiaoyinyu1
imageBg
=
R
.
mipmap
.
yintian_bg
}
}
smallRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
weather_bg
,
xiaoIcon
)
smallRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
smallRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
smallRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_range
,
"$min℃/$max℃"
)
smallRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_range
,
"$min℃/$max℃"
)
val
bigRemoteViewsVar
=
val
bigRemoteViewsVar
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_weather_big
)
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_weather_big
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather_11h
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather_14h
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather_17h
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather_20h
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather_23h
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
iv_weather
,
icon
)
bigRemoteViewsVar
.
setImageViewResource
(
R
.
id
.
big_bg
,
imageBg
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_11h
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_14h
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_17h
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_20h
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_23h
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
)
bigRemoteViewsVar
.
setTextViewText
(
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
R
.
id
.
tv_wendu_now
,
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
kotlin
.
random
.
Random
.
nextInt
(
min
,
max
).
toString
()
...
@@ -175,15 +179,33 @@ object NotificationUtils {
...
@@ -175,15 +179,33 @@ object NotificationUtils {
"$min℃/$max℃ ${formatATime()}"
"$min℃/$max℃ ${formatATime()}"
)
)
val
content
=
context
.
getString
(
contentRes
)
sendNotification
(
sendNotification
(
context
,
content
,
getLaunchIntent
(
context
,
id
),
smallRemoteViewsVar
,
bigRemoteViewsVar
,
id
,
type
)
context
,
"Weather"
,
getLaunchIntent
(
context
,
id
),
smallRemoteViewsVar
,
bigRemoteViewsVar
,
id
,
type
)
return
return
}
}
val
(
iconRes
,
contentRes
)
=
getNotificationDetails
(
id
)
if
(
iconRes
==
0
||
contentRes
==
0
)
return
val
notificationLayout
=
getNotificationLayout
(
context
,
iconRes
,
contentRes
)
val
notificationLayout
=
getNotificationLayout
(
context
,
iconRes
,
contentRes
)
val
notificationLayoutExpanded
=
getExpandedNotificationLayout
(
context
,
iconRes
,
contentRes
)
val
notificationLayoutExpanded
=
getExpandedNotificationLayout
(
context
,
iconRes
,
contentRes
)
val
content
=
context
.
getString
(
contentRes
)
val
content
=
context
.
getString
(
contentRes
)
sendNotification
(
context
,
content
,
getLaunchIntent
(
context
,
id
),
notificationLayout
,
notificationLayoutExpanded
,
id
,
type
)
sendNotification
(
context
,
content
,
getLaunchIntent
(
context
,
id
),
notificationLayout
,
notificationLayoutExpanded
,
id
,
type
)
}
}
fun
sendBatteryNotification
(
context
:
Context
,
battery
:
Int
,
isCharging
:
Boolean
,
type
:
String
)
{
fun
sendBatteryNotification
(
context
:
Context
,
battery
:
Int
,
isCharging
:
Boolean
,
type
:
String
)
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/MainActivity.java
View file @
1f6a927d
...
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity {
private
ActivityResultLauncher
<
Intent
>
notificationSettingsLauncher
;
private
ActivityResultLauncher
<
Intent
>
notificationSettingsLauncher
;
private
static
final
String
PREFS_NAME
=
"AppPrefs"
;
private
static
final
String
PREFS_NAME
=
"AppPrefs"
;
private
static
final
String
KEY_CLEANED
=
"cleaned"
;
private
static
final
String
KEY_CLEANED
=
"cleaned"
;
private
FullscreenDialog
fullscreenDialog
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -61,27 +62,33 @@ public class MainActivity extends AppCompatActivity {
...
@@ -61,27 +62,33 @@ public class MainActivity extends AppCompatActivity {
initBar
();
initBar
();
if
(!
isCleaned
())
{
if
(!
isCleaned
())
{
FullscreenDialog
fullscreenDialog
=
new
FullscreenDialog
(
this
);
//
fullscreenDialog = new FullscreenDialog(this);
fullscreenDialog
.
setOnDialogDismissListener
(
new
FullscreenDialog
.
OnDialogDismissListener
()
{
//
fullscreenDialog.setOnDialogDismissListener(new FullscreenDialog.OnDialogDismissListener() {
@Override
//
@Override
public
void
onSuccButton
()
{
//
public void onSuccButton() {
startActivity
(
new
Intent
(
MainActivity
.
this
,
CleanJunkActivity
.
class
));
//
startActivity(new Intent(MainActivity.this,CleanJunkActivity.class));
}
//
}
});
//
});
fullscreenDialog
.
show
();
//
fullscreenDialog.show();
}
}
initPermission
();
initPermission
();
initShow
();
initShow
();
binding
.
jiantou
.
setOnClickListener
(
v
->{
// binding.jiantou.setOnClickListener(v->{
NotificationUtils
.
INSTANCE
.
sendNotification
(
// NotificationUtils.INSTANCE.sendNotification(
CleanApplication
.
context
,
// CleanApplication.context,
ID_WHEATHER
,
// ID_XINGZUO,
"timer_not_cleaned"
// "xingzuo"
);
// );
Log
.
d
(
"NotificationUtils"
,
"111"
);
// NotificationUtils.INSTANCE.sendNotification(
});
// CleanApplication.context,
// ID_WHEATHER,
// "wheather"
// );
// Log.d("NotificationUtils","111");
// });
}
}
private
boolean
isCleaned
()
{
private
boolean
isCleaned
()
{
SharedPreferences
prefs
=
getSharedPreferences
(
PREFS_NAME
,
MODE_PRIVATE
);
SharedPreferences
prefs
=
getSharedPreferences
(
PREFS_NAME
,
MODE_PRIVATE
);
return
prefs
.
getBoolean
(
KEY_CLEANED
,
false
);
return
prefs
.
getBoolean
(
KEY_CLEANED
,
false
);
...
@@ -241,6 +248,11 @@ public class MainActivity extends AppCompatActivity {
...
@@ -241,6 +248,11 @@ public class MainActivity extends AppCompatActivity {
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
Log
.
d
(
"isCleaned"
,
isCleaned
()
+
"111"
);
if
(
isCleaned
())
{
Log
.
d
(
"isCleaned"
,
isCleaned
()
+
"222"
);
fullscreenDialog
.
dismiss
();
}
if
(
bannerShowed
.
get
())
return
;
if
(
bannerShowed
.
get
())
return
;
bannerShowed
.
set
(
true
);
bannerShowed
.
set
(
true
);
...
...
app/src/main/java/com/swiftcleaner/chovey/view/dialog/FullscreenDialog.java
View file @
1f6a927d
...
@@ -92,6 +92,12 @@ public class FullscreenDialog {
...
@@ -92,6 +92,12 @@ public class FullscreenDialog {
dialog
.
show
();
dialog
.
show
();
}
}
public
void
dismiss
()
{
if
(
dialog
!=
null
&&
dialog
.
isShowing
()
){
dialog
.
dismiss
();
}
}
private
void
handleButtonClick
()
{
private
void
handleButtonClick
()
{
if
(
dismissListener
!=
null
)
{
if
(
dismissListener
!=
null
)
{
dismissListener
.
onSuccButton
();
dismissListener
.
onSuccButton
();
...
...
app/src/main/res/layout/notification_weather_big.xml
View file @
1f6a927d
...
@@ -9,8 +9,13 @@
...
@@ -9,8 +9,13 @@
android:id=
"@+id/weather_bg"
android:id=
"@+id/weather_bg"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"8dp"
android:layout_margin=
"8dp"
>
android:background=
"@mipmap/yintian_bg"
>
<ImageView
android:id=
"@+id/big_bg"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
android:src=
"@mipmap/yintian_bg"
/>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/ll"
android:id=
"@+id/ll"
...
@@ -102,206 +107,6 @@
...
@@ -102,206 +107,6 @@
android:textColor=
"#4990FA"
android:textColor=
"#4990FA"
android:textSize=
"17sp"
android:textSize=
"17sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@id/ll"
android:visibility=
"gone"
android:orientation=
"horizontal"
>
<!--11h -->
<LinearLayout
android:id=
"@+id/ll_11h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginHorizontal=
"15dp"
android:layout_toStartOf=
"@id/ll_14h"
android:orientation=
"vertical"
tools:ignore=
"RelativeOverlap"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"11H"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather_11h"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/x_qing"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_wendu_11h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"13sp"
android:textColor=
"@color/white"
android:textSize=
"17sp"
tools:text=
"29°"
/>
</LinearLayout>
<!--14h -->
<LinearLayout
android:id=
"@+id/ll_14h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginHorizontal=
"15dp"
android:layout_toStartOf=
"@id/ll_17h"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"14H"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather_14h"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/x_qing"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_wendu_14h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"13sp"
android:textColor=
"@color/white"
android:textSize=
"17sp"
tools:text=
"29°"
/>
</LinearLayout>
<!--17h -->
<LinearLayout
android:id=
"@+id/ll_17h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_marginHorizontal=
"15dp"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"17H"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather_17h"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/x_qing"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_wendu_17h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"13sp"
android:textColor=
"@color/white"
android:textSize=
"17sp"
tools:text=
"29°"
/>
</LinearLayout>
<!--20h -->
<LinearLayout
android:id=
"@+id/ll_20h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginHorizontal=
"15dp"
android:layout_toEndOf=
"@id/ll_17h"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"20H"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather_20h"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/x_qing"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_wendu_20h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"13sp"
android:textColor=
"@color/white"
android:textSize=
"17sp"
tools:text=
"29°"
/>
</LinearLayout>
<!--23h -->
<LinearLayout
android:id=
"@+id/ll_23h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginHorizontal=
"15dp"
android:layout_toEndOf=
"@id/ll_20h"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"23H"
android:textColor=
"@color/white"
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_weather_23h"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:src=
"@mipmap/x_qing"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_wendu_23h"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"13sp"
android:textColor=
"@color/white"
android:textSize=
"17sp"
tools:text=
"29°"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/layout/notification_weather_small.xml
View file @
1f6a927d
...
@@ -19,21 +19,22 @@
...
@@ -19,21 +19,22 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<!-- 天气图标 -->
<ImageView
<ImageView
android:id=
"@+id/iv_weather"
android:id=
"@+id/iv_weather"
android:layout_width=
"36dp"
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_height=
"36dp"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:src=
"@mipmap/d_qing"
android:src=
"@mipmap/d_qing"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_centerVertical=
"true"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_alignParentStart=
"true"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<!-- 当前温度 -->
<TextView
<TextView
android:id=
"@+id/tv_wendu_now"
android:id=
"@+id/tv_wendu_now"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -41,11 +42,11 @@
...
@@ -41,11 +42,11 @@
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"30sp"
android:textSize=
"30sp"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_centerVertical=
"true"
app:layout_constraintStart_toEndOf=
"@id/iv_weather"
android:layout_toEndOf=
"@id/iv_weather"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"20"
/>
tools:text=
"20"
/>
<!-- 温度单位 "℃" -->
<TextView
<TextView
android:id=
"@+id/tv_c"
android:id=
"@+id/tv_c"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -55,20 +56,22 @@
...
@@ -55,20 +56,22 @@
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:textSize=
"14sp"
android:layout_marginTop=
"2dp"
android:layout_marginTop=
"2dp"
a
pp:layout_constraintStar
t_toEndOf=
"@id/tv_wendu_now"
a
ndroid:layou
t_toEndOf=
"@id/tv_wendu_now"
a
pp:layout_constraintTop_toTopOf
=
"@id/tv_wendu_now"
a
ndroid:layout_alignTop
=
"@id/tv_wendu_now"
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<!-- 城市名称 -->
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"ChengDu..."
android:text=
"ChengDu..."
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"12sp"
android:textSize=
"12sp"
android:layout_marginBottom=
"2dp"
android:layout_marginStart=
"10dp"
app:layout_constraintBottom_toBottomOf=
"@id/tv_wendu_now"
android:layout_below=
"@id/tv_wendu_now"
app:layout_constraintStart_toEndOf=
"@id/tv_c"
android:layout_alignStart=
"@id/tv_c"
/>
android:layout_marginStart=
"10dp"
/>
<!-- 详情按钮 -->
<TextView
<TextView
android:text=
"Detail"
android:text=
"Detail"
android:textSize=
"15sp"
android:textSize=
"15sp"
...
@@ -76,14 +79,12 @@
...
@@ -76,14 +79,12 @@
android:layout_width=
"77dp"
android:layout_width=
"77dp"
android:layout_height=
"26dp"
android:layout_height=
"26dp"
android:gravity=
"center"
android:gravity=
"center"
android:layout_marginEnd=
"20
s
p"
android:layout_marginEnd=
"20
d
p"
android:background=
"@drawable/shape_radio_16_white"
android:background=
"@drawable/shape_radio_16_white"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_centerVertical=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_alignParentEnd=
"true"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/mipmap-xxhdpi/xiaoqing1.png
0 → 100644
View file @
1f6a927d
47 KB
app/src/main/res/mipmap-xxhdpi/xiaoshachenbao1.png
0 → 100644
View file @
1f6a927d
149 KB
app/src/main/res/mipmap-xxhdpi/xiaoxuetian1.png
0 → 100644
View file @
1f6a927d
148 KB
app/src/main/res/mipmap-xxhdpi/xiaoyinyu1.png
0 → 100644
View file @
1f6a927d
150 KB
app/src/main/res/mipmap-xxhdpi/xiaoyutian_bg1.png
0 → 100644
View file @
1f6a927d
142 KB
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