From c3e85dc27a0452c0f63af78efd5012cdfdafcd1d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 19:59:39 +0000 Subject: [PATCH] Implement proper edge-to-edge with insets and use checkmark for main transport - Remove fitsSystemWindows hack, use proper window insets handling - Apply system bar insets to RecyclerView top/bottom padding - Apply bottom inset to FAB margin for proper positioning - Replace "Main" text label with checkmark icon (ic_check_white_24dp) - Checkmark appears to the left of transport email for main transport - Properly handle edge-to-edge so toolbar color goes to status bar Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com> --- .../securesms/TransportListActivity.java | 29 ++++++++++++ .../securesms/TransportListAdapter.java | 2 +- .../res/layout/activity_transport_list.xml | 4 +- src/main/res/layout/transport_list_item.xml | 45 ++++++++----------- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/thoughtcrime/securesms/TransportListActivity.java b/src/main/java/org/thoughtcrime/securesms/TransportListActivity.java index 4968dc0eb..f8e3d5c97 100644 --- a/src/main/java/org/thoughtcrime/securesms/TransportListActivity.java +++ b/src/main/java/org/thoughtcrime/securesms/TransportListActivity.java @@ -3,9 +3,14 @@ package org.thoughtcrime.securesms; import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; +import android.view.View; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -46,6 +51,7 @@ public class TransportListActivity extends BaseActionBarActivity getSupportActionBar().setElevation(0); } + CoordinatorLayout coordinatorLayout = findViewById(R.id.coordinator_layout); recyclerView = findViewById(R.id.transport_list); fabAdd = findViewById(R.id.fab_add_transport); @@ -55,6 +61,29 @@ public class TransportListActivity extends BaseActionBarActivity fabAdd.setOnClickListener(v -> openAddTransport()); + // Handle window insets for edge-to-edge + ViewCompat.setOnApplyWindowInsetsListener(coordinatorLayout, (v, windowInsets) -> { + Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()); + + // Apply top inset to RecyclerView as padding + recyclerView.setPadding( + recyclerView.getPaddingLeft(), + insets.top, + recyclerView.getPaddingRight(), + insets.bottom + ); + recyclerView.setClipToPadding(false); + + // Apply bottom inset to FAB as margin + CoordinatorLayout.LayoutParams fabParams = (CoordinatorLayout.LayoutParams) fabAdd.getLayoutParams(); + int fabMargin = (int) (16 * getResources().getDisplayMetrics().density); + fabParams.bottomMargin = insets.bottom + fabMargin; + fabParams.rightMargin = fabMargin; + fabAdd.setLayoutParams(fabParams); + + return WindowInsetsCompat.CONSUMED; + }); + loadTransports(); } diff --git a/src/main/java/org/thoughtcrime/securesms/TransportListAdapter.java b/src/main/java/org/thoughtcrime/securesms/TransportListAdapter.java index 7c9a43651..223a1c7d7 100644 --- a/src/main/java/org/thoughtcrime/securesms/TransportListAdapter.java +++ b/src/main/java/org/thoughtcrime/securesms/TransportListAdapter.java @@ -59,7 +59,7 @@ public class TransportListAdapter extends RecyclerView.Adapter diff --git a/src/main/res/layout/transport_list_item.xml b/src/main/res/layout/transport_list_item.xml index a319d5c26..47e6fa835 100644 --- a/src/main/res/layout/transport_list_item.xml +++ b/src/main/res/layout/transport_list_item.xml @@ -9,41 +9,32 @@ android:minHeight="72dp" android:gravity="center_vertical"> + + - - - - - - - + android:textAppearance="?android:attr/textAppearanceMedium" + android:textSize="16sp" + android:textColor="?android:attr/textColorPrimary" + tools:text="user@example.com" />