diff --git a/app/src/main/java/com/bnyro/recorder/ui/components/SettingsBottomSheet.kt b/app/src/main/java/com/bnyro/recorder/ui/components/SettingsBottomSheet.kt
index 3edef16b..0f8b4218 100644
--- a/app/src/main/java/com/bnyro/recorder/ui/components/SettingsBottomSheet.kt
+++ b/app/src/main/java/com/bnyro/recorder/ui/components/SettingsBottomSheet.kt
@@ -228,6 +228,14 @@ fun SettingsBottomSheet(
)
}
Spacer(modifier = Modifier.height(10.dp))
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ CheckboxPref(
+ prefKey = Preferences.showOverlayAnnotationToolKey,
+ title = stringResource(R.string.screen_recorder_annotation),
+ summary = stringResource(R.string.screen_recorder_annotation_desc)
+ )
+ }
+ Spacer(modifier = Modifier.height(10.dp))
NamingPatternPref()
}
diff --git a/app/src/main/java/com/bnyro/recorder/ui/models/RecorderModel.kt b/app/src/main/java/com/bnyro/recorder/ui/models/RecorderModel.kt
index 323a2931..b3318438 100644
--- a/app/src/main/java/com/bnyro/recorder/ui/models/RecorderModel.kt
+++ b/app/src/main/java/com/bnyro/recorder/ui/models/RecorderModel.kt
@@ -18,13 +18,13 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.core.content.ContextCompat
import androidx.lifecycle.ViewModel
+import com.bnyro.recorder.canvas_overlay.CanvasOverlay
import com.bnyro.recorder.enums.AudioSource
import com.bnyro.recorder.enums.RecorderState
import com.bnyro.recorder.services.AudioRecorderService
import com.bnyro.recorder.services.LosslessRecorderService
import com.bnyro.recorder.services.RecorderService
import com.bnyro.recorder.services.ScreenRecorderService
-import com.bnyro.recorder.canvas_overlay.CanvasOverlay
import com.bnyro.recorder.util.PermissionHelper
import com.bnyro.recorder.util.Preferences
@@ -61,7 +61,9 @@ class RecorderModel : ViewModel() {
activityResult = result
val serviceIntent = Intent(context, ScreenRecorderService::class.java)
startRecorderService(context, serviceIntent)
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ val showOverlayAnnotation =
+ Preferences.prefs.getBoolean(Preferences.showOverlayAnnotationToolKey, false)
+ if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) && showOverlayAnnotation) {
canvasOverlay = CanvasOverlay(context)
canvasOverlay?.showAll()
}
diff --git a/app/src/main/java/com/bnyro/recorder/util/Preferences.kt b/app/src/main/java/com/bnyro/recorder/util/Preferences.kt
index bebfe9b5..5c1edbcb 100644
--- a/app/src/main/java/com/bnyro/recorder/util/Preferences.kt
+++ b/app/src/main/java/com/bnyro/recorder/util/Preferences.kt
@@ -19,6 +19,7 @@ object Preferences {
const val themeModeKey = "themeMode"
const val losslessRecorderKey = "losslessRecorder"
const val namingPatternKey = "namingPattern"
+ const val showOverlayAnnotationToolKey = "annotationTool"
fun init(context: Context) {
prefs = context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE)
@@ -29,4 +30,4 @@ object Preferences {
}
fun getString(key: String, defValue: String) = prefs.getString(key, defValue) ?: defValue
-}
+}
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c19a040b..5675c40d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -64,4 +64,6 @@
System
Dark
Light
+ Screen Record Annotation
+ Show annotation tool during screen recording
\ No newline at end of file