Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d1550d3
updating for Android 15 (sdk 35) compatibility
mzorz Aug 2, 2025
e385220
with edge-to-edge on Android 15, the app must draw its own background…
mzorz Aug 3, 2025
fd4b3a3
fixed insets and back arrow showing up for SignUp and Authentication …
mzorz Aug 3, 2025
4553813
fixed insets in passcode lock screen
mzorz Aug 3, 2025
d2df32f
added inset handling for Android 15 edge-to-edge in the note editing …
mzorz Aug 3, 2025
0e2e828
Merge branch 'mzorz/update-compose-android-and-kotlin-libs' into mzor…
mzorz Aug 3, 2025
aede0c5
applying insets to the Edit Tags activity for Andorid 15 edge-to-edge
mzorz Aug 3, 2025
be33637
applying insets in CollaboratorsActivity, for compatibility with Andr…
mzorz Aug 3, 2025
32332e5
Add apply window insets for floating action button method to display …
theck13 Aug 3, 2025
e58bac6
Add on apply window insets listener to add button in collaborators ac…
theck13 Aug 3, 2025
9f61fa1
Add on apply window insets listener to add button in tags activity
theck13 Aug 3, 2025
e79e7e4
Add Apply Window Insets Listener to Floating Action Button on Collabo…
mzorz Aug 4, 2025
d057796
applying insets to authentication screen so 3-button navigation doesn…
mzorz Aug 4, 2025
b75d859
adding insets handling on AddTagActivity and preserving animation
mzorz Aug 4, 2025
e387f83
using theme aware edge-to-edge setup
mzorz Aug 4, 2025
065c25c
fixed merge conflict
mzorz Aug 5, 2025
a5ad9d9
removed unused methods
mzorz Aug 5, 2025
3543434
Rename .java to .kt
mzorz Aug 5, 2025
f42e53e
converted file to kotlin
mzorz Aug 5, 2025
7cd7192
kotlinified code a bit
mzorz Aug 5, 2025
dd575ff
calculate IME inset and pass the event through down to children, othe…
mzorz Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.wordpress.passcodelock;

import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
import androidx.core.os.CancellationSignal;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsControllerCompat;

public class PasscodeManagePasswordActivity extends AbstractPasscodeKeyboardActivity {
public static final String KEY_TYPE = "type";
Expand All @@ -17,6 +20,23 @@ public class PasscodeManagePasswordActivity extends AbstractPasscodeKeyboardActi
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Setup edge-to-edge display for Android 15+ compatibility
// This is a fullscreen passcode activity without toolbar
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);

WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(
getWindow(),
getWindow().getDecorView()
);

if (controller != null) {
// Dark status bar appearance for the passcode screen background
controller.setAppearanceLightStatusBars(false);
controller.setAppearanceLightNavigationBars(false);
}
}

Bundle extras = getIntent().getExtras();
if (extras != null) {
Expand Down
3 changes: 2 additions & 1 deletion PasscodeLock/src/main/res/layout/app_passcode_keyboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
android:background="@color/passcodelock_background"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="false"
android:paddingBottom="24dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="32dp">
android:paddingTop="?attr/actionBarSize">

<TextView
android:id="@+id/passcodelock_prompt"
Expand Down
2 changes: 1 addition & 1 deletion Simplenote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
versionCode versionProperties.getProperty("versionCode").toInteger()

minSdkVersion 23
targetSdkVersion 34
targetSdkVersion 35
}


Expand Down
3 changes: 2 additions & 1 deletion Simplenote/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
android:name="com.automattic.simplenote.PreferencesActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="Preferences"
android:parentActivityName=".NotesActivity">
android:parentActivityName=".NotesActivity"
android:theme="@style/Theme.Simplestyle">
</activity>

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import androidx.appcompat.widget.Toolbar;

import com.automattic.simplenote.utils.DrawableUtils;
import com.automattic.simplenote.utils.SystemBarUtils;

public class AboutActivity extends AppCompatActivity {
@Override
Expand All @@ -24,6 +25,17 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
this, R.drawable.ic_cross_24dp, android.R.color.white
));
}

