Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery 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
Data Recovery White
Commits
2af9ef22
Commit
2af9ef22
authored
Jul 10, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...常驻通知栏
parent
d763d63b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
3 deletions
+143
-3
FileScanActivity.kt
...m/base/datarecovery/activity/recovery/FileScanActivity.kt
+1
-1
StayNotificationService.kt
.../com/base/datarecovery/service/StayNotificationService.kt
+11
-1
bg_ad_border.xml
app/src/main/res/drawable/bg_ad_border.xml
+7
-0
bg_ad_button.xml
app/src/main/res/drawable/bg_ad_button.xml
+5
-0
icon_notification_small.xml
app/src/main/res/drawable/icon_notification_small.xml
+18
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+2
-1
layout_native_custom.xml
app/src/main/res/layout/layout_native_custom.xml
+99
-0
No files found.
app/src/main/java/com/base/datarecovery/activity/recovery/FileScanActivity.kt
View file @
2af9ef22
...
@@ -46,7 +46,7 @@ class FileScanActivity : BaseActivity<ActivityFileScanBinding>() {
...
@@ -46,7 +46,7 @@ class FileScanActivity : BaseActivity<ActivityFileScanBinding>() {
@SuppressLint
(
"SetTextI18n"
)
@SuppressLint
(
"SetTextI18n"
)
override
fun
initView
()
{
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
tru
e
)
BarUtils
.
setStatusBarLightMode
(
this
,
fals
e
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
scanType
=
intent
.
extras
?.
getInt
(
"Type"
)
?:
0
scanType
=
intent
.
extras
?.
getInt
(
"Type"
)
?:
0
...
...
app/src/main/java/com/base/datarecovery/service/StayNotificationService.kt
View file @
2af9ef22
...
@@ -8,11 +8,14 @@ import android.app.PendingIntent
...
@@ -8,11 +8,14 @@ import android.app.PendingIntent
import
android.app.Service
import
android.app.Service
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Bitmap
import
android.graphics.BitmapFactory
import
android.graphics.BitmapFactory
import
android.graphics.drawable.Icon
import
android.os.Build
import
android.os.Build
import
android.os.IBinder
import
android.os.IBinder
import
android.widget.RemoteViews
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationCompat
import
androidx.core.graphics.drawable.IconCompat
import
com.base.datarecovery.R
import
com.base.datarecovery.R
import
com.base.datarecovery.activity.MainActivity
import
com.base.datarecovery.activity.MainActivity
import
com.base.datarecovery.activity.junkclean.ScanJunkActivity
import
com.base.datarecovery.activity.junkclean.ScanJunkActivity
...
@@ -129,7 +132,14 @@ class StayNotificationService : Service() {
...
@@ -129,7 +132,14 @@ class StayNotificationService : Service() {
val
builder
=
NotificationCompat
.
Builder
(
context
,
channelId
)
val
builder
=
NotificationCompat
.
Builder
(
context
,
channelId
)
builder
.
setSmallIcon
(
R
.
mipmap
.
logo
)
//设置状态栏内的小图标
val
smallIcon
=
IconCompat
.
createFromIcon
(
context
,
Icon
.
createWithResource
(
this
,
R
.
drawable
.
icon_notification_small
)
)
smallIcon
?.
let
{
builder
.
setSmallIcon
(
smallIcon
)
//设置状态栏内的小图标
}
builder
.
setLargeIcon
(
BitmapFactory
.
decodeResource
(
context
.
resources
,
R
.
mipmap
.
logo
))
builder
.
setLargeIcon
(
BitmapFactory
.
decodeResource
(
context
.
resources
,
R
.
mipmap
.
logo
))
builder
.
setContentTitle
(
context
.
resources
.
getString
(
R
.
string
.
app_name
))
builder
.
setContentTitle
(
context
.
resources
.
getString
(
R
.
string
.
app_name
))
builder
.
setContentIntent
(
pendingIntent
)
//设置PendingIntent
builder
.
setContentIntent
(
pendingIntent
)
//设置PendingIntent
...
...
app/src/main/res/drawable/bg_ad_border.xml
0 → 100644
View file @
2af9ef22
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="#E5E5E5" />-->
<solid
android:color=
"#F2F2F2"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_ad_button.xml
0 → 100644
View file @
2af9ef22
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#FDA409"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/icon_notification_small.xml
0 → 100644
View file @
2af9ef22
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<!-- <path-->
<!-- android:fillColor="#ABABAB"-->
<!-- android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0" />-->
<path
android:pathData=
"M6.368,6.31h1.226c0.097,0 0.175,-0.07 0.175,-0.158V5.68c0,-0.087 -0.078,-0.158 -0.175,-0.158H6.368c-0.097,0 -0.175,0.07 -0.175,0.158v0.473C6.193,6.239 6.271,6.31 6.368,6.31z"
android:fillColor=
"#FFFFFF"
/>
<path
android:pathData=
"M20.558,13.612l-0.018,-4.95c0,-1.575 -1.575,-1.575 -1.575,-1.575h-3.15l-0.788,-1.575H9.513L8.726,7.087H4.788c0,0 -1.575,0 -1.575,1.575v7.876c0,1.575 1.575,1.575 1.575,1.575h10.226l-0.021,-4.501H20.558zM16.602,8.662c0.435,0 0.788,0.353 0.788,0.788c0,0.435 -0.353,0.788 -0.788,0.788c-0.435,0 -0.788,-0.353 -0.788,-0.788C15.814,9.015 16.167,8.662 16.602,8.662zM13.55,14.706c-0.49,0.339 -1.072,0.521 -1.669,0.521c-0.097,0 -0.194,-0.006 -0.291,-0.016c-0.02,-0.002 -0.039,-0.006 -0.058,-0.007c-0.054,-0.007 -0.109,-0.012 -0.162,-0.021c-0.016,-0.002 -0.031,-0.007 -0.047,-0.011c-0.04,-0.007 -0.077,-0.017 -0.115,-0.025c-0.059,-0.013 -0.115,-0.027 -0.17,-0.043c-0.031,-0.009 -0.061,-0.019 -0.091,-0.029c-0.064,-0.02 -0.127,-0.043 -0.189,-0.068l-0.054,-0.024c-0.072,-0.031 -0.143,-0.065 -0.212,-0.101l-0.019,-0.011c-0.247,-0.133 -0.474,-0.302 -0.672,-0.5c-0.058,-0.059 -0.115,-0.119 -0.168,-0.182l-0.04,-0.051c-0.036,-0.044 -0.074,-0.089 -0.107,-0.136c-0.004,-0.006 -0.007,-0.013 -0.011,-0.019c-0.336,-0.476 -0.517,-1.044 -0.517,-1.627H8.374l0.934,-1.378l0.934,1.378H9.658c0.001,0.496 0.172,0.976 0.486,1.359v0l0.026,0.033c0.18,0.213 0.399,0.39 0.644,0.523c0.058,0.03 0.116,0.059 0.176,0.084l0.033,0.015c0.049,0.02 0.099,0.038 0.15,0.054c0.021,0.007 0.042,0.014 0.063,0.021c0.044,0.013 0.089,0.024 0.134,0.034c0.028,0.007 0.055,0.014 0.084,0.02c0.046,0.009 0.093,0.015 0.14,0.021c0.024,0.003 0.049,0.007 0.074,0.009c0.06,0.005 0.121,0.008 0.181,0.009c0.463,0.007 0.917,-0.13 1.299,-0.393c0.158,-0.109 0.375,-0.072 0.487,0.085c0.001,0.002 0.003,0.004 0.004,0.006C13.746,14.388 13.706,14.6 13.55,14.706zM13.51,12.353L13.51,12.353l0.583,0c0,-0.506 -0.178,-0.995 -0.503,-1.382c-0.231,-0.274 -0.517,-0.485 -0.841,-0.622l-0.017,-0.008c-0.054,-0.022 -0.11,-0.042 -0.166,-0.059c-0.015,-0.005 -0.031,-0.011 -0.047,-0.016c-0.049,-0.015 -0.1,-0.027 -0.15,-0.039c-0.022,-0.005 -0.044,-0.011 -0.067,-0.015c-0.052,-0.01 -0.104,-0.018 -0.157,-0.024c-0.019,-0.003 -0.039,-0.006 -0.058,-0.008c-0.524,-0.051 -1.05,0.085 -1.483,0.384c-0.158,0.109 -0.375,0.072 -0.488,-0.085c-0.001,-0.002 -0.003,-0.004 -0.004,-0.006c-0.106,-0.156 -0.066,-0.368 0.09,-0.474c0.49,-0.338 1.071,-0.519 1.666,-0.518c0.021,0 0.035,0.002 0.049,0.002c0.077,0.001 0.155,0.005 0.232,0.012c0.032,0.003 0.064,0.008 0.096,0.012c0.046,0.006 0.093,0.009 0.138,0.017c0.017,0.003 0.033,0.008 0.05,0.011c0.035,0.007 0.069,0.015 0.103,0.023c0.062,0.014 0.123,0.029 0.183,0.047c0.026,0.008 0.05,0.016 0.075,0.024C12.864,9.652 12.932,9.677 13,9.704l0.035,0.016c0.422,0.178 0.795,0.454 1.089,0.805l0.015,0.02c0.044,0.053 0.087,0.106 0.127,0.161c0.005,0.008 0.009,0.016 0.013,0.024c0.334,0.475 0.514,1.042 0.514,1.624h0.584l-0.934,1.378L13.51,12.353z"
android:fillColor=
"#FFFFFF"
/>
<path
android:pathData=
"M20.487,14.488h-4.288c-0.166,0 -0.3,0.134 -0.3,0.3v3.4c0,0.166 0.134,0.3 0.3,0.3h4.288c0.166,0 0.3,-0.134 0.3,-0.3v-3.4C20.788,14.623 20.653,14.488 20.487,14.488zM19.899,15.044c0.184,0 0.333,0.149 0.333,0.333c0,0.184 -0.149,0.333 -0.333,0.333c-0.184,0 -0.333,-0.149 -0.333,-0.333C19.565,15.193 19.715,15.044 19.899,15.044zM20.257,17.833c-0.04,0.069 -0.114,0.111 -0.194,0.111v0h-3.441c-0.083,0 -0.16,-0.046 -0.199,-0.12c-0.039,-0.074 -0.033,-0.163 0.015,-0.231l0.972,-1.397c0.042,-0.06 0.111,-0.096 0.184,-0.096c0.073,0 0.142,0.036 0.184,0.096l1.031,1.483l0.55,-0.961c0.04,-0.07 0.114,-0.113 0.194,-0.113c0.08,0 0.155,0.043 0.194,0.113l0.51,0.891C20.298,17.679 20.297,17.764 20.257,17.833z"
android:fillColor=
"#FFFFFF"
/>
</vector>
app/src/main/res/layout/fragment_home.xml
View file @
2af9ef22
...
@@ -305,7 +305,8 @@
...
@@ -305,7 +305,8 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/fl_ad"
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/layout_native_custom.xml
0 → 100644
View file @
2af9ef22
<com.google.android.gms.ads.nativead.NativeAdView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
>
<LinearLayout
android:background=
"@drawable/bg_ad_border"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:baselineAligned=
"false"
>
<com.google.android.gms.ads.nativead.MediaView
android:id=
"@+id/ad_media"
android:layout_width=
"91dp"
android:layout_height=
"91dp"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"5dp"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:background=
"#FF923E"
android:padding=
"2dp"
android:text=
"Ad"
android:textColor=
"@color/white"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/ad_body"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:layout_marginEnd=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingVertical=
"5dp"
>
<ImageView
android:id=
"@+id/ad_app_icon"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_vertical"
tools:ignore=
"ContentDescription"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/ad_call_to_action"
android:layout_width=
"match_parent"
android:layout_height=
"26dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"12dp"
android:background=
"@drawable/bg_ad_button"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"15sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.gms.ads.nativead.NativeAdView>
\ No newline at end of file
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