Compare commits

..

23 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 7f9ca6eeba Fix edge-to-edge on Android 5: only enable on API 23+
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-27 03:06:27 +00:00
copilot-swe-agent[bot] a8c8acd64d Fix preferences list bottom padding: use onViewCreated and remove padding reset
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 23:01:43 +00:00
copilot-swe-agent[bot] 81ac28736d Fix preferences list edge-to-edge: scroll behind navigation bar with bottom padding
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 19:42:20 +00:00
copilot-swe-agent[bot] 91bbf2b042 Fix toolbar left/right insets for landscape mode
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 06:40:03 +00:00
copilot-swe-agent[bot] bba72d11f1 Fix display cutout (camera notch) insets in landscape mode
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 06:28:08 +00:00
copilot-swe-agent[bot] 66e016ad3e Fix chat list behind navigation bars in landscape mode
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 06:01:19 +00:00
copilot-swe-agent[bot] 99ba187e3f Fix FAB covered by navigation bar in ConversationListActivity
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-26 03:42:19 +00:00
copilot-swe-agent[bot] 86ab25262c Fix edge-to-edge for 9 more activities: add status_bar_background view
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 19:38:39 +00:00
adbenitez 4d59ad8f56 fix some stuff 2025-11-25 20:22:42 +01:00
copilot-swe-agent[bot] 25bef64f7f Fix content overlapping toolbar in ActionBar activities (archive, settings, blocked)
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 16:05:13 +00:00
copilot-swe-agent[bot] ca1d5ad15e Fix ActionBar activities: toolbar color behind status bar for archive, settings, blocked
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 14:31:11 +00:00
copilot-swe-agent[bot] 1f1546e0d5 Fix ConversationActivity: toolbar color extends behind status bar
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 14:14:26 +00:00
copilot-swe-agent[bot] 60efd8a95a Fix ConversationActivity edge-to-edge: toolbar and input panel insets
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 03:32:00 +00:00
copilot-swe-agent[bot] b541ab16ee Fix edge-to-edge: toolbar renders behind status bar with proper padding
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 03:15:23 +00:00
copilot-swe-agent[bot] 7257b9eb2e Move edge-to-edge inset handling to BaseActionBarActivity.onPostCreate()
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-25 02:57:26 +00:00
adb bb3797860f Merge branch 'main' into copilot/implement-edge-to-edge-layout 2025-11-24 21:40:00 +01:00
copilot-swe-agent[bot] 48903c5b9c Improve documentation and comments for edge-to-edge implementation
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:11:41 +00:00
copilot-swe-agent[bot] 7ff607ebe4 Add null checks and prevent overwriting original padding values
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:10:09 +00:00
copilot-swe-agent[bot] 2fa9a8ba8e Fix inset padding accumulation and keyboard handling issues
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:08:50 +00:00
copilot-swe-agent[bot] ff286c5b02 Address code review feedback: improve comments, imports, and view selection
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:06:15 +00:00
copilot-swe-agent[bot] f7a97140a8 Add requestApplyInsets call to ensure insets are dispatched
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:04:16 +00:00
copilot-swe-agent[bot] cb4c31aef3 Implement proper edge-to-edge using window insets instead of fitsSystemWindows hack
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:03:09 +00:00
copilot-swe-agent[bot] 717a6cae6f Initial plan 2025-11-24 19:57:38 +00:00
41 changed files with 833 additions and 756 deletions
-1
View File
@@ -39,7 +39,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<!-- force compiling emojipicker on sdk<21; runtime checks are required then -->
<uses-sdk tools:overrideLibrary="androidx.emoji2.emojipicker"/>
@@ -1,13 +1,14 @@
package org.thoughtcrime.securesms;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.WindowManager;
import androidx.activity.EdgeToEdge;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -17,6 +18,7 @@ import androidx.fragment.app.Fragment;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.ViewUtil;
import java.lang.reflect.Field;
@@ -33,9 +35,62 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
onPreCreate();
EdgeToEdge.enable(this); // docs says to use: WindowCompat.enableEdgeToEdge(getWindow()); but it is not available
// Enable edge-to-edge display by allowing app content to draw behind system bars (status bar, navigation bar)
// Only enable on API 23+ where WindowInsets APIs work correctly
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
}
super.onCreate(savedInstanceState);
WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()).setAppearanceLightStatusBars(false); // force white text in status bar
// Force white text in status bar
WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()).setAppearanceLightStatusBars(false);
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Skip edge-to-edge insets on API < 23 where WindowInsets APIs don't work correctly
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return;
}
// Apply window insets for edge-to-edge display
// The toolbar/app bar should extend behind the status bar with padding applied
// Also apply left and right insets for landscape mode (navigation bars and display cutout)
View toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
// Check if toolbar is inside an AppBarLayout
View parent = (View) toolbar.getParent();
if (parent instanceof com.google.android.material.appbar.AppBarLayout) {
ViewUtil.applyWindowInsets(parent, true, true, true, false);
} else {
ViewUtil.applyWindowInsets(toolbar, true, true, true, false);
}
}
// For activities without a custom toolbar, apply insets to status_bar_background view
// and add top padding to fragment container for status bar + action bar height
View statusBarBackground = findViewById(R.id.status_bar_background);
if (statusBarBackground != null) {
ViewUtil.applyWindowInsetsAsHeight(statusBarBackground);
// Only apply top padding (status bar + action bar) to fragment container
// Left/right/bottom insets should be handled by the fragment's content (e.g., preference list)
// so content can draw behind navigation bar with clipToPadding="false"
View fragment = findViewById(R.id.fragment);
if (fragment != null) {
// Get the action bar size
android.util.TypedValue tv = new android.util.TypedValue();
int actionBarSize = 0;
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
actionBarSize = android.util.TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics());
}
ViewUtil.applyWindowInsetsWithActionBar(fragment, actionBarSize);
}
}
}
@Override
@@ -36,6 +36,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.provider.Browser;
@@ -883,6 +884,23 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
// Apply edge-to-edge insets (only on API 23+ where WindowInsets APIs work correctly)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// 1. Set status bar background height to match status bar inset
View statusBarBackground = findViewById(R.id.status_bar_background);
ViewUtil.applyWindowInsetsAsHeight(statusBarBackground);
// 2. Apply top padding to the ActionBar toolbar so content is below status bar
View toolbarParent = (View) supportActionBar.getCustomView().getParent();
if (toolbarParent instanceof Toolbar) {
ViewUtil.applyWindowInsets(toolbarParent, false, true, false, false);
}
// 3. Apply bottom padding to input panel for navigation bar
ViewUtil.applyWindowInsets(inputPanel, false, false, false, true);
ViewUtil.applyWindowInsets(findViewById(R.id.fragment_content), false, true, false, false);
}
container.addOnKeyboardShownListener(this);
container.addOnKeyboardHiddenListener(backgroundView);
container.addOnKeyboardShownListener(backgroundView);
@@ -114,6 +114,15 @@ public class ConversationListFragment extends BaseConversationListFragment
emptyTitle.setText(R.string.archive_empty_hint);
} else {
fab.setVisibility(View.VISIBLE);
// Apply bottom inset to FAB to prevent it from being covered by the navigation bar (API 23+ only)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
ViewUtil.applyWindowInsetsAsBottomMargin(fab);
}
}
// Apply left and right insets to the list for landscape mode (API 23+ only)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
ViewUtil.applyWindowInsets(list, true, false, true, false);
}
list.setHasFixedSize(true);
@@ -5,12 +5,9 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.location.Location;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import androidx.core.content.ContextCompat;
import org.thoughtcrime.securesms.connect.DcHelper;
import java.util.LinkedList;
@@ -26,13 +23,11 @@ public class DcLocationManager implements Observer {
private final Context context;
private DcLocation dcLocation = DcLocation.getInstance();
private final LinkedList<Integer> pendingShareLastLocation = new LinkedList<>();
private boolean serviceBound = false;
private final ServiceConnection serviceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
Log.d(TAG, "background service connected");
serviceBinder = (LocationBackgroundService.LocationBackgroundServiceBinder) service;
serviceBound = true;
while (!pendingShareLastLocation.isEmpty()) {
shareLastLocation(pendingShareLastLocation.pop());
}
@@ -42,7 +37,6 @@ public class DcLocationManager implements Observer {
public void onServiceDisconnected(ComponentName name) {
Log.d(TAG, "background service disconnected");
serviceBinder = null;
serviceBound = false;
}
};
@@ -55,29 +49,19 @@ public class DcLocationManager implements Observer {
}
public void startLocationEngine() {
if (serviceBinder == null || !serviceBound) {
if (serviceBinder == null) {
Intent intent = new Intent(context.getApplicationContext(), LocationBackgroundService.class);
// Start as foreground service
ContextCompat.startForegroundService(context, intent);
// Then bind to it
context.bindService(intent, serviceConnection, BIND_AUTO_CREATE);
}
}
public void stopLocationEngine() {
if (serviceBinder == null || !serviceBound) {
if (serviceBinder == null) {
return;
}
try {
context.unbindService(serviceConnection);
if (serviceBinder != null) {
serviceBinder.stop();
}
} catch (IllegalArgumentException e) {
Log.w(TAG, "Service not registered", e);
}
context.unbindService(serviceConnection);
serviceBinder.stop();
serviceBinder = null;
serviceBound = false;
}
public void stopSharingLocation(int chatId) {
@@ -1,36 +1,18 @@
package org.thoughtcrime.securesms.geolocation;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ServiceInfo;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.core.app.NotificationCompat;
import androidx.core.app.ServiceCompat;
import androidx.core.content.ContextCompat;
import androidx.core.location.LocationListenerCompat;
import androidx.core.location.LocationManagerCompat;
import androidx.core.location.LocationRequestCompat;
import org.thoughtcrime.securesms.ConversationListActivity;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.notifications.NotificationCenter;
import org.thoughtcrime.securesms.util.IntentUtils;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
public class LocationBackgroundService extends Service {
@@ -40,7 +22,6 @@ public class LocationBackgroundService extends Service {
private static final int LOCATION_INTERVAL = 1000;
private static final float LOCATION_DISTANCE = 25F;
ServiceLocationListener locationListener;
private final AtomicBoolean isForeground = new AtomicBoolean(false);
private final IBinder mBinder = new LocationBackgroundServiceBinder();
@@ -56,21 +37,12 @@ public class LocationBackgroundService extends Service {
@Override
public void onCreate() {
super.onCreate();
locationManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
if (locationManager == null) {
Log.e(TAG, "Unable to initialize location service");
// Must start foreground to avoid crash, then stop immediately
initializeForegroundService();
stopForeground(true);
stopSelf();
return;
}
// Initialize foreground service after successful location manager setup
initializeForegroundService();
locationListener = new ServiceLocationListener();
Location lastLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (lastLocation != null) {
@@ -79,19 +51,14 @@ public class LocationBackgroundService extends Service {
DcLocation.getInstance().updateLocation(lastLocation);
}
}
// Request location updates from both GPS and network providers for better coverage
//requestLocationUpdate(LocationManager.NETWORK_PROVIDER);
requestLocationUpdate(LocationManager.GPS_PROVIDER);
requestLocationUpdate(LocationManager.NETWORK_PROVIDER);
initialLocationUpdate();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
// Ensure foreground notification is shown (handles edge cases)
initializeForegroundService();
return START_STICKY;
}
@@ -99,93 +66,23 @@ public class LocationBackgroundService extends Service {
public void onDestroy() {
super.onDestroy();
// Stop foreground notification
stopForeground(true);
if (locationManager == null || locationListener == null) {
if (locationManager == null) {
return;
}
try {
LocationManagerCompat.removeUpdates(locationManager, locationListener);
locationManager.removeUpdates(locationListener);
} catch (Exception ex) {
Log.i(TAG, "fail to remove location listeners, ignore", ex);
}
}
private void initializeForegroundService() {
if (isForeground.compareAndSet(false, true)) {
createNotificationChannel();
Notification notification = createNotification();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
// Android 14+ requires foregroundServiceType in startForeground
ServiceCompat.startForeground(this, NotificationCenter.ID_LOCATION, notification,
ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION);
} else {
startForeground(NotificationCenter.ID_LOCATION, notification);
}
Log.d(TAG, "Foreground service started with notification");
}
}
private void createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
NotificationCenter.CH_LOCATION,
getString(R.string.location),
NotificationManager.IMPORTANCE_LOW
);
channel.setDescription("Location sharing notification");
NotificationManager notificationManager = getSystemService(NotificationManager.class);
if (notificationManager != null) {
notificationManager.createNotificationChannel(channel);
}
}
}
private Notification createNotification() {
Intent intent = new Intent(this, ConversationListActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(
this,
0,
intent,
IntentUtils.FLAG_IMMUTABLE()
);
return new NotificationCompat.Builder(this, NotificationCenter.CH_LOCATION)
.setContentTitle(getString(R.string.location_sharing_notification_title))
.setContentText(getString(R.string.location_sharing_notification_text))
.setSmallIcon(R.drawable.ic_location_on_white_24dp)
.setContentIntent(pendingIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.build();
}
private void requestLocationUpdate(String provider) {
try {
// Check if provider is available
if (!locationManager.isProviderEnabled(provider)) {
Log.w(TAG, String.format("Provider %s is not enabled", provider));
return;
}
// Use LocationManagerCompat for better compatibility with modern Android
LocationRequestCompat locationRequest = new LocationRequestCompat.Builder(LOCATION_INTERVAL)
.setMinUpdateDistanceMeters(LOCATION_DISTANCE)
.setQuality(LocationRequestCompat.QUALITY_HIGH_ACCURACY)
.build();
Executor executor = ContextCompat.getMainExecutor(this);
LocationManagerCompat.requestLocationUpdates(
locationManager,
provider,
locationRequest,
executor,
locationListener
);
Log.d(TAG, String.format("Requested location updates from %s provider", provider));
} catch (SecurityException | IllegalArgumentException ex) {
locationManager.requestLocationUpdates(
provider, LOCATION_INTERVAL, LOCATION_DISTANCE,
locationListener);
} catch (SecurityException | IllegalArgumentException ex) {
Log.e(TAG, String.format("Unable to request %s provider based location updates.", provider), ex);
}
}
@@ -196,16 +93,9 @@ public class LocationBackgroundService extends Service {
if (gpsLocation != null && System.currentTimeMillis() - gpsLocation.getTime() < INITIAL_TIMEOUT) {
locationListener.onLocationChanged(gpsLocation);
}
// Also try network provider for initial location
Location networkLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (networkLocation != null && System.currentTimeMillis() - networkLocation.getTime() < INITIAL_TIMEOUT) {
// Use network location if GPS location is not available or network location is newer
if (gpsLocation == null || networkLocation.getTime() > gpsLocation.getTime()) {
locationListener.onLocationChanged(networkLocation);
}
}
} catch (NullPointerException | SecurityException e) {
Log.e(TAG, "Error getting initial location", e);
e.printStackTrace();
}
}
@@ -220,22 +110,30 @@ public class LocationBackgroundService extends Service {
}
}
private class ServiceLocationListener implements LocationListenerCompat {
private class ServiceLocationListener implements LocationListener {
@Override
public void onLocationChanged(@NonNull Location location) {
Log.d(TAG, "onLocationChanged: " + location);
if (location == null) {
return;
}
DcLocation.getInstance().updateLocation(location);
}
@Override
public void onProviderDisabled(@NonNull String provider) {
Log.w(TAG, "onProviderDisabled: " + provider);
Log.e(TAG, "onProviderDisabled: " + provider);
}
@Override
public void onProviderEnabled(@NonNull String provider) {
Log.d(TAG, "onProviderEnabled: " + provider);
Log.e(TAG, "onProviderEnabled: " + provider);
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
Log.e(TAG, "onStatusChanged: " + provider + " status: " + status);
}
}
@@ -484,7 +484,7 @@ public class AttachmentManager {
// for rationale dialog requirements
Permissions.PermissionsBuilder permissionsBuilder = Permissions.with(activity)
.ifNecessary()
.withRationaleDialog("To share your live location with chat members, allow ArcaneChat to use your location data.", R.drawable.ic_location_on_white_24dp)
.withRationaleDialog("To share your live location with chat members, allow ArcaneChat to use your location data.\n\nTo make live location work gaplessly, location data is used even when the app is closed or not in use.", R.drawable.ic_location_on_white_24dp)
.withPermanentDenialDialog(activity.getString(R.string.perm_explain_access_to_location_denied))
.onAllGranted(() -> {
ShareLocationDialog.show(activity, durationInSeconds -> {
@@ -495,7 +495,11 @@ public class AttachmentManager {
}
});
});
permissionsBuilder.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
permissionsBuilder.request(Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION);
} else {
permissionsBuilder.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION);
}
permissionsBuilder.execute();
}
@@ -218,7 +218,6 @@ public class NotificationCenter {
public static final int ID_MSG_SUMMARY = 2;
public static final int ID_GENERIC = 3;
public static final int ID_FETCH = 4;
public static final int ID_LOCATION = 5;
public static final int ID_MSG_OFFSET = 0; // msgId is added - as msgId start at 10, there are no conflicts with lower numbers
@@ -244,7 +243,6 @@ public class NotificationCenter {
public static final String CH_MSG_VERSION = "5";
public static final String CH_PERMANENT = "dc_fg_notification_ch";
public static final String CH_GENERIC = "ch_generic";
public static final String CH_LOCATION = "ch_location";
public static final String CH_CALLS_PREFIX = "call_chan";
private boolean notificationChannelsSupported() {
@@ -1,15 +1,19 @@
package org.thoughtcrime.securesms.preferences;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.recyclerview.widget.RecyclerView;
import org.thoughtcrime.securesms.components.CustomDefaultPreference;
import org.thoughtcrime.securesms.util.ViewUtil;
public abstract class CorrectedPreferenceFragment extends PreferenceFragmentCompat {
@@ -19,11 +23,19 @@ public abstract class CorrectedPreferenceFragment extends PreferenceFragmentComp
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
View lv = getView().findViewById(android.R.id.list);
if (lv != null) lv.setPadding(0, 0, 0, 0);
View lv = view.findViewById(android.R.id.list);
if (lv != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// For edge-to-edge (API 23+ only): apply left/right/bottom insets for navigation bar and enable clipToPadding false
// so the list can scroll behind the navigation bar
if (lv instanceof RecyclerView) {
((RecyclerView) lv).setClipToPadding(false);
}
// Apply window insets for left, right, bottom but not top (top is handled by ActionBar)
ViewUtil.applyWindowInsets(lv, true, false, true, true);
}
}
@Override
@@ -39,12 +39,4 @@ public class IntentUtils {
return 0;
}
}
public static int FLAG_IMMUTABLE() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return PendingIntent.FLAG_IMMUTABLE;
} else {
return 0;
}
}
}
@@ -41,6 +41,7 @@ import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
@@ -284,6 +285,178 @@ public class ViewUtil {
}
}
/**
* Get combined insets from system bars (status bar, navigation bar) and display cutout areas.
* @param windowInsets The window insets to extract from
* @return Combined insets using the maximum values from system bars and display cutout
*/
private static Insets getCombinedInsets(@NonNull WindowInsetsCompat windowInsets) {
Insets systemBars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
Insets displayCutout = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout());
return Insets.max(systemBars, displayCutout);
}
/**
* Apply window insets to a view by adding padding to avoid system bars.
* This is the proper way to handle edge-to-edge display.
*
* This method stores the original padding values in view tags to ensure that
* padding doesn't accumulate on multiple inset applications. Original padding
* is preserved and only stored once per view.
*
* @param view The view to apply insets to
* @param left Whether to apply left inset
* @param top Whether to apply top inset
* @param right Whether to apply right inset
* @param bottom Whether to apply bottom inset
*/
public static void applyWindowInsets(@NonNull View view, boolean left, boolean top, boolean right, boolean bottom) {
// Store the original padding as a tag only if not already stored
// This prevents losing the true original padding on subsequent calls
if (view.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_left) == null) {
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_left, view.getPaddingLeft());
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_top, view.getPaddingTop());
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_right, view.getPaddingRight());
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_bottom, view.getPaddingBottom());
}
ViewCompat.setOnApplyWindowInsetsListener(view, (v, windowInsets) -> {
Insets insets = getCombinedInsets(windowInsets);
// Retrieve the original padding values from tags with null checks
Integer leftTag = (Integer) v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_left);
Integer topTag = (Integer) v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_top);
Integer rightTag = (Integer) v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_right);
Integer bottomTag = (Integer) v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_bottom);
int basePaddingLeft = leftTag != null ? leftTag : 0;
int basePaddingTop = topTag != null ? topTag : 0;
int basePaddingRight = rightTag != null ? rightTag : 0;
int basePaddingBottom = bottomTag != null ? bottomTag : 0;
v.setPadding(
left ? basePaddingLeft + insets.left : basePaddingLeft,
top ? basePaddingTop + insets.top : basePaddingTop,
right ? basePaddingRight + insets.right : basePaddingRight,
bottom ? basePaddingBottom + insets.bottom : basePaddingBottom
);
return windowInsets;
});
// Request the initial insets to be dispatched if the view is attached
if (ViewCompat.isAttachedToWindow(view)) {
ViewCompat.requestApplyInsets(view);
}
}
/**
* Apply window insets to a view by adding padding to avoid system bars.
* Convenience method that applies insets to all sides.
*
* @param view The view to apply insets to
*/
public static void applyWindowInsets(@NonNull View view) {
applyWindowInsets(view, true, true, true, true);
}
/**
* Apply the top status bar inset as the height of a view.
* This is useful for creating a colored status bar background view.
* @param view The view whose height should be set to the status bar inset
*/
public static void applyWindowInsetsAsHeight(@NonNull View view) {
ViewCompat.setOnApplyWindowInsetsListener(view, (v, windowInsets) -> {
Insets insets = getCombinedInsets(windowInsets);
android.view.ViewGroup.LayoutParams params = v.getLayoutParams();
if (params != null) {
params.height = insets.top;
v.setLayoutParams(params);
}
return windowInsets;
});
// Request the initial insets to be dispatched if the view is attached
if (ViewCompat.isAttachedToWindow(view)) {
ViewCompat.requestApplyInsets(view);
}
}
/**
* Apply the top status bar inset plus action bar size as top padding to a view.
* This is useful for fragment containers in activities using the default ActionBar.
* @param view The view to apply top padding to
* @param actionBarSize The action bar height in pixels
*/
public static void applyWindowInsetsWithActionBar(@NonNull View view, int actionBarSize) {
// Store the original padding as a tag only if not already stored
if (view.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_top) == null) {
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_top, view.getPaddingTop());
}
ViewCompat.setOnApplyWindowInsetsListener(view, (v, windowInsets) -> {
Insets insets = getCombinedInsets(windowInsets);
Object topTagObj = v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_padding_top);
int basePaddingTop = (topTagObj instanceof Integer) ? (Integer) topTagObj : 0;
v.setPadding(
v.getPaddingLeft(),
basePaddingTop + insets.top + actionBarSize,
v.getPaddingRight(),
v.getPaddingBottom()
);
return windowInsets;
});
// Request the initial insets to be dispatched if the view is attached
if (ViewCompat.isAttachedToWindow(view)) {
ViewCompat.requestApplyInsets(view);
}
}
/**
* Apply the bottom navigation bar inset as additional bottom margin to a view.
* This is useful for FABs and other floating elements that should stay above the navigation bar.
* @param view The view to apply the bottom margin inset to
*/
public static void applyWindowInsetsAsBottomMargin(@NonNull View view) {
// Store the original bottom margin as a tag only if not already stored
if (view.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_margin_bottom) == null) {
ViewGroup.LayoutParams params = view.getLayoutParams();
if (params instanceof ViewGroup.MarginLayoutParams) {
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_margin_bottom,
((ViewGroup.MarginLayoutParams) params).bottomMargin);
} else {
view.setTag(org.thoughtcrime.securesms.R.id.tag_window_insets_margin_bottom, 0);
}
}
ViewCompat.setOnApplyWindowInsetsListener(view, (v, windowInsets) -> {
Insets insets = getCombinedInsets(windowInsets);
ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
Object bottomMarginTag = v.getTag(org.thoughtcrime.securesms.R.id.tag_window_insets_margin_bottom);
int baseMarginBottom = (bottomMarginTag instanceof Integer) ? (Integer) bottomMarginTag : 0;
ViewGroup.MarginLayoutParams marginParams = (ViewGroup.MarginLayoutParams) layoutParams;
marginParams.bottomMargin = baseMarginBottom + insets.bottom;
v.setLayoutParams(marginParams);
}
return windowInsets;
});
// Request the initial insets to be dispatched if the view is attached
if (ViewCompat.isAttachedToWindow(view)) {
ViewCompat.requestApplyInsets(view);
}
}
// Checks if a selection is valid for a given Spinner view.
// Returns given selection if valid.
// Otherwise, to avoid ArrayIndexOutOfBoundsException, 0 is returned, assuming to refer to a good default.
@@ -2,14 +2,19 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:id="@+id/fragment" />
</RelativeLayout>
@@ -2,14 +2,19 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:id="@+id/fragment" />
</RelativeLayout>
@@ -2,14 +2,19 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:id="@+id/fragment" />
</RelativeLayout>
+14 -57
View File
@@ -3,49 +3,53 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="?android:attr/windowBackground"
tools:context=".EditTransportActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_start_shifted"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="14dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_start"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<androidx.legacy.widget.Space
android:id="@+id/fab_spacer"
android:layout_width="wrap_content"
android:layout_height="28dp" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/email"
android:layout_width="0dp"
@@ -54,16 +58,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/fab_spacer">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/email_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email_address"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/password"
android:layout_width="0dp"
@@ -72,16 +73,13 @@
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/email"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/existing_password"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:id="@+id/provider_layout"
android:layout_width="match_parent"
@@ -93,14 +91,12 @@
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/password"
>
<TextView
android:id="@+id/provider_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:textSize="16sp"/>
<TextView
android:id="@+id/provider_link"
android:layout_width="match_parent"
@@ -111,9 +107,7 @@
android:textSize="16sp"
android:text="@string/more_info_desktop"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/no_servers_hint"
android:layout_width="0dp"
@@ -123,7 +117,6 @@
android:text="@string/login_advanced_hint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/provider_layout" />
<androidx.constraintlayout.widget.Group
android:id="@+id/advanced_group"
android:layout_width="wrap_content"
@@ -132,7 +125,6 @@
tools:visibility="visible"
app:constraint_referenced_ids="inbox, imap_login, imap_server, imap_port, imap_security_label, imap_security, outbox_view_spacer_top,
outbox, smtp_login, smtp_password, smtp_server, smtp_port, smtp_security_label, smtp_security, cert_check_label, cert_check, view_log_button, proxy_settings" />
<ImageView
android:id="@+id/advanced_icon"
android:layout_width="wrap_content"
@@ -145,7 +137,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@+id/guideline_root_start_shifted"
app:layout_constraintTop_toBottomOf="@id/no_servers_hint" />
<TextView
android:id="@+id/advanced_text"
android:layout_width="wrap_content"
@@ -158,7 +149,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/advanced_icon"
app:layout_constraintTop_toBottomOf="@id/no_servers_hint" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/proxy_settings"
android:layout_width="0dp"
@@ -169,7 +159,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/advanced_text" />
<TextView
android:id="@+id/inbox"
android:layout_width="wrap_content"
@@ -179,7 +168,6 @@
android:text="@string/login_inbox"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/proxy_settings" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/imap_login"
android:layout_width="0dp"
@@ -187,16 +175,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/inbox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/imap_login_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress|textNoSuggestions"
android:hint="@string/login_imap_login" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/imap_server"
android:layout_width="0dp"
@@ -205,16 +190,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/imap_login">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/imap_server_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_imap_server"
android:inputType="textUri|textNoSuggestions" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/imap_port"
android:layout_width="0dp"
@@ -223,16 +205,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/imap_server">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/imap_port_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_imap_port"
android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/imap_security_label"
style="@style/TextAppearance.AppCompat.Caption"
@@ -242,7 +221,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/imap_port" />
<Spinner
android:id="@+id/imap_security"
android:layout_width="0dp"
@@ -251,13 +229,11 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/imap_security_label" />
<androidx.legacy.widget.Space
android:id="@+id/outbox_view_spacer_top"
android:layout_width="wrap_content"
android:layout_height="16dp"
app:layout_constraintTop_toBottomOf="@id/imap_security" />
<TextView
android:id="@+id/outbox"
android:layout_width="wrap_content"
@@ -266,7 +242,6 @@
android:text="@string/login_outbox"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/outbox_view_spacer_top" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/smtp_login"
android:layout_width="0dp"
@@ -274,16 +249,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/outbox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/smtp_login_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textWebEmailAddress|textNoSuggestions"
android:hint="@string/login_smtp_login" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/smtp_password"
android:layout_width="0dp"
@@ -292,16 +264,13 @@
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_login"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/smtp_password_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_smtp_password"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/smtp_server"
android:layout_width="0dp"
@@ -310,16 +279,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_password">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/smtp_server_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_smtp_server"
android:inputType="textUri|textNoSuggestions" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/smtp_port"
android:layout_width="0dp"
@@ -328,16 +294,13 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_server">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/smtp_port_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/login_smtp_port"
android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/smtp_security_label"
style="@style/TextAppearance.AppCompat.Caption"
@@ -347,7 +310,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_port" />
<Spinner
android:id="@+id/smtp_security"
android:layout_width="0dp"
@@ -356,7 +318,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_security_label" />
<TextView
android:id="@+id/cert_check_label"
style="@style/TextAppearance.AppCompat.Caption"
@@ -366,7 +327,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/smtp_security" />
<Spinner
android:id="@+id/cert_check"
android:layout_width="0dp"
@@ -375,7 +335,6 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/cert_check_label" />
<TextView
android:id="@+id/view_log_button"
android:layout_width="0dp"
@@ -390,9 +349,7 @@
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/cert_check" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</FrameLayout>
</RelativeLayout>
+1 -8
View File
@@ -3,26 +3,22 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="14dp"
app:contentInsetLeft="14dp"
android:elevation="4dp"
android:theme="?attr/actionBarStyle"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
@@ -37,13 +33,10 @@
app:tabIndicatorColor="@color/white"
app:tabTextColor="@color/gray10"
app:tabSelectedTextColor="@color/white"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
-3
View File
@@ -2,14 +2,11 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="org.thoughtcrime.securesms.qr.QrShowFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/qrScannerFragment" />
</RelativeLayout>
@@ -1,25 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:orientation="vertical"
android:gravity="center_horizontal">
<LinearLayout
android:id="@+id/top_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -42,7 +38,6 @@
android:textColor="?attr/emoji_text_color"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -63,14 +58,11 @@
android:textColor="?attr/emoji_text_color"
android:textSize="16sp"/>
</LinearLayout>
</LinearLayout>
<androidx.legacy.widget.Space
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -78,20 +70,15 @@
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:orientation="vertical">
<com.journeyapps.barcodescanner.CompoundBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<androidx.legacy.widget.Space
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
</RelativeLayout>
@@ -2,43 +2,47 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:orientation="vertical"
android:gravity="center_horizontal">
<androidx.legacy.widget.Space
android:layout_weight="2"
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:orientation="vertical">
<com.journeyapps.barcodescanner.CompoundBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal">
<androidx.legacy.widget.Space
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<androidx.legacy.widget.Space
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
android:layout_height="0dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:orientation="vertical">
<com.journeyapps.barcodescanner.CompoundBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<androidx.legacy.widget.Space
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
</FrameLayout>
</RelativeLayout>
@@ -2,23 +2,19 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_container"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.thoughtcrime.securesms.components.ScaleStableImageView
android:id="@+id/preview"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<Button
android:id="@+id/set_default_button"
style="@style/ButtonPrimary"
@@ -30,7 +26,6 @@
android:minWidth="200dp"
android:text="@string/pref_background_btn_default"
android:textAllCaps="false" />
<Button
android:id="@+id/from_gallery_button"
style="@style/ButtonPrimary"
@@ -42,7 +37,5 @@
android:minWidth="200dp"
android:text="@string/pref_background_btn_gallery"
android:textAllCaps="false" />
</LinearLayout>
</FrameLayout>
+1 -8
View File
@@ -3,26 +3,22 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="14dp"
app:contentInsetLeft="14dp"
android:elevation="4dp"
android:theme="?attr/actionBarStyle"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
@@ -37,13 +33,10 @@
app:tabIndicatorColor="@color/white"
app:tabTextColor="@color/gray10"
app:tabSelectedTextColor="@color/white"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -2,14 +2,11 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:id="@+id/backup_provider_fragment" />
</RelativeLayout>
@@ -2,32 +2,26 @@
<LinearLayout android:layout_gravity="center"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<org.thoughtcrime.securesms.components.ContactFilterToolbar
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="?attr/actionBarStyle"
app:contentInsetStartWithNavigation="0dp"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<fragment android:id="@+id/contact_selection_list_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="org.thoughtcrime.securesms.ContactSelectionListFragment" />
</FrameLayout>
</LinearLayout>
@@ -2,10 +2,18 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:layout_height="match_parent" android:layout_width="match_parent">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<org.thoughtcrime.securesms.components.ScaleStableImageView
android:id="@+id/conversation_background"
android:layout_width="match_parent"
@@ -5,7 +5,6 @@
android:id="@id/container"
android:orientation="vertical"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -13,7 +12,7 @@
android:id="@+id/toolbar"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="0dp"
@@ -2,16 +2,13 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:orientation="vertical">
<LinearLayout
android:id="@+id/group_image_holder"
android:layout_width="fill_parent"
@@ -21,13 +18,11 @@
android:paddingTop="14dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<androidx.appcompat.widget.AppCompatImageView android:id="@+id/avatar"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginEnd="10dp"
android:contentDescription="@string/group_avatar" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/group_name"
android:layout_width="match_parent"
@@ -41,7 +36,6 @@
<requestFocus />
</androidx.appcompat.widget.AppCompatEditText>
</LinearLayout>
<TextView
android:id="@+id/chat_hints"
android:layout_width="match_parent"
@@ -52,14 +46,11 @@
android:layout_marginTop="16dp"
android:textSize="18sp"
android:text="@string/chat_new_channel_hint" />
<ListView android:id="@+id/selected_contacts_list"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:dividerHeight="0dp"
android:divider="@null" />
</LinearLayout>
</RelativeLayout>
@@ -2,147 +2,138 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="?android:attr/windowBackground"
>
<LinearLayout
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:paddingTop="20dp"
android:orientation="vertical">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView android:id="@+id/avatar"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="@string/pref_profile_photo"
android:transitionName="avatar"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/name_text"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:paddingTop="20dp"
android:orientation="vertical">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView android:id="@+id/avatar"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="@string/pref_profile_photo"
android:transitionName="avatar"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/pref_your_name"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<TextView
android:id="@+id/information_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/pref_your_name"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<TextView
android:id="@+id/information_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="start"
android:text="@string/set_name_and_avatar_explain"
android:textColor="@color/gray50" />
<TextView
android:id="@+id/privacy_policy_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="16dp"
android:text=""
android:textColor="?attr/colorAccent"
android:textSize="16sp"/>
<Button
style="@style/ButtonPrimary"
android:id="@+id/signup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="20dp"
android:text="@string/instant_onboarding_create"/>
<LinearLayout
android:id="@+id/or_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:gravity="center"
android:orientation="horizontal">
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@drawable/divider_start"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_weight="0"
android:gravity="center"
android:text="@string/or_separator"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:textColor="@color/gray50"/>
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@drawable/divider_end"/>
</LinearLayout>
<Button
style="@style/ButtonSecondary"
android:id="@+id/use_other_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/instant_onboarding_other_server"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="16dp"
android:text="@string/manual_account_setup_option"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/scan_qr_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="16dp"
android:text="@string/scan_invitation_code"/>
</LinearLayout>
</ScrollView>
android:layout_marginTop="16dp"
android:gravity="start"
android:text="@string/set_name_and_avatar_explain"
android:textColor="@color/gray50" />
<TextView
android:id="@+id/privacy_policy_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="16dp"
android:text=""
android:textColor="?attr/colorAccent"
android:textSize="16sp"/>
<Button
style="@style/ButtonPrimary"
android:id="@+id/signup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="20dp"
android:text="@string/instant_onboarding_create"/>
<LinearLayout
android:id="@+id/or_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:gravity="center"
android:orientation="horizontal">
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@drawable/divider_start"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_weight="0"
android:gravity="center"
android:text="@string/or_separator"
android:textSize="14sp"
android:fontFamily="sans-serif"
android:textColor="@color/gray50"/>
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"
android:background="@drawable/divider_end"/>
</LinearLayout>
<Button
style="@style/ButtonSecondary"
android:id="@+id/use_other_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/instant_onboarding_other_server"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="16dp"
android:text="@string/manual_account_setup_option"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/scan_qr_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_marginTop="16dp"
android:text="@string/scan_invitation_code"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
</RelativeLayout>
+19 -9
View File
@@ -2,15 +2,25 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/fragment_container"
android:orientation="vertical"
android:background="?android:attr/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
android:id="@+id/fragment_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</RelativeLayout>
@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="@color/gray95">
<org.thoughtcrime.securesms.components.viewpager.HackyViewPager
android:id="@+id/media_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
+67 -62
View File
@@ -1,71 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:fillViewport="true"
tools:context=".contacts.NewContactActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:background="?attr/colorPrimary">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="?android:attr/windowBackground"
android:animateLayoutChanges="true">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_start"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_end"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".contacts.NewContactActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name_text"
android:layout_width="match_parent"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:animateLayoutChanges="true">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_start"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_root_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/name_desktop"
android:inputType="textPersonName" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/email"
android:layout_width="0dp"
android:layout_height="58dp"
app:errorEnabled="true"
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/name">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/email_text"
android:layout_width="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/email_address"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name_desktop"
android:inputType="textPersonName" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/email"
android:layout_width="0dp"
android:layout_height="58dp"
app:errorEnabled="true"
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
app:layout_constraintTop_toBottomOf="@id/name">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/email_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email_address"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</FrameLayout>
</RelativeLayout>
+1 -2
View File
@@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -15,7 +14,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="14dp"
+81 -82
View File
@@ -1,89 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent">
<org.thoughtcrime.securesms.components.InputAwareLayout
android:id="@+id/container"
android:background="?android:attr/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:orientation="vertical">
<TextView
android:id="@+id/login_success_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="20dp"
android:gravity="start"
android:text=""
android:textSize="16sp"
android:textColor="?android:attr/textColorPrimary" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="horizontal">
<ImageView android:id="@+id/avatar"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="@string/pref_profile_photo"
android:transitionName="avatar"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/pref_your_name"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/status_text_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/status_text"
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<org.thoughtcrime.securesms.components.InputAwareLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:orientation="vertical">
<TextView
android:id="@+id/login_success_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|start"
android:hint="@string/pref_default_status_label"
android:inputType="textMultiLine"
android:maxLines="3" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/information_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:gravity="start"
android:text="@string/pref_who_can_see_profile_explain"
android:textColor="@color/gray50" />
</org.thoughtcrime.securesms.components.InputAwareLayout>
</FrameLayout>
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="20dp"
android:gravity="start"
android:text=""
android:textSize="16sp"
android:textColor="?android:attr/textColorPrimary" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="horizontal">
<ImageView android:id="@+id/avatar"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="@string/pref_profile_photo"
android:transitionName="avatar"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/pref_your_name"
android:inputType="textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/status_text_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/status_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|start"
android:hint="@string/pref_default_status_label"
android:inputType="textMultiLine"
android:maxLines="3" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/information_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:gravity="start"
android:text="@string/pref_who_can_see_profile_explain"
android:textColor="@color/gray50" />
</org.thoughtcrime.securesms.components.InputAwareLayout>
</FrameLayout>
</RelativeLayout>
+29 -22
View File
@@ -3,30 +3,37 @@
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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground"
android:orientation="vertical"
tools:context=".proxy.ProxySettingsActivity">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/proxy_switch"
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/proxy_use_proxy" />
<ListView
android:id="@+id/proxy_list"
android:paddingTop="10dp"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".proxy.ProxySettingsActivity">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/proxy_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/proxy_use_proxy" />
<ListView
android:id="@+id/proxy_list"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
@@ -6,8 +6,5 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:fitsSystemWindows="true"
tools:context="org.thoughtcrime.securesms.scribbles.ScribbleActivity">
</FrameLayout>
@@ -3,9 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/camera_sticker_tabs"
android:layout_width="match_parent"
@@ -19,13 +17,10 @@
app:tabTextColor="@color/gray10"
app:tabSelectedTextColor="@color/white"
app:tabMode="fixed"/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/camera_sticker_pager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="@color/black" />
</LinearLayout>
+2 -1
View File
@@ -9,7 +9,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/search_toolbar_background"/>
<View android:layout_width="match_parent"
+1 -9
View File
@@ -2,30 +2,25 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:orientation="vertical"
android:background="?android:attr/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="?attr/actionBarStyle">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/chat_share_with_title"
@@ -35,10 +30,8 @@
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -46,5 +39,4 @@
android:textSize="20sp"
android:text="@string/one_moment" />
</RelativeLayout>
</RelativeLayout>
+22 -12
View File
@@ -1,13 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:orientation="vertical">
<WebView android:id="@+id/webview"
android:layout_width="match_parent" android:layout_height="match_parent"/>
</LinearLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<WebView android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</RelativeLayout>
+81 -81
View File
@@ -3,89 +3,89 @@
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">
<LinearLayout
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">
<androidx.legacy.widget.Space
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="10"
android:gravity="bottom"
android:src="@drawable/intro1"
android:paddingLeft="32dp"
android:paddingRight="32dp"
tools:ignore="contentDescription"/>
<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:layout_marginBottom="20dp"
android:text="@string/welcome_chat_over_email"
android:textSize="22sp"
android:textStyle="bold"/>
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:elevation="5dp" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal">
<Button
style="@style/ButtonPrimary"
android:id="@+id/signup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/onboarding_create_instant_account"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/add_as_second_device_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/multidevice_receiver_title"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/backup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/import_backup_title"/>
</LinearLayout>
<androidx.legacy.widget.Space
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
tools:context=".WelcomeActivity">
<androidx.legacy.widget.Space
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="10"
android:gravity="bottom"
android:src="@drawable/intro1"
android:paddingLeft="32dp"
android:paddingRight="32dp"
tools:ignore="contentDescription"/>
<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:layout_marginBottom="20dp"
android:text="@string/welcome_chat_over_email"
android:textSize="22sp"
android:textStyle="bold"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal">
<Button
style="@style/ButtonPrimary"
android:id="@+id/signup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/onboarding_create_instant_account"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/add_as_second_device_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/multidevice_receiver_title"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/backup_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/import_backup_title"/>
</LinearLayout>
<androidx.legacy.widget.Space
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
</FrameLayout>
</RelativeLayout>
+7
View File
@@ -1,3 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Tag IDs for storing original padding values when applying window insets -->
<item name="tag_window_insets_padding_left" type="id"/>
<item name="tag_window_insets_padding_top" type="id"/>
<item name="tag_window_insets_padding_right" type="id"/>
<item name="tag_window_insets_padding_bottom" type="id"/>
<!-- Tag ID for storing original margin values when applying window insets -->
<item name="tag_window_insets_margin_bottom" type="id"/>
</resources>
-2
View File
@@ -358,8 +358,6 @@
<string name="copy_json">Copy JSON</string>
<string name="replace_draft">Replace Draft</string>
<string name="title_share_location">Share location with all group members</string>
<string name="location_sharing_notification_title">Sharing location</string>
<string name="location_sharing_notification_text">Location is being shared with chat members</string>
<string name="device_talk">Device Messages</string>
<string name="device_talk_subtitle">Locally generated messages</string>
<string name="device_talk_explain">Messages in this chat are generated on your device to inform about app updates and problems during usage.</string>