File tree Expand file tree Collapse file tree
kotlin/org/btcmap/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ class SettingsFragment : Fragment() {
5959 refreshAllColors()
6060 }
6161
62+ binding.showDebugInfo.isChecked = prefs.showDebugInfo
63+ binding.showDebugInfo.setOnCheckedChangeListener { _, isChecked ->
64+ prefs.showDebugInfo = isChecked
65+ }
66+
6267 initMarkerBackgroundButton()
6368 initMarkerIconButton()
6469
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.content.Context.MODE_PRIVATE
55import android.content.SharedPreferences
66import android.content.res.Configuration
77import androidx.core.content.edit
8+ import org.btcmap.BuildConfig
89import org.btcmap.R
910import org.maplibre.android.geometry.LatLngBounds
1011import androidx.core.graphics.toColorInt
@@ -365,4 +366,12 @@ var SharedPreferences.authToken: String?
365366 }
366367
367368val SharedPreferences .authorized: Boolean
368- get() = ! getString(KEY_AUTH_TOKEN , null ).isNullOrBlank()
369+ get() = ! getString(KEY_AUTH_TOKEN , null ).isNullOrBlank()
370+
371+ private const val KEY_SHOW_DEBUG_INFO = " show_debug_info"
372+
373+ var SharedPreferences .showDebugInfo: Boolean
374+ get() = getBoolean(KEY_SHOW_DEBUG_INFO , BuildConfig .DEBUG )
375+ set(value) {
376+ edit { putBoolean(KEY_SHOW_DEBUG_INFO , value) }
377+ }
Original file line number Diff line number Diff line change 360360
361361 </LinearLayout >
362362
363+ <LinearLayout
364+ android : layout_width =" match_parent"
365+ android : layout_height =" wrap_content"
366+ android : gravity =" center_vertical"
367+ android : minHeight =" 64dp"
368+ android : orientation =" horizontal"
369+ android : paddingStart =" 16dp"
370+ android : paddingEnd =" 16dp" >
371+
372+ <TextView
373+ android : layout_width =" 0dp"
374+ android : layout_height =" wrap_content"
375+ android : layout_weight =" 1"
376+ android : text =" @string/show_debug_info"
377+ android : textColor =" ?colorOnSurface"
378+ android : textSize =" 16sp" />
379+
380+ <com .google.android.material.materialswitch.MaterialSwitch
381+ android : id =" @+id/showDebugInfo"
382+ android : layout_width =" wrap_content"
383+ android : layout_height =" wrap_content" />
384+
385+ </LinearLayout >
386+
363387 <Space
364388 android : layout_width =" match_parent"
365389 android : layout_height =" 40dp" />
Original file line number Diff line number Diff line change 9797 <string name =" click_to_see_your_profile" tools : ignore =" MissingTranslation" >Click to see your profile</string >
9898 <string name =" delete" tools : ignore =" MissingTranslation" >Delete</string >
9999 <string name =" upcoming_events" tools : ignore =" MissingTranslation" >Upcoming events</string >
100+ <string name =" show_debug_info" tools : ignore =" MissingTranslation" >Show debug info</string >
100101</resources >
You can’t perform that action at this time.
0 commit comments