diff --git a/.gitignore b/.gitignore index aa724b7..fd5e7b9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,15 @@ .externalNativeBuild .cxx local.properties +/.idea/.gitignore +/.idea/.name +/.idea/AndroidProjectSystem.xml +/.idea/compiler.xml +/.idea/deploymentTargetSelector.xml +/.idea/gradle.xml +/.idea/kotlinc.xml +/.idea/migrations.xml +/.idea/misc.xml +/.idea/runConfigurations.xml +/secrets.properties +/.idea/vcs.xml diff --git a/app/build.gradle b/app/build.gradle index 3e76c3d..0624473 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,6 +34,13 @@ android { buildFeatures { viewBinding true } + secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + } } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7a1883f..19a3970 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,14 @@ + + + + + + + android:value="${MAPS_API_KEY}" /> Unit) { - // TODO("Добавить получение местоположения от fusedLocationClient и передать результат в callback после получения") + fusedLocationClient.getLastLocation(LastLocationRequest.Builder().build()) + .addOnCompleteListener { callback.invoke(it.result) } } private fun startCamera() { @@ -168,9 +206,10 @@ class CameraActivity : AppCompatActivity() { private const val TAG = "CameraXApp" private const val FILENAME_FORMAT = "yyyy-MM-dd-HH-mm-ss-SSS" private const val REQUEST_CODE_PERMISSIONS = 10 - // TODO("Указать набор требуемых разрешений") private val REQUIRED_PERMISSIONS: Array = mutableListOf( - // TODO("Добавить требуемые разрешения") + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION, + Manifest.permission.CAMERA, ).toTypedArray() const val SUCCESS_RESULT_CODE = 15