// Setup edge-to-edge display with proper WindowInsets handling
// AboutActivity has a dark theme with blue background, so use appropriate appearance
SystemBarUtils.setupEdgeToEdgeWithToolbar(
this,
findViewById(R.id.main_parent_view),
toolbar,
findViewById(R.id.about_fragment),
false, // Dark status bar icons for blue background
false // Dark navigation bar icons for blue background
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.automattic.simplenote

import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.text.method.LinkMovementMethod
Expand All @@ -10,10 +11,13 @@ import android.widget.TextView
import androidx.activity.viewModels
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.widget.doAfterTextChanged
import com.automattic.simplenote.databinding.ActivityTagAddBinding
import com.automattic.simplenote.utils.DisplayUtils
import com.automattic.simplenote.utils.HtmlCompat
import com.automattic.simplenote.utils.SystemBarUtils
import com.automattic.simplenote.utils.ThemeUtils
import com.automattic.simplenote.viewmodels.AddTagViewModel
import com.automattic.simplenote.widgets.MorphCircleToRectangle
Expand All @@ -27,15 +31,29 @@ class AddTagActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
ThemeUtils.setTheme(this)
super.onCreate(savedInstanceState)
val binding: ActivityTagAddBinding = ActivityTagAddBinding.inflate(layoutInflater)

binding.setObservers()
binding.setupLayout()
binding.setupViews()
with(ActivityTagAddBinding.inflate(layoutInflater)) {
setContentView(root)
setupLayout()
setupViews()
setObservers()

viewModel.start()
viewModel.start()


// Setup edge-to-edge display with proper WindowInsets handling
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
SystemBarUtils.setupEdgeToEdgeWithAutoTheming(this@AddTagActivity, root, null, null)
}

// Add minimal IME (keyboard) insets handling for dialog positioning
ViewCompat.setOnApplyWindowInsetsListener(root) { view, insets ->
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
view.setPadding(view.paddingLeft, view.paddingTop, view.paddingRight, imeInsets.bottom)
insets
}
}

setContentView(binding.root)
}

private fun ActivityTagAddBinding.setupViews() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.LinearLayoutManager
import com.automattic.simplenote.databinding.ActivityCollaboratorsBinding
import com.automattic.simplenote.utils.CollaboratorsAdapter
import com.automattic.simplenote.utils.CollaboratorsAdapter.*
import com.automattic.simplenote.utils.CollaboratorsAdapter.CollaboratorDataItem.*
import com.automattic.simplenote.utils.DisplayUtils
import com.automattic.simplenote.utils.IntentUtils
import com.automattic.simplenote.utils.SystemBarUtils
import com.automattic.simplenote.utils.toast
import com.automattic.simplenote.viewmodels.CollaboratorsViewModel
import com.automattic.simplenote.viewmodels.CollaboratorsViewModel.Event
Expand Down Expand Up @@ -47,6 +48,16 @@ class CollaboratorsActivity : ThemedAppCompatActivity() {
setObservers()

viewModel.loadCollaborators(noteId)

// Setup edge-to-edge display with proper WindowInsets handling
// Use auto-theming to properly handle status bar appearance based on theme
val toolbar = findViewById<Toolbar>(R.id.toolbar)
SystemBarUtils.setupEdgeToEdgeWithAutoTheming(
this@CollaboratorsActivity,
findViewById(R.id.main_parent_view),
toolbar,
collaboratorsList
)
}
}

Expand Down Expand Up @@ -79,6 +90,9 @@ class CollaboratorsActivity : ThemedAppCompatActivity() {
collaboratorsList.setEmptyView(empty.root)

buttonAddCollaborator.setOnClickListener { viewModel.clickAddCollaborator() }
buttonAddCollaborator.setOnApplyWindowInsetsListener { view, insets ->
DisplayUtils.applyWindowInsetsForFloatingActionButton(insets, resources, view)
}

empty.image.setImageResource(R.drawable.ic_collaborate_24dp)
empty.title.text = getString(R.string.no_collaborators)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.automattic.simplenote.utils.DisplayUtils;
import com.automattic.simplenote.utils.IntentUtils;
import com.automattic.simplenote.utils.NetworkUtils;
import com.automattic.simplenote.utils.SystemBarUtils;
import com.automattic.simplenote.utils.WidgetUtils;
import com.automattic.simplenote.widgets.NoteEditorViewPager;
import com.automattic.simplenote.widgets.RobotoMediumTextView;
Expand Down Expand Up @@ -230,6 +231,15 @@ public void onPageScrollStateChanged(int state) {
"note_list_widget_note_tapped"
);
}

// 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.pager)
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import com.automattic.simplenote.utils.TagsMultiAutoCompleteTextView;
import com.automattic.simplenote.utils.TagsMultiAutoCompleteTextView.OnTagAddedListener;
import com.automattic.simplenote.utils.TextHighlighter;
import com.automattic.simplenote.utils.SystemBarUtils;
import com.automattic.simplenote.utils.ThemeUtils;
import com.automattic.simplenote.utils.WidgetUtils;
import com.automattic.simplenote.viewmodels.NoteEditorViewModel;
Expand Down Expand Up @@ -204,7 +205,7 @@ public boolean onCreateActionMode(ActionMode mode, Menu menu) {
DrawableUtils.tintMenuWithAttribute(getActivity(), menu, R.attr.toolbarIconColor);
}

requireActivity().getWindow().setStatusBarColor(ThemeUtils.getColorFromAttribute(requireContext(), R.attr.mainBackgroundColor));
SystemBarUtils.setStatusBarColor(requireActivity(), ThemeUtils.getColorFromAttribute(requireContext(), R.attr.mainBackgroundColor));
return true;
}

Expand Down Expand Up @@ -279,7 +280,7 @@ public void onDestroyActionMode(ActionMode mode) {
}

