feat: Add service to receive locale for Android <= 12

This commit is contained in:
Myzel394 2023-08-10 19:28:08 +02:00
parent a10bba9b75
commit 7b0230d4f2
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
4 changed files with 14 additions and 2 deletions

View File

@ -96,6 +96,7 @@ dependencies {
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation "androidx.compose.material:material-icons-extended:1.4.3"
implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

View File

@ -38,6 +38,16 @@
</intent-filter>
</receiver>
<service android:name=".services.AudioRecorderService" android:foregroundServiceType="microphone|camera" />
<!-- Change locale for Android <= 12 -->
<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>
</application>
</manifest>

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.datastore.dataStore
import app.myzel394.alibi.db.AppSettingsSerializer
import app.myzel394.alibi.ui.Navigation
@ -15,7 +16,7 @@ val Context.dataStore by dataStore(
serializer = AppSettingsSerializer()
)
class MainActivity : ComponentActivity() {
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Alibi" parent="android:Theme.Material.Light.NoActionBar">
<style name="Theme.Alibi" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowContentOverlay">@color/windowBackground</item>
<item name="android:windowBackground">@color/windowBackground</item>