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
package com.github.firezenk | |
import androidx.navigation.NavGraphBuilder | |
import androidx.navigation.NavHostController | |
import androidx.navigation.NavType | |
import androidx.navigation.compose.composable | |
import com.github.firezenk.Route | |
import com.github.firezenk.exampleRoute2 | |
internal val exampleRoute1 = Route("ExampleRoute1", linkedMapOf( |
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
plop.setGenerator('feature', { | |
description: 'creates a new mvp-based feature', | |
prompts: [{ | |
type: 'input', | |
name: 'package', | |
message: 'Package name?' | |
},{ | |
type: 'input', | |
name: 'feature', | |
message: 'Feature name?' |
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
module.exports = function (plop) { | |
plop.addHelper('lowerCase', (text) => text.toLowerCase()); | |
// add more helpers here | |
plop.setGenerator('feature', { | |
description: 'creates a new mvp-based feature', | |
prompts: [{ | |
type: 'input', |
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
@Composable | |
fun OnLifecycleEvent(onEvent: (owner: LifecycleOwner, event: Lifecycle.Event) -> Unit) { | |
val eventHandler = rememberUpdatedState(onEvent) | |
val lifecycleOwner = rememberUpdatedState(LocalLifecycleOwner.current) | |
DisposableEffect(lifecycleOwner.value) { | |
val lifecycle = lifecycleOwner.value.lifecycle | |
val observer = LifecycleEventObserver { owner, event -> | |
eventHandler.value(owner, event) | |
} |
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
@Composable | |
fun ActivateLocationServices() { | |
val context = LocalContext.current | |
val lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager | |
if (!LocationManagerCompat.isLocationEnabled(lm)) | |
context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)) | |
} |
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
@Composable | |
fun ActivateBluetooth(launcher: (() -> Unit) -> Unit, isRequestingActivation: (Boolean) -> Unit, | |
onActivated: () -> Unit) { | |
val bluetoothActivationLauncher = | |
rememberLauncherForActivityResult(RequestBluetoothActivation()) { | |
if (it) { | |
isRequestingActivation(false) | |
onActivated() | |
} | |
} |
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
@ExperimentalPermissionsApi | |
@Composable | |
fun CheckPermissions(permissions: List<String>, launcher: (() -> Unit) -> Unit, | |
onAllGranted: () -> Unit, onPermissionsNeeded: () -> Unit, ) { | |
val multiplePermissionsState = rememberMultiplePermissionsState(permissions) | |
val isAlreadyGranted = remember { mutableStateOf(false) } | |
launcher { multiplePermissionsState.launchMultiplePermissionRequest() } | |
val allGranted = multiplePermissionsState.allPermissionsGranted | |
if (allGranted && !isAlreadyGranted.value) { |
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
package com.your.package; | |
import android.support.design.widget.Snackbar; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.daimajia.easing.BaseEasingMethod; | |
import com.daimajia.easing.Glider; | |
import com.daimajia.easing.Skill; | |
import com.nineoldandroids.animation.AnimatorSet; |
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
import proguard.gradle.ProGuardTask | |
import java.nio.file.Paths | |
dependencies { | |
[...] | |
// Required by @task::obfuscate | |
compileOnly 'org.jetbrains:annotations:13.0' | |
} | |
def jarNameWithoutExtension = jar.archiveName.with { it.take(it.lastIndexOf(".")) } |
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
open class Action |
NewerOlder