mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Debug: Hide drop table in non-debug builds
This commit is contained in:
+5
-1
@@ -18,6 +18,7 @@ import androidx.preference.PreferenceViewHolder
|
||||
import com.google.android.material.datepicker.CalendarConstraints
|
||||
import com.google.android.material.datepicker.MaterialDatePicker
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication
|
||||
import nodomain.freeyourgadget.gadgetbridge.R
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils
|
||||
@@ -65,7 +66,10 @@ class DatabaseTableDebugFragment : AbstractDebugFragment() {
|
||||
|
||||
onClick(PREF_DEBUG_CLEAR_TABLE) { clearTable(tableName) }
|
||||
|
||||
onClick(PREF_DEBUG_DROP_TABLE) { dropTable(tableName) }
|
||||
if (BuildConfig.DEBUG) {
|
||||
findPreference<Preference>(PREF_DEBUG_DROP_TABLE)?.isVisible = true
|
||||
onClick(PREF_DEBUG_DROP_TABLE) { dropTable(tableName) }
|
||||
}
|
||||
|
||||
val ddl = getTableDdl(tableName)
|
||||
|
||||
|
||||
@@ -36,13 +36,15 @@
|
||||
android:summary="Warning! By pushing this button all data from the table will be deleted."
|
||||
android:title="Clear table" />
|
||||
|
||||
<!-- only in debug builds -->
|
||||
<Preference
|
||||
android:dependency="dangerous_actions"
|
||||
android:icon="@drawable/ic_delete_forever"
|
||||
android:key="pref_debug_drop_table"
|
||||
android:persistent="false"
|
||||
android:summary="Warning! By pushing this button the table will be dropped to the database and must be re-created."
|
||||
android:title="Drop table" />
|
||||
android:title="Drop table"
|
||||
app:isPreferenceVisible="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
||||
Reference in New Issue
Block a user