Class PermissionAwareDelegate

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Unit init(Activity activity) As this is meant to be a delegate part of activity - it needs activity to call methods on.
      Unit openPermissionSettings() Open system UI - permission settings for current application.
      Unit activateCameraPermission() Will ask for permission OR show rationale - if permission was already turned down.
      Unit tryAskCameraPermission() Will only ask for permission if it is a first time app asking - no rationale will be shown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PermissionAwareDelegate

        PermissionAwareDelegate()
    • Method Detail

      • init

         Unit init(Activity activity)

        As this is meant to be a delegate part of activity - it needs activity to call methods on.

        Call (this as PermissionAware).init(this) in onCreate.

      • activateCameraPermission

         Unit activateCameraPermission()

        Will ask for permission OR show rationale - if permission was already turned down.

      • tryAskCameraPermission

         Unit tryAskCameraPermission()

        Will only ask for permission if it is a first time app asking - no rationale will be shown.