new Handler().postDelayed(
() -> requireActivity().getWindow().setStatusBarColor(
() -> SystemBarUtils.setStatusBarColor(requireActivity(),
getResources().getColor(android.R.color.transparent, requireActivity().getTheme())),
requireContext().getResources().getInteger(android.R.integer.config_mediumAnimTime)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import com.automattic.simplenote.utils.SimplenoteLinkify;
import com.automattic.simplenote.utils.StrUtils;
import com.automattic.simplenote.utils.TextHighlighter;
import com.automattic.simplenote.utils.SystemBarUtils;
import com.automattic.simplenote.utils.ThemeUtils;
import com.automattic.simplenote.utils.WidgetUtils;
import com.automattic.simplenote.widgets.RobotoRegularTextView;
Expand Down Expand Up @@ -193,7 +194,7 @@ public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
inflater.inflate(R.menu.bulk_edit, menu);
DrawableUtils.tintMenuWithAttribute(getActivity(), menu, R.attr.actionModeTextColor);
mActionMode = actionMode;
requireActivity().getWindow().setStatusBarColor(ThemeUtils.getColorFromAttribute(requireContext(), R.attr.mainBackgroundColor));
SystemBarUtils.setStatusBarColor(requireActivity(), ThemeUtils.getColorFromAttribute(requireContext(), R.attr.mainBackgroundColor));
return true;
}

Expand Down Expand Up @@ -304,7 +305,7 @@ public void onDestroyActionMode(ActionMode mode) {
new Runnable() {
@Override
public void run() {
requireActivity().getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent, requireActivity().getTheme()));
SystemBarUtils.setStatusBarColor(requireActivity(), getResources().getColor(android.R.color.transparent, requireActivity().getTheme()));
}
},
requireContext().getResources().getInteger(android.R.integer.config_longAnimTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;

import com.automattic.simplenote.utils.BrowserUtils;
import com.automattic.simplenote.utils.SystemBarUtils;

import org.wordpress.passcodelock.PasscodePreferenceFragment;
import org.wordpress.passcodelock.PasscodePreferenceFragmentCompat;
Expand Down Expand Up @@ -56,6 +58,15 @@ protected void onCreate(Bundle savedInstanceState) {
mPreferencesFragment = (PreferencesFragment) fragmentManager.findFragmentByTag(preferencesTag);
mPasscodePreferenceFragment = (PasscodePreferenceFragmentCompat) fragmentManager.findFragmentByTag(passcodeTag);
}

// 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.preferences_container)
);
}

@Override
Expand Down
14 changes: 14 additions & 0 deletions Simplenote/src/main/java/com/automattic/simplenote/TagsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.LinearLayoutManager
import com.automattic.simplenote.databinding.ActivityTagsBinding
import com.automattic.simplenote.utils.*
import com.automattic.simplenote.utils.SystemBarUtils
import com.automattic.simplenote.viewmodels.TagsEvent
import com.automattic.simplenote.viewmodels.TagsEvent.*
import com.automattic.simplenote.viewmodels.TagsViewModel
Expand All @@ -36,6 +37,16 @@ class TagsActivity : ThemedAppCompatActivity() {
binding.setObservers()

viewModel.start()

// Setup edge-to-edge display with proper WindowInsets handling
// Use auto-theming to properly handle status bar appearance based on theme
val toolbar = findViewById<Toolbar>(R.id.toolbar)
SystemBarUtils.setupEdgeToEdgeWithAutoTheming(
this,
findViewById(R.id.main_parent_view),
toolbar,
binding.list
)
}

private fun ActivityTagsBinding.setupViews() {
Expand All @@ -62,6 +73,9 @@ class TagsActivity : ThemedAppCompatActivity() {
viewModel.longClickAddTag()
true
}
buttonAdd.setOnApplyWindowInsetsListener { view, insets ->
DisplayUtils.applyWindowInsetsForFloatingActionButton(insets, resources, view)
}
}

private fun ActivityTagsBinding.setObservers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextThemeWrapper;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
Expand All @@ -20,6 +25,7 @@
import com.automattic.simplenote.analytics.AnalyticsTracker;
import com.automattic.simplenote.utils.IntentUtils;
import com.automattic.simplenote.utils.StrUtils;
import com.automattic.simplenote.utils.SystemBarUtils;
import com.automattic.simplenote.utils.WordPressUtils;
import com.automattic.simplenote.viewmodels.MagicLinkUiState;
import com.automattic.simplenote.viewmodels.CompleteMagicLinkViewModel;
Expand Down Expand Up @@ -59,6 +65,28 @@ public class SimplenoteAuthenticationActivity extends AuthenticationActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Setup edge-to-edge display only on Android 15+ to avoid breaking existing theming
// 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

// Apply navigation bar insets to avoid button overlap with 3-button navigation
ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content), (v, windowInsets) -> {
Insets systemBars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());

// Apply bottom padding to avoid navigation bar overlap
v.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
systemBars.bottom
);

return WindowInsetsCompat.CONSUMED;
});
}

final Intent intent = getIntent();

Expand Down
Loading