Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
afollestad committed May 14, 2019
1 parent bed9166 commit 9ffa08e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2.3.0

* Rationale support! See the README.
* Bug fixes, of course.
* Dependency upgrades.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ ext.versions = [
minSdk : 14,
compileSdk : 28,
buildTools : '28.0.3',
publishVersion : '2.2.3',
publishVersionCode : 18,
publishVersion : '2.3.0',
publishVersionCode : 19,

gradlePlugin : '3.4.0',
spotlessPlugin : '3.22.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.afollestad.assent

import android.content.pm.PackageManager
import android.content.pm.PackageManager.PERMISSION_DENIED
import android.content.pm.PackageManager.PERMISSION_GRANTED
import androidx.fragment.app.Fragment
Expand Down Expand Up @@ -64,14 +63,15 @@ class AssentInFragmentTest {
val checkPermission = inv.getArgument<String>(0)
val parsedCheckPermission = Permission.parse(checkPermission)
return@doAnswer if (allowedPermissions.contains(parsedCheckPermission)) {
PackageManager.PERMISSION_GRANTED
PERMISSION_GRANTED
} else {
PackageManager.PERMISSION_DENIED
PERMISSION_DENIED
}
}
}
private val fragment = mock<Fragment> {
on { fragmentManager } doReturn fragmentManager
on { childFragmentManager } doReturn fragmentManager
on { activity } doReturn activity
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MockShouldShowRationale : ShouldShowRationale {
fun handleShowRationale(
permission: Permission,
message: CharSequence,
onContinue: (Boolean) -> Unit
onContinue: ConfirmCallback
) {
onContinue(shouldConfirm.contains(permission))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ class RationaleHandlerTest {
override fun showRationale(
permission: Permission,
message: CharSequence,
onContinue: (confirmed: Boolean) -> Unit
) = shouldShow.handleShowRationale(permission, message, onContinue)
confirm: ConfirmCallback
) = shouldShow.handleShowRationale(permission, message, confirm)

override fun onDestroy() = Unit
}.apply {
onPermission(READ_CONTACTS, CALL_PHONE_RATIONALE)
onPermission(ACCESS_FINE_LOCATION, WRITE_STORAGE_RATIONALE)
Expand Down

0 comments on commit 9ffa08e

Please sign in to comment.