Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ plugins {
}

android {
namespace "com.launchdarkly.hello_android"
compileSdk 37
namespace = "com.launchdarkly.hello_android"
compileSdk = 37
defaultConfig {
applicationId "com.launchdarkly.hello_android"
applicationId = "com.launchdarkly.hello_android"
minSdkVersion(24)
targetSdkVersion(34)
versionCode 1
versionName "1.0"
versionCode = 1
versionName = "1.0"
}
buildTypes {
release {
minifyEnabled false
minifyEnabled = false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.launchdarkly.hello_android.MainApplication.Companion.LAUNCHDARKLY_MOBILE_KEY
import com.launchdarkly.sdk.android.LDClient

Expand Down Expand Up @@ -36,11 +37,11 @@ class MainActivity : AppCompatActivity() {
)

// Style the display
textView.setTextColor(resources.getColor(R.color.colorText))
textView.setTextColor(ContextCompat.getColor(this, R.color.colorText))
if(flagValue) {
fullView.setBackgroundColor(resources.getColor(R.color.colorBackgroundTrue))
fullView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorBackgroundTrue))
} else {
fullView.setBackgroundColor(resources.getColor(R.color.colorBackgroundFalse))
fullView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorBackgroundFalse))
}

// to register a listener to get updates in real time
Expand All @@ -52,9 +53,9 @@ class MainActivity : AppCompatActivity() {
changedFlagValue.toString()
)
if(changedFlagValue) {
fullView.setBackgroundColor(resources.getColor(R.color.colorBackgroundTrue))
fullView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorBackgroundTrue))
} else {
fullView.setBackgroundColor(resources.getColor(R.color.colorBackgroundFalse))
fullView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorBackgroundFalse))
}
}
}
Expand Down
Loading