Compare commits

...
6 Commits
10 changed files with 62 additions and 22 deletions
@@ -90,7 +90,7 @@ class RecorderModule @Inject constructor(
private fun createRecordingFilePath() = File(
File(context.cacheDir, "debug/logs"),
"bb_logfile_${System.currentTimeMillis()}.log"
"capod_logfile_${System.currentTimeMillis()}.log"
)
suspend fun startRecorder(): File {
@@ -123,6 +123,6 @@ class RecorderModule @Inject constructor(
companion object {
internal val TAG = logTag("Debug", "Log", "Recorder", "Module")
private const val FORCE_FILE = "bb_force_debug_run"
private const val FORCE_FILE = "capod_force_debug_run"
}
}
@@ -34,6 +34,7 @@ class DebugSettingsFragment : PreferenceFragment2() {
vm.toggleRecorder()
true
}
super.onViewCreated(view, savedInstanceState)
}
@@ -3,10 +3,15 @@ package eu.darken.capod.main.ui.settings.general.debug
import androidx.lifecycle.SavedStateHandle
import dagger.hilt.android.lifecycle.HiltViewModel
import eu.darken.capod.common.coroutine.DispatcherProvider
import eu.darken.capod.common.debug.autoreport.DebugSettings
import eu.darken.capod.common.debug.logging.log
import eu.darken.capod.common.debug.logging.logTag
import eu.darken.capod.common.debug.recording.core.RecorderModule
import eu.darken.capod.common.uix.ViewModel3
import eu.darken.capod.main.core.GeneralSettings
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.onEach
import javax.inject.Inject
@HiltViewModel
@@ -14,10 +19,24 @@ class DebugSettingsFragmentVM @Inject constructor(
private val handle: SavedStateHandle,
dispatcherProvider: DispatcherProvider,
private val recorderModule: RecorderModule,
private val generalSettings: GeneralSettings,
private val debugSettings: DebugSettings,
) : ViewModel3(dispatcherProvider) {
val state = recorderModule.state.asLiveData2()
init {
debugSettings.showUnfiltered.flow
.distinctUntilChanged()
.onEach { showUnfiltered ->
if (showUnfiltered) {
log(TAG) { "Enabling 'show all' due to debug setting 'show unfiltered' enabled" }
generalSettings.showAll.value = true
}
}
.launchInViewModel()
}
fun toggleRecorder() = launch {
if (recorderModule.state.first().isRecording) {
recorderModule.stopRecorder()
@@ -18,12 +18,12 @@
<ImageView
android:id="@+id/pod_left_icon"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_airpod_left_24" />
<TextView
android:id="@+id/pod_left_label"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -31,12 +31,12 @@
<ImageView
android:id="@+id/pod_left_charging"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_power_24" />
<ImageView
android:id="@+id/pod_left_ear"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_hearing_24" />
</LinearLayout>
@@ -52,12 +52,12 @@
<ImageView
android:id="@+id/pod_case_icon"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_airpod_case_24" />
<TextView
android:id="@+id/pod_case_label"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -65,7 +65,7 @@
<ImageView
android:id="@+id/pod_case_charging"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_power_24" />
</LinearLayout>
@@ -81,12 +81,12 @@
<ImageView
android:id="@+id/pod_right_icon"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_airpod_right_24" />
<TextView
android:id="@+id/pod_right_label"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -94,12 +94,12 @@
<ImageView
android:id="@+id/pod_right_charging"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_power_24" />
<ImageView
android:id="@+id/pod_right_ear"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_hearing_24" />
</LinearLayout>
@@ -7,7 +7,7 @@
<TextView
android:id="@+id/headphones_label"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
@@ -21,12 +21,12 @@
<ImageView
android:id="@+id/headphones_battery_icon"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_battery_unknown_24" />
<TextView
android:id="@+id/headphones_battery_label"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -35,12 +35,12 @@
<ImageView
android:id="@+id/headphones_charging"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_power_24" />
<ImageView
android:id="@+id/headphones_worn"
style="@style/PodInfoItemIcon"
style="@style/PodInfoItemIcon.Notification"
android:src="@drawable/ic_baseline_hearing_24" />
</LinearLayout>
@@ -6,7 +6,7 @@
<TextView
android:id="@+id/device"
style="@style/TextAppearance.Compat.Notification.Title"
style="@style/PodInfoItemText.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
+1 -1
View File
@@ -135,5 +135,5 @@
<string name="settings_compatibility_mode_label">Kompatibilitätsmodus</string>
<string name="settings_compatibility_mode_description">Deaktivieren Sie Optimierungen, um die Kompatibilität zu verbessern. Versuchen Sie dies, wenn Sie keine Daten sehen.</string>
<string name="translators_thanks_title">Übersetzer</string>
<string name="translators_thanks_description" comment="translators_thanks_description&#10;&#10;You can voluntarily add your name here to have it displayed in the app. It will be shown in the Settings&gt;Acknowledgements&gt;Thank you section.&#10;&#10;Separate names by semicolons and an optional email may be included in brackets, example:&#10;&#10;darken(darken@darken.eu);John Doe(john@example.com)&#10;&#10;&quot;darken&quot; is just a placeholder and does not have to be kept if/when you add yours.&#10;&#10;Be nice to each other!">darken</string>
<string name="translators_thanks_description" comment="translators_thanks_description&#10;&#10;You can voluntarily add your name here to have it displayed in the app. It will be shown in the Settings&gt;Acknowledgements&gt;Thank you section.&#10;&#10;Separate names by semicolons and an optional email may be included in brackets, example:&#10;&#10;darken(darken@darken.eu);John Doe(john@example.com)&#10;&#10;&quot;darken&quot; is just a placeholder and does not have to be kept if/when you add yours.&#10;&#10;Be nice to each other!">Gamechanger181</string>
</resources>
+10
View File
@@ -134,4 +134,14 @@
<string name="permission_required_title">Izin berikut diperlukan:</string>
<string name="settings_compatibility_mode_label">Mode kompatibilitas</string>
<string name="settings_compatibility_mode_description">Nonaktifkan pengoptimalan untuk meningkatkan kompatibilitas. Coba ini jika anda tidak melihat data apa pun.</string>
<string name="translators_thanks_title">Penerjemah</string>
<string name="translators_thanks_description" comment="translators_thanks_description&#10;&#10;You can voluntarily add your name here to have it displayed in the app. It will be shown in the Settings&gt;Acknowledgements&gt;Thank you section.&#10;&#10;Separate names by semicolons and an optional email may be included in brackets, example:&#10;&#10;darken(darken@darken.eu);John Doe(john@example.com)&#10;&#10;&quot;darken&quot; is just a placeholder and does not have to be kept if/when you add yours.&#10;&#10;Be nice to each other!">nama anda dapat ditambahkan sebagai relawan di sini dan ditampilkan di aplikasi. Itu akan ditampilkan pada bagian Pengaturan>Penghargaan>Terima kasih
Pisahkan nama dengan titik koma dan email opsional dapat dimasukkan dalam tanda kurung, contoh:
𝓼𝓾𝓵𝓽𝓪𝓷 𝓱𝓪𝓶𝓴𝓪(sultanhamka@gmail.com); John Doe(john@example.com)
\"𝓼𝓾𝓵𝓽𝓪𝓷 𝓱𝓪𝓶𝓴𝓪\" hanyalah pengganti dan tidak harus disimpan jika/ketika anda menambahkan milik anda.
Bersikap baik satu sama lain!</string>
</resources>
+11 -1
View File
@@ -7,7 +7,17 @@
<item name="android:layout_marginEnd">8dp</item>
</style>
<style name="PodInfoItemIcon">
<style name="PodInfoItemIcon.Notification" parent="TextAppearance.Compat.Notification.Title">
<item name="android:layout_height">20dp</item>
<item name="android:layout_width">20dp</item>
</style>
<style name="PodInfoItemText.Notification" parent="TextAppearance.Compat.Notification.Title">
<item name="android:singleLine">true</item>
<item name="android:ellipsize">end</item>
</style>
<style name="PodInfoItemIcon" parent="TextAppearance.MaterialComponents.Body2">
<item name="android:layout_height">20dp</item>
<item name="android:layout_width">20dp</item>
</style>
+1 -1
View File
@@ -8,7 +8,7 @@ buildscript {
'version' : [
'major': 1,
'minor': 3,
'patch': 10,
'patch': 12,
'build': 0,
],
]