Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leokwsw committed Aug 29, 2021
1 parent 475e62e commit 8a8d95f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 25 deletions.
16 changes: 0 additions & 16 deletions .idea/codeStyles/Project.xml

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

1 change: 1 addition & 0 deletions .idea/runConfigurations.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 @@ -10,7 +10,7 @@ android {

defaultConfig {
applicationId "com.leonardpark.pixel.sample"
minSdkVersion 16
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:theme="@style/Theme.PixelImage.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
r

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class MainActivity : AppCompatActivity() {
Toast.makeText(this, "Approve permissions to open Draw", Toast.LENGTH_LONG).show()
}
}
else -> {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
8 changes: 4 additions & 4 deletions pixel/src/main/java/com/leonardpark/pixel/utility/PermUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ class PermUtil {
if (!addPermission(
permissionsList,
Manifest.permission.CAMERA,
fragment.activity!!
fragment.requireActivity()
)
) permissionsNeeded.add("CAMERA")

if (!addPermission(
permissionsList,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
fragment.activity!!
fragment.requireActivity()
)
) permissionsNeeded.add("WRITE_EXTERNAL_STORAGE")

Expand Down Expand Up @@ -129,7 +129,7 @@ class PermUtil {
if (!addPermission(
permissionsList,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
fragment.activity!!
fragment.requireActivity()
)
) permissionsNeeded.add("WRITE_EXTERNAL_STORAGE")

Expand Down Expand Up @@ -179,7 +179,7 @@ class PermUtil {
if (!addPermission(
permissionsList,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
fragment.activity!!
fragment.requireActivity()
)
) permissionsNeeded.add("WRITE_EXTERNAL_STORAGE")

Expand Down

0 comments on commit 8a8d95f

Please sign in to comment.