Compare commits

..

3 Commits

Author SHA1 Message Date
Jean-Baptiste
ac25e18e8a [android] Use dark background in the editor
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-11 19:07:31 +01:00
Jean-Baptiste
b4abd476db [android] Add support of dark mode for how to edit oh html file
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-11 17:37:03 +01:00
Jean-Baptiste
649d947eac [android] Improve colors of buttons in alert dialogs
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-11 14:41:42 +01:00
27 changed files with 69 additions and 43 deletions

View File

@@ -7,7 +7,7 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/margin_base"
android:paddingBottom="@dimen/margin_base"
android:background="?appBackground"
android:background="?cardBackground"
android:clickable="true"
android:focusable="true"
android:fillViewport="true"

View File

@@ -8,7 +8,7 @@
android:layout_margin="4dp"
android:clickable="true"
android:focusable="true"
app:cardBackgroundColor="?cardBackground"
app:cardBackgroundColor="?appBackground"
app:cardCornerRadius="12dp"
app:cardElevation="2dp"
tools:showIn="@layout/item_charging_sockets">

View File

@@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/elevation_profile_content_height"
android:background="?appBackground"
android:background="?cardBackground"
android:orientation="vertical">
<app.organicmaps.widget.placepage.ElevationProfileChart
android:id="@+id/elevation_profile_chart"

View File

@@ -5,7 +5,7 @@
android:id="@+id/elevation_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?appBackground"
android:background="?cardBackground"
android:clickable="true"
android:fillViewport="true"
android:focusable="true"

View File

@@ -6,6 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:background="?attr/colorSurfaceContainerHigh"
tools:context=".editor.EditorActivity">
<LinearLayout
android:layout_width="match_parent"
@@ -430,7 +431,6 @@
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="@dimen/margin_quarter"
app:backgroundTint="?cardBackground"
android:textColor="@color/base_red"
app:strokeColor="@color/base_red"
android:text="@string/editor_business_vacant_button"/>
@@ -441,7 +441,6 @@
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="@dimen/margin_base"
app:backgroundTint="?cardBackground"
android:textColor="@color/base_red"
app:strokeColor="@color/base_red"
tools:text="Reset my changes"/>

View File

@@ -2,10 +2,10 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?windowBackgroundForced"
android:background="?attr/colorSurfaceContainerHigh"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar

View File

@@ -10,13 +10,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frameLayout"
android:background="?windowBackgroundForced">
android:background="?attr/colorSurfaceContainerHigh"
android:layout_marginBottom="@dimen/margin_quarter">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/phones_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?cardBackground"
android:scrollbars="vertical" />
</FrameLayout>

View File

@@ -9,7 +9,7 @@
style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?windowBackgroundForced"
android:background="?attr/colorSurfaceContainerHigh"
android:layout_above="@+id/tv__mode_switch"
android:layout_below="@id/toolbar"/>
@@ -19,14 +19,13 @@
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv__mode_switch"
android:layout_alignParentBottom="true"
android:background="?cardBackground"/>
android:background="?attr/colorSurfaceContainerHigh"/>/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tv__mode_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?clickableBackground"
android:gravity="center_vertical"
android:padding="@dimen/margin_base"
android:text="@string/editor_time_advanced"
@@ -35,7 +34,7 @@
android:textColor="?colorSecondary" />
<include
layout="@layout/shadow_bottom"
layout="@layout/item_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/tv__mode_switch"/>

View File

@@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?windowBackgroundForced">
android:background="?attr/colorSurfaceContainerHigh">>
<LinearLayout
android:layout_width="match_parent"
@@ -17,8 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
style="@style/MwmWidget.M3.Editor.CardView"
app:cardBackgroundColor="?cardBackground">
style="@style/MwmWidget.M3.Editor.CardView">
<LinearLayout
android:id="@+id/examples"

View File

@@ -4,7 +4,7 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?windowBackgroundForced"
android:background="?attr/colorSurfaceContainerHigh"
android:paddingStart="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:scrollbars="vertical"/>

View File

@@ -6,7 +6,7 @@
android:layout_margin="4dp"
android:clickable="true"
android:focusable="true"
app:cardBackgroundColor="?cardBackground"
app:cardBackgroundColor="?appBackground"
app:cardCornerRadius="12dp"
app:cardElevation="2dp">

View File

@@ -21,5 +21,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/edit_socket_info_tooltip"
android:textAppearance="?android:attr/textAppearanceSmall" />
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginBottom="@dimen/margin_quarter"/>
</LinearLayout>

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:background="?appBackground"
android:background="?cardBackground"
android:orientation="vertical">
<include
android:id="@+id/pp__preview"

View File

@@ -12,7 +12,7 @@
style="@style/MwmWidget.M3.Button.Secondary"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:backgroundTint="?colorSurfaceContainerLow"
android:backgroundTint="?colorSurfaceContainerLow"
app:backgroundTint="?windowBackgroundForced"
android:backgroundTint="?windowBackgroundForced"
android:text="@string/placepage_add_place_button" />
</LinearLayout>

View File

@@ -9,7 +9,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal|top"
android:background="?appBackground"
android:background="?ppBackground"
android:visibility="gone" />
<androidx.core.widget.NestedScrollView
android:id="@+id/placepage"

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurfaceContainerLow"
android:background="?windowBackgroundForced"
android:orientation="vertical">
@@ -13,7 +13,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?appBackground"
android:background="?ppBackground"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView

View File

@@ -11,7 +11,7 @@
style="@style/MwmWidget.M3.Button.Secondary"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:backgroundTint="?colorSurfaceContainerLow"
android:backgroundTint="?colorSurfaceContainerLow"
app:backgroundTint="?windowBackgroundForced"
android:backgroundTint="?windowBackgroundForced"
android:text="@string/edit_place"/>
</LinearLayout>

View File

@@ -9,7 +9,7 @@ android:layout_marginHorizontal="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_half"
app:strokeWidth="1dp"
app:strokeColor="@color/base_accent"
app:cardBackgroundColor="?appBackground">
app:cardBackgroundColor="?cardBackground">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -8,6 +8,6 @@
android:id="@+id/rw__phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?appBackground"
android:background="?cardBackground"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>

View File

@@ -189,7 +189,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?appBackground"
android:background="?ppBackground"
android:orientation="horizontal">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/item_icon"

View File

@@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?appBackground"
android:background="?cardBackground"
android:orientation="vertical">
<View
android:layout_width="match_parent"

View File

@@ -4,7 +4,7 @@
android:id="@+id/pp_buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorSurfaceContainerLow"
android:background="?windowBackgroundForced"
android:orientation="horizontal"
android:layout_gravity="bottom">
<include layout="@layout/item_divider" />

View File

@@ -4,5 +4,5 @@
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?cardBackground"
android:background="?appBackground"
android:scrollbars="vertical"/>

View File

@@ -89,7 +89,7 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">@dimen/margin_half</item>
<item name="cardBackgroundColor">?cardBackground</item>
<item name="cardBackgroundColor">?appBackground</item>
<item name="android:padding">@dimen/margin_base</item>
<item name="cardPreventCornerOverlap">false</item>
</style>

View File

@@ -239,10 +239,6 @@
<item name="android:foreground">@drawable/shadow_top</item>
</style>
<style name="MwmWidget.FrameLayout.BookmarkCategories">
<item name="android:background">?windowBackgroundForced</item>
</style>
<style name="MwmWidget.Counter">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>

View File

@@ -278,15 +278,21 @@
<style name="MwmTheme.Navigation">
<item name="iconTint">@color/white_primary</item>
</style>
<style name="PopupMenu" parent="ThemeOverlay.Material3">
<item name="android:popupBackground">?windowBackgroundForced</item>
</style>
<!-- Theme required to apply M3 dialog style on preference screen -->
<style name="MwmTheme.M3.AlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="dialogCornerRadius">28dp</item>
<item name="cornerFamily">rounded</item>
<item name="android:colorBackground">?attr/colorSurfaceContainerHigh</item>
<item name="android:layout">@layout/m3_alert_dialog</item>
<item name="buttonBarPositiveButtonStyle">@style/MwmTheme.M3.AlertDialog.Button</item>
<item name="buttonBarNegativeButtonStyle">@style/MwmTheme.M3.AlertDialog.Button</item>
<item name="buttonBarNeutralButtonStyle">@style/MwmTheme.M3.AlertDialog.Button.Neutral</item>
</style>
<style name="MwmTheme.M3.AlertDialog.Button" parent="@style/Widget.Material3.Button.TextButton.Dialog">
<item name="android:textColor">?colorSecondary</item>
</style>
<style name="MwmTheme.M3.AlertDialog.Button.Neutral" parent="@style/Widget.Material3.Button.TextButton.Dialog.Flush">
<item name="android:textColor">?colorSecondary</item>
</style>
</resources>

View File

@@ -2,12 +2,38 @@
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<style>
/* All langs are invisible by default. */
[lang] {
display: none;
}
/* Dark mode support. */
:root {
color-scheme: light dark;
--primary-color: black;
--secondary-color: #555555;
--link-color: #37653F;
--background-color: white;
--separator-color: #0e0e0e;
}
@media screen and (prefers-color-scheme: dark) {
:root {
--primary-color: #b5b5b5;
--secondary-color: #858585;
--link-color: #659464;
--background-color: black;
--separator-color: #0a0a0a;
}
}
html {
color: var(--secondary-color);
background-color: var(--background-color);
}
.example {
font-weight: bold;
font-family: monospace;