LanarsInc / dynamic-environment-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic Environment Tool

How to

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.LanarsInc:dynamic-environment-android:LATEST'
}

Step 3. Add OkHttp interceptor

  OkHttpClient.Builder()
    .addInterceptor(DynamicEnvironmentInterceptor(context))
    .build()

Step 4. Call dialog

val dialogState = remember { mutableStateOf(false) }

if (dialogState.value) {
    DynamicEnvironmentDialog(
        baseUrl = BuildConfig.AUTH_BASE_URL,
        onDismiss = {
            dialogState.value = false
        }
    )
}

About


Languages

Language:Kotlin 100.0%