-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from icerockdev/develop
Release 0.14.0
- Loading branch information
Showing
14 changed files
with
280 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("dev.icerock.moko.gradle.android.library") | ||
id("dev.icerock.moko.gradle.android.publication") | ||
id("dev.icerock.moko.gradle.stub.javadoc") | ||
id("dev.icerock.moko.gradle.detekt") | ||
id("org.jetbrains.compose") | ||
} | ||
|
||
dependencies { | ||
api(projects.permissions) | ||
api(compose.runtime) | ||
api(libs.appCompat) | ||
api(libs.composeActivity) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="dev.icerock.moko.permissions.compose" /> |
23 changes: 23 additions & 0 deletions
23
permissions-compose/src/main/kotlin/dev/icerock/moko/permissions/compose/BindEffect.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.moko.permissions.compose | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalLifecycleOwner | ||
import androidx.fragment.app.FragmentActivity | ||
import dev.icerock.moko.permissions.PermissionsController | ||
|
||
@Suppress("FunctionNaming") | ||
@Composable | ||
fun BindEffect(permissionsController: PermissionsController) { | ||
val lifecycleOwner = LocalLifecycleOwner.current | ||
val fragmentManager = (LocalContext.current as FragmentActivity).supportFragmentManager | ||
|
||
LaunchedEffect(true) { | ||
permissionsController.bind(lifecycleOwner.lifecycle, fragmentManager) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
plugins { | ||
id("dev.icerock.moko.gradle.android.application") | ||
id("dev.icerock.moko.gradle.detekt") | ||
id("kotlin-kapt") | ||
} | ||
|
||
android { | ||
defaultConfig { | ||
applicationId = "dev.icerock.moko.samples.permissions" | ||
minSdk = 21 | ||
versionCode = 1 | ||
versionName = "0.1.0" | ||
} | ||
|
||
buildFeatures.compose = true | ||
composeOptions.kotlinCompilerExtensionVersion = libs.versions.composeCompilerVersion.get() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.appCompat) | ||
implementation(libs.composeActivity) | ||
implementation(libs.composeMaterial) | ||
implementation(projects.sample.mppLibrary) | ||
implementation(projects.permissionsCompose) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.icerockdev"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> | ||
|
||
<application | ||
android:label="moko-permissions test app" | ||
android:theme="@style/Theme.AppCompat.DayNight" | ||
tools:ignore="GoogleAppIndexingWarning"> | ||
|
||
<activity android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
Oops, something went wrong.