Update gradle build settings

Update build settings to remove useless libraries [AppCompat], add useful libraries [LeakCanary], and also enable minifying on the release build [Which hadnt been enabled before somehow].
This commit is contained in:
OxygenCobalt
2020-09-04 12:19:36 -06:00
parent 4b3285cef0
commit e59009a0fa
2 changed files with 18 additions and 16 deletions
@@ -29,8 +29,6 @@ class LoadingFragment : Fragment(R.layout.fragment_loading) {
).get(LoadingViewModel::class.java)
}
private var noPerms = false
private lateinit var binding: FragmentLoadingBinding
private lateinit var permLauncher: ActivityResultLauncher<String>
@@ -75,8 +73,6 @@ class LoadingFragment : Fragment(R.layout.fragment_loading) {
if (granted) {
wipeViews()
noPerms = false
loadingModel.retry()
}
}
@@ -85,23 +81,25 @@ class LoadingFragment : Fragment(R.layout.fragment_loading) {
// This should be in MusicRepository, but the response comes faster than the view creation
// itself and therefore causes the error screen to not appear.
if (checkPerms()) {
noPerms = true
onNoPerms()
} else {
loadingModel.go()
}
Log.d(this::class.simpleName, "Fragment created.")
return binding.root
}
// Check for permissions. God help us all.
// Check for two things:
// - If Auxio needs to show the rationale for getting the READ_EXTERNAL_STORAGE perm
// - If Auxio straight up doesnt have the permission
private fun checkPerms(): Boolean {
return shouldShowRequestPermissionRationale(
Manifest.permission.READ_EXTERNAL_STORAGE
) || ContextCompat.checkSelfPermission(
requireContext(), Manifest.permission.READ_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_DENIED || noPerms
) == PackageManager.PERMISSION_DENIED
}
private fun onMusicLoadResponse(repoResponse: MusicLoaderResponse?) {