Commit 7dbb47be authored by wanglei's avatar wanglei

...ui

parent e4ebb741
...@@ -6,6 +6,7 @@ import androidx.activity.enableEdgeToEdge ...@@ -6,6 +6,7 @@ import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import com.base.datarecovery.databinding.ActivityMainBinding import com.base.datarecovery.databinding.ActivityMainBinding
import com.base.datarecovery.help.BaseActivity import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils import com.base.datarecovery.utils.BarUtils
...@@ -20,6 +21,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() { ...@@ -20,6 +21,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
override fun initView() { override fun initView() {
BarUtils.setStatusBarLightMode(this, true) BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT) BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
} }
} }
\ No newline at end of file
...@@ -51,15 +51,18 @@ class RepeatActivity : BaseActivity<ActivityRepeatBinding>() { ...@@ -51,15 +51,18 @@ class RepeatActivity : BaseActivity<ActivityRepeatBinding>() {
if (checkStorePermission()) { if (checkStorePermission()) {
initData() initData()
} else { } else {
showGerPermission(null, deny = { finishToMain() }, allow = { showGerPermission("Storage Permission Required",
requestStorePermission(launcher, result = { "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.",
if (it) { deny = { finishToMain() },
initData() allow = {
} else { requestStorePermission(launcher, result = {
finishToMain() if (it) {
} initData()
} else {
finishToMain()
}
})
}) })
})
} }
} }
......
...@@ -19,7 +19,7 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) : ...@@ -19,7 +19,7 @@ class AppFunctionAdapter(val click: (name: String) -> Unit) :
RecyclerView.Adapter<AppFunctionAdapter.JJJ>() { RecyclerView.Adapter<AppFunctionAdapter.JJJ>() {
val list = arrayListOf( val list = arrayListOf(
Fun(JUNK_CLEANER, R.mipmap.h_cleanjunk, "Clean junk regularly to free up space", "Clean Up"), Fun(JUNK_CLEANER, R.mipmap.clean, "Clean junk regularly to free up space", "Clean Up"),
Fun(REPEAT_PHOTOS, R.mipmap.repeatedphotos, "Check similar photos to release more space", "Clean Up"), Fun(REPEAT_PHOTOS, R.mipmap.repeatedphotos, "Check similar photos to release more space", "Clean Up"),
Fun(SCREENSHOT_CLEANER, R.mipmap.screenshots, "Too many screenshots? Free up your phone storage!", "Clean Up"), Fun(SCREENSHOT_CLEANER, R.mipmap.screenshots, "Too many screenshots? Free up your phone storage!", "Clean Up"),
) )
......
...@@ -42,17 +42,22 @@ class PrivacyPageFragment( ...@@ -42,17 +42,22 @@ class PrivacyPageFragment(
} else { } else {
val activity = (requireActivity() as PrivacySpaceActivity) val activity = (requireActivity() as PrivacySpaceActivity)
requireContext().showGerPermission(null, deny = { requireContext().showGerPermission("Privacy Space Access",
activity.finishToMain() "To help you protect your privacy, our app needs to scan your device for photos and videos. We will use this information to create a secure private space that only you can access. We do not collect any personal information or data. Please click \"Agree\" to grant us permission to scan your device or \"Cancel\" to exit.",
}, allow = { denyText = "Exit",
requireContext().requestStorePermission(activity.launcher, result = { allowText = "Agree",
if (it) { deny = {
initData() activity.finishToMain()
} else { },
activity.finishToMain() allow = {
} requireContext().requestStorePermission(activity.launcher, result = {
if (it) {
initData()
} else {
activity.finishToMain()
}
})
}) })
})
} }
} }
......
...@@ -17,7 +17,7 @@ object ConfigHelper { ...@@ -17,7 +17,7 @@ object ConfigHelper {
const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696110" const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696110"
// 正式包名 // 正式包名
const val packageName = "" const val packageName = "com.kuke.photosrecovery.allrecovery.acbcali"
val noLoadingActivities = listOf( val noLoadingActivities = listOf(
"full", // 过滤全屏广告 "full", // 过滤全屏广告
......
...@@ -46,6 +46,8 @@ object DialogViews { ...@@ -46,6 +46,8 @@ object DialogViews {
fun Context.showGerPermission( fun Context.showGerPermission(
tittle: String? = null, tittle: String? = null,
desc: String? = null, desc: String? = null,
denyText: String? = null,
allowText: String? = null,
deny: ((view: Dialog) -> Unit)? = null, deny: ((view: Dialog) -> Unit)? = null,
allow: ((view: Dialog) -> Unit)? = null allow: ((view: Dialog) -> Unit)? = null
): Dialog { ): Dialog {
...@@ -61,6 +63,9 @@ object DialogViews { ...@@ -61,6 +63,9 @@ object DialogViews {
tittle?.let { binding.tvTitle.text = it } tittle?.let { binding.tvTitle.text = it }
desc?.let { binding.tvDesc.text = it } desc?.let { binding.tvDesc.text = it }
denyText?.let { binding.idDeny.text=it }
allowText?.let { binding.idTvAllow.text=it }
binding.idFullLottie.imageAssetsFolder = "recovery_permission_finger/images/" binding.idFullLottie.imageAssetsFolder = "recovery_permission_finger/images/"
binding.idFullLottie.setAnimation("recovery_permission_finger/data.json") binding.idFullLottie.setAnimation("recovery_permission_finger/data.json")
binding.idFullLottie.playAnimation() binding.idFullLottie.playAnimation()
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
android:id="@+id/tv_pin_tip" android:id="@+id/tv_pin_tip"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Protect your private photos adnd videos by creating PIN" android:text="Protect your private photos and videos by creating PIN"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<TextView <TextView
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Screenshot Cleaner" android:text="Repeat Photos"
android:textSize="19sp" android:textSize="19sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginBottom="30dp" android:layout_marginBottom="30dp"
android:text="Screenshots totally" android:text="Clean totally"
android:textColor="#666666" android:textColor="#666666"
android:textSize="15sp" android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
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