WelcomeActivity: properly implement edge-to-edge

This commit is contained in:
adbenitez
2025-11-26 20:57:50 +01:00
parent 5b8c0db287
commit 9e5a2d30ed
2 changed files with 12 additions and 9 deletions
@@ -38,6 +38,7 @@ import org.thoughtcrime.securesms.service.NotificationController;
import org.thoughtcrime.securesms.util.StorageUtil;
import org.thoughtcrime.securesms.util.StreamUtil;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.ViewUtil;
import org.thoughtcrime.securesms.util.views.ProgressDialog;
import java.io.File;
@@ -62,6 +63,9 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
super.onCreate(bundle);
setContentView(R.layout.welcome_activity);
// add padding to avoid content hidden behind system bars
ViewUtil.applyWindowInsets(findViewById(R.id.content_container));
Button signUpButton = findViewById(R.id.signup_button);
Button signInButton = findViewById(R.id.signin_button);
@@ -96,7 +100,6 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
boolean canGoBack = AccountManager.getInstance().canRollbackAccountCreation(this);
supportActionBar.setDisplayHomeAsUpEnabled(canGoBack);
getSupportActionBar().setTitle(canGoBack? R.string.add_account : R.string.welcome_desktop);
getSupportActionBar().setElevation(0); // TODO: use custom toolbar instead
}
private void registerForEvents() {
+8 -8
View File
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:context=".WelcomeActivity">
<include layout="@layout/status_bar_background"/>
<LinearLayout
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="?android:attr/windowBackground"
tools:context=".WelcomeActivity">
android:gravity="center_horizontal">
<androidx.legacy.widget.Space
android:layout_weight="3"
@@ -79,4 +79,4 @@
</LinearLayout>
</RelativeLayout>
</FrameLayout>