diff --git a/Simplenote/build.gradle b/Simplenote/build.gradle index a48c58be2..d070f825d 100644 --- a/Simplenote/build.gradle +++ b/Simplenote/build.gradle @@ -109,7 +109,7 @@ dependencies { // Fastlane screengrab for screenshots automation androidTestImplementation "tools.fastlane:screengrab:$screengrabVersion" // Automattic and WordPress dependencies - implementation 'com.automattic:simperium:v1.3.1' + implementation 'com.automattic:simperium:v1.4.0' implementation "com.automattic:Automattic-Tracks-Android:$automatticTracksVersion" implementation "com.automattic.tracks:crashlogging:$automatticTracksVersion" diff --git a/Simplenote/src/main/java/com/automattic/simplenote/authentication/NewCredentialsActivity.kt b/Simplenote/src/main/java/com/automattic/simplenote/authentication/NewCredentialsActivity.kt index 4b47e4f0d..bebe34929 100644 --- a/Simplenote/src/main/java/com/automattic/simplenote/authentication/NewCredentialsActivity.kt +++ b/Simplenote/src/main/java/com/automattic/simplenote/authentication/NewCredentialsActivity.kt @@ -30,6 +30,7 @@ import com.automattic.simplenote.utils.AccountNetworkUtils import com.automattic.simplenote.utils.AccountVerificationEmailHandler import com.automattic.simplenote.utils.AppLog import com.automattic.simplenote.utils.HtmlCompat +import com.automattic.simplenote.utils.SystemBarUtils import com.google.android.material.color.MaterialColors import com.google.android.material.textfield.TextInputLayout import com.simperium.Simperium @@ -249,6 +250,15 @@ open class NewCredentialsActivity : AppCompatActivity() { ) { Handler().postDelayed({ startLogin() }, 600L) } + + // Setup edge-to-edge display with proper WindowInsets handling + // Use auto-theming to properly handle status bar appearance based on theme + SystemBarUtils.setupEdgeToEdgeWithAutoTheming( + this, + findViewById(R.id.main_parent_view), + toolbar, + findViewById(R.id.content_view) + ); } protected fun handleResponseSuccess(user: User, userId: String?, token: String?, provider: AuthProvider) { diff --git a/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteAuthenticationActivity.java b/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteAuthenticationActivity.java index 7ce9eb4dd..839943087 100644 --- a/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteAuthenticationActivity.java +++ b/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteAuthenticationActivity.java @@ -70,7 +70,10 @@ public void onCreate(Bundle savedInstanceState) { // Since this extends Simperium's AuthenticationActivity, we need to be conservative if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) { WindowCompat.setDecorFitsSystemWindows(getWindow(), false); - SystemBarUtils.setSystemBarsAppearance(this, true, true); // Dark icons on light background + // Use auto-theming to properly handle dark mode + boolean isLightTheme = (getResources().getConfiguration().uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK) + != android.content.res.Configuration.UI_MODE_NIGHT_YES; + SystemBarUtils.setSystemBarsAppearance(this, isLightTheme, isLightTheme); // Apply navigation bar insets to avoid button overlap with 3-button navigation ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content), (v, windowInsets) -> { diff --git a/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteSignupActivity.java b/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteSignupActivity.java index 6b5e73cba..eb153339c 100644 --- a/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteSignupActivity.java +++ b/Simplenote/src/main/java/com/automattic/simplenote/authentication/SimplenoteSignupActivity.java @@ -48,14 +48,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { initToolbar(isSignUp); // Setup edge-to-edge display with proper WindowInsets handling - // Toolbar has white background, so we need light status bar appearance (dark icons) - SystemBarUtils.setupEdgeToEdgeWithToolbar( + // Use auto-theming to properly handle status bar appearance based on theme + SystemBarUtils.setupEdgeToEdgeWithAutoTheming( this, findViewById(R.id.main), mToolbar, - findViewById(R.id.fragment_container), - true, // Light status bar (dark icons) for white toolbar background - true // Light navigation bar (dark icons) + findViewById(R.id.fragment_container) ); } diff --git a/Simplenote/src/main/java/com/automattic/simplenote/utils/ThemeUtils.java b/Simplenote/src/main/java/com/automattic/simplenote/utils/ThemeUtils.java index 081f45489..4dc399b6a 100644 --- a/Simplenote/src/main/java/com/automattic/simplenote/utils/ThemeUtils.java +++ b/Simplenote/src/main/java/com/automattic/simplenote/utils/ThemeUtils.java @@ -66,16 +66,14 @@ public static void setTheme(Activity activity) { } } - switch (PrefUtils.getIntPref(activity, PrefUtils.PREF_THEME, THEME_LIGHT)) { - case THEME_AUTO: - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_TIME); - break; + switch (PrefUtils.getIntPref(activity, PrefUtils.PREF_THEME, THEME_SYSTEM)) { case THEME_DARK: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); break; case THEME_LIGHT: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); break; + case THEME_AUTO: case THEME_SYSTEM: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); break; diff --git a/Simplenote/src/main/res/layout/activity_signup.xml b/Simplenote/src/main/res/layout/activity_signup.xml index f96187a25..4dd3d0ac3 100644 --- a/Simplenote/src/main/res/layout/activity_signup.xml +++ b/Simplenote/src/main/res/layout/activity_signup.xml @@ -13,10 +13,12 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="@android:color/white" + android:background="?attr/toolbarColor" android:elevation="0dp" - app:popupTheme="@style/ThemeOverlay.MaterialComponents.Light" - app:theme="@style/ThemeOverlay.MaterialComponents.Light" + app:titleTextColor="@color/text_title" + app:navigationIconTint="@color/text_title" + app:popupTheme="@style/ThemeOverlay.MaterialComponents" + app:theme="@style/ThemeOverlay.MaterialComponents" tools:layout_height="wrap_content" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/magic_link_login_with_wordpress_or_break" + android:textColor="?attr/onMainBackgroundColor" android:paddingHorizontal="5dp" /> + android:tint="@color/text_description" /> @@ -35,8 +35,8 @@ android:layout_marginEnd="@dimen/padding_extra_extra_large" android:layout_marginBottom="@dimen/padding_extra_large" android:gravity="center" - android:textColor="@color/gray_50" - android:textColorLink="@color/gray_50" + android:textColor="@color/text_description_secondary" + android:textColorLink="@color/text_description_secondary" android:textSize="16sp" tools:text="Didn't get an email? You may already have an account. Contact simplenote@support.com for help." /> diff --git a/Simplenote/src/main/res/layout/fragment_login.xml b/Simplenote/src/main/res/layout/fragment_login.xml index 4a5f7b5ef..f180096b9 100644 --- a/Simplenote/src/main/res/layout/fragment_login.xml +++ b/Simplenote/src/main/res/layout/fragment_login.xml @@ -42,7 +42,7 @@ android:minHeight="@dimen/height_button" android:text="@string/magic_link_login" android:textAllCaps="true" - android:textColor="@android:color/white" /> + android:textColor="@color/text_button_primary" /> @@ -73,6 +74,6 @@ android:minHeight="@dimen/height_button" android:text="@string/simperium_button_login_other" android:textAllCaps="true" - android:textColor="@android:color/white" /> + android:textColor="@color/text_button_primary" /> diff --git a/Simplenote/src/main/res/layout/fragment_magic_link_code.xml b/Simplenote/src/main/res/layout/fragment_magic_link_code.xml index 78cd09ed6..a9aa601ee 100644 --- a/Simplenote/src/main/res/layout/fragment_magic_link_code.xml +++ b/Simplenote/src/main/res/layout/fragment_magic_link_code.xml @@ -72,6 +72,6 @@ android:minHeight="@dimen/height_button" android:text="@string/magic_link_confirm_code_enter_pass_label" android:textAllCaps="true" - android:textColor="@android:color/black"/> + android:textColor="@color/text_button_tertiary"/> diff --git a/Simplenote/src/main/res/layout/fragment_signup.xml b/Simplenote/src/main/res/layout/fragment_signup.xml index 356dc9447..707e3e48b 100644 --- a/Simplenote/src/main/res/layout/fragment_signup.xml +++ b/Simplenote/src/main/res/layout/fragment_signup.xml @@ -41,7 +41,7 @@ android:minHeight="@dimen/height_button" android:text="@string/simperium_button_signup" android:textAllCaps="true" - android:textColor="@android:color/white" /> + android:textColor="@color/text_button_primary" /> + android:layout_width="match_parent" + android:fitsSystemWindows="false"> @@ -74,7 +78,7 @@ android:layout_marginBottom="@dimen/margin_default_quarter" android:layout_marginEnd="@dimen/margin_default_quarter" android:layout_marginStart="@dimen/margin_default_quarter" - android:layout_marginTop="@dimen/margin_default_quarter" + android:layout_marginTop="@dimen/margin_default" android:layout_width="match_parent" android:hint="@string/simperium_hint_password" app:endIconMode="password_toggle" @@ -94,8 +98,8 @@ android:backgroundTint="@color/button_primary_disabled_selector" android:layout_below="@id/input_password" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/margin_default_quarter" - android:layout_marginTop="@dimen/margin_default_quarter" + android:layout_marginBottom="@dimen/padding_medium" + android:layout_marginTop="@dimen/padding_medium" android:layout_width="match_parent" android:minHeight="@dimen/height_button" android:textAllCaps="true" @@ -114,7 +118,7 @@ android:layout_height="wrap_content" android:layout_width="match_parent" android:minHeight="@dimen/height_footer" - android:padding="@dimen/margin_default_quarter" + android:padding="@dimen/padding_medium" android:textColor="@color/text_footer" android:textSize="@dimen/text_footer" tools:text="@string/simperium_footer_login"> diff --git a/Simplenote/src/main/res/values-night/colors.xml b/Simplenote/src/main/res/values-night/colors.xml index cd9cca7a7..400140567 100644 --- a/Simplenote/src/main/res/values-night/colors.xml +++ b/Simplenote/src/main/res/values-night/colors.xml @@ -23,4 +23,13 @@ @color/text_content_dark @color/text_title_dark @color/red_20 + + + @color/gray_20 + @color/gray_30 + + + @color/gray_1 + @color/gray_1 + diff --git a/Simplenote/src/main/res/values-night/styles.xml b/Simplenote/src/main/res/values-night/styles.xml index d801e6fc3..044541ef2 100755 --- a/Simplenote/src/main/res/values-night/styles.xml +++ b/Simplenote/src/main/res/values-night/styles.xml @@ -329,4 +329,10 @@ @color/background_dark_sepia_8 + + + diff --git a/Simplenote/src/main/res/values-v29/arrays.xml b/Simplenote/src/main/res/values-v29/arrays.xml index 3c9d60c14..75900f832 100644 --- a/Simplenote/src/main/res/values-v29/arrays.xml +++ b/Simplenote/src/main/res/values-v29/arrays.xml @@ -24,7 +24,6 @@ @string/theme_light @string/theme_dark - @string/theme_auto @string/theme_system diff --git a/Simplenote/src/main/res/values/arrays.xml b/Simplenote/src/main/res/values/arrays.xml index aecfc5791..ee971972a 100644 --- a/Simplenote/src/main/res/values/arrays.xml +++ b/Simplenote/src/main/res/values/arrays.xml @@ -24,7 +24,7 @@ @string/theme_light @string/theme_dark - @string/theme_auto + @string/theme_system diff --git a/Simplenote/src/main/res/values/colors.xml b/Simplenote/src/main/res/values/colors.xml index e46ca47f7..75f13b15f 100644 --- a/Simplenote/src/main/res/values/colors.xml +++ b/Simplenote/src/main/res/values/colors.xml @@ -128,6 +128,10 @@ @color/gray_80 @color/red_50 + + @color/gray_80 + @color/gray_50 + @color/gray_20 @color/simplenote_blue_50 diff --git a/Simplenote/src/main/res/xml/preferences.xml b/Simplenote/src/main/res/xml/preferences.xml index 15ae53fde..f07c8f745 100644 --- a/Simplenote/src/main/res/xml/preferences.xml +++ b/Simplenote/src/main/res/xml/preferences.xml @@ -43,7 +43,7 @@