Commit 20b1053d authored by 周文华's avatar 周文华

Merge remote-tracking branch 'origin/master'

parents 5105733a 92e402ed
...@@ -219,6 +219,12 @@ ...@@ -219,6 +219,12 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" /> tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".luma.WeatherInterface"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider" android:authorities="${applicationId}.provider"
......
...@@ -5,7 +5,7 @@ package com.base.scanqrclear ...@@ -5,7 +5,7 @@ package com.base.scanqrclear
*/ */
object GlobalConfig { 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 { ...@@ -16,7 +16,7 @@ object GlobalConfig {
/** /**
* Url Api 业务接口 * Url Api 业务接口
*/ */
const val URL_API = "https://api.gamexzonerk.xyz" const val URL_API = "https://api.rocioxyn.xyz"
/** /**
* Url Privacy 隐私链接 * Url Privacy 隐私链接
...@@ -31,7 +31,7 @@ object GlobalConfig { ...@@ -31,7 +31,7 @@ object GlobalConfig {
/** /**
* Key Aes 加密key * Key Aes 加密key
*/ */
const val KEY_AES = "o3yb8vzeptlki1ve" const val KEY_AES = "ez9r013lcubfpepu"
/** /**
* Key solar 归因key * Key solar 归因key
......
...@@ -26,6 +26,7 @@ import com.base.scanqrclear.helper.InstallHelps ...@@ -26,6 +26,7 @@ import com.base.scanqrclear.helper.InstallHelps
import com.base.scanqrclear.helper.NewComUtils import com.base.scanqrclear.helper.NewComUtils
import com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME import com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME
import com.base.scanqrclear.luma.SpUtils 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.service.StayJobService.Companion.startJob
import com.base.scanqrclear.ui.start.StartActivity import com.base.scanqrclear.ui.start.StartActivity
import com.base.scanqrclear.utils.ActivityManagerUtils import com.base.scanqrclear.utils.ActivityManagerUtils
...@@ -158,6 +159,8 @@ class MyApplication : Application() { ...@@ -158,6 +159,8 @@ class MyApplication : Application() {
MyNotificationManager.startNotificationQueue() MyNotificationManager.startNotificationQueue()
appContext.initSolarEngine(true) appContext.initSolarEngine(true)
requestWeatherData()
} }
private fun initAppConfig() { private fun initAppConfig() {
...@@ -273,7 +276,7 @@ class MyApplication : Application() { ...@@ -273,7 +276,7 @@ class MyApplication : Application() {
//广告 //广告
AdConfigBean.adsConfigBean = configBean.adConfigBean AdConfigBean.adsConfigBean = configBean.adConfigBean
LogEx.logDebug("initConfig", "adsConfigBean=${AdConfigBean.adsConfigBean.numDisplayLimit}") LogEx.logDebug("initConfig", "adsConfigBean=${AdConfigBean.adsConfigBean.functionBackShowAd}")
//通知 //通知
PopupConfigBean.popupConfigBean = configBean.popupConfigBean PopupConfigBean.popupConfigBean = configBean.popupConfigBean
......
...@@ -71,7 +71,7 @@ object MyNotificationManager { ...@@ -71,7 +71,7 @@ object MyNotificationManager {
val next = actionIdList[0] val next = actionIdList[0]
actionIdList.removeAt(0) actionIdList.removeAt(0)
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
return ACTION_ID_CLEAN_JUNK return ACTION_ID_WEATHER
} }
return next return next
} }
......
...@@ -187,7 +187,10 @@ object NotificationUiUtil { ...@@ -187,7 +187,10 @@ object NotificationUiUtil {
val smallRemoteViews = RemoteViews(MyApplication.appContext.packageName, R.layout.notification_weather_small) val smallRemoteViews = RemoteViews(MyApplication.appContext.packageName, R.layout.notification_weather_small)
smallRemoteViews.setTextViewText(R.id.tv_city, weatherBean.city) smallRemoteViews.setTextViewText(R.id.tv_city, weatherBean.city)
val min = subBean.tempMin.toInt() 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()) smallRemoteViews.setTextViewText(R.id.tv_wendu_now, Random.nextInt(min, max).toString())
val icon = when (WeatherUtils.getWeatherType(subBean.iconDay.toInt())) { val icon = when (WeatherUtils.getWeatherType(subBean.iconDay.toInt())) {
"Sunny day" -> R.mipmap.d_qing "Sunny day" -> R.mipmap.d_qing
...@@ -219,6 +222,9 @@ object NotificationUiUtil { ...@@ -219,6 +222,9 @@ object NotificationUiUtil {
bigRemoteViews.setTextViewText(R.id.tv_wendu_now, Random.nextInt(min, max).toString()) 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_day_desc, if (isDayOrNight()) subBean.textDay else subBean.textNight)
bigRemoteViews.setTextViewText(R.id.tv_weather_info, "$min℃/$max℃ ${formatATime()}") bigRemoteViews.setTextViewText(R.id.tv_weather_info, "$min℃/$max℃ ${formatATime()}")
sendBean.bigRemoteViews = bigRemoteViews
sendBean.smallRemoteViews = smallRemoteViews
} }
......
...@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter ...@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.app.Activity import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
...@@ -279,4 +280,12 @@ open class BaseActivity2 : AppCompatActivity() { ...@@ -279,4 +280,12 @@ open class BaseActivity2 : AppCompatActivity() {
// } // }
// finish() // 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
...@@ -17,6 +17,7 @@ import com.base.scanqrclear.ads.AdsMgr ...@@ -17,6 +17,7 @@ import com.base.scanqrclear.ads.AdsMgr
import com.base.scanqrclear.ads.AdsShowCallBack import com.base.scanqrclear.ads.AdsShowCallBack
import com.base.scanqrclear.bean.ListBean import com.base.scanqrclear.bean.ListBean
import com.base.scanqrclear.bean.WeatherBean import com.base.scanqrclear.bean.WeatherBean
import com.base.scanqrclear.bean.config.AdConfigBean
import com.base.scanqrclear.databinding.ActivityWeatherBinding import com.base.scanqrclear.databinding.ActivityWeatherBinding
import com.base.scanqrclear.utils.BarUtils import com.base.scanqrclear.utils.BarUtils
import kotlin.random.Random import kotlin.random.Random
...@@ -24,18 +25,19 @@ import kotlin.random.Random ...@@ -24,18 +25,19 @@ import kotlin.random.Random
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
class WeatherInterface : BaseActivity2() { class WeatherInterface : BaseActivity2() {
val binding: ActivityWeatherBinding by lazy { val binding: ActivityWeatherBinding by lazy {
ActivityWeatherBinding.inflate(layoutInflater) ActivityWeatherBinding.inflate(layoutInflater)
} }
var wBean: WeatherBean? = null var wBean: WeatherBean? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(binding.root)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
getData() getData()
initListener() initListener()
// AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd) AdsMgr.showNative(binding.idFlAd, R.layout.layout_admob_native_custom)
} }
...@@ -45,7 +47,24 @@ class WeatherInterface : BaseActivity2() { ...@@ -45,7 +47,24 @@ class WeatherInterface : BaseActivity2() {
} }
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) { onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() { 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() { ...@@ -59,7 +78,7 @@ class WeatherInterface : BaseActivity2() {
WeatherUtils.requestWeatherData() WeatherUtils.requestWeatherData()
} }
binding.root.postDelayed({ binding.root.postDelayed({
AdsMgr.showInsert(this,false,object :AdsShowCallBack(){ AdsMgr.showInsert(this, false, object : AdsShowCallBack() {
override fun close(where: Int) { override fun close(where: Int) {
binding.idFlLoading.isVisible = false binding.idFlLoading.isVisible = false
} }
......
...@@ -7,6 +7,7 @@ import com.base.scanqrclear.GlobalConfig ...@@ -7,6 +7,7 @@ import com.base.scanqrclear.GlobalConfig
import com.base.scanqrclear.bean.WeatherBean import com.base.scanqrclear.bean.WeatherBean
import com.base.scanqrclear.helper.AESHelper import com.base.scanqrclear.helper.AESHelper
import com.base.scanqrclear.utils.AppPreferences import com.base.scanqrclear.utils.AppPreferences
import com.base.scanqrclear.utils.LogEx
import com.google.gson.Gson import com.google.gson.Gson
import okhttp3.Call import okhttp3.Call
import okhttp3.Callback import okhttp3.Callback
...@@ -151,6 +152,7 @@ object WeatherUtils { ...@@ -151,6 +152,7 @@ object WeatherUtils {
.url(url) .url(url)
.get() .get()
.build() .build()
LogEx.logDebug("requestWeatherData", "url=$url")
client.newCall(request).enqueue(object : Callback { client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
...@@ -158,11 +160,14 @@ object WeatherUtils { ...@@ -158,11 +160,14 @@ object WeatherUtils {
override fun onResponse(call: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
response.body?.string()?.let { response.body?.string()?.let {
LogEx.logDebug("requestWeatherData", "it=$it")
val i = Regex("\"data\":\"(.*?)\"").find(it) val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") { if (i.toString() != "null") {
i?.groupValues?.get(1).let { i?.groupValues?.get(1).let {
LogEx.logDebug("requestWeatherData", "it=$it")
if (!TextUtils.isEmpty(it)) { if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!) val str = AESHelper.decrypt(it!!)
LogEx.logDebug("requestWeatherData", "str=$str")
saveWeatherData(str) saveWeatherData(str)
} }
} }
......
<?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
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout> </LinearLayout>
<FrameLayout <com.base.scanqrclear.ads.NativeParentView
android:id="@+id/id_fl_ad" android:id="@+id/id_fl_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment