diff --git a/app/src/main/java/com/kylecorry/trail_sense/tools/ui/Tools.kt b/app/src/main/java/com/kylecorry/trail_sense/tools/ui/Tools.kt index a65c66ec9..711b0cee6 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/tools/ui/Tools.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/tools/ui/Tools.kt @@ -23,6 +23,7 @@ object Tools { val hasLightMeter = Sensors.hasSensor(context, Sensor.TYPE_LIGHT) val hasPedometer = Sensors.hasSensor(context, Sensor.TYPE_STEP_COUNTER) val hasCompass = SensorService(context).hasCompass() + val hasBarometer = Sensors.hasBarometer(context) val prefs = UserPreferences(context) val signaling = ToolGroup( context.getString(R.string.tool_category_signaling), listOf( @@ -61,6 +62,16 @@ object Tools { val location = ToolGroup( context.getString(R.string.location), listOfNotNull( + Tool( + context.getString(R.string.navigation), + R.drawable.ic_compass_icon, + R.id.action_navigation + ), + Tool( + context.getString(R.string.beacons), + R.drawable.ic_location, + R.id.action_tools_to_beacons + ), Tool( context.getString(R.string.photo_maps), R.drawable.maps, @@ -104,6 +115,11 @@ object Tools { R.drawable.ic_tool_clock, R.id.action_action_experimental_tools_to_toolClockFragment ), + Tool( + context.getString(R.string.astronomy), + R.drawable.ic_astronomy, + R.id.action_astronomy + ), Tool( context.getString(R.string.water_boil_timer), R.drawable.ic_tool_boil, @@ -142,6 +158,11 @@ object Tools { val weather = ToolGroup( context.getString(R.string.weather), listOfNotNull( + if (hasBarometer) Tool( + context.getString(R.string.weather), + R.drawable.cloud, + R.id.action_weather + ) else null, Tool( context.getString(R.string.tool_climate), R.drawable.ic_temperature_range, @@ -207,6 +228,21 @@ object Tools { R.drawable.ic_qr_code, R.id.action_tools_to_qr ), + Tool( + context.getString(R.string.sensors), + R.drawable.ic_sensors, + R.id.sensorDetailsFragment + ), + Tool( + context.getString(R.string.diagnostics), + R.drawable.ic_alert, + R.id.action_tools_to_diagnostics + ), + Tool( + context.getString(R.string.settings), + R.drawable.ic_settings, + R.id.action_settings + ), Tool( context.getString(R.string.tool_user_guide_title), R.drawable.ic_user_guide, diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index ab5520a71..7b1ec868d 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -56,6 +56,13 @@ android:id="@+id/action_experimental_tools" android:name="com.kylecorry.trail_sense.tools.ui.ToolsFragment" android:label="ToolsFragment"> + +