Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
scanqrwhitecopy
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
scanqrwhitecopy
Commits
a82d849f
Commit
a82d849f
authored
Jan 20, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
2da1a960
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
11 deletions
+64
-11
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+6
-0
GlobalConfig.kt
app/src/main/java/com/base/scanqrclear/GlobalConfig.kt
+3
-3
MyApplication.kt
app/src/main/java/com/base/scanqrclear/MyApplication.kt
+4
-1
MyNotificationManager.kt
...ase/scanqrclear/fcm/notification/MyNotificationManager.kt
+1
-1
NotificationUiUtil.kt
...m/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
+7
-1
BaseActivity2.kt
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
+9
-0
WeatherInterface.kt
...c/main/java/com/base/scanqrclear/luma/WeatherInterface.kt
+23
-4
WeatherUtils.kt
app/src/main/java/com/base/scanqrclear/luma/WeatherUtils.kt
+5
-0
bg_0571ed_18.xml
app/src/main/res/drawable/bg_0571ed_18.xml
+5
-0
activity_weather.xml
app/src/main/res/layout/activity_weather.xml
+1
-1
img_guangbiao_tuisong.png
app/src/main/res/mipmap-xxhdpi/img_guangbiao_tuisong.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
a82d849f
...
...
@@ -177,6 +177,12 @@
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".luma.WeatherInterface"
android:exported=
"false"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${applicationId}.provider"
...
...
app/src/main/java/com/base/scanqrclear/GlobalConfig.kt
View file @
a82d849f
...
...
@@ -5,7 +5,7 @@ package com.base.scanqrclear
*/
object
GlobalConfig
{
//包名
const
val
PACKAGE_NAME
=
"com.
scan.barcode.deeplink
"
const
val
PACKAGE_NAME
=
"com.
ok.ai.browser.jojo
"
// 域名
/**
...
...
@@ -16,7 +16,7 @@ object GlobalConfig {
/**
* Url Api 业务接口
*/
const
val
URL_API
=
"https://api.
gamexzonerk
.xyz"
const
val
URL_API
=
"https://api.
rocioxyn
.xyz"
/**
* Url Privacy 隐私链接
...
...
@@ -31,7 +31,7 @@ object GlobalConfig {
/**
* Key Aes 加密key
*/
const
val
KEY_AES
=
"
o3yb8vzeptlki1ve
"
const
val
KEY_AES
=
"
ez9r013lcubfpepu
"
/**
* Key solar 归因key
...
...
app/src/main/java/com/base/scanqrclear/MyApplication.kt
View file @
a82d849f
...
...
@@ -26,6 +26,7 @@ import com.base.scanqrclear.helper.InstallHelps
import
com.base.scanqrclear.helper.NewComUtils
import
com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME
import
com.base.scanqrclear.luma.SpUtils
import
com.base.scanqrclear.luma.WeatherUtils.requestWeatherData
import
com.base.scanqrclear.service.StayJobService.Companion.startJob
import
com.base.scanqrclear.ui.start.StartActivity
import
com.base.scanqrclear.utils.ActivityManagerUtils
...
...
@@ -158,6 +159,8 @@ class MyApplication : Application() {
MyNotificationManager
.
startNotificationQueue
()
appContext
.
initSolarEngine
(
true
)
requestWeatherData
()
}
private
fun
initAppConfig
()
{
...
...
@@ -273,7 +276,7 @@ class MyApplication : Application() {
//广告
AdConfigBean
.
adsConfigBean
=
configBean
.
adConfigBean
LogEx
.
logDebug
(
"initConfig"
,
"adsConfigBean=${AdConfigBean.adsConfigBean.
numDisplayLimit
}"
)
LogEx
.
logDebug
(
"initConfig"
,
"adsConfigBean=${AdConfigBean.adsConfigBean.
functionBackShowAd
}"
)
//通知
PopupConfigBean
.
popupConfigBean
=
configBean
.
popupConfigBean
...
...
app/src/main/java/com/base/scanqrclear/fcm/notification/MyNotificationManager.kt
View file @
a82d849f
...
...
@@ -71,7 +71,7 @@ object MyNotificationManager {
val
next
=
actionIdList
[
0
]
actionIdList
.
removeAt
(
0
)
if
(
BuildConfig
.
DEBUG
)
{
return
ACTION_ID_
CLEAN_JUNK
return
ACTION_ID_
WEATHER
}
return
next
}
...
...
app/src/main/java/com/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
View file @
a82d849f
...
...
@@ -187,7 +187,10 @@ object NotificationUiUtil {
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_weather_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_city
,
weatherBean
.
city
)
val
min
=
subBean
.
tempMin
.
toInt
()
val
max
=
subBean
.
tempMax
.
toInt
()
var
max
=
subBean
.
tempMax
.
toInt
()
if
(
max
<=
min
)
{
max
=
min
+
1
}
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
val
icon
=
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
"Sunny day"
->
R
.
mipmap
.
d_qing
...
...
@@ -219,6 +222,9 @@ object NotificationUiUtil {
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
...
...
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
View file @
a82d849f
...
...
@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter
import
android.animation.ValueAnimator
import
android.app.Activity
import
android.app.Dialog
import
android.content.Intent
import
android.os.Bundle
import
android.view.View
import
android.view.animation.LinearInterpolator
...
...
@@ -279,4 +280,12 @@ open class BaseActivity2 : AppCompatActivity() {
// }
// finish()
}
fun
finishToMainTop
()
{
val
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
intent
.
putExtra
(
"where"
,
"finishToMainTop"
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
startActivity
(
intent
)
finish
()
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqrclear/luma/WeatherInterface.kt
View file @
a82d849f
...
...
@@ -17,6 +17,7 @@ import com.base.scanqrclear.ads.AdsMgr
import
com.base.scanqrclear.ads.AdsShowCallBack
import
com.base.scanqrclear.bean.ListBean
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.bean.config.AdConfigBean
import
com.base.scanqrclear.databinding.ActivityWeatherBinding
import
com.base.scanqrclear.utils.BarUtils
import
kotlin.random.Random
...
...
@@ -24,18 +25,19 @@ import kotlin.random.Random
@SuppressLint
(
"SimpleDateFormat"
)
class
WeatherInterface
:
BaseActivity2
()
{
val
binding
:
ActivityWeatherBinding
by
lazy
{
ActivityWeatherBinding
.
inflate
(
layoutInflater
)
}
var
wBean
:
WeatherBean
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
binding
.
root
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
getData
()
initListener
()
// AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd)
AdsMgr
.
showNative
(
binding
.
idFlAd
,
R
.
layout
.
layout_admob_native_custom
)
}
...
...
@@ -45,7 +47,24 @@ class WeatherInterface : BaseActivity2() {
}
onBackPressedDispatcher
.
addCallback
(
object
:
OnBackPressedCallback
(
true
)
{
override
fun
handleOnBackPressed
()
{
finish
()
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@WeatherInterface
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMainTop
()
}
})
}
else
{
finishToMainTop
()
}
}
})
}
...
...
@@ -59,7 +78,7 @@ class WeatherInterface : BaseActivity2() {
WeatherUtils
.
requestWeatherData
()
}
binding
.
root
.
postDelayed
({
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
binding
.
idFlLoading
.
isVisible
=
false
}
...
...
app/src/main/java/com/base/scanqrclear/luma/WeatherUtils.kt
View file @
a82d849f
...
...
@@ -7,6 +7,7 @@ import com.base.scanqrclear.GlobalConfig
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.helper.AESHelper
import
com.base.scanqrclear.utils.AppPreferences
import
com.base.scanqrclear.utils.LogEx
import
com.google.gson.Gson
import
okhttp3.Call
import
okhttp3.Callback
...
...
@@ -151,6 +152,7 @@ object WeatherUtils {
.
url
(
url
)
.
get
()
.
build
()
LogEx
.
logDebug
(
"requestWeatherData"
,
"url=$url"
)
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
...
...
@@ -158,11 +160,14 @@ object WeatherUtils {
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
response
.
body
?.
string
()
?.
let
{
LogEx
.
logDebug
(
"requestWeatherData"
,
"it=$it"
)
val
i
=
Regex
(
"\"data\":\"(.*?)\""
).
find
(
it
)
if
(
i
.
toString
()
!=
"null"
)
{
i
?.
groupValues
?.
get
(
1
).
let
{
LogEx
.
logDebug
(
"requestWeatherData"
,
"it=$it"
)
if
(!
TextUtils
.
isEmpty
(
it
))
{
val
str
=
AESHelper
.
decrypt
(
it
!!
)
LogEx
.
logDebug
(
"requestWeatherData"
,
"str=$str"
)
saveWeatherData
(
str
)
}
}
...
...
app/src/main/res/drawable/bg_0571ed_18.xml
0 → 100644
View file @
a82d849f
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#0571ED"
/>
<corners
android:radius=
"18dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_weather.xml
View file @
a82d849f
...
...
@@ -166,7 +166,7 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<
FrameLayout
<
com.base.scanqrclear.ads.NativeParentView
android:id=
"@+id/id_fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/mipmap-xxhdpi/img_guangbiao_tuisong.png
0 → 100644
View file @
a82d849f
9.14 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