Commit ed360823 authored by guest's avatar guest

增加天气和星座,推送,修改bug,去掉测试代码

parent 17b519ab
......@@ -120,4 +120,5 @@ dependencies {
implementation 'com.google.android.ump:user-messaging-platform:3.0.0'
implementation 'com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3'
implementation 'com.reyun.solar.engine:se-plugin-oaid:1.2.8.3'
implementation("com.github.JavaNoober.BackgroundLibrary:libraryx:1.7.6")
}
\ No newline at end of file
......@@ -35,6 +35,8 @@
android:roundIcon="@mipmap/logo"
android:supportsRtl="true"
android:theme="@style/Theme.DataRecovery"
android:requestRawExternalStorageAccess="true"
android:requestLegacyExternalStorage="true"
tools:targetApi="34">
<activity
......@@ -244,7 +246,14 @@
<activity
android:name=".activity.junkclean.ScanJunk2Activity"
android:screenOrientation="portrait" />
<activity android:name=".activity.newfunction.WeatherInterface"
android:screenOrientation="portrait"/>
<activity android:name=".activity.newfunction.WebBrowserActivity"
android:screenOrientation="portrait"/>
<activity android:name=".activity.newfunction.XingzuoLoadingActivity"
android:screenOrientation="portrait"/>
<activity android:name=".activity.repeat.SimilarPicAt"
android:screenOrientation="portrait"/>
<meta-data
android:name="com.google.android.gms.ads.flag.OPTIMIZE_INITIALIZATION"
android:value="true" />
......
......@@ -13,6 +13,7 @@ import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.NetworkType
import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
import com.base.datarecovery.activity.newfunction.WeatherUtils
import com.base.datarecovery.activity.splash.Splash2Activity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ConstObject.ifAgreePrivacy
......@@ -63,7 +64,7 @@ class MyApplication : BaseApplication() {
startJob()
initLifeListener()
solarInit()
if(ifAgreePrivacy){
if (ifAgreePrivacy) {
initApp()
}
startWorkManager()
......@@ -78,18 +79,19 @@ class MyApplication : BaseApplication() {
uuid = UUID.randomUUID().toString() + System.currentTimeMillis()
AppPreferences.getInstance().put("uuid", uuid)
}
FacebookSdk.sdkInitialize(applicationContext)
FacebookSdk.sdkInitialize(applicationContext)
// FacebookSdk.setIsDebugEnabled(true)
// FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS)
val topic = ConfigHelper.packageName + "_push"
FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic)
LogEx.logDebug(TAG, "topic=${topic}")
ScreenStatusReceiver.setupScreenStatusListener(this)
InstallHelps.init()
BlackUtils.requestBlack()
initLifeListener()
// startJob()
val topic = ConfigHelper.packageName + "_push"
FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic)
LogEx.logDebug(TAG, "topic=${topic}")
ScreenStatusReceiver.setupScreenStatusListener(this)
InstallHelps.init()
BlackUtils.requestBlack()
initLifeListener()
WeatherUtils.requestWeatherData()
// startJob()
if (ifAgreePrivacy) {
......@@ -109,7 +111,8 @@ class MyApplication : BaseApplication() {
}
}
fun startWorkManager(){
fun startWorkManager() {
// WorkManager.getInstance(this).cancelAllWorkByTag("ScannerWorker")
WorkManager.getInstance(this).enqueueUniquePeriodicWork(
"ScannerWorker",
......@@ -139,7 +142,7 @@ class MyApplication : BaseApplication() {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
private var count = 0
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
ActivityManagerUtils.getInstance().addActivity(activity)
ActivityManagerUtils.addActivity(activity)
}
override fun onActivityStarted(activity: Activity) {
......@@ -148,7 +151,7 @@ class MyApplication : BaseApplication() {
lastTimeResume = System.currentTimeMillis()
if (count == 1 && isHotLaunch()) {
val topActivity: Activity? = ActivityManagerUtils.getInstance().topActivity
val topActivity: Activity? = ActivityManagerUtils.topActivity
var flag = if (topActivity == null) {
true
......@@ -209,11 +212,12 @@ class MyApplication : BaseApplication() {
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {
ActivityManagerUtils.getInstance().removeActivity(activity)
ActivityManagerUtils.removeActivity(activity)
}
})
}
private fun solarInit(){
private fun solarInit() {
SolarEngineManager.getInstance().preInit(context, "f6b7345fd1edd658")
val config = SolarEngineConfig.Builder()
// .logEnabled() //开启本地调试日志
......@@ -242,7 +246,8 @@ class MyApplication : BaseApplication() {
}
}
fun startAlarm(){
fun startAlarm() {
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
......@@ -261,7 +266,8 @@ class MyApplication : BaseApplication() {
pendingIntent
)
}
fun start48Alarm(){
fun start48Alarm() {
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
this, 2,
......@@ -275,11 +281,12 @@ class MyApplication : BaseApplication() {
alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP,
calendar.timeInMillis,
1800000*2*48,
1800000 * 2 * 48,
pendingIntent
)
}
fun start72Alarm(){
fun start72Alarm() {
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
this, 3,
......@@ -293,7 +300,7 @@ class MyApplication : BaseApplication() {
alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP,
calendar.timeInMillis,
1800000*2*72,
1800000 * 2 * 72,
pendingIntent
)
}
......
......@@ -68,10 +68,12 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
Uri.parse(ConfigHelper.privacyPolicy)
)
startActivity(intent)
// NotificationUtil.sendNotification(this, actionId = ID_WEATHER,"weather")
}
binding.llScore.setOnClickListener {
showRateStarPopDialog(mustShow = true)
// NotificationUtil.sendNotification(this, actionId = ID_XINGZUO,"xingzuo")
}
// binding.idToken.text= AppPreferences.getInstance().getString("token","")
// binding.idCopy.setOnClickListener {
......
......@@ -40,7 +40,7 @@ class AppManagerActivity : BaseActivity<ActivityAppManagerBinding>() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
val ramPair = ramPair()
val percent = ((ramPair.first.toFloat() / ramPair.second.toFloat()) * 100).toInt()
ePercent = percent
......
......@@ -22,6 +22,7 @@ class AppManagerAnimationActivity : BaseActivity<ActivityAppProcessAnimationBind
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
playLottie()
}
......
......@@ -22,7 +22,6 @@ import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.RamUtils.ramPair
import com.base.datarecovery.view.DialogViews.showAppProcessExitDialog
import com.base.datarecovery.view.DialogViews.showExitFunctionDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
......@@ -42,7 +41,7 @@ class AppProcessActivity : BaseActivity<ActivityAppProcessBinding>() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
val ramPair = ramPair()
val percent = ((ramPair.first.toFloat() / ramPair.second.toFloat()) * 100).toInt()
ePercent = percent
......
......@@ -24,6 +24,7 @@ class AppProcessAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
override fun initView() {
playLottie()
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
override fun initListener() {
......
......@@ -24,6 +24,7 @@ class BatteryInfoAnimationActivity : BaseActivity<ActivityBatteryInfoAnimationBi
override fun initView() {
resumeLottie()
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
override fun initListener() {
......
......@@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityGuideBinding
import com.base.datarecovery.fragment.GuideFragment
import com.base.datarecovery.help.BaseActivity
......@@ -38,7 +39,7 @@ class GuideActivity : BaseActivity<ActivityGuideBinding>() {
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
binding.viewpager2.run {
adapter = object : FragmentStateAdapter(this@GuideActivity) {
override fun getItemCount(): Int {
......
......@@ -136,6 +136,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
startActivity(
Intent(this, CleaningActivity::class.java).apply {
val list = junkExpandAdapter.getChoosePath()
putExtra("type",JUNK_CLEANER)
putExtra("list", list.map { it.chilepath }.toTypedArray())
putExtra("size", list.sumOf { it.childSize })
}
......@@ -146,6 +147,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
startActivity(
Intent(this, CleaningActivity::class.java).apply {
val list = junkExpandAdapter.getChoosePath()
putExtra("type",JUNK_CLEANER)
putExtra("list", list.map { it.chilepath }.toTypedArray())
putExtra("size", list.sumOf { it.childSize })
}
......
......@@ -10,8 +10,6 @@ import androidx.core.animation.doOnEnd
import androidx.core.view.updatePadding
import com.base.datarecovery.activity.ResultActivity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.bean.ConstObject.JUNK_CLEANER
import com.base.datarecovery.databinding.ActivityLayoutCleanupingBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils
......@@ -36,11 +34,14 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
private val listPath by lazy {
intent.getStringArrayExtra("list") ?: arrayOf()
}
private val type by lazy {
intent.getStringExtra("type") ?: ""
}
override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
MainScope().launch(Dispatchers.IO) {
try {
listPath.forEach {
......@@ -82,7 +83,8 @@ class CleaningActivity : BaseActivity<ActivityLayoutCleanupingBinding>() {
doOnEnd {
AdmobMaxHelper.admobMaxShowInterstitialAd(this@CleaningActivity,false) {
startActivity(
Intent(this@CleaningActivity, ResultActivity::class.java).putExtra("from", JUNK_CLEANER)
Intent(this@CleaningActivity, ResultActivity::class.java)
.putExtra("from", type)
.putExtra("clean_size", intentSize)
)
finish()
......
......@@ -13,11 +13,8 @@ import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityLayoutScanJunkBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.PermissionHelp.checkStorePermission
import com.base.datarecovery.help.PermissionHelp.requestStorePermission
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.LogEx
import com.base.datarecovery.view.DialogViews.showGerPermission
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
......@@ -35,6 +32,7 @@ class ScanJunk2Activity : BaseActivity<ActivityLayoutScanJunkBinding>() {
LogEx.logDebug(TAG,"ScanJunkActivity initView")
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
......
......@@ -10,6 +10,7 @@ import android.widget.Toast
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.AdmobMaxHelper.admobMaxShowInterstitialAd
import com.base.datarecovery.databinding.ActivityLayoutScanJunkBinding
import com.base.datarecovery.help.BaseActivity
......@@ -38,7 +39,7 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
LogEx.logDebug(TAG,"ScanJunkActivity initView")
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
if (!checkStorePermission()) {
showGerPermission(tittle = "Storage Permission Required",
desc = "This feature requires access to your storage to scan your files and clean up junk files and unused APK files. We will not transmit your data to any third-party service. Please grant permission so that we can provide you with better service.",
......
......@@ -5,7 +5,7 @@ import android.content.Intent
import androidx.activity.addCallback
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.activity.ResultActivity
import com.base.datarecovery.activity.junkclean.CleaningActivity
import com.base.datarecovery.adapter.LargeFileAdapter
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ConstObject
......@@ -27,9 +27,7 @@ import com.base.datarecovery.view.DialogViews.showExitFunctionDialog
import com.base.datarecovery.view.DialogViews.showGerPermission
import com.base.datarecovery.view.DialogViews.showLargeFileTypeDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.io.File
class LargeFileActivity : BaseActivity<ActivityLargeFileBinding>() {
......@@ -45,6 +43,7 @@ class LargeFileActivity : BaseActivity<ActivityLargeFileBinding>() {
@SuppressLint("SetTextI18n")
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
largeFileAdapter = LargeFileAdapter(itemClick = {}, selectClick = {
if (it.isNotEmpty()) {
binding.tvDelete.isEnabled = true
......@@ -139,22 +138,27 @@ class LargeFileActivity : BaseActivity<ActivityLargeFileBinding>() {
return false
}
private fun deleteFiles() = lifecycleScope.launch(Dispatchers.IO) {
private fun deleteFiles() {
val list = largeFileAdapter.getSelectData()
runCatching {
list.forEach { bean ->
File(bean.path).delete()
// runCatching {
// list.forEach { bean ->
// File(bean.path).delete()
// }
// }
// launch(Dispatchers.Main) {
// largeFileAdapter.removeData(list)
// delay(1000)
// startActivity(Intent(this@LargeFileActivity, ResultActivity::class.java).apply {
// putExtra("from", ConstObject.LARGE_FILE)
// })
// finish()
// }
startActivity(Intent(this, CleaningActivity::class.java).apply {
putExtra("list",list.map { it.path }.toTypedArray())
putExtra("type", ConstObject.LARGE_FILE)
}
}
launch(Dispatchers.Main) {
largeFileAdapter.removeData(list)
delay(1000)
startActivity(Intent(this@LargeFileActivity, ResultActivity::class.java).apply {
putExtra("from", ConstObject.LARGE_FILE)
})
finish()
}
)
finish()
}
private fun initData() = lifecycleScope.launch(Dispatchers.IO) {
......
package com.base.datarecovery.activity.largefile
import android.annotation.SuppressLint
import android.content.Intent
import android.view.View
import android.widget.Toast
......@@ -23,6 +22,7 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
override fun initListener() {
......
package com.base.datarecovery.activity.newfunction
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import android.widget.TextView
import androidx.activity.OnBackPressedCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.recyclerview.widget.RecyclerView
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ListBean
import com.base.datarecovery.bean.WeatherBean
import com.base.datarecovery.databinding.ActivityWeatherBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils
import kotlin.random.Random
@SuppressLint("SimpleDateFormat")
class WeatherInterface : BaseActivity<ActivityWeatherBinding>() {
override val binding: ActivityWeatherBinding by lazy {
ActivityWeatherBinding.inflate(layoutInflater)
}
var wBean: WeatherBean? = null
override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.idBack.updatePadding(top = BarUtils.getStatusBarHeight())
getData()
AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlNative,1)
AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd,1)
}
override fun initListener() {
binding.idBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
AdmobMaxHelper.admobMaxShowInterstitialAd(this@WeatherInterface){
finishToMain()
}
}
})
}
private fun getData() {
wBean = WeatherUtils.getWeatherEntity()
if (wBean != null) {
setViews()
} else {
WeatherUtils.requestWeatherData()
}
binding.root.postDelayed({
AdmobMaxHelper.admobMaxShowInterstitialAd(this@WeatherInterface){
binding.idFlLoading.isVisible = false
}
}, Random.nextLong(2000, 4000))
ValueAnimator.ofFloat(0f, 360f).apply {
duration = 1100
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener { binding.idZhuan.rotation = it.animatedValue as Float }
start()
}
}
@SuppressLint("SetTextI18n")
private var wertherList = mutableListOf<ListBean>()
@SuppressLint("SetTextI18n")
private fun setViews() {
binding.idTvCity.text = wBean?.city
binding.idTvDate.text = wBean?.list?.get(0)?.fxDate
binding.idTvTmp.text = "${wBean?.list?.get(0)?.tempMax}°"
binding.idTvHumidity.text = "${wBean?.list?.get(0)?.humidity}%"
binding.idTvWind.text = "${wBean?.list?.get(0)?.windScaleDay}"
binding.idTvPressure.text = "${wBean?.list?.get(0)?.pressure}hPa"
when ((wBean?.list?.get(0)?.iconDay)?.toInt()?.let { WeatherUtils.getWeatherType(it) }) {
"Sunny day" -> {
binding.idImgW.setImageResource(R.mipmap.d_qing)
}
"Cloudy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_yin)
}
"Rainy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_dayu)
}
"Snowy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_xiaxue)
}
"Greasy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_wumaishachengbao)
}
"Unknown" -> {
binding.idImgW.setImageResource(R.mipmap.d_qing)
}
}
wertherList.clear()
wBean?.list?.let { wertherList.addAll(it) }
binding.idRlWeather.run {
adapter = object : RecyclerView.Adapter<ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(this@WeatherInterface)
.inflate(R.layout.item_layout_wheather, parent, false)
return ViewHolder(view)
}
override fun getItemCount(): Int {
return wertherList.size
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = wertherList[position]
when (WeatherUtils.getWeatherType(item.iconDay.toInt())) {
"Sunny day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_qing)
}
"Cloudy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_yin)
}
"Rainy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_dayu)
}
"Snowy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_xiaxue)
}
"Greasy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_wumaishachengbao)
}
"Unknown" -> {
holder.ivIcon.setImageResource(R.mipmap.x_qing)
}
}
holder.tvTime.text = item.fxDate
holder.tvMaxTmp.text = "${item.tempMax}°/"
holder.tvMinTmp.text = "${item.tempMin}°"
}
}
}
}
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val ivIcon: ImageView
val tvTime: TextView
val tvMaxTmp: TextView
val tvMinTmp: TextView
init {
ivIcon = view.findViewById(R.id.id_img_icon)
tvTime = view.findViewById(R.id.id_tv_time)
tvMaxTmp = view.findViewById(R.id.id_tv_max_tmp)
tvMinTmp = view.findViewById(R.id.id_tv_min_tmp)
}
}
}
package com.base.datarecovery.activity.newfunction
import android.text.TextUtils
import com.base.datarecovery.BuildConfig
import com.base.datarecovery.bean.WeatherBean
import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.utils.AESHelper
import com.base.datarecovery.utils.AppPreferences
import com.google.gson.Gson
import okhttp3.Call
import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.concurrent.TimeUnit
object WeatherUtils {
private val TAG = "WeatherUtils"
fun getWeatherType(param: Int): String {
val sunny_day: IntArray = intArrayOf(100, 101, 102, 103, 150, 151, 152, 153)
val cloudy_day: IntArray = intArrayOf(104)
val rainy_day: IntArray =
intArrayOf(300, 301, 302, 303, 304, 305, 306, 307, 307, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 350, 351, 399)
val snowy_day: IntArray = intArrayOf(400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 456, 457, 499)
val greasy_day: IntArray = intArrayOf(500, 501, 502, 503, 504, 505, 507, 508, 509, 510, 511, 512, 513, 514, 515)
when (param) {
in sunny_day -> return "Sunny day"
in cloudy_day -> return "Cloudy day"
in rainy_day -> return "Rainy day"
in snowy_day -> return "Snowy day"
in greasy_day -> return "Greasy day"
else -> return "Unknown"
}
}
fun hasWeatherDataToday(): Boolean {
return !TextUtils.isEmpty(getWeatherJsonStr())
}
fun getWeatherJsonStr(): String {
val data = AppPreferences.getInstance().getString(getTodayStr() + "_weather", "")
return data
}
fun getWeatherEntity(): WeatherBean? {
val str = getWeatherJsonStr()
// LogEx.logDebug(TAG, "getWeatherEntity str=$str")
if (TextUtils.isEmpty(str)) {
} else {
try {
val gson = Gson()
val wBean = gson.fromJson(str, WeatherBean::class.java)
return wBean
} catch (e: Exception) {
e.printStackTrace()
}
}
return null
}
private val url by lazy {
val pkg = ConfigHelper.packageName
val url = StringBuilder(
"${ConfigHelper.apiUrl}/city/${
pkg.filter { it.isLowerCase() }.substring(4, 9)
}tq"
)
url.append("?pkg=$pkg")
val sdf = SimpleDateFormat("yyyyMMdd")
url.append("&date=${sdf.format(Calendar.getInstance().time)}")
url.toString()
}
fun requestWeatherData() {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
})
}
}.build()
val request = Request.Builder()
.url(url)
.get()
.build()
// LogEx.logDebug(TAG, "url=$url")
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
}
override fun onResponse(call: Call, response: Response) {
response.body?.string()?.let {
val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") {
i?.groupValues?.get(1).let { data ->
// LogEx.logDebug(TAG, "data=$data")
if (!TextUtils.isEmpty(data)) {
val str = AESHelper.decrypt(data ?: "")
saveWeatherData(str)
}
}
}
}
}
})
}
/**
* 同步
*/
fun getWeatherData() = runCatching {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
})
}
}.connectTimeout(1, TimeUnit.SECONDS)
.readTimeout(1, TimeUnit.SECONDS)
.writeTimeout(1, TimeUnit.SECONDS)
.build()
val request = Request.Builder()
.url(url)
.get()
.build()
val response = client.newCall(request).execute()
response.body?.string()?.let {
val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") {
i?.groupValues?.get(1).let {
if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!)
saveWeatherData(str)
}
}
}
}
}
private fun saveWeatherData(string: String) {
AppPreferences.getInstance().put(getTodayStr() + "_weather", string)
}
private fun getTodayStr(): String {
val calendar = Calendar.getInstance()
val year = calendar[Calendar.YEAR]
val month = calendar[Calendar.MONTH] + 1
val day = calendar[Calendar.DAY_OF_MONTH]
val today =
year.toString() + "-" + String.format("%02d", month) + "-" + String.format("%02d", day)
return today;
}
}
\ No newline at end of file
package com.base.datarecovery.activity.newfunction
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import android.net.http.SslError
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.addCallback
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityWebBrowserBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
override val binding: ActivityWebBrowserBinding by lazy {
ActivityWebBrowserBinding.inflate(layoutInflater)
}
override fun initView() {
BarUtils.setStatusBarLightMode(this,true)
initWebSettings()
binding.webView.loadUrl("https://www.horoscope.com/us/index.aspx")
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.flNative,1)
}
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 {
AdmobMaxHelper.admobMaxShowInterstitialAd(this@WebBrowserActivity) {
finishToMain()
}
}
}
@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
package com.base.datarecovery.activity.newfunction
import android.content.Context
import android.util.AttributeSet
import android.webkit.WebView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
/**
*Create by SleepDog on 2025-01-21
*/
class WebRefreshView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : WebView(context, attrs) {
var swipeRefreshLayout: SwipeRefreshLayout? = null
override fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) {
super.onScrollChanged(l, t, oldl, oldt)
swipeRefreshLayout?.isEnabled = scrollY == 0
}
}
\ No newline at end of file
package com.base.datarecovery.activity.newfunction
import android.animation.ValueAnimator
import android.content.Intent
import android.graphics.Color
import android.view.animation.LinearInterpolator
import android.widget.Toast
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityLayoutXingzuoLoadingBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlin.random.Random
class XingzuoLoadingActivity : BaseActivity<ActivityLayoutXingzuoLoadingBinding>() {
override val binding: ActivityLayoutXingzuoLoadingBinding by lazy {
ActivityLayoutXingzuoLoadingBinding.inflate(layoutInflater)
}
override fun initView() {
BarUtils.setStatusBarLightMode(this,false)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
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 {
Toast.makeText(this@XingzuoLoadingActivity, "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({
animaEnd()
}, Random.nextLong(3000, 5000))
}
}
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()
}
}
}
}
......@@ -7,7 +7,9 @@ import androidx.activity.addCallback
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.activity.repeat.RepeatActivity
import com.base.datarecovery.activity.repeat.RepeatAnimationActivity
import com.base.datarecovery.activity.screenshot.ScreenShotActivity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityPhotoManagerBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.FileHelp.getDirFiles
......@@ -31,7 +33,7 @@ class PhotoManagerActivity : BaseActivity<ActivityPhotoManagerBinding>() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.WHITE)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
val tittle = intent.extras?.getString("tittle")
tittle?.let { binding.tvTittle.text = it }
......@@ -63,7 +65,7 @@ class PhotoManagerActivity : BaseActivity<ActivityPhotoManagerBinding>() {
startActivity(Intent(this@PhotoManagerActivity, ScreenShotActivity::class.java))
}
binding.cardRepeatPhotos.setOnClickListener {
startActivity(Intent(this@PhotoManagerActivity, RepeatActivity::class.java))
startActivity(Intent(this@PhotoManagerActivity, RepeatAnimationActivity::class.java))
}
}
......
......@@ -23,7 +23,7 @@ class PhotoManagerAnimationActivity : BaseActivity<ActivityScreenShotAnimationBi
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
private fun jumpJob() = lifecycleScope.launch(Dispatchers.Main) {
......
......@@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ConstObject.privacyPinPassword
import com.base.datarecovery.databinding.ActivityPrivacyPinOneBinding
import com.base.datarecovery.help.BaseActivity
......@@ -34,7 +35,7 @@ class PrivacyPinOneActivity : BaseActivity<ActivityPrivacyPinOneBinding>() {
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
@RequiresApi(Build.VERSION_CODES.O)
......
......@@ -9,6 +9,7 @@ import androidx.core.content.ContextCompat
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ConstObject.privacyPinPassword
import com.base.datarecovery.databinding.ActivityPrivacyPinTwoBinding
import com.base.datarecovery.help.BaseActivity
......@@ -35,6 +36,7 @@ class PrivacyPinTwoActivity : BaseActivity<ActivityPrivacyPinTwoBinding>() {
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
firstInput = intent.extras?.getString("FirstInput") ?: "null"
LogEx.logDebug(TAG, "firstInput=$firstInput")
}
......
......@@ -9,13 +9,11 @@ import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.bean.ConstObject.privacyPinPassword
import com.base.datarecovery.databinding.ActivityPrivacySpaceBinding
import com.base.datarecovery.fragment.PrivacyPageFragment
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.view.DialogViews.showExitFunctionDialog
/**
* 隐私空间
......@@ -75,11 +73,11 @@ class PrivacySpaceActivity : BaseActivity<ActivityPrivacySpaceBinding>() {
}
override fun initListener() {
super.initListener()
binding.tvGoOrSetting.setOnClickListener {
if (privacyPinPassword.isEmpty()) {
startActivity(Intent(this, PrivacyPinOneActivity::class.java))
finish()
} else {
binding.llTip.visibility = View.GONE
}
......
......@@ -2,7 +2,6 @@ package com.base.datarecovery.activity.recovery
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Environment
import android.view.View
import androidx.activity.addCallback
......@@ -51,11 +50,11 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
@SuppressLint("SetTextI18n")
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
//BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
scanType = intent.extras?.getInt("ScanType") ?: 0
LogEx.logDebug(TAG, "scanType=$scanType")
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
when (scanType) {
SCAN_PHOTOS -> {
binding.tvTittle.text = "Photo Recovery"
......
......@@ -7,8 +7,9 @@ import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityRepeatAnimationBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.SimarPhotoUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -21,7 +22,7 @@ class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlNative, 1)
}
override fun initListener() {
......@@ -30,26 +31,56 @@ class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {
}
}
fun jumpJob() = lifecycleScope.launch {
delay(Random.nextLong(3000, 4500))
AdmobMaxHelper.admobMaxShowInterstitialAd(this@RepeatAnimationActivity) {
startActivity(Intent(this@RepeatAnimationActivity, RepeatActivity::class.java))
finish()
}
// fun jumpJob() = lifecycleScope.launch {
// delay(Random.nextLong(3000, 4500))
// AdmobMaxHelper.admobMaxShowInterstitialAd(this@RepeatAnimationActivity) {
// startActivity(Intent(this@RepeatAnimationActivity, RepeatActivity::class.java))
// finish()
// }
// }
//
// override fun onResume() {
// super.onResume()
// if (job?.isActive == false || job == null) {
// job = jumpJob()
// }
// }
//
// override fun onPause() {
// super.onPause()
// job?.cancel()
// job = null
// }
private var isPasue = false
override fun onPause() {
super.onPause()
isPasue = false
}
override fun onResume() {
super.onResume()
if (job?.isActive == false || job == null) {
job = jumpJob()
}
isPasue = true
playAnimal()
}
private fun playAnimal() {
lifecycleScope.launch(Dispatchers.Main) {
binding.root.postDelayed({
SimarPhotoUtils.getImageFiles {
animaEnd()
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}, Random.nextLong(500, 1000))
}
}
private fun animaEnd(){
if (isPasue) {
AdmobMaxHelper.admobMaxShowInterstitialAd(this){
startActivity(Intent(this, SimilarPicAt::class.java))
finish()
}
}
}
}
\ No newline at end of file
package com.base.datarecovery.activity.repeat
import android.annotation.SuppressLint
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ImageInfoBean
import com.base.datarecovery.databinding.ActivityDuplicateImageBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.help.PermissionHelp.checkStorePermission
import com.base.datarecovery.help.PermissionHelp.requestStorePermission
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.MediaStoreUtils
import com.base.datarecovery.utils.NewFileUtils
import com.base.datarecovery.utils.SimarPhotoUtils
import com.base.datarecovery.view.DialogViews.showDeletePermanentlyDialog
import com.base.datarecovery.view.DialogViews.showExitFunctionDialog
import com.base.datarecovery.view.DialogViews.showGerPermission
import com.bumptech.glide.Glide
class SimilarPicAt : BaseActivity<ActivityDuplicateImageBinding>() {
private var isSelectAll = false
override val binding: ActivityDuplicateImageBinding by lazy {
ActivityDuplicateImageBinding.inflate(layoutInflater)
}
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
if (checkStorePermission()) {
initData()
} else {
showGerPermission("Storage Permission Required",
"This feature requires access to your storage to scan your files and clean up repeat photos. We will not transmit your data to any third-party service. Please grant permission so that we can provide you with better service.",
deny = { finishToMain() },
allow = {
requestStorePermission(launcher, result = {
if (it) {
initData()
} else {
finishToMain()
}
})
})
}
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
binding.idTvDelete.isEnabled = false
}
private fun initData(){
binding.idLlResult.isVisible = true
fileList = SimarPhotoUtils.similarImageList
binding.idTvNoData.isVisible = fileList.size == 0
binding.idTvDelete.isVisible = fileList.size > 0
binding.idTvAll.isVisible = fileList.size > 0
binding.idImgSelect.isVisible = fileList.size > 0
initAdapter()
if (fileList.size > 6) {
AdmobMaxHelper.admobMaxShowNativeAd(this, binding.flAd, 1)
}
}
@SuppressLint("NotifyDataSetChanged")
override fun initListener() {
binding.idBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
showExitFunctionDialog {
if (it) {
AdmobMaxHelper.admobMaxShowInterstitialAd(this@SimilarPicAt, false) {
finishToMain()
}
} else {
finishToMain()
}
}
}
})
binding.idImgSelect.setOnClickListener {
if (isSelectAll) {
isSelectAll = false
binding.idTvAll.text = "All"
binding.idImgSelect.setImageResource(R.mipmap.weixuan)
} else {
isSelectAll = true
binding.idTvAll.text = "Cancel"
binding.idImgSelect.setImageResource(R.mipmap.xuanzhong)
}
fileList.forEach { it.isSelect = isSelectAll }
// mAdapter.notifyItemRangeChanged(0, fileList.size, 1)
binding.idRlList.adapter?.notifyItemRangeChanged(0, fileList.size, 1)
setTvStatus()
}
binding.idTvDelete.setOnClickListener {
showDeletePermanentlyDialog {
AdmobMaxHelper.admobMaxShowInterstitialAd(this, false) {
cleanFile()
}
}
}
}
private fun cleanFile() {
val list = fileList.toList().filter { it.isSelect }
if (list.isNotEmpty() && list.all { NewFileUtils.delete(it.path) }) {
fileList.removeAll(list)
SimarPhotoUtils.similarImageList.removeAll(list)
// mAdapter.notifyDataSetChanged()
binding.idRlList.adapter?.notifyDataSetChanged()
setTvStatus()
Toast.makeText(this, "Delete Successful", Toast.LENGTH_SHORT).show()
val array = list.map { it.path }.toTypedArray()
MediaStoreUtils.updateMediaStore(this, array)
} else {
Toast.makeText(this, "Delete failed.", Toast.LENGTH_SHORT).show()
}
}
private var fileList = mutableListOf<ImageInfoBean>()
private fun initAdapter() {
binding.idRlList.run {
layoutManager = GridLayoutManager(this@SimilarPicAt, 3)
adapter = object : RecyclerView.Adapter<mViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): mViewHolder {
val view = LayoutInflater.from(context)
.inflate(R.layout.item_layout_repeater_photo, parent, false)
return mViewHolder(view)
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: mViewHolder, position: Int) {
val item = fileList[position]
Glide.with(BaseApplication.context).load(item.path).into(holder.ivImage)
holder.ivSelect.isVisible = true
holder.itemView.setOnClickListener {
item.isSelect = !item.isSelect
notifyItemChanged(position, 1)
if (fileList.all { it.isSelect }) {
isSelectAll = true
binding.idTvAll.text = "Cancel"
binding.idImgSelect.setImageResource(R.mipmap.xuanzhong)
} else {
isSelectAll = false
binding.idTvAll.text = "All"
binding.idImgSelect.setImageResource(R.mipmap.weixuan)
}
setTvStatus()
}
}
override fun onBindViewHolder(
holder: mViewHolder,
position: Int,
payloads: MutableList<Any>
) {
super.onBindViewHolder(holder, position, payloads)
val item = fileList[position]
holder.ivSelect.setImageResource(
if (item.isSelect) {
R.mipmap.xuanzhong
} else {
R.mipmap.weixuan
}
)
}
override fun getItemCount() = fileList.size
}
}
}
private fun setTvStatus() {
val it = fileList.filter { it.isSelect }
binding.idTvDelete.isEnabled = it.isNotEmpty()
}
class mViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val ivImage: ImageView
val ivSelect: ImageView
init {
ivImage = view.findViewById(R.id.iv_image)
ivSelect = view.findViewById(R.id.id_img_sel)
}
}
}
\ No newline at end of file
......@@ -3,13 +3,13 @@ package com.base.datarecovery.activity.screenshot
import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Environment
import android.util.Log
import androidx.activity.addCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.adapter.ScreenShotAdapter
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.AdmobMaxHelper.showDeleteAdSp
import com.base.datarecovery.bean.ScreenPhotoBean
import com.base.datarecovery.bean.ScreenshotBean
import com.base.datarecovery.databinding.ActivityScreenShotBinding
......@@ -29,7 +29,6 @@ import kotlinx.coroutines.launch
import java.io.File
import java.text.SimpleDateFormat
import java.util.Locale
import kotlin.collections.HashSet
class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
......@@ -122,13 +121,14 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.tvClean.setOnClickListener {
showDeletePermanentlyDialog {
if (showDeleteAdSp()) {
AdmobMaxHelper.admobMaxShowInterstitialAd(this, false) {
cleanFile()
}
} else {
AdmobMaxHelper.admobMaxShowInterstitialAd(this, false) {
cleanFile()
}
// if (showDeleteAdSp()) {
//
// } else {
// cleanFile()
// }
}
}
......@@ -136,6 +136,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
private fun cleanFile() {
val files = screenShotAdapter.getSelectData()
Log.e("MXL", "cleanFile: "+files.size )
lifecycleScope.launch(Dispatchers.IO) {
async {
files.forEach { screenFile ->
......@@ -152,6 +153,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
binding.tvSize.text = split[0]
binding.tvUnit.text = split[1]
setCleanUpUi(0)
}
}
}
......
......@@ -5,10 +5,8 @@ import android.widget.Toast
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.databinding.ActivityScreenShotAnimationBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.LogEx
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
......@@ -22,7 +20,7 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
}
fun jumpJob() = lifecycleScope.launch {
......
......@@ -9,6 +9,8 @@ import com.base.datarecovery.activity.appprocess.AppProcessAnimationActivity
import com.base.datarecovery.activity.battery.BatteryInfoAnimationActivity
import com.base.datarecovery.activity.guide.GuideActivity
import com.base.datarecovery.activity.junkclean.ScanJunkActivity
import com.base.datarecovery.activity.newfunction.WeatherInterface
import com.base.datarecovery.activity.newfunction.XingzuoLoadingActivity
import com.base.datarecovery.activity.photomanager.PhotoManagerAnimationActivity
import com.base.datarecovery.activity.recovery.FileScanResultActivity
import com.base.datarecovery.activity.whatsapp.WhatsAppCleanerAnimationActivity
......@@ -22,7 +24,9 @@ import com.base.datarecovery.bean.ConstObject.ID_RECOVERY_PHOTOS
import com.base.datarecovery.bean.ConstObject.ID_RECOVERY_VIDEOS
import com.base.datarecovery.bean.ConstObject.ID_SCREENSHOT_CLEAN
import com.base.datarecovery.bean.ConstObject.ID_SIMILAR_IMAGE
import com.base.datarecovery.bean.ConstObject.ID_WEATHER
import com.base.datarecovery.bean.ConstObject.ID_WHATSAPP_CLEANER
import com.base.datarecovery.bean.ConstObject.ID_XINGZUO
import com.base.datarecovery.bean.ConstObject.isGuide
object StartUtils {
......@@ -98,7 +102,12 @@ object StartUtils {
ID_BATTERY_INFO -> {
context.startActivity(Intent(context, BatteryInfoAnimationActivity::class.java))
}
ID_WEATHER->{
context.startActivity(Intent(context, WeatherInterface::class.java))
}
ID_XINGZUO->{
context.startActivity(Intent(context, XingzuoLoadingActivity::class.java))
}
//================================被动广播=========================================
......
......@@ -4,12 +4,12 @@ import android.content.Intent
import android.graphics.Color
import android.os.Environment
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.R
import com.base.datarecovery.activity.ResultActivity
import com.base.datarecovery.adapter.WhatsAppCleanerAdapter
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.bean.ConstObject.WHATSAPP_CLEANER
import com.base.datarecovery.bean.WhatsAppCleanerBean
import com.base.datarecovery.databinding.ActivityWhatsAppCleanerBinding
......@@ -20,7 +20,7 @@ import com.base.datarecovery.help.PermissionHelp.checkStorePermission
import com.base.datarecovery.help.PermissionHelp.requestStorePermission
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.utils.FileHexEx.isImage
import com.base.datarecovery.utils.FileHexEx.isVideo
import com.base.datarecovery.utils.FileHexEx.isWhatAppVideo
import com.base.datarecovery.utils.LogEx
import com.base.datarecovery.view.DialogViews.showExitFunctionDialog
import com.base.datarecovery.view.DialogViews.showGerPermission
......@@ -42,13 +42,14 @@ class WhatsAppCleanerActivity : BaseActivity<ActivityWhatsAppCleanerBinding>() {
override fun initView() {
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.idTop.updatePadding(top = BarUtils.getStatusBarHeight())
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
adapter = WhatsAppCleanerAdapter {
startActivity(Intent(this, WhatsAppMessageCleanActivity::class.java).apply {
putExtra("PathList", Gson().toJson(it.subFile.toTypedArray()))
putExtra("Tittle", it.tittle)
})
finish()
// finish()
}
binding.rv.adapter = adapter
......@@ -107,11 +108,10 @@ class WhatsAppCleanerActivity : BaseActivity<ActivityWhatsAppCleanerBinding>() {
list.add(WhatsAppCleanerBean(R.mipmap.audiomessages, "Audio Messages"))
var totalSize = 0L
whatsAppRoot.listFiles()?.forEach { file ->
if (file.name == "WhatsApp Video") {
LogEx.logDebug(TAG, "whatsapp file=${file.absolutePath}")
val bean = list.find { it.tittle == "Video Messages" }
val subFile = getDirFiles(file).filter { isVideo(it) }
val subFile = getDirFiles(file).filter { isWhatAppVideo(it) }
val size = subFile.sumOf { it.length() }
bean?.size = size
totalSize += size
......
......@@ -23,7 +23,9 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
private var job: Job? = null
override fun initView() {
AdmobMaxHelper.admobMaxShowNativeAd(this,binding.idFlNative,1)
playLottie()
}
override fun initListener() {
......
......@@ -5,7 +5,8 @@ import android.graphics.Color
import androidx.activity.addCallback
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.datarecovery.activity.ResultActivity
import com.base.datarecovery.activity.MainActivity
import com.base.datarecovery.activity.junkclean.CleaningActivity
import com.base.datarecovery.adapter.WhatsAppMediaAdapter
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.ads.admob.AdmobNativeUtils
......@@ -14,6 +15,7 @@ import com.base.datarecovery.bean.MediaBean
import com.base.datarecovery.databinding.ActivityWhatsAppMessageCleanBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.ActivityManagerUtils
import com.base.datarecovery.utils.BarUtils
import com.google.gson.Gson
import java.io.File
......@@ -86,13 +88,21 @@ class WhatsAppMessageCleanActivity : BaseActivity<ActivityWhatsAppMessageCleanBi
AdmobInterstitialUtils.showInterstitialAd(this) {
val list = adapter.getSelectData()
runCatching {
list.forEach { File(it).delete() }
}
startActivity(Intent(this@WhatsAppMessageCleanActivity, ResultActivity::class.java).apply {
putExtra("from", ConstObject.WHATSAPP_CLEANER)
})
finish()
ActivityManagerUtils.finishAll(MainActivity::class.java)
startActivity(
Intent(this, CleaningActivity::class.java).apply {
putExtra("list",list.toTypedArray())
putExtra("size", list.map { File(it) }.sumOf { it.length() })
putExtra("type", ConstObject.WHATSAPP_CLEANER)
}
)
// runCatching {
// list.forEach { File(it).delete() }
// }
// startActivity(Intent(this@WhatsAppMessageCleanActivity, ResultActivity::class.java).apply {
// putExtra("from", ConstObject.WHATSAPP_CLEANER)
// })
// finish()
}
}
}
......
......@@ -135,6 +135,7 @@ object AdmobEvent {
val mediationGroupName = extras.getString("mediation_group_name")
val mediationABTestName = extras.getString("mediation_ab_test_name")
val mediationABTestVariant = extras.getString("mediation_ab_test_variant")
obj.put("ad_unit", "openAd")
obj.put("adUnitId", adUnitId)
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
......@@ -158,6 +159,7 @@ object AdmobEvent {
val mediationGroupName = extras.getString("mediation_group_name")
val mediationABTestName = extras.getString("mediation_ab_test_name")
val mediationABTestVariant = extras.getString("mediation_ab_test_variant")
obj.put("ad_unit", "interAd")
obj.put("adUnitId", adUnitId)
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
......@@ -201,6 +203,7 @@ object AdmobEvent {
val mediationGroupName = extras?.getString("mediation_group_name")
val mediationABTestName = extras?.getString("mediation_ab_test_name")
val mediationABTestVariant = extras?.getString("mediation_ab_test_variant")
obj.put("ad_unit", "nativeAd")
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
obj.put("adSourceInstanceName", adSourceInstanceName)
......@@ -231,11 +234,7 @@ object AdmobEvent {
obj.put("session_id", responseInfo?.responseId)
obj.put("networkname", responseInfo?.mediationAdapterClassName)
obj.put("mediation", "admob")
if (adUnit != "nativeAd") {
EventUtils.event("ad_click", ext = obj)
} else {
EventUtils.event("bigimage_ad_click", ext = obj)
}
EventUtils.event("ad_click", ext = obj)
}
fun showAd(responseInfo: ResponseInfo?, adUnit: String, activity: Activity? = null) {
......@@ -253,10 +252,6 @@ object AdmobEvent {
obj.put("session_id", responseInfo?.responseId)
obj.put("from", activity?.javaClass?.simpleName)
obj.put("mediation", "admob")
if (adUnit != "nativeAd") {
EventUtils.event("ad_show", ext = obj)
} else {
EventUtils.event("bigimage_ad_show", ext = obj)
}
EventUtils.event("ad_show", ext = obj)
}
}
\ No newline at end of file
......@@ -35,10 +35,10 @@ object AdmobNativeUtils {
return
}
if (isLoading) {
return
}
isLoading = true
// if (isLoading) {
// return
// }
// isLoading = true
if (!AdDisplayUtils.getInstance().shouldShowAd("interAd")) {
return
}
......@@ -56,7 +56,7 @@ object AdmobNativeUtils {
nativeAd = it
LogEx.logDebug(TAG, "nativeAd=${nativeAd.toString()}")
isLoading = false
// isLoading = false
loadingListener?.invoke()
pullAd(it.responseInfo, "nativeAd", reqId = reqId)
it.setOnPaidEventListener(AdmobEvent.EventOnPaidEventListener(it))
......@@ -68,7 +68,7 @@ object AdmobNativeUtils {
override fun onAdFailedToLoad(p0: LoadAdError) {
LogEx.logDebug(TAG, "onAdFailedToLoad=${p0.message}")
nativeAd = null
isLoading = false
// isLoading = false
pullAd(p0.responseInfo, "nativeAd", p0.message, reqId = reqId)
// Log.e("MXL", "NativeAdFailedToLoad: " + p0.message)
}
......
......@@ -16,6 +16,8 @@ object ConstObject {
const val ID_APP_PROCESS = 13011
const val ID_APP_MANAGER = 12076
const val ID_BATTERY_INFO = 12086
const val ID_XINGZUO = 12087
const val ID_WEATHER = 12088
const val RECOVERY_PHOTOS = "Recovery Photos"
......
package com.base.datarecovery.bean
data class ImageInfoBean(
val path: String,
val hashCode: String = "",
val avgPixel: Int = 0,
var isSelect: Boolean = false
)
\ No newline at end of file
package com.base.datarecovery.bean
data class WeatherBean(val city: String, val list: List<ListBean>)
data class ListBean(
val tempMax: String,
val tempMin: String,
val humidity: String,
val fxDate: String,
val iconDay: String,
val windScaleDay: String,
val pressure: String,
val textDay: String,
val textNight: String,
)
......@@ -16,6 +16,7 @@ import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.base.datarecovery.R
import com.base.datarecovery.activity.SettingActivity
import com.base.datarecovery.activity.appmanager.AppManagerAnimationActivity
import com.base.datarecovery.activity.appprocess.AppProcessAnimationActivity
......@@ -23,12 +24,17 @@ import com.base.datarecovery.activity.battery.BatteryInfoAnimationActivity
import com.base.datarecovery.activity.junkclean.ScanJunk2Activity
import com.base.datarecovery.activity.junkclean.ScanJunkActivity
import com.base.datarecovery.activity.largefile.LargeFileAnimationActivity
import com.base.datarecovery.activity.newfunction.WeatherInterface
import com.base.datarecovery.activity.newfunction.WeatherUtils
import com.base.datarecovery.activity.newfunction.XingzuoLoadingActivity
import com.base.datarecovery.activity.whatsapp.WhatsAppCleanerAnimationActivity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.FragmentHomeBinding
import com.base.datarecovery.help.BaseFragment
import com.base.datarecovery.help.KotlinExt.toFormatSize
import com.base.datarecovery.utils.AppPreferences
import java.io.File
import kotlin.random.Random
class HomeFragment : BaseFragment<FragmentHomeBinding>() {
......@@ -39,6 +45,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override fun setView() {
AdmobMaxHelper.admobMaxShowNativeAd(requireActivity(), binding.idFlNative, 1)
animatorSet = createHeartbeatAnimation(binding.flScan)
showStorage()
}
......@@ -47,7 +54,8 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
private var lastClickTime = 0L
override fun setListener() {
binding.flScan.setOnClickListener {
val jumpJunkFirstAd = AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
val jumpJunkFirstAd =
AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
if (jumpJunkFirstAd == 1) {
startActivity(Intent(requireContext(), ScanJunk2Activity::class.java))
......@@ -58,7 +66,8 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
// sendNotification(requireContext(), ConstObject.ID_JUNK_CLEAN_PUSH)
}
binding.tvClean.setOnClickListener {
val jumpJunkFirstAd = AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
val jumpJunkFirstAd =
AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
if (jumpJunkFirstAd == 1) {
startActivity(Intent(requireContext(), ScanJunk2Activity::class.java))
......@@ -66,8 +75,10 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
}
}
binding.cardCleanJunk.setOnClickListener {
val jumpJunkFirstAd = AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
val jumpJunkFirstAd =
AppPreferences.getInstance().getString("isjunkPlayAd", "0").toInt()
if (jumpJunkFirstAd == 1) {
startActivity(Intent(requireContext(), ScanJunk2Activity::class.java))
......@@ -107,7 +118,12 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
i++
lastClickTime = System.currentTimeMillis()
}
binding.idXz.setOnClickListener {
startActivity(Intent(requireActivity(), XingzuoLoadingActivity::class.java))
}
binding.llWeather.setOnClickListener {
startActivity(Intent(requireActivity(), WeatherInterface::class.java))
}
}
private fun copyUuidGid() {
......@@ -158,6 +174,29 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override fun onResume() {
super.onResume()
animatorSet.resume()
val bean = WeatherUtils.getWeatherEntity()?.list?.get(0)
bean?.let {
var value = 22
val min = bean.tempMin.toInt()
val max = bean.tempMax.toInt()
if (min == max) {
value = max
}
if (min < max) {
value = Random.nextInt(min, max)
}
val icon = when (WeatherUtils.getWeatherType(bean.iconDay.toInt())) {
"Sunny day" -> R.mipmap.x_qing
"Cloudy day" -> R.mipmap.x_yin
"Rainy day" -> R.mipmap.x_dayu
"Snowy day" -> R.mipmap.x_xiaxue
"Greasy day" -> R.mipmap.x_wumaishachengbao
"Unknown" -> R.mipmap.x_qing
else -> R.mipmap.x_qing
}
binding.tvWendu.text = value.toString()
binding.ivWeather.setImageResource(icon)
}
}
@SuppressLint("SetTextI18n")
......@@ -165,13 +204,16 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
binding.llStorage.visibility = View.VISIBLE
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val storageStatsManager = requireContext().getSystemService(Context.STORAGE_STATS_SERVICE) as StorageStatsManager
val storageStatsManager =
requireContext().getSystemService(Context.STORAGE_STATS_SERVICE) as StorageStatsManager
Thread {
val totalBytes = storageStatsManager.getTotalBytes(StorageManager.UUID_DEFAULT)
val usedBytes = totalBytes - storageStatsManager.getFreeBytes(StorageManager.UUID_DEFAULT)
val usedBytes =
totalBytes - storageStatsManager.getFreeBytes(StorageManager.UUID_DEFAULT)
binding.root.post {
binding.tvStorage.text = "${usedBytes.toFormatSize()} / ${totalBytes.toFormatSize()}"
binding.tvStorage.text =
"${usedBytes.toFormatSize()} / ${totalBytes.toFormatSize()}"
}
}.start()
......@@ -181,7 +223,8 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
val path2: File = Environment.getExternalStorageDirectory()
val stat2 = StatFs(path2.path)
val totalSize = (stat1.totalBytes + stat2.totalBytes).toFormatSize()
val usedSize = ((stat1.totalBytes + stat2.totalBytes) - (stat1.availableBytes + stat2.availableBytes)).toFormatSize()
val usedSize =
((stat1.totalBytes + stat2.totalBytes) - (stat1.availableBytes + stat2.availableBytes)).toFormatSize()
binding.tvStorage.text = "$usedSize / $totalSize"
}
}
......
......@@ -22,7 +22,6 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
}
override fun setListener() {
super.setListener()
binding.flRyPhoto.setOnClickListener {
startActivity(Intent(requireContext(), FileScanResultActivity::class.java).apply {
putExtra("ScanType", ConstObject.SCAN_PHOTOS)
......@@ -44,12 +43,13 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
})
}
binding.cardPrivacySpace.setOnClickListener {
if (ConstObject.privacyPinPassword.isNotEmpty()) {
startActivity(Intent(requireContext(), PrivacyPinOneActivity::class.java))
} else {
startActivity(Intent(requireContext(), PrivacySpaceActivity::class.java).apply {
})
AdmobMaxHelper.admobMaxShowInterstitialAd(requireActivity()){
if (ConstObject.privacyPinPassword.isNotEmpty()) {
startActivity(Intent(requireContext(), PrivacyPinOneActivity::class.java))
} else {
startActivity(Intent(requireContext(), PrivacySpaceActivity::class.java).apply {
})
}
}
}
binding.cardPhotosManager.setOnClickListener {
......
......@@ -22,7 +22,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
setContentView(binding.root)
EventUtils.event("page_${javaClass.simpleName}")
ActivityManagerUtils.getInstance().addActivity(this)
ActivityManagerUtils.addActivity(this)
initView()
initListener()
}
......@@ -33,7 +33,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
fun finishToMain() {
if (this !is MainActivity && !ActivityManagerUtils.getInstance().isActivityInStack(MainActivity::class.java)) {
if (this !is MainActivity && !ActivityManagerUtils.isActivityInStack(MainActivity::class.java)) {
startActivity(Intent(this, MainActivity::class.java))
}
finish()
......@@ -42,7 +42,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
var dialog: Dialog? = null
override fun onDestroy() {
super.onDestroy()
ActivityManagerUtils.getInstance().removeActivity(this)
ActivityManagerUtils.removeActivity(this)
if (dialog != null) {
dialog?.dismiss()
dialog = null
......
package com.base.datarecovery.utils;
import android.app.Activity;
import java.util.Stack;
public class ActivityManagerUtils {
private static ActivityManagerUtils instance;
private Stack<Activity> activityStack = new Stack<>();
private ActivityManagerUtils() {
}
public static ActivityManagerUtils getInstance() {
if (instance == null) {
instance = new ActivityManagerUtils();
}
return instance;
}
/**
* 添加Activity到堆栈
*/
public void addActivity(Activity activity) {
activityStack.add(activity);
}
/**
* 移除Activity从堆栈
*/
public void removeActivity(Activity activity) {
activityStack.remove(activity);
}
/**
* 获取当前Activity(堆栈中最后一个压入的)
*/
public Activity getCurrentActivity() {
return activityStack.lastElement();
}
/**
* 结束指定的Activity
*/
public void finishActivity(Activity activity) {
if (activity != null) {
activityStack.remove(activity);
activity.finish();
}
}
/**
* 结束所有Activity
*/
public void finishAllActivity() {
for (Activity activity : activityStack) {
if (activity != null) {
activity.finish();
}
}
activityStack.clear();
}
/**
* 检查Activity是否存在于堆栈中
*/
public boolean isActivityInStack(Class<?> cls) {
boolean isExist = false;
if (cls != null) {
for (Activity activity : activityStack) {
if (cls.equals(activity.getClass())) {
isExist = true;
break;
}
}
}
return isExist;
}
public Activity getTopActivity() {
if (activityStack.empty()) {
return null;
} else {
return activityStack.peek();
}
}
}
\ No newline at end of file
package com.base.datarecovery.utils
import android.app.Activity
import java.util.Stack
object ActivityManagerUtils {
private val activityStack = Stack<Activity>()
/**
* 添加Activity到堆栈
*/
fun addActivity(activity: Activity) {
activityStack.add(activity)
}
/**
* 移除Activity从堆栈
*/
fun removeActivity(activity: Activity) {
activityStack.remove(activity)
}
val currentActivity: Activity
/**
* 获取当前Activity(堆栈中最后一个压入的)
*/
get() = activityStack.lastElement()
/**
* 结束指定的Activity
*/
fun finishActivity(activity: Activity?) {
if (activity != null) {
activityStack.remove(activity)
activity.finish()
}
}
/**
* 结束所有Activity
*/
fun finishAllActivity() {
for (activity in activityStack) {
activity?.finish()
}
activityStack.clear()
}
/**
* 检查Activity是否存在于堆栈中
*/
fun isActivityInStack(cls: Class<*>?): Boolean {
var isExist = false
if (cls != null) {
for (activity in activityStack) {
if (cls == activity.javaClass) {
isExist = true
break
}
}
}
return isExist
}
val topActivity: Activity?
get() = if (activityStack.empty()) {
null
} else {
activityStack.peek()
}
fun finishAll(excludeCls: Class<*>?) {
val iterator = activityStack.iterator()
while (iterator.hasNext()) {
val item = iterator.next()
if (excludeCls != item.javaClass) {
item.finish()
iterator.remove()
}
}
}
}
\ No newline at end of file
......@@ -88,7 +88,10 @@ object FileHexEx {
LogEx.logDebug(TAG, "flag=$flag hex=${hex} ${file.absolutePath}")
return flag
}
fun isWhatAppVideo(file: File): Boolean {
return file.name.endsWith(".mp4") || file.name.endsWith(".avi") || file.name.endsWith(".wmv")
// return isMp4(file) || isAvi(file) || isMkv(file)
}
fun isVideo(file: File): Boolean {
return isMp4(file) || isAvi(file) || isMkv(file)
}
......
package com.base.datarecovery.utils
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import android.media.ThumbnailUtils
import com.base.datarecovery.bean.ImageInfoBean
import com.base.datarecovery.help.BaseApplication
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlin.math.pow
object ImageHelper {
private val width by lazy {
ScreenUtils.getScreenWidth(BaseApplication.context).coerceAtMost(1024)
}
private val height by lazy {
ScreenUtils.getScreenHeight(BaseApplication.context).coerceAtMost(1280)
}
private fun loadBitmapFromFile(path: String): Bitmap? {
if (width <= 0 || height <= 0) {
return null
}
val options = BitmapFactory.Options()
options.inJustDecodeBounds = true
BitmapFactory.decodeFile(path, options)
if (options.outHeight == -1 || options.outWidth == -1) {
return null
}
var inSampleSize = (0.5f + options.outHeight.toFloat() / height.toFloat()).coerceAtLeast(0.5f + options.outWidth.toFloat() / width.toFloat()).toInt()
inSampleSize += 1
options.inSampleSize = inSampleSize.coerceAtLeast(1)
options.inJustDecodeBounds = false
return BitmapFactory.decodeFile(path, options)
}
suspend fun createImage(path: String): ImageInfoBean? {
return withContext(Dispatchers.IO) {
try {
val width = 8
val height = 8
val source = loadBitmapFromFile(path)
val thumb = ThumbnailUtils.extractThumbnail(source, width, height)
val pixels = IntArray(width * height)
for (i in 0 until width) {
for (j in 0 until height) {
pixels[i * height + j] = rgbToGray(thumb.getPixel(i, j))
}
}
val avgPixel = average(pixels)
val comps = IntArray(width * height)
for (i in comps.indices) {
if (pixels[i] >= avgPixel) {
comps[i] = 1
} else {
comps[i] = 0
}
}
val hashCode = StringBuffer()
var i = 0
while (i < comps.size) {
val result = comps[i] * 2.0.pow(3.0).toInt() + (comps[i + 1] * 2.0.pow(2.0).toInt()) + (comps[i + 2] * 2.0.pow(1.0).toInt()) + comps[i + 3]
hashCode.append(binaryToHex(result))
i += 4
}
recycleBitmap(thumb)
recycleBitmap(source)
return@withContext ImageInfoBean(path, hashCode.toString(), avgPixel)
} catch (_: Exception) {
return@withContext null
}
}
}
private fun rgbToGray(pixels: Int): Int {
val red = Color.red(pixels)
val green = Color.green(pixels)
val blue = Color.blue(pixels)
return (0.3 * red + 0.59 * green + 0.11 * blue).toInt()
}
private fun average(pixels: IntArray): Int {
return (pixels.sumOf { it }.toFloat() / pixels.size).toInt()
}
private fun recycleBitmap(thumb: Bitmap?) {
if (thumb?.isRecycled == false) {
thumb.recycle()
}
}
fun similarCondition(first: ImageInfoBean, second: ImageInfoBean): Boolean {
return hammingDistance(first.hashCode, second.hashCode) <= 6 && (first.avgPixel.toFloat() / second.avgPixel) in 0.8..1.2
}
private fun hammingDistance(sourceHashCode: String, hashCode: String): Int {
var difference = 0
for (i in sourceHashCode.indices) {
if (sourceHashCode[i] != hashCode[i]) {
difference++
}
}
return difference
}
private fun binaryToHex(binary: Int) = when (binary) {
0 -> '0'
1 -> '1'
2 -> '2'
3 -> '3'
4 -> '4'
5 -> '5'
6 -> '6'
7 -> '7'
8 -> '8'
9 -> '9'
10 -> 'a'
11 -> 'b'
12 -> 'c'
13 -> 'd'
14 -> 'e'
15 -> 'f'
else -> ' '
}
}
\ No newline at end of file
package com.base.datarecovery.utils;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;
public class ScreenUtils {
/**
* 获取屏幕宽度
*/
public static int getScreenWidth(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
return dm.widthPixels;
}
/**
* 获取屏幕高度
*/
public static int getScreenHeight(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
return dm.heightPixels;
}
}
\ No newline at end of file
package com.base.datarecovery.utils
import android.provider.MediaStore
import com.base.datarecovery.bean.ImageInfoBean
import com.base.datarecovery.help.BaseApplication
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
object SimarPhotoUtils {
val similarImageList = mutableListOf<ImageInfoBean>()
fun getImageFiles(callback: () -> Unit) {
MainScope().launch(Dispatchers.Main) {
try {
val imageList = mutableListOf<String>()
val query = BaseApplication.context.contentResolver.query(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
arrayOf(MediaStore.Files.FileColumns.DATA),
null,
null,
"${MediaStore.Files.FileColumns.DATE_MODIFIED} DESC"
) ?: return@launch
while (query.moveToNext()) {
imageList.add(query.getString(0))
}
query.close()
val imageDataList = mutableListOf<ImageInfoBean>()
imageDataList.addAll(imageList.mapNotNull { ImageHelper.createImage(it) })
imageDataList.sortBy { it.hashCode }
similarImageList.clear()
var index1 = 0
var index2 = 1
val similarItem = mutableListOf<ImageInfoBean>()
while (index2 < imageDataList.size) {
val first = imageDataList[index1]
val second = imageDataList[index2]
if (ImageHelper.similarCondition(first, second)) {
if (similarItem.indexOf(first) < 0) {
similarItem.add(first)
}
if (similarItem.indexOf(second) < 0) {
similarItem.add(second)
}
} else {
if (similarItem.size > 1) {
similarImageList.addAll(similarItem)
}
similarItem.clear()
}
index1++
index2++
}
if (similarItem.size > 1) {
similarImageList.addAll(similarItem)
}
}catch (_:Exception){
}
callback()
}
}
}
\ No newline at end of file
package com.base.datarecovery.utils
import com.base.datarecovery.activity.newfunction.WeatherUtils
import com.base.datarecovery.bean.ConstObject
object WeatherInfoStringManager {
private val functionCopyMap: HashMap<Int, ArrayList<String>> = hashMapOf()
private var currentIndexMap: HashMap<Int, Int> = hashMapOf()
private fun getCopyList(actionId: Int): ArrayList<String> {
if (functionCopyMap[actionId] == null) {
functionCopyMap[actionId] = arrayListOf()
}
val list = functionCopyMap[actionId] ?: arrayListOf()
when (actionId) {
ConstObject.ID_WEATHER ->{
val city = WeatherUtils.getWeatherEntity()?.city ?: ""
list.add("Sunny skies for many, but rain or snow for some over the next few days. How about ${city}? Tap to check!")
list.add("Sunshine for many, but rain or snow forecast for some in the next few days. What’s ${city}’s forecast? Tap to find out!")
list.add("Sunny days for many, but rain or snow for some in the next few days. What’s ${city} like? Tap to check!")
list.add("Sun for many, but rain or snow for some in the next few days. How about ${city}? Tap to discover!")
}
}
return list
}
fun getNextCopy(actionId: Int): String {
val currentIndex = currentIndexMap[actionId] ?: 0
val copyList = getCopyList(actionId)
val copy = copyList[currentIndex]
currentIndexMap[actionId] = (currentIndex + 1) % copyList.size
return copy
}
}
\ No newline at end of file
package com.base.datarecovery.utils;
import java.util.ArrayList;
import java.util.List;
public class XingzuoStringManager {
private static final List<String> xingzuolist = new ArrayList<>();
private static final List<String> titlelist = new ArrayList<>();
private static int currentCopyIndex = 0;
static {
// 初始化并添加文案到列表
titlelist.add("Unlock the Secrets of the Universe!");
titlelist.add("Discover Your Hidden Fortune!");
titlelist.add("Your Fate is Written in the Stars!");
titlelist.add("Unlock Your Future Today!");
xingzuolist.add("Your daily horoscope holds the answers you've been searching for. Click now to discover them!");
xingzuolist.add("Your horoscope is a gateway to new opportunities. Click now to unlock your destiny");
xingzuolist.add("Today's horoscope reveals secrets that could change everything. Click now to see what's in store for you!");
xingzuolist.add("Your daily horoscope is a treasure map to success and happiness. Don't miss out—click to find your path!");
}
public static String getNextDesc() {
if (xingzuolist.isEmpty()) {
return null; // 根据您的需要处理错误情况
}
String copy = xingzuolist.get(currentCopyIndex);
currentCopyIndex = (currentCopyIndex + 1) % xingzuolist.size();
return copy;
}
public static String getNextTitle() {
if (titlelist.isEmpty()) {
return null; // 根据您的需要处理错误情况
}
String copy = titlelist.get(currentCopyIndex);
currentCopyIndex = (currentCopyIndex + 1) % titlelist.size();
return copy;
}
}
......@@ -283,6 +283,7 @@ object DialogViews {
val params = dialog.window?.attributes
params?.width = resources.getDimensionPixelOffset(R.dimen.dp_345)
dialog.window?.attributes = params
AdmobMaxHelper.admobMaxShowNativeAd(this as Activity,binding.idFlNative,1)
binding.tvN.setOnClickListener {
dialog.dismiss()
exitAction.invoke(true)
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#26000000" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置背景色 -->
<item android:id="@android:id/background">
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent" />
</shape>
</item>
<!-- 设置进度条颜色 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/theme_color" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/theme_color"/>
<corners android:radius="70dp"/>
</shape>
\ No newline at end of file
......@@ -37,7 +37,10 @@
tools:ignore="HardcodedText" />
</FrameLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
......
......@@ -51,4 +51,10 @@
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -106,11 +106,17 @@
tools:ignore="HardcodedText" />
</FrameLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="25dp"
android:layout_marginTop="12dp"
android:text="Manager user apps"
android:textColor="#999999"
android:textSize="15sp"
......
......@@ -50,4 +50,10 @@
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -47,5 +47,9 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/id_ll_result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginBottom="10dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="15dp"
android:paddingEnd="7dp"
android:src="@mipmap/fanhui"
android:tint="@color/black" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Similar Photos"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="7dp"
android:text="All"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_img_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:src="@mipmap/weixuan"
android:visibility="gone" />
</androidx.appcompat.widget.LinearLayoutCompat>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rl_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_no_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="@mipmap/queshengye"
android:drawablePadding="10dp"
android:gravity="center"
android:text="No similar photos found"
android:textColor="#666666"
android:textSize="13sp"
android:visibility="gone"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
</FrameLayout>
<TextView
android:id="@+id/id_tv_delete"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginHorizontal="46dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:gravity="center"
android:text="Delete"
android:textColor="#999999"
android:textSize="16sp"
android:visibility="gone"
app:bl_corners_radius="18dp"
app:bl_enabled_solid_color="@color/theme_color"
app:bl_enabled_textColor="@color/white"
app:bl_unEnabled_solid_color="#BFBFBF"
app:bl_unEnabled_textColor="@color/white"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -9,10 +9,6 @@
android:orientation="vertical"
tools:context=".activity.recovery.FileScanResultActivity">
<View
android:layout_width="match_parent"
android:layout_height="40dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -45,9 +41,9 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="123dp"
android:layout_height="110dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginTop="8dp"
app:cardBackgroundColor="#F0F3FA"
app:cardCornerRadius="10dp"
app:cardElevation="0dp">
......@@ -126,7 +122,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginTop="4dp"
android:textColor="#768294"
android:textSize="14sp"
android:textStyle="bold"
......@@ -158,7 +154,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginTop="4dp"
android:text="Folders"
android:textColor="#768294"
android:textSize="14sp"
......@@ -172,10 +168,16 @@
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
android:layout_marginTop="8dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
......@@ -186,12 +188,12 @@
tools:listitem="@layout/item_folder_recovery" />
<LinearLayout
android:visibility="gone"
android:id="@+id/fl_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<ImageView
......
......@@ -10,7 +10,9 @@
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewpager2"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/id_fl_native"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
......@@ -60,5 +62,10 @@
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -60,7 +60,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="5dp"
android:padding="15dp">
android:paddingHorizontal="15dp"
android:paddingVertical="8dp">
<ImageView
android:layout_width="wrap_content"
......@@ -71,6 +72,11 @@
</FrameLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
......
......@@ -53,4 +53,10 @@
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
<androidx.appcompat.widget.LinearLayoutCompat 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">
<androidx.appcompat.widget.LinearLayoutCompat
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="169dp"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/id_bottomt_content"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="wrap_content"
android:layout_marginTop="140dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_yuan"
android:layout_width="229dp"
android:layout_height="229dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/qingliz" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_yuan"
android:layout_width="229dp"
android:layout_height="229dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/qingliz" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="124dp"
android:layout_height="124dp"
android:layout_gravity="center"
android:src="@mipmap/qingliyuan" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="124dp"
android:layout_height="124dp"
android:layout_gravity="center"
android:src="@mipmap/qingliyuan" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<androidx.appcompat.widget.LinearLayoutCompat
<TextView
android:id="@+id/id_tv_jd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:id="@+id/id_tv_jd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/white"
android:textSize="48sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
android:text="0"
android:textColor="@color/white"
android:textSize="48sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="%"
android:textColor="@color/white"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/id_bottomt_content"
android:layout_width="match_parent"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="%"
android:textColor="@color/white"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="150dp"
android:text="Wait a moment..."
android:textColor="#666666"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
android:layout_gravity="center_horizontal"
android:layout_marginVertical="16dp"
android:text="Wait a moment..."
android:textColor="#666666"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
......@@ -65,23 +65,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="295dp"
android:layout_marginBottom="50dp"
android:text="Wait a moment..."
android:textColor="#333333"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/id_bottomt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<LinearLayout
android:id="@+id/id_bottomt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="75dp"
android:layout_marginBottom="60dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toTopOf="@+id/id_fl_native">
<FrameLayout
android:layout_width="wrap_content"
......@@ -153,4 +154,10 @@
</LinearLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/xzbg"
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/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -152,4 +152,14 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
......@@ -161,4 +161,10 @@
</LinearLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -202,5 +202,10 @@
tools:ignore="HardcodedText" />
</LinearLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -33,4 +33,9 @@
app:layout_constraintTop_toBottomOf="@id/lottie"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -46,4 +46,9 @@
app:layout_constraintTop_toBottomOf="@id/lottie"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
<?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">
<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="Constellation"
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.base.datarecovery.activity.newfunction.WebRefreshView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<FrameLayout
android:id="@+id/flNative"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat 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"
android:id="@+id/main"
......@@ -9,127 +9,122 @@
android:orientation="vertical"
tools:context=".activity.whatsapp.WhatsAppCleanerActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="UselessParent">
<View
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/white" />
<FrameLayout
android:id="@+id/id_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<FrameLayout
android:layout_width="match_parent"
android:id="@+id/fl_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white">
android:padding="15dp">
<FrameLayout
android:id="@+id/fl_back"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp">
android:src="@mipmap/fanhui"
android:tint="@color/black"
tools:ignore="ContentDescription,UseAppTint" />
</FrameLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/fanhui"
android:tint="@color/black"
tools:ignore="ContentDescription,UseAppTint" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="WhatsApp Cleaner"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="WhatsApp Cleaner"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<FrameLayout
android:layout_width="match_parent"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white">
android:layout_gravity="center"
android:layout_marginVertical="25dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginVertical="25dp"
android:orientation="vertical"
tools:ignore="UselessParent">
android:orientation="horizontal">
<LinearLayout
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#4772FF"
android:textSize="45sp"
android:textStyle="bold"
tools:text="108.7" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="8dp"
android:textColor="#4772FF"
android:textSize="12sp"
android:textStyle="bold"
tools:text="KB" />
</LinearLayout>
android:textColor="#4772FF"
android:textSize="45sp"
android:textStyle="bold"
tools:text="108.7" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:text="Cleanable"
android:textColor="#666666"
android:textSize="15sp"
tools:ignore="HardcodedText" />
android:layout_gravity="start"
android:layout_marginStart="8dp"
android:textColor="#4772FF"
android:textSize="12sp"
android:textStyle="bold"
tools:text="KB" />
</LinearLayout>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:layout_weight="1"
android:background="@color/white"
android:paddingVertical="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_whatsapp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:text="Cleanable"
android:textColor="#666666"
android:textSize="15sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_tv_got_it"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginHorizontal="40dp"
android:layout_marginVertical="20dp"
android:gravity="center"
android:text="Got it"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
android:background="@drawable/bg_355bea_10"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp" />
</FrameLayout>
\ No newline at end of file
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:background="@color/white"
android:paddingVertical="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_whatsapp" />
<TextView
android:id="@+id/tv_tv_got_it"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginHorizontal="40dp"
android:layout_marginVertical="20dp"
android:background="@drawable/bg_355bea_10"
android:gravity="center"
android:text="Got it"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat 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"
android:layout_width="match_parent"
......@@ -11,6 +11,7 @@
android:id="@+id/id_top_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="14dp"
app:layout_constraintTop_toTopOf="parent">
<TextView
......@@ -30,11 +31,8 @@
<FrameLayout
android:layout_width="300dp"
android:layout_height="300dp"
app:layout_constraintBottom_toTopOf="@id/tv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.65">
android:layout_gravity="center"
android:layout_marginTop="80dp">
<com.base.datarecovery.view.XmlLottieAnimationView
android:id="@+id/lottie"
......@@ -62,14 +60,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="275dp"
android:layout_marginTop="16dp"
android:text="Wait a moment..."
android:textColor="#333333"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat 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"
android:layout_width="345dp"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="20dp">
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:text="Exit scanning"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<androidx.cardview.widget.CardView
android:layout_width="345dp"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="20dp">
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="35dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="lf you exit, the scanning results will be discarded."
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="25dp">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_n"
android:layout_width="145dp"
android:layout_height="45dp"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_stroke_577dfd_22"
android:gravity="center"
android:text="Exit"
android:textColor="#577DFD"
android:textSize="16sp"
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:text="Exit scanning"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_y"
android:layout_width="145dp"
android:layout_height="45dp"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_577dfd_22"
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="35dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="Continue"
android:textColor="@color/white"
android:textSize="16sp"
android:text="lf you exit, the scanning results will be discarded."
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_marginBottom="25dp">
<TextView
android:id="@+id/tv_n"
android:layout_width="145dp"
android:layout_height="45dp"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_stroke_577dfd_22"
android:gravity="center"
android:text="Exit"
android:textColor="#577DFD"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<TextView
android:id="@+id/tv_y"
android:layout_width="145dp"
android:layout_height="45dp"
android:layout_marginHorizontal="8dp"
android:background="@drawable/bg_577dfd_22"
android:gravity="center"
android:text="Continue"
android:textColor="@color/white"
android:textSize="16sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
</LinearLayout>
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp" />
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
......@@ -30,20 +30,78 @@
android:textSize="19sp"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/fl_setting"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:padding="10dp">
android:layout_gravity="end|center_vertical"
android:gravity="center_vertical">
<ImageView
<com.noober.background.view.BLLinearLayout
android:id="@+id/ll_weather"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_marginEnd="12dp"
android:orientation="horizontal"
app:bl_corners_radius="28dp"
app:bl_solid_color="#FFF0EF">
<TextView
android:id="@+id/tv_wendu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="15dp"
android:layout_marginEnd="2dp"
android:includeFontPadding="false"
android:textColor="@color/black"
android:textSize="13sp"
tools:text="20" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="4dp"
android:includeFontPadding="false"
android:text="℃"
android:textColor="@color/black"
android:textSize="13sp"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/iv_weather"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="9dp"
android:src="@mipmap/duoyun"
tools:ignore="ContentDescription" />
</com.noober.background.view.BLLinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_xz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:src="@mipmap/shezhi"
tools:ignore="ContentDescription" />
</FrameLayout>
android:layout_marginEnd="12dp"
android:src="@mipmap/xingzuo" />
<FrameLayout
android:id="@+id/fl_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:src="@mipmap/shezhi"
tools:ignore="ContentDescription" />
</FrameLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
......@@ -113,11 +171,17 @@
android:textStyle="bold"
tools:ignore="HardcodedText" />
<FrameLayout
android:id="@+id/id_fl_native"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="6dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="12dp"
android:layout_marginTop="6dp"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="7dp"
app:cardCornerRadius="7dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="h,1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_img_sel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:src="@mipmap/weixuan"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
<?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="wrap_content"
android:layout_marginVertical="16dp">
<TextView
android:id="@+id/id_tv_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_weight="1"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="Today, 25 Jun" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_img_icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="22dp"
android:src="@mipmap/x_qing" />
<TextView
android:id="@+id/id_tv_max_tmp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="17sp"
tools:text="32°/" />
<TextView
android:id="@+id/id_tv_min_tmp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="14dp"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="12°" />
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<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="210dp"
android:layout_height="220dp"
android:layout_marginHorizontal="10dp"
android:background="@drawable/bg_ffffff_10"
android:orientation="vertical">
......@@ -78,6 +78,8 @@
android:layout_gravity="center"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="10dp"
android:maxLines="2"
android:ellipsize="end"
android:gravity="center"
android:textColor="#000000"
android:textSize="16sp"
......@@ -200,7 +202,7 @@
<TextView
android:id="@+id/tv_btn"
android:id="@+id/id_tv_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
......
......@@ -35,7 +35,7 @@
<TextView
android:id="@+id/tv_btn"
android:id="@+id/id_tv_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_ffffff_r28"
android:orientation="vertical"
android:padding="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:src="@mipmap/icon_xz" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/id_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Unlock the Secrets of the Universe!"
android:textColor="#000000"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="Your daily horoscope holds the answers you've
been searching for. Click now to discover them!"
android:textColor="#666666"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/fl_btn"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginTop="17dp"
android:background="@drawable/shape_f_20"
android:gravity="center"
android:text="View"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold" />
</LinearLayout>
\ No newline at end of file
<?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="wrap_content"
android:background="@drawable/shape_ffffff_r28"
android:padding="10dp">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="12dp"
android:src="@mipmap/icon_xz"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical"
tools:ignore="UselessParent">
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:text="Unlock the Secrets of the Universe!"
android:textColor="#000000"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="3dp"
android:layout_marginEnd="12dp"
android:text="Your daily horoscope holds the answers you've been searching for. Click now to discover them!"
android:textColor="#666666"
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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