Skip to content

Commit

Permalink
feat: Add hint for old Android version for video recorder custom fold…
Browse files Browse the repository at this point in the history
…er notice
  • Loading branch information
Myzel394 committed Dec 29, 2023
1 parent 4950dc3 commit 8b4c46a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
Expand All @@ -28,6 +30,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -36,6 +39,7 @@ import androidx.documentfile.provider.DocumentFile
import app.myzel394.alibi.R
import app.myzel394.alibi.dataStore
import app.myzel394.alibi.db.AppSettings
import app.myzel394.alibi.ui.VIDEO_RECORDER_SUPPORTS_CUSTOM_FOLDER
import app.myzel394.alibi.ui.components.atoms.SettingsTile
import app.myzel394.alibi.ui.utils.rememberFolderSelectorDialog
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -214,6 +218,37 @@ fun SaveFolderTile(
modifier = Modifier.fillMaxWidth(),
)
}
if (!VIDEO_RECORDER_SUPPORTS_CUSTOM_FOLDER) {
Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(horizontal = 32.dp, vertical = 8.dp),
) {
Icon(
Icons.Default.Warning,
contentDescription = null,
tint = Color.Yellow,
modifier = Modifier.size(ButtonDefaults.IconSize),
)
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Text(
stringResource(R.string.ui_settings_option_saveFolder_videoUnsupported),
style = MaterialTheme.typography.bodySmall,
color = Color.Yellow,
)
Text(
stringResource(R.string.ui_minApiRequired, 8, 26),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurface,
)
}
}
}
}
}
)
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,6 @@
<string name="ui_settings_option_enableAppLock_enrollmentRequired">Please enroll a password or a biometric unlock method first</string>
<string name="identityVerificationRequired_title">Verification required</string>
<string name="identityVerificationRequired_subtitle">You need to verify your identity to continue</string>
<string name="ui_settings_option_saveFolder_videoUnsupported">Custom folders for Video Recordings aren\'t supported by your Android version. Alibi will fallback to the internal folder instead for Video Recordings.</string>
<string name="ui_minApiRequired">You will need an Android phone running at least Android %s (API-Level: %s) to use this feature</string>
</resources>

0 comments on commit 8b4c46a

Please sign in to comment.