Skip to content

Commit

Permalink
Dependency version was updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
halilozel1903 committed May 19, 2022
1 parent e6260f3 commit b94367d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

// Huawei Dependencies
Expand Down
25 changes: 16 additions & 9 deletions app/src/main/java/com/veripark/buildvariantapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ import androidx.core.app.ActivityCompat

class MainActivity : AppCompatActivity() {

companion object{
companion object {
private const val REQUEST_CODE = 1903
private val PERMISSIONS = arrayOf(
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION)
Manifest.permission.ACCESS_FINE_LOCATION
)
}

private lateinit var mapHelper: MapHelper

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

if (!hasPermissions(this, *PERMISSIONS)){
if (!hasPermissions(this, *PERMISSIONS)) {
askForPermissions()
} else {
mapHelper = MapHelper(this)
Expand All @@ -35,25 +37,30 @@ class MainActivity : AppCompatActivity() {
}*/
}

private fun askForPermissions(){
private fun askForPermissions() {
ActivityCompat.requestPermissions(this, PERMISSIONS, REQUEST_CODE)
}

private fun hasPermissions(context: Context, vararg permissions: String): Boolean {
for (permission in permissions) {
if (ActivityCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.checkSelfPermission(
context,
permission
) != PackageManager.PERMISSION_GRANTED
) {
return false
}
}
return true
}

override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<out String>,
grantResults: IntArray) {
requestCode: Int,
permissions: Array<out String>,
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
if(requestCode == REQUEST_CODE) {
if (requestCode == REQUEST_CODE) {
this.recreate()
}
}
Expand Down

0 comments on commit b94367d

Please sign in to comment.