diff --git a/app/build.gradle b/app/build.gradle index f9567d5..0b2058f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,12 +9,12 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { applicationId "com.simplemobiletools.flashlight" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 51 versionName "5.5.3" setProperty("archivesBaseName", "flashlight") @@ -61,7 +61,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:03e4d214b1' + implementation 'com.github.SimpleMobileTools:Simple-Commons:7e87bb9089' implementation 'org.greenrobot:eventbus:3.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2392da2..b7d7d66 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,6 +29,7 @@ @@ -41,6 +42,7 @@ @@ -50,6 +52,7 @@ @@ -59,36 +62,49 @@ + android:parentActivityName=".activities.MainActivity"> + + + + + + @@ -101,6 +117,7 @@ @@ -113,6 +130,7 @@ @@ -124,6 +142,7 @@ @@ -137,6 +156,7 @@ @@ -150,6 +170,7 @@ @@ -163,6 +184,7 @@ @@ -176,6 +198,7 @@ @@ -189,6 +212,7 @@ @@ -202,6 +226,7 @@ @@ -215,6 +240,7 @@ @@ -228,6 +254,7 @@ @@ -241,6 +268,7 @@ @@ -254,6 +282,7 @@ @@ -267,6 +296,7 @@ @@ -280,6 +310,7 @@ @@ -293,6 +324,7 @@ @@ -306,6 +338,7 @@ @@ -318,6 +351,7 @@ @@ -331,6 +365,7 @@ @@ -344,6 +379,7 @@ @@ -357,6 +393,7 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt index 4099553..082f17d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt @@ -210,11 +210,11 @@ class MainActivity : SimpleActivity() { private fun cameraPermissionGranted(isSOS: Boolean) { if (isSOS) { val isSOSRunning = mCameraImpl!!.toggleSOS() - sos_btn.setTextColor(if (isSOSRunning) getAdjustedPrimaryColor() else getContrastColor()) + sos_btn.setTextColor(if (isSOSRunning) getProperPrimaryColor() else getContrastColor()) } else { if (mCameraImpl!!.toggleStroboscope()) { stroboscope_bar.beInvisibleIf(stroboscope_bar.isVisible()) - changeIconColor(if (stroboscope_bar.isVisible()) getAdjustedPrimaryColor() else getContrastColor(), stroboscope_btn) + changeIconColor(if (stroboscope_bar.isVisible()) getProperPrimaryColor() else getContrastColor(), stroboscope_btn) } } } @@ -251,7 +251,7 @@ class MainActivity : SimpleActivity() { } private fun enableFlashlight() { - changeIconColor(getAdjustedPrimaryColor(), flashlight_btn) + changeIconColor(getProperPrimaryColor(), flashlight_btn) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) mIsFlashlightOn = true diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt index fe41bda..1062c5a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt @@ -32,7 +32,7 @@ class SettingsActivity : SimpleActivity() { invalidateOptionsMenu() arrayOf(settings_color_customization_label, settings_general_settings_label).forEach { - it.setTextColor(getAdjustedPrimaryColor()) + it.setTextColor(getProperPrimaryColor()) } arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach { diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetBrightDisplayProvider.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetBrightDisplayProvider.kt index 2a28a48..5dc34f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetBrightDisplayProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetBrightDisplayProvider.kt @@ -38,7 +38,7 @@ class MyWidgetBrightDisplayProvider : AppWidgetProvider() { private fun setupAppOpenIntent(context: Context, views: RemoteViews) { Intent(context, BrightDisplayActivity::class.java).apply { - val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT) + val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE) views.setOnClickPendingIntent(R.id.bright_display_btn, pendingIntent) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetTorchProvider.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetTorchProvider.kt index f55a132..eec512c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetTorchProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyWidgetTorchProvider.kt @@ -30,7 +30,7 @@ class MyWidgetTorchProvider : AppWidgetProvider() { appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach { val views = RemoteViews(context.packageName, R.layout.widget_torch) - val pendingIntent = PendingIntent.getBroadcast(context, it, intent, PendingIntent.FLAG_UPDATE_CURRENT) + val pendingIntent = PendingIntent.getBroadcast(context, it, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE) views.setOnClickPendingIntent(R.id.flashlight_btn, pendingIntent) views.setImageViewBitmap(R.id.flashlight_btn, bmp) appWidgetManager.updateAppWidget(it, views) diff --git a/build.gradle b/build.gradle index 4105770..8f697cf 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f807f01..686ec53 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip