Commit 0d49db5e authored by wanglei's avatar wanglei

...

parent f556bb12
...@@ -12,7 +12,6 @@ import com.base.filerecoveryrecyclebin.utils.LogEx ...@@ -12,7 +12,6 @@ import com.base.filerecoveryrecyclebin.utils.LogEx
import com.google.gson.Gson import com.google.gson.Gson
import java.io.File import java.io.File
@RequiresApi(Build.VERSION_CODES.Q)
class MyFileObserver(files: List<File>) : FileObserver(files, ALL_EVENTS) { class MyFileObserver(files: List<File>) : FileObserver(files, ALL_EVENTS) {
private val TAG = "MyFileObserver" private val TAG = "MyFileObserver"
......
...@@ -2,7 +2,9 @@ package com.base.filerecoveryrecyclebin.activity.vip ...@@ -2,7 +2,9 @@ package com.base.filerecoveryrecyclebin.activity.vip
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.view.View
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import com.base.filerecoveryrecyclebin.activity.MainActivity import com.base.filerecoveryrecyclebin.activity.MainActivity
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
...@@ -20,6 +22,9 @@ class VipActivity : BaseActivity<ActivityVipBinding>() { ...@@ -20,6 +22,9 @@ class VipActivity : BaseActivity<ActivityVipBinding>() {
BarUtils.setStatusBarLightMode(this, true) BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.WHITE) BarUtils.setStatusBarColor(this, Color.WHITE)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
val isSkip = intent.extras?.getBoolean("isSkip") ?: false
binding.tvSkip.isVisible = isSkip
} }
override fun initListener() { override fun initListener() {
...@@ -38,6 +43,9 @@ class VipActivity : BaseActivity<ActivityVipBinding>() { ...@@ -38,6 +43,9 @@ class VipActivity : BaseActivity<ActivityVipBinding>() {
binding.flQuit.setOnClickListener { binding.flQuit.setOnClickListener {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
} }
binding.tvSkip.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
} }
......
...@@ -27,10 +27,10 @@ object AdMaxInit { ...@@ -27,10 +27,10 @@ object AdMaxInit {
initConfigBuilder.mediationProvider = AppLovinMediationProvider.MAX initConfigBuilder.mediationProvider = AppLovinMediationProvider.MAX
// Enable test mode by default for the current device. Cannot be run on the main thread. // Enable test mode by default for the current device. Cannot be run on the main thread.
// val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id
// if (currentGaid != null) { if (currentGaid != null) {
// initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid) initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid)
// } }
// Initialize the AppLovin SDK // Initialize the AppLovin SDK
val sdk = AppLovinSdk.getInstance(this) val sdk = AppLovinSdk.getInstance(this)
......
...@@ -29,7 +29,6 @@ class GuideFragment constructor() : BaseFragment<FragmentGuideBinding>() { ...@@ -29,7 +29,6 @@ class GuideFragment constructor() : BaseFragment<FragmentGuideBinding>() {
binding.iv.setImageResource(R.mipmap.yindaoye1) binding.iv.setImageResource(R.mipmap.yindaoye1)
binding.tv0.text = "Effective recovery" binding.tv0.text = "Effective recovery"
binding.tvBtn.text = "Next" binding.tvBtn.text = "Next"
binding.flSkip.visibility = View.VISIBLE
} else { } else {
binding.iv.setImageResource(R.mipmap.yindaoye2) binding.iv.setImageResource(R.mipmap.yindaoye2)
binding.tv0.text = "Recycle Bin" binding.tv0.text = "Recycle Bin"
...@@ -47,14 +46,13 @@ class GuideFragment constructor() : BaseFragment<FragmentGuideBinding>() { ...@@ -47,14 +46,13 @@ class GuideFragment constructor() : BaseFragment<FragmentGuideBinding>() {
jumpNext() jumpNext()
} }
} }
binding.flSkip.setOnClickListener {
jumpNext()
}
} }
private fun jumpNext() { private fun jumpNext() {
if (isInstallVip) { if (isInstallVip) {
startActivity(Intent(requireContext(), VipActivity::class.java)) startActivity(Intent(requireContext(), VipActivity::class.java).apply {
putExtra("isSkip", true)
})
requireActivity().finish() requireActivity().finish()
isInstallVip = false isInstallVip = false
} else { } else {
......
package com.base.filerecoveryrecyclebin.fragment package com.base.filerecoveryrecyclebin.fragment
import android.app.Dialog
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
import android.os.Handler import android.os.Handler
...@@ -97,7 +98,7 @@ class RecycleBinFragment : BaseFragment<FragmentRecycleBinBinding>() { ...@@ -97,7 +98,7 @@ class RecycleBinFragment : BaseFragment<FragmentRecycleBinBinding>() {
} }
} }
@RequiresApi(Build.VERSION_CODES.Q) var permissionDialog: Dialog? = null
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
LogEx.logDebug(TAG, "onResume") LogEx.logDebug(TAG, "onResume")
...@@ -107,13 +108,15 @@ class RecycleBinFragment : BaseFragment<FragmentRecycleBinBinding>() { ...@@ -107,13 +108,15 @@ class RecycleBinFragment : BaseFragment<FragmentRecycleBinBinding>() {
} }
} }
val launcher = (requireActivity() as MainActivity).launcher val launcher = (requireActivity() as MainActivity).launcher
if (!requireActivity().checkStorePermission()) { if (!requireActivity().checkStorePermission() && permissionDialog == null) {
requireContext().showGerPermission( permissionDialog = requireContext().showGerPermission(
desc = "In order to scan and recover your lost photos, videos, and documents, we need to access your device storage. This permission is essential for our app to locate and restore your files.", desc = "In order to scan and recover your lost photos, videos, and documents, we need to access your device storage. This permission is essential for our app to locate and restore your files.",
deny = { deny = {
permissionDialog = null
(requireActivity() as MainActivity).setPage(0) (requireActivity() as MainActivity).setPage(0)
}, },
allow = { allow = {
permissionDialog = null
requireContext().requestStorePermission(launcher, result = { flag -> requireContext().requestStorePermission(launcher, result = { flag ->
if (flag) { if (flag) {
initData() initData()
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="#4773FF" />
</shape>
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
android:id="@+id/ll1" android:id="@+id/ll1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="80dp" android:layout_marginTop="70dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -316,6 +316,7 @@ ...@@ -316,6 +316,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/tv_tip"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
...@@ -327,4 +328,19 @@ ...@@ -327,4 +328,19 @@
app:layout_constraintTop_toBottomOf="@id/cl" app:layout_constraintTop_toBottomOf="@id/cl"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_skip"
android:layout_width="318dp"
android:layout_height="45dp"
android:layout_marginTop="16dp"
android:background="@drawable/bg_4773ff_10"
android:gravity="center"
android:text="Skip"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tip" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -8,27 +8,6 @@ ...@@ -8,27 +8,6 @@
tools:context=".fragment.GuideFragment"> tools:context=".fragment.GuideFragment">
<FrameLayout
android:id="@+id/fl_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:padding="10dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/tv_btn"
app:layout_constraintStart_toStartOf="@id/tv_btn"
app:layout_constraintTop_toBottomOf="@id/tv_btn">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Skip"
android:textColor="@color/black"
android:textSize="19sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
<ImageView <ImageView
android:id="@+id/iv" android:id="@+id/iv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment