Skip to content
Open
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
Binary file added aa-stream-v1.1.0.35-debug.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import kotlinx.android.synthetic.main.view_settings_audio.*
import kotlinx.android.synthetic.main.view_settings_brightness.*
import kotlinx.android.synthetic.main.view_settings_debug.*
import kotlinx.android.synthetic.main.view_settings_immersive.*
import kotlinx.android.synthetic.main.view_settings_fullscreen.*
import kotlinx.android.synthetic.main.view_settings_resize.*
import kotlinx.android.synthetic.main.view_settings_rotation.*
import kotlinx.android.synthetic.main.view_settings_sidebar.*
Expand Down Expand Up @@ -155,6 +156,13 @@ class SettingsActivity : AppCompatActivity() {
}
preferences.putBoolean(PreferenceHandler.KEY_IMMERSIVE_MODE, isChecked)
}

// FullScreen controller
settings_fullscreen_switch.isChecked = preferences.getBoolean(PreferenceHandler.KEY_FULLSCREEN_MODE, false)
settings_fullscreen_switch.setOnCheckedChangeListener { _, isChecked ->
DevLog.d("Fullscreen switch changed: $isChecked")
preferences.putBoolean(PreferenceHandler.KEY_FULLSCREEN_MODE, isChecked)
}

// Audio controller
settings_audio_switch.isChecked = preferences.getBoolean(PreferenceHandler.KEY_AUDIO_FOCUS, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class CarActivityController(val context: Application) : OnScreenLockCallback, On
audioHandler.start()
orientationListener.enable()
displayHandler.changeDisplaySettings()
checkFullScreen()
brightnessHandler.setScreenBrightness()
rotationHandler.setScreenRotation()
context.registerReceiver(screenLockReceiver, screenFilter)
Expand Down Expand Up @@ -710,4 +711,12 @@ class CarActivityController(val context: Application) : OnScreenLockCallback, On
VIEW_TERMINAL(3)
}
}
}

private fun checkFullScreen(){
if (preferences.getBoolean(PreferenceHandler.KEY_FULLSCREEN_MODE, false)) {
rootView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_IMMERSIVE or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ class PreferenceHandler(context: Application) {
const val KEY_OPEN_MENU_METHOD = "menu_open_method"
const val KEY_RESIZE_ENABLED = "resize_enabled"
const val KEY_IMMERSIVE_MODE = "immersive_mode"
const val KEY_FULLSCREEN_MODE = "fullscreen_mode"
}
}
8 changes: 7 additions & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<include layout="@layout/view_settings_immersive"
android:id="@+id/view_settings_immersive" />

<View style="@style/DividerStyle"/>

<!-- Full Screen control -->
<include layout="@layout/view_settings_fullscreen"
android:id="@+id/view_settings_fullscreen" />

<View style="@style/DividerStyle"/>

<!-- Audio control -->
Expand All @@ -67,4 +73,4 @@
android:id="@+id/view_settings_about" />

</LinearLayout>
</ScrollView>
</ScrollView>
40 changes: 40 additions & 0 deletions app/src/main/res/layout/view_settings_fullscreen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/settings_immersive_holder"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/settings_fullscreen_switch"
app:layout_constraintStart_toStartOf="parent">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/txt_force_fullscreen_title"
style="@style/TitleTextStyle"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/txt_force_fullscreen_subtitle"
style="@style/SubtitleTextStyle"/>

</LinearLayout>

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/settings_fullscreen_switch"
style="@style/SwitchStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/settings_immersive_holder"
app:layout_constraintBottom_toBottomOf="@id/settings_immersive_holder"
app:layout_constraintTop_toTopOf="@id/settings_immersive_holder"/>

</androidx.constraintlayout.widget.ConstraintLayout>
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 @@ -74,4 +74,6 @@
</string>
<string name="txt_force_immersive_title">Force immersive mode</string>
<string name="txt_force_immersive_subtitle">Enable this setting to force immersive mode</string>
<string name="txt_force_fullscreen_title">FullScreen mode in Android Auto</string>
<string name="txt_force_fullscreen_subtitle">Enable this setting to force FullScreen mode</string>
</resources>