Commit 38b12d9c authored by wanglei's avatar wanglei

处理储存权限

parent 290dd04c
plugins { plugins {
alias(libs.plugins.androidApplication) alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid) alias(libs.plugins.jetbrainsKotlinAndroid)
id 'applovin-quality-service'
} }
applovin {
apiKey "7M6t_fBDFPKdlDdekL1bw1OntM7gd4Vk5yK_p7yEdl9BCKCfGZpmZMvL2LDHcuNGWIHLXPD0w_SFDDv94WMaSw"
}
android { android {
namespace 'com.xm.test.myfile' namespace 'com.xm.test.myfile'
...@@ -66,7 +63,9 @@ dependencies { ...@@ -66,7 +63,9 @@ dependencies {
androidTestImplementation libs.androidx.junit androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core androidTestImplementation libs.androidx.espresso.core
//noinspection GradleDependency
implementation 'androidx.viewpager2:viewpager2:1.0.0' implementation 'androidx.viewpager2:viewpager2:1.0.0'
//Lottie动画 //Lottie动画
implementation "com.airbnb.android:lottie:3.6.0" implementation "com.airbnb.android:lottie:3.6.0"
...@@ -106,7 +105,5 @@ dependencies { ...@@ -106,7 +105,5 @@ dependencies {
implementation("androidx.datastore:datastore-preferences:1.0.0") implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("com.facebook.android:facebook-android-sdk:[8,9)") implementation("com.facebook.android:facebook-android-sdk:[8,9)")
} }
...@@ -3,10 +3,9 @@ package com.xm.test.myfile.activity ...@@ -3,10 +3,9 @@ package com.xm.test.myfile.activity
import android.Manifest import android.Manifest
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Environment
import android.view.View import android.view.View
import android.widget.RadioButton import android.widget.RadioButton
import android.widget.RadioGroup
import androidx.activity.OnBackPressedCallback
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
...@@ -15,20 +14,23 @@ import androidx.core.view.WindowInsetsCompat ...@@ -15,20 +14,23 @@ import androidx.core.view.WindowInsetsCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2 import androidx.viewpager2.widget.ViewPager2
import com.permissionx.guolindev.PermissionX
import com.xm.test.myfile.R import com.xm.test.myfile.R
import com.xm.test.myfile.databinding.ActivityHomeBinding import com.xm.test.myfile.databinding.ActivityHomeBinding
import com.xm.test.myfile.fragment.FileManagerFragment import com.xm.test.myfile.fragment.FileManagerFragment
import com.xm.test.myfile.fragment.HomeFragment import com.xm.test.myfile.fragment.HomeFragment
import com.xm.test.myfile.fragment.InternalStorageFragment import com.xm.test.myfile.fragment.InternalStorageFragment
import com.xm.test.myfile.notification.NotificationHelper.postNotification import com.xm.test.myfile.util.ActivityLauncher
import com.xm.test.myfile.util.PermissionUtil import com.xm.test.myfile.util.PermissionUtil
import com.xm.test.myfile.util.storePermission.StorePermissionEx.requestStorePermission
import com.xm.test.myfile.util.storePermission.StorePermissionVersion
import com.xm.test.myfile.view.ManageStorageDialog.showManageStorageDialog
import com.xm.test.myfile.view.QuitDialog.showQuitDialog import com.xm.test.myfile.view.QuitDialog.showQuitDialog
class HomeActivity : AppCompatActivity() { class HomeActivity : AppCompatActivity() {
var mViewPage: ViewPager2? = null var mViewPage: ViewPager2? = null
private lateinit var binding: ActivityHomeBinding private lateinit var binding: ActivityHomeBinding
private lateinit var launcher: ActivityLauncher
companion object { companion object {
var isPermission = false var isPermission = false
...@@ -42,6 +44,7 @@ class HomeActivity : AppCompatActivity() { ...@@ -42,6 +44,7 @@ class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
launcher = ActivityLauncher(this)
binding = ActivityHomeBinding.inflate(layoutInflater) binding = ActivityHomeBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
...@@ -60,10 +63,6 @@ class HomeActivity : AppCompatActivity() { ...@@ -60,10 +63,6 @@ class HomeActivity : AppCompatActivity() {
list.add(HomeFragment()) list.add(HomeFragment())
list.add(InternalStorageFragment()) list.add(InternalStorageFragment())
list.add(FileManagerFragment()) list.add(FileManagerFragment())
getPermission()
postNotification(11001)
this.mViewPage?.adapter = object : FragmentStateAdapter(this) { this.mViewPage?.adapter = object : FragmentStateAdapter(this) {
override fun getItemCount(): Int { override fun getItemCount(): Int {
return list.size return list.size
...@@ -76,21 +75,26 @@ class HomeActivity : AppCompatActivity() { ...@@ -76,21 +75,26 @@ class HomeActivity : AppCompatActivity() {
this.mViewPage?.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { this.mViewPage?.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) super.onPageSelected(position)
if (position == 0) { when (position) {
findViewById<RadioButton>(R.id.radio_home_btn).isChecked = true 0 -> {
findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = false findViewById<RadioButton>(R.id.radio_home_btn).isChecked = true
findViewById<RadioButton>(R.id.radio_view_btn).isChecked = false findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = false
} else if (position == 1) { findViewById<RadioButton>(R.id.radio_view_btn).isChecked = false
findViewById<RadioButton>(R.id.radio_home_btn).isChecked = false }
findViewById<RadioButton>(R.id.radio_view_btn).isChecked = true
findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = false 1 -> {
} else if (position == 2) { findViewById<RadioButton>(R.id.radio_home_btn).isChecked = false
findViewById<RadioButton>(R.id.radio_home_btn).isChecked = false findViewById<RadioButton>(R.id.radio_view_btn).isChecked = true
findViewById<RadioButton>(R.id.radio_view_btn).isChecked = false findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = false
findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = true }
2 -> {
findViewById<RadioButton>(R.id.radio_home_btn).isChecked = false
findViewById<RadioButton>(R.id.radio_view_btn).isChecked = false
findViewById<RadioButton>(R.id.radio_file_manage_btn).isChecked = true
}
} }
} }
...@@ -118,41 +122,60 @@ class HomeActivity : AppCompatActivity() { ...@@ -118,41 +122,60 @@ class HomeActivity : AppCompatActivity() {
finish() finish()
} }
} }
storePermission()
} }
fun getPermission() { private fun storePermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { requestStorePermission(launcher, object : StorePermissionVersion {
isPermission = false override fun version13Action(
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !isPermission) { manage: Boolean,
PermissionX.init(this).permissions( haveRequest: Boolean,
Manifest.permission.READ_EXTERNAL_STORAGE, requestManager: () -> Unit
Manifest.permission.WRITE_EXTERNAL_STORAGE, ) {
).request { allGranted, grantedList, deniedList -> when {
if (allGranted) { manage -> {
isPermission = true isPermission = true
} else { }
isPermission = false
!manage && !haveRequest -> {
showManageStorageDialog {
requestManager.invoke()
}
}
} }
} }
} else {
PermissionX.init(this).permissions( override fun version11Action(
Manifest.permission.READ_EXTERNAL_STORAGE, storage: Boolean,
Manifest.permission.WRITE_EXTERNAL_STORAGE, manage: Boolean,
).request { allGranted, grantedList, deniedList -> haveRequest: Boolean,
if (allGranted) { requestManager: () -> Unit
isPermission = true ) {
} else { when {
isPermission = false storage && !manage && !haveRequest -> {
showManageStorageDialog {
requestManager.invoke()
}
}
storage && manage -> {
isPermission = true
}
} }
} }
}
override fun version11BelowAction(result: Boolean) {
isPermission = result
}
})
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (PermissionUtil.checkGrantedPermission(this)) { storePermission()
isPermission = true
}
} }
} }
\ No newline at end of file
...@@ -128,19 +128,19 @@ class FileManagerFragment : Fragment(), View.OnClickListener { ...@@ -128,19 +128,19 @@ class FileManagerFragment : Fragment(), View.OnClickListener {
} }
private fun checkPermission(): Boolean { private fun checkPermission(): Boolean {
if (!PermissionUtil.checkGrantedPermission(activity)) { // if (!PermissionUtil.checkGrantedPermission(activity)) {
val customDialog = CustomDialog(context) // val customDialog = CustomDialog(context)
customDialog.setsConfirm(View.OnClickListener { // customDialog.setsConfirm(View.OnClickListener {
PermissionUtil.requestPermission(context) // PermissionUtil.requestPermission(context)
customDialog.dismiss() // customDialog.dismiss()
}).setsCancel(View.OnClickListener { // }).setsCancel(View.OnClickListener {
customDialog.dismiss() // customDialog.dismiss()
}).show() // }).show()
customDialog.isShowEditText(false) // customDialog.isShowEditText(false)
customDialog.setsTitle("not permission") // customDialog.setsTitle("not permission")
customDialog.setsHint("Please grant file management permissions") // customDialog.setsHint("Please grant file management permissions")
return false // return false
} // }
return true return true
} }
......
...@@ -49,8 +49,6 @@ class HomeFragment : Fragment(), OnClickListener { ...@@ -49,8 +49,6 @@ class HomeFragment : Fragment(), OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
override fun onCreateView( override fun onCreateView(
...@@ -124,19 +122,19 @@ class HomeFragment : Fragment(), OnClickListener { ...@@ -124,19 +122,19 @@ class HomeFragment : Fragment(), OnClickListener {
} }
private fun checkPermission(): Boolean { private fun checkPermission(): Boolean {
if (!PermissionUtil.checkGrantedPermission(activity)) { // if (!PermissionUtil.checkGrantedPermission(activity)) {
val customDialog = CustomDialog(context) // val customDialog = CustomDialog(context)
customDialog.setsConfirm(OnClickListener { // customDialog.setsConfirm(OnClickListener {
PermissionUtil.requestPermission(context) // PermissionUtil.requestPermission(context)
customDialog.dismiss() // customDialog.dismiss()
}).setsCancel(OnClickListener { // }).setsCancel(OnClickListener {
customDialog.dismiss() // customDialog.dismiss()
}).show() // }).show()
customDialog.isShowEditText(false) // customDialog.isShowEditText(false)
customDialog.setsTitle("not permission") // customDialog.setsTitle("not permission")
customDialog.setsHint("Please grant fileAll management permissions") // customDialog.setsHint("Please grant fileAll management permissions")
return false // return false
} // }
return true return true
} }
......
package com.xm.test.myfile.util
import android.content.Intent
import androidx.activity.result.ActivityResult
import androidx.activity.result.ActivityResultCallback
import androidx.activity.result.ActivityResultCaller
import androidx.activity.result.contract.ActivityResultContracts
class ActivityLauncher(activityResultCaller: ActivityResultCaller) {
//region 权限
private var permissionCallback: ActivityResultCallback<Map<String, Boolean>>? = null
private val permissionLauncher =
activityResultCaller.registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result: Map<String, Boolean> ->
permissionCallback?.onActivityResult(result)
}
fun launch(
permissionArray: Array<String>,
permissionCallback: ActivityResultCallback<Map<String, Boolean>>?
) {
this.permissionCallback = permissionCallback
permissionLauncher.launch(permissionArray)
}
//endregion
//region intent跳转
private var activityResultCallback: ActivityResultCallback<ActivityResult>? = null
private val intentLauncher =
activityResultCaller.registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { activityResult: ActivityResult ->
activityResultCallback?.onActivityResult(activityResult)
}
/**
* it.resultCode == Activity.RESULT_OK
*/
fun launch(
intent: Intent,
activityResultCallback: ActivityResultCallback<ActivityResult>? = null
) {
this.activityResultCallback = activityResultCallback
intentLauncher.launch(intent)
}
//endregion
}
\ No newline at end of file
...@@ -18,22 +18,22 @@ import com.xm.test.myfile.activity.HomeActivity ...@@ -18,22 +18,22 @@ import com.xm.test.myfile.activity.HomeActivity
object PermissionUtil { object PermissionUtil {
var LOCATION_PERMISSION = false var LOCATION_PERMISSION = false
fun requestPermission(context: Context?){ fun requestPermission(context: Context?) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val intent = Intent().apply { val intent = Intent().apply {
action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
data = Uri.fromParts("package", context?.packageName, null) data = Uri.fromParts("package", context?.packageName, null)
flags = Intent.FLAG_ACTIVITY_NEW_TASK flags = Intent.FLAG_ACTIVITY_NEW_TASK
} }
context?.startActivity(intent) context?.startActivity(intent)
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val intent = Intent().apply { val intent = Intent().apply {
action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION action = Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
data = Uri.fromParts("package", context?.packageName, null) data = Uri.fromParts("package", context?.packageName, null)
flags = Intent.FLAG_ACTIVITY_NEW_TASK flags = Intent.FLAG_ACTIVITY_NEW_TASK
} }
context?.startActivity(intent) context?.startActivity(intent)
}else{ } else {
val intent = Intent().apply { val intent = Intent().apply {
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
data = Uri.fromParts("package", context?.packageName, null) data = Uri.fromParts("package", context?.packageName, null)
...@@ -42,30 +42,34 @@ object PermissionUtil { ...@@ -42,30 +42,34 @@ object PermissionUtil {
} }
} }
fun checkGrantedPermission(activity: ComponentActivity?) : Boolean{ fun checkGrantedPermission(activity: ComponentActivity): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){ HomeActivity.isPermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
//TODO android 14以上 Environment.isExternalStorageManager()
HomeActivity.isPermission = Environment.isExternalStorageManager() } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
return HomeActivity.isPermission val flag1 = Environment.isExternalStorageManager()
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { val flag2 =
HomeActivity.isPermission = Environment.isExternalStorageManager() ActivityCompat.checkSelfPermission(
&&ActivityCompat.checkSelfPermission(activity!!, activity,
Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED Manifest.permission.READ_EXTERNAL_STORAGE
return HomeActivity.isPermission ) == PackageManager.PERMISSION_GRANTED
}else{ flag1 && flag2
HomeActivity.isPermission = ActivityCompat.checkSelfPermission(activity!!, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED } else {
return HomeActivity.isPermission ActivityCompat.checkSelfPermission(
activity,
Manifest.permission.READ_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
} }
return HomeActivity.isPermission
} }
fun requestLocationPermission(context: FragmentActivity?){ fun requestLocationPermission(context: FragmentActivity?) {
PermissionX.init(context!!).permissions( PermissionX.init(context!!).permissions(
Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,
).request(RequestCallback{ allGranted, grantedList, deniedList -> ).request(RequestCallback { allGranted, grantedList, deniedList ->
if (allGranted){ if (allGranted) {
LOCATION_PERMISSION = true LOCATION_PERMISSION = true
}else{ } else {
LOCATION_PERMISSION = false LOCATION_PERMISSION = false
} }
}) })
......
package com.xm.test.myfile.util.storePermission
import android.Manifest
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.Settings
import androidx.annotation.RequiresApi
import com.xm.test.myfile.util.ActivityLauncher
object StorePermissionEx {
@RequiresApi(Build.VERSION_CODES.R)
fun settingManageExternalStorage(uri: Uri? = null): Intent {
val intent = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, uri)
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return intent
}
fun Context.requestStorePermission(
activityLauncher: ActivityLauncher,
storePermissionVersion: StorePermissionVersion,
) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val requestManager = {
val uri = Uri.parse("package:$packageName")
val intent = settingManageExternalStorage(uri)
activityLauncher.launch(intent) {
val flag = Environment.isExternalStorageManager()
storePermissionVersion.version13Action(flag, true) {}
}
}
val flag = Environment.isExternalStorageManager()
storePermissionVersion.version13Action(flag, false, requestManager)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
activityLauncher.launch(
arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
) { map ->
val allGranted = map.values.all { it }
val manage = Environment.isExternalStorageManager()
val requestManager = {
val uri = Uri.parse("package:$packageName")
val intent = settingManageExternalStorage(uri)
activityLauncher.launch(intent) {
val flag = Environment.isExternalStorageManager()
storePermissionVersion.version11Action(true, flag, true) {}
}
}
storePermissionVersion.version11Action(allGranted, manage, false, requestManager)
}
} else {
activityLauncher.launch(
arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
) { map ->
val allGranted = map.values.all { it }
storePermissionVersion.version11BelowAction(allGranted)
}
}
}
}
\ No newline at end of file
package com.xm.test.myfile.util.storePermission
interface StorePermissionVersion {
/**
* Android 13回调
*/
abstract fun version13Action(manage: Boolean, haveRequest: Boolean, requestManager: () -> Unit)
/**
* Android 11回调
*/
abstract fun version11Action(
storage: Boolean,
manage: Boolean,
haveRequest: Boolean,
requestManager: () -> Unit
)
/**
* Android 11以下回调
*/
abstract fun version11BelowAction(result: Boolean)
}
\ No newline at end of file
package com.xm.test.myfile.view
import android.app.Activity
import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import com.xm.test.myfile.databinding.DialogManageStorageBinding
object ManageStorageDialog {
fun Context.showManageStorageDialog( action: () -> Unit) {
val binding = DialogManageStorageBinding.inflate(LayoutInflater.from(this))
val dialog = AlertDialog.Builder(this).setView(binding.root).create()
dialog.setCanceledOnTouchOutside(false)
dialog.show()
//修改dialog的尺寸
val lp = dialog.window?.attributes
// lp?.horizontalMargin = this.resources.getDimension(R.dimen.dp_16)
// lp?.width = ViewGroup.LayoutParams.MATCH_PARENT
lp?.height = ViewGroup.LayoutParams.WRAP_CONTENT
lp?.gravity = Gravity.BOTTOM
dialog.window?.attributes = lp
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
binding.tvAllow.setOnClickListener {
dialog.dismiss()
action.invoke()
}
}
}
\ No newline at end of file
...@@ -6,7 +6,6 @@ import android.view.LayoutInflater ...@@ -6,7 +6,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import com.xm.test.myfile.R
import com.xm.test.myfile.ad.MaxAdUtils import com.xm.test.myfile.ad.MaxAdUtils
import com.xm.test.myfile.databinding.DialogWhetherQuitBinding import com.xm.test.myfile.databinding.DialogWhetherQuitBinding
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#286EFD" />
<corners android:radius="10dp" />
</shape>
\ 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/white" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
\ No newline at end of file
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:src="@drawable/ic_rename" android:src="@drawable/ic_rename"
tools:ignore="NestedWeights" /> tools:ignore="ContentDescription,NestedWeights" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="0.7" android:layout_weight="0.7"
android:src="@drawable/ic_copy" android:src="@drawable/ic_copy"
tools:ignore="NestedWeights" /> tools:ignore="ContentDescription,NestedWeights" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
<?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_marginTop="10dp"
android:background="@drawable/bg_corners_white_tlf"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="28dp"
android:text="You need to get storage permissions"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="21dp"
android:text="If you want to use this function, pleaseturn on the storage of KeepFiles in thesettings of your mobile phone Permissions"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="match_parent"
android:layout_height="257dp"
android:layout_marginHorizontal="40dp"
android:layout_marginTop="40dp"
android:src="@mipmap/permissions"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/tv_allow"
android:layout_width="224dp"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="50dp"
android:background="@drawable/bg_corners_286efd"
android:gravity="center"
android:text="ALLOW"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#6F98ED"> android:background="#6F98ED">
...@@ -21,7 +22,8 @@ ...@@ -21,7 +22,8 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:src="@mipmap/start_icon" /> android:src="@mipmap/start_icon"
tools:ignore="ContentDescription" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -31,7 +33,8 @@ ...@@ -31,7 +33,8 @@
android:text="File Manager Ultra" android:text="File Manager Ultra"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="24sp" android:textSize="24sp"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -14,71 +14,76 @@ ...@@ -14,71 +14,76 @@
android:id="@+id/btn_cancel" android:id="@+id/btn_cancel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_cancel" android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:src="@drawable/ic_cancel"
android:visibility="gone" android:visibility="gone"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageView <ImageView
android:id="@+id/btn_quit" android:id="@+id/btn_quit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_quit"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:src="@drawable/ic_quit"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:orientation="horizontal"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:gravity="center" android:gravity="center"
android:layout_width="wrap_content" android:orientation="horizontal">
android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/btn_new" android:id="@+id/btn_new"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_resource_new" android:src="@drawable/ic_resource_new"
android:visibility="gone" android:visibility="gone"
android:layout_marginEnd="16dp"/> tools:ignore="ContentDescription" />
<ImageView <ImageView
android:id="@+id/btn_edit" android:id="@+id/btn_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_edit" android:src="@drawable/ic_edit"
android:visibility="gone" android:visibility="gone"
android:layout_marginEnd="16dp"/> tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:orientation="horizontal"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:gravity="center" android:gravity="center"
android:layout_width="wrap_content" android:orientation="horizontal">
android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/btn_delete" android:id="@+id/btn_delete"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_delete" android:src="@drawable/ic_delete"
android:visibility="gone" android:visibility="gone"
android:layout_marginEnd="16dp" tools:ignore="ContentDescription" />
/>
<ImageView <ImageView
android:id="@+id/btn_share" android:id="@+id/btn_share"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:layout_marginEnd="16dp"
android:src="@drawable/ic_share" android:src="@drawable/ic_share"
android:layout_marginEnd="16dp"/> android:visibility="gone"
tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
...@@ -86,32 +91,35 @@ ...@@ -86,32 +91,35 @@
android:id="@+id/title_bar_text" android:id="@+id/title_bar_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="18dp"
android:textStyle="bold"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textColor="@color/black"/> android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
tools:ignore="RelativeOverlap" />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/current_file_path" android:id="@+id/current_file_path"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/top_title_bar" android:layout_below="@+id/top_title_bar"
android:text="Internal Storage/"
android:textSize="16dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:textColor="@color/black"/> android:text="Internal Storage/"
android:textColor="@color/black"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<RelativeLayout <RelativeLayout
android:id="@+id/switch_and_select_layout" android:id="@+id/switch_and_select_layout"
android:layout_below="@+id/current_file_path"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_below="@+id/current_file_path"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:visibility="gone" android:layout_marginEnd="16dp"
android:layout_height="30dp"> android:visibility="gone">
<LinearLayout <LinearLayout
android:id="@+id/check_item_all_btn" android:id="@+id/check_item_all_btn"
...@@ -123,40 +131,37 @@ ...@@ -123,40 +131,37 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:text="All" android:text="All"
android:textColor="#8B8B8B" android:textColor="#8B8B8B"
android:textSize="18dp" android:textSize="18dp"
android:textStyle="bold" android:textStyle="bold" />
android:gravity="center"/>
<CheckBox <CheckBox
android:id="@+id/checkbox_item_all" android:id="@+id/checkbox_item_all"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:button="@null"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:drawableStart="@drawable/bg_item_switch_selector"/> android:button="@null"
android:drawableStart="@drawable/bg_item_switch_selector" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/select_num" android:id="@+id/select_num"
android:layout_centerVertical="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/select_0"
android:textColor="#8B8B8B" android:textColor="#8B8B8B"
android:textSize="18dp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
android:text="@string/select_0"/> tools:ignore="RelativeOverlap" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:5.2.4"
}
}
plugins { plugins {
alias(libs.plugins.androidApplication) apply false alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false alias(libs.plugins.jetbrainsKotlinAndroid) apply false
} }
//apply plugin: 'applovin-quality-service'
//applovin {
// apiKey "7M6t_fBDFPKdlDdekL1bw1OntM7gd4Vk5yK_p7yEdl9BCKCfGZpmZMvL2LDHcuNGWIHLXPD0w_SFDDv94WMaSw"
//}
\ No newline at end of file
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