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
676ca368
Commit
676ca368
authored
Mar 24, 2025
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除星座
parent
ed9c1a74
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
537 deletions
+0
-537
NotificationUtils.kt
...om/swiftcleaner/chovey/business/push/NotificationUtils.kt
+0
-27
MainActivity.java
.../main/java/com/swiftcleaner/chovey/view/MainActivity.java
+0
-7
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+0
-8
WebBrowserActivity.kt
.../chovey/view/function/constellation/WebBrowserActivity.kt
+0
-241
XzLoadingActivity.kt
...r/chovey/view/function/constellation/XzLoadingActivity.kt
+0
-119
activity_main.xml
app/src/main/res/layout/activity_main.xml
+0
-10
activity_web_browser.xml
app/src/main/res/layout/activity_web_browser.xml
+0
-70
activity_xz_loading.xml
app/src/main/res/layout/activity_xz_loading.xml
+0
-55
No files found.
app/src/main/java/com/swiftcleaner/chovey/business/push/NotificationUtils.kt
View file @
676ca368
...
@@ -21,7 +21,6 @@ import com.swiftcleaner.chovey.GlobalConfig.ID_MALWARE_CLEAN
...
@@ -21,7 +21,6 @@ import com.swiftcleaner.chovey.GlobalConfig.ID_MALWARE_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SCREENSHOT_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SCREENSHOT_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SIMILAR_PHOTOS
import
com.swiftcleaner.chovey.GlobalConfig.ID_SIMILAR_PHOTOS
import
com.swiftcleaner.chovey.GlobalConfig.ID_WHEATHER
import
com.swiftcleaner.chovey.GlobalConfig.ID_WHEATHER
import
com.swiftcleaner.chovey.GlobalConfig.ID_XINGZUO
import
com.swiftcleaner.chovey.GlobalConfig.KEY_NOTIFICATION_ID
import
com.swiftcleaner.chovey.GlobalConfig.KEY_NOTIFICATION_ID
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.business.EventUtils
import
com.swiftcleaner.chovey.business.EventUtils
...
@@ -47,7 +46,6 @@ object NotificationUtils {
...
@@ -47,7 +46,6 @@ object NotificationUtils {
ID_LARGE_FILE_CLEANER
,
ID_LARGE_FILE_CLEANER
,
ID_SIMILAR_PHOTOS
,
ID_SIMILAR_PHOTOS
,
ID_SCREENSHOT_CLEAN
,
ID_SCREENSHOT_CLEAN
,
ID_XINGZUO
,
ID_WHEATHER
,
ID_WHEATHER
,
ID_MALWARE_CLEAN
ID_MALWARE_CLEAN
)
)
...
@@ -69,31 +67,6 @@ object NotificationUtils {
...
@@ -69,31 +67,6 @@ object NotificationUtils {
@SuppressLint
(
"RemoteViewLayout"
)
@SuppressLint
(
"RemoteViewLayout"
)
fun
sendNotification
(
context
:
Context
,
id
:
Int
,
type
:
String
)
{
fun
sendNotification
(
context
:
Context
,
id
:
Int
,
type
:
String
)
{
if
(
id
==
ID_XINGZUO
)
{
//val icon = R.mipmap.xingzuoicon
val
desc
=
XingzuoStringManager
.
getNextDesc
()
val
btn
=
XingzuoStringManager
.
getNextTitle
()
val
smallRemoteViewsVar
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notify_layout_xingzuo_small
)
smallRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_desc
,
btn
)
smallRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_btn
,
desc
)
val
bigRemoteViewsVar
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notify_layout_xingzuo_big
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
id_title
,
btn
)
bigRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
// sendCustomNotification(context, actionId, intent, bigRemoteViewsVar, smallRemoteViewsVar)
sendNotification
(
context
,
btn
,
getLaunchIntent
(
context
,
id
),
smallRemoteViewsVar
,
bigRemoteViewsVar
,
id
,
type
)
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
...
...
app/src/main/java/com/swiftcleaner/chovey/view/MainActivity.java
View file @
676ca368
package
com
.
swiftcleaner
.
chovey
.
view
;
package
com
.
swiftcleaner
.
chovey
.
view
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_NOT_CLEANED
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_WHEATHER
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_XINGZUO
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
URL_PRIVACY
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
URL_PRIVACY
;
import
androidx.activity.result.ActivityResultLauncher
;
import
androidx.activity.result.ActivityResultLauncher
;
...
@@ -53,7 +50,6 @@ import com.swiftcleaner.chovey.view.dialog.AppExitDialog;
...
@@ -53,7 +50,6 @@ import com.swiftcleaner.chovey.view.dialog.AppExitDialog;
import
com.swiftcleaner.chovey.view.dialog.CustomBottomSheetDialog
;
import
com.swiftcleaner.chovey.view.dialog.CustomBottomSheetDialog
;
import
com.swiftcleaner.chovey.view.dialog.FullscreenDialog
;
import
com.swiftcleaner.chovey.view.dialog.FullscreenDialog
;
import
com.swiftcleaner.chovey.view.dialog.NoticeDialog
;
import
com.swiftcleaner.chovey.view.dialog.NoticeDialog
;
import
com.swiftcleaner.chovey.view.function.constellation.XzLoadingActivity
;
import
com.swiftcleaner.chovey.view.function.weather.ListBean
;
import
com.swiftcleaner.chovey.view.function.weather.ListBean
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherBean
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherBean
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherInterface
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherInterface
;
...
@@ -277,9 +273,6 @@ public class MainActivity extends AppCompatActivity {
...
@@ -277,9 +273,6 @@ public class MainActivity extends AppCompatActivity {
binding
.
similarPhotos
.
setOnClickListener
(
v
->
{
binding
.
similarPhotos
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
MainActivity
.
this
,
SimilarPhotosActivity
.
class
));
startActivity
(
new
Intent
(
MainActivity
.
this
,
SimilarPhotosActivity
.
class
));
});
});
binding
.
xingzuo
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
MainActivity
.
this
,
XzLoadingActivity
.
class
));
});
binding
.
clTianqi
.
setOnClickListener
(
v
->
{
binding
.
clTianqi
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
MainActivity
.
this
,
WeatherInterface
.
class
));
startActivity
(
new
Intent
(
MainActivity
.
this
,
WeatherInterface
.
class
));
});
});
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/StartActivity.java
View file @
676ca368
...
@@ -2,7 +2,6 @@ package com.swiftcleaner.chovey.view.activity;
...
@@ -2,7 +2,6 @@ package com.swiftcleaner.chovey.view.activity;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_MALWARE_CLEAN
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_MALWARE_CLEAN
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_WHEATHER
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_WHEATHER
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
ID_XINGZUO
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
KEY_NOTIFICATION_ID
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
KEY_NOTIFICATION_ID
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
URL_PRIVACY
;
import
static
com
.
swiftcleaner
.
chovey
.
GlobalConfig
.
URL_PRIVACY
;
//import static com.swiftcleaner.chovey.model.bean.Global.FUNCTION_SIMILAR_PHOTOS;
//import static com.swiftcleaner.chovey.model.bean.Global.FUNCTION_SIMILAR_PHOTOS;
...
@@ -47,7 +46,6 @@ import com.swiftcleaner.chovey.util.ActivityLauncher;
...
@@ -47,7 +46,6 @@ import com.swiftcleaner.chovey.util.ActivityLauncher;
import
com.swiftcleaner.chovey.util.NonBlockingCountdown
;
import
com.swiftcleaner.chovey.util.NonBlockingCountdown
;
import
com.swiftcleaner.chovey.util.SPUtils
;
import
com.swiftcleaner.chovey.util.SPUtils
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.MainActivity
;
import
com.swiftcleaner.chovey.view.function.constellation.XzLoadingActivity
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherInterface
;
import
com.swiftcleaner.chovey.view.function.weather.WeatherInterface
;
import
java.util.List
;
import
java.util.List
;
...
@@ -489,12 +487,6 @@ public class StartActivity extends AppCompatActivity {
...
@@ -489,12 +487,6 @@ public class StartActivity extends AppCompatActivity {
finish
();
finish
();
return
;
return
;
}
}
if
(
Objects
.
equals
(
actionId
,
ID_XINGZUO
))
{
AdmobHelps
.
INSTANCE
.
isShowAdInter
();
startActivity
(
new
Intent
(
this
,
XzLoadingActivity
.
class
));
finish
();
return
;
}
if
(
Objects
.
equals
(
actionId
,
ID_MALWARE_CLEAN
))
{
if
(
Objects
.
equals
(
actionId
,
ID_MALWARE_CLEAN
))
{
AdmobHelps
.
INSTANCE
.
isShowAdInter
();
AdmobHelps
.
INSTANCE
.
isShowAdInter
();
startActivity
(
new
Intent
(
this
,
MalwareCleanActivity
.
class
));
startActivity
(
new
Intent
(
this
,
MalwareCleanActivity
.
class
));
...
...
app/src/main/java/com/swiftcleaner/chovey/view/function/constellation/WebBrowserActivity.kt
deleted
100644 → 0
View file @
ed9c1a74
package
com.swiftcleaner.chovey.view.function.constellation
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Intent
import
android.graphics.Bitmap
import
android.net.Uri
import
android.net.http.SslError
import
android.util.Log
import
android.view.View
import
android.webkit.CookieManager
import
android.webkit.JsResult
import
android.webkit.SslErrorHandler
import
android.webkit.ValueCallback
import
android.webkit.WebChromeClient
import
android.webkit.WebResourceError
import
android.webkit.WebResourceRequest
import
android.webkit.WebResourceResponse
import
android.webkit.WebSettings
import
android.webkit.WebStorage
import
android.webkit.WebView
import
android.webkit.WebViewClient
import
androidx.activity.OnBackPressedCallback
import
androidx.lifecycle.lifecycleScope
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.isShowAdNativeBottom
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.showInterstitialAd
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.showNativeAd
import
com.google.android.gms.ads.nativead.NativeAd
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.business.admob.AdmobManager
import
com.swiftcleaner.chovey.databinding.ActivityWebBrowserBinding
import
com.swiftcleaner.chovey.model.util.FinishMain
import
com.swiftcleaner.chovey.view.BaseActivityKotlin
import
com.swiftcleaner.chovey.view.dialog.CustomScoreDialog
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
kotlin.random.Random
class
WebBrowserActivity
:
BaseActivityKotlin
<
ActivityWebBrowserBinding
>()
{
override
val
binding
:
ActivityWebBrowserBinding
by
lazy
{
ActivityWebBrowserBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
initWebSettings
()
binding
.
webView
.
loadUrl
(
"https://www.horoscope.com/us/index.aspx"
)
showNativeAd
(
this
,
binding
.
flAd
,
R
.
layout
.
layout_ad_native_small
,
isShowAdNativeBottom
(),
false
)
}
override
fun
initListener
()
{
super
.
initListener
()
binding
.
idBack
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
binding
.
refreshLayout
.
setOnRefreshListener
{
lifecycleScope
.
launch
{
binding
.
refreshLayout
.
isRefreshing
=
true
delay
(
Random
.
nextLong
(
1500
,
2500
))
binding
.
refreshLayout
.
isRefreshing
=
false
}
binding
.
webView
.
reload
()
}
onBackPressedDispatcher
.
addCallback
(
object
:
OnBackPressedCallback
(
true
)
{
override
fun
handleOnBackPressed
()
{
val
activity
:
Activity
=
this
@WebBrowserActivity
if
(
AdmobHelps
.
isShowAdBackInter
())
{
showInterstitialAd
(
this
@WebBrowserActivity
,
{
FinishMain
.
finishToMain
(
activity
)
// 当广告被关闭时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad was dismissed."
)
null
},
{
// 当广告展示完成时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad was shown."
)
null
},
{
FinishMain
.
finishToMain
(
activity
)
// 当广告加载失败时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad failed to load."
)
null
},
false
)
}
else
{
FinishMain
.
finishToMain
(
activity
)
}
}
})
}
@SuppressLint
(
"JavascriptInterface"
)
private
fun
initWebSettings
()
{
val
webSettings
=
binding
.
webView
.
settings
webSettings
.
allowFileAccess
=
true
// 设置允许访问文件数据
webSettings
.
setSupportZoom
(
false
)
webSettings
.
builtInZoomControls
=
true
webSettings
.
cacheMode
=
WebSettings
.
LOAD_NO_CACHE
webSettings
.
domStorageEnabled
=
true
webSettings
.
databaseEnabled
=
true
@Suppress
(
"DEPRECATION"
)
webSettings
.
allowFileAccessFromFileURLs
=
true
WebStorage
.
getInstance
().
deleteAllData
()
// 关键性代码,这里要给webView添加这行代码,才可以点击之后正常播放音频。记录一下。
webSettings
.
mediaPlaybackRequiresUserGesture
=
false
//设置WebView属性,能够执行Javascript脚本
webSettings
.
javaScriptEnabled
=
true
//设置混合内容模式:对于HTTPS和HTTP混合内容的加载,需要设置WebView以允许混合内容:
webSettings
.
mixedContentMode
=
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
//使用CookieManager设置允许跨域Cookie
CookieManager
.
getInstance
().
setAcceptThirdPartyCookies
(
binding
.
webView
,
true
)
//适应屏幕设置
webSettings
.
useWideViewPort
=
true
webSettings
.
loadWithOverviewMode
=
true
//网页使用localStorage等Web存储API,需要启用DOM存储
webSettings
.
domStorageEnabled
=
true
webSettings
.
setUseWideViewPort
(
false
)
webSettings
.
setLoadsImagesAutomatically
(
true
)
// 确保自动加载图片
//设置WebChromeClient
binding
.
webView
.
webChromeClient
=
object
:
WebChromeClient
()
{
override
fun
onProgressChanged
(
view
:
WebView
,
newProgress
:
Int
)
{
binding
.
progressBar
.
progress
=
newProgress
if
(
binding
.
progressBar
.
progress
>=
100
)
{
binding
.
progressBar
.
visibility
=
View
.
GONE
}
}
override
fun
onReceivedTitle
(
view
:
WebView
?,
title
:
String
?)
{
super
.
onReceivedTitle
(
view
,
title
)
}
override
fun
onShowFileChooser
(
webView
:
WebView
?,
filePathCallback
:
ValueCallback
<
Array
<
Uri
?
>?>,
fileChooserParams
:
FileChooserParams
?
):
Boolean
{
return
true
}
override
fun
onJsAlert
(
view
:
WebView
?,
url
:
String
?,
message
:
String
?,
result
:
JsResult
?
):
Boolean
=
true
}
binding
.
webView
.
webViewClient
=
object
:
WebViewClient
()
{
override
fun
shouldInterceptRequest
(
view
:
WebView
?,
request
:
WebResourceRequest
?):
WebResourceResponse
?
{
val
url
=
request
?.
url
.
toString
()
// LogEx.logDebug(TAG, "shouldInterceptRequest url=$url")
if
(
url
.
contains
(
"//ads."
)
||
url
.
contains
(
"https://play.google.com"
))
{
return
WebResourceResponse
(
null
,
null
,
null
)
// 拦截广告请
}
return
super
.
shouldInterceptRequest
(
view
,
request
)
}
override
fun
onLoadResource
(
view
:
WebView
?,
url
:
String
?)
{
super
.
onLoadResource
(
view
,
url
)
}
override
fun
shouldOverrideUrlLoading
(
view
:
WebView
?,
request
:
WebResourceRequest
?
):
Boolean
{
if
(
request
!=
null
)
{
val
uri
=
request
.
url
val
scheme
=
uri
.
scheme
// 检查 URL 是否是 scheme 类型
if
(
scheme
!=
null
&&
(
scheme
==
"http"
||
scheme
==
"https"
))
{
}
else
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
uri
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
if
(
packageManager
!=
null
&&
intent
.
resolveActivity
(
packageManager
)
!=
null
)
{
startActivity
(
intent
)
}
return
true
// 返回 true,表示 URL 已经被处理
}
return
super
.
shouldOverrideUrlLoading
(
view
,
request
)
}
return
false
}
override
fun
onPageStarted
(
view
:
WebView
?,
url
:
String
?,
favicon
:
Bitmap
?)
{
super
.
onPageStarted
(
view
,
url
,
favicon
)
}
override
fun
onPageFinished
(
view
:
WebView
?,
url
:
String
?)
{
val
jsCode
=
"javascript:"
+
"var ads = document.querySelectorAll('.ad-container');"
+
// 替换为广告的CSS选择器
"for (var i = 0; i < ads.length; i++) {"
+
" ads[i].parentNode.removeChild(ads[i]);"
+
"}"
view
?.
loadUrl
(
jsCode
)
}
override
fun
onReceivedSslError
(
view
:
WebView
?,
handler
:
SslErrorHandler
?,
error
:
SslError
?
)
{
}
override
fun
onReceivedError
(
view
:
WebView
?,
request
:
WebResourceRequest
?,
error
:
WebResourceError
?
)
{
super
.
onReceivedError
(
view
,
request
,
error
)
}
}
//设置Cookie
val
instance
=
CookieManager
.
getInstance
()
instance
.
setAcceptThirdPartyCookies
(
binding
.
webView
,
true
)
binding
.
webView
.
addJavascriptInterface
(
this
,
"android"
)
binding
.
webView
.
swipeRefreshLayout
=
binding
.
refreshLayout
}
}
\ No newline at end of file
app/src/main/java/com/swiftcleaner/chovey/view/function/constellation/XzLoadingActivity.kt
deleted
100644 → 0
View file @
ed9c1a74
package
com.swiftcleaner.chovey.view.function.constellation
import
android.animation.ValueAnimator
import
android.content.Intent
import
android.graphics.Color
import
android.util.Log
import
android.view.animation.LinearInterpolator
import
android.widget.Toast
import
androidx.activity.OnBackPressedCallback
import
androidx.lifecycle.lifecycleScope
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.isShowAdNativeBottom
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.showInterstitialAd
import
com.swiftcleaner.chovey.business.newAdmob.AdmobHelps.showNativeAd
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.databinding.ActivityXzLoadingBinding
import
com.swiftcleaner.chovey.view.BaseActivityKotlin
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
kotlin.random.Random
class
XzLoadingActivity
:
BaseActivityKotlin
<
ActivityXzLoadingBinding
>()
{
override
val
binding
:
ActivityXzLoadingBinding
by
lazy
{
ActivityXzLoadingBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
showNativeAd
(
this
,
binding
.
flAd
,
R
.
layout
.
layout_ad_native_small
,
isShowAdNativeBottom
(),
false
)
BarUtils
.
setStatusBarLightMode
(
this
,
false
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
ValueAnimator
.
ofFloat
(
0f
,
360f
).
apply
{
duration
=
1100
repeatMode
=
ValueAnimator
.
RESTART
repeatCount
=
ValueAnimator
.
INFINITE
interpolator
=
LinearInterpolator
()
addUpdateListener
{
binding
.
idZhuan
.
rotation
=
it
.
animatedValue
as
Float
}
start
()
}
}
override
fun
initListener
()
{
onBackPressedDispatcher
.
addCallback
(
object
:
OnBackPressedCallback
(
true
)
{
override
fun
handleOnBackPressed
()
{
Toast
.
makeText
(
this
@XzLoadingActivity
,
"wait a moment"
,
Toast
.
LENGTH_SHORT
).
show
()
}
})
}
private
var
isPasue
=
false
override
fun
onPause
()
{
super
.
onPause
()
isPasue
=
false
}
override
fun
onResume
()
{
super
.
onResume
()
isPasue
=
true
playAnimal
()
}
private
fun
playAnimal
()
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
binding
.
root
.
postDelayed
({
if
(
AdmobHelps
.
isShowAdInter
())
{
showInterstitialAd
(
this
@XzLoadingActivity
,
{
startIntent
()
// 当广告被关闭时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad was dismissed."
)
null
},
{
// 当广告展示完成时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad was shown."
)
null
},
{
startIntent
()
// 当广告加载失败时的逻辑
Log
.
d
(
"AdmobHelps"
,
"Interstitial Ad failed to load."
)
null
},
false
)
}
else
{
startIntent
()
}
},
Random
.
nextLong
(
3000
,
5000
))
}
}
private
fun
startIntent
()
{
val
intent
=
Intent
(
this
@XzLoadingActivity
,
WebBrowserActivity
::
class
.
java
)
intent
.
putExtra
(
"url"
,
"https://www.horoscope.com/us/index.aspx"
)
startActivity
(
intent
)
finish
()
}
// private fun animaEnd(){
// if (isPasue) {
// AdmobMaxHelper.admobMaxShowInterstitialAd(this){
// startActivity(Intent(this, WebBrowserActivity::class.java).apply {
// putExtra("url", "https://www.horoscope.com/us/index.aspx")
// })
// finish()
// }
// }
// }
}
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
676ca368
...
@@ -91,16 +91,6 @@
...
@@ -91,16 +91,6 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id=
"@+id/xingzuo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"15dp"
android:src=
"@mipmap/horoscope"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/iv_setting"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
<ImageView
android:id=
"@+id/iv_setting"
android:id=
"@+id/iv_setting"
android:layout_width=
"22dp"
android:layout_width=
"22dp"
...
...
app/src/main/res/layout/activity_web_browser.xml
deleted
100644 → 0
View file @
ed9c1a74
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".view.function.constellation.WebBrowserActivity"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/id_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:padding=
"16dp"
android:src=
"@mipmap/fanhui"
android:tint=
"@color/black"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"@string/app_name"
android:textSize=
"17sp"
android:textStyle=
"bold"
/>
</FrameLayout>
<ProgressBar
android:id=
"@+id/progress_bar"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"3dp"
android:layout_marginVertical=
"3dp"
android:max=
"100"
android:progressDrawable=
"@drawable/progress_bar_web"
tools:progress=
"50"
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id=
"@+id/refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.swiftcleaner.chovey.view.function.constellation.WebRefreshView
android:id=
"@+id/webView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<FrameLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:src=
"@mipmap/img_adzhanwei_small"
/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_xz_loading.xml
deleted
100644 → 0
View file @
ed9c1a74
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
tools:context=
".view.function.constellation.XzLoadingActivity"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/xingzuo_bg"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/id_fl_dh"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/id_zhuan"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@mipmap/xingzuoyuan"
/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@mipmap/xing"
/>
</FrameLayout>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"27dp"
android:text=
"Please wait..."
android:textColor=
"@color/white"
android:textSize=
"15sp"
android:textStyle=
"bold"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/id_fl_dh"
/>
<FrameLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:src=
"@mipmap/img_adzhanwei_small"
/>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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