Compare commits

..

15 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 469259f469 Fix LocationListenerCompat compilation error - use correct interface for LocationManagerCompat
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 21:53:16 +00:00
copilot-swe-agent[bot] 9dcd75fe54 Use LocationManagerCompat for proper location updates on modern Android
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 21:47:02 +00:00
copilot-swe-agent[bot] adffc4f6f8 Fix foreground service for Android 14+ and add NETWORK_PROVIDER fallback
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 21:22:29 +00:00
copilot-swe-agent[bot] 7633338359 Fix PermissionsBuilder method chaining - request and execute must be separate calls
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:43:58 +00:00
adb 2f4d239e2b Merge branch 'main' into copilot/allow-location-sharing-again 2025-11-24 21:38:50 +01:00
copilot-swe-agent[bot] ca65424653 Ensure foreground service requirements are met even on error
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:22:58 +00:00
copilot-swe-agent[bot] 6e48933a8f Remove orphaned code from LocationBackgroundService
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:21:00 +00:00
copilot-swe-agent[bot] df50a6d608 Fix method call, thread safety, and service initialization order
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:19:30 +00:00
copilot-swe-agent[bot] b3abc39059 Add FLAG_IMMUTABLE and improve foreground service initialization
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:17:30 +00:00
copilot-swe-agent[bot] 61fc7019b2 Improve foreground service lifecycle handling
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:15:09 +00:00
copilot-swe-agent[bot] b8d6c0b481 Fix service binding logic and foreground service lifecycle
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:13:51 +00:00
copilot-swe-agent[bot] 8675f816de Fix code review feedback: improve error handling and service logic
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:12:34 +00:00
copilot-swe-agent[bot] c9af561868 Add FOREGROUND_SERVICE_LOCATION permission
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:10:28 +00:00
copilot-swe-agent[bot] db10790ecd Implement foreground notification for location sharing
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
2025-11-24 20:07:35 +00:00
copilot-swe-agent[bot] 09f389d6de Initial plan 2025-11-24 20:00:57 +00:00
41 changed files with 750 additions and 827 deletions
+1
View File
@@ -39,6 +39,7 @@
<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,14 +1,13 @@
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;
@@ -18,7 +17,6 @@ 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;
@@ -35,62 +33,9 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
onPreCreate();
// 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);
}
EdgeToEdge.enable(this); // docs says to use: WindowCompat.enableEdgeToEdge(getWindow()); but it is not available
super.onCreate(savedInstanceState);
// 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);
}
}
WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()).setAppearanceLightStatusBars(false); // force white text in status bar
}
@Override
@@ -36,7 +36,6 @@ 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;
@@ -884,23 +883,6 @@ 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,15 +114,6 @@ 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,9 +5,12 @@ 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;
@@ -23,11 +26,13 @@ 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());
}
@@ -37,6 +42,7 @@ public class DcLocationManager implements Observer {
public void onServiceDisconnected(ComponentName name) {
Log.d(TAG, "background service disconnected");
serviceBinder = null;
serviceBound = false;
}
};
@@ -49,19 +55,29 @@ public class DcLocationManager implements Observer {
}
public void startLocationEngine() {
if (serviceBinder == null) {
if (serviceBinder == null || !serviceBound) {
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) {
if (serviceBinder == null || !serviceBound) {
return;
}
context.unbindService(serviceConnection);
serviceBinder.stop();
try {
context.unbindService(serviceConnection);
if (serviceBinder != null) {
serviceBinder.stop();
}
} catch (IllegalArgumentException e) {
Log.w(TAG, "Service not registered", e);
}
serviceBinder = null;
serviceBound = false;
}
public void stopSharingLocation(int chatId) {
@@ -1,18 +1,36 @@
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.Bundle;
import android.os.Build;
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 {
@@ -22,6 +40,7 @@ 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();
@@ -37,12 +56,21 @@ 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) {
@@ -51,14 +79,19 @@ public class LocationBackgroundService extends Service {
DcLocation.getInstance().updateLocation(lastLocation);
}
}
//requestLocationUpdate(LocationManager.NETWORK_PROVIDER);
// Request location updates from both GPS and network providers for better coverage
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;
}
@@ -66,23 +99,93 @@ public class LocationBackgroundService extends Service {
public void onDestroy() {
super.onDestroy();
if (locationManager == null) {
// Stop foreground notification
stopForeground(true);
if (locationManager == null || locationListener == null) {
return;
}
try {
locationManager.removeUpdates(locationListener);
LocationManagerCompat.removeUpdates(locationManager, 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 {
locationManager.requestLocationUpdates(
provider, LOCATION_INTERVAL, LOCATION_DISTANCE,
locationListener);
} catch (SecurityException | IllegalArgumentException ex) {
// 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) {
Log.e(TAG, String.format("Unable to request %s provider based location updates.", provider), ex);
}
}
@@ -93,9 +196,16 @@ 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) {
e.printStackTrace();
Log.e(TAG, "Error getting initial location", e);
}
}
@@ -110,30 +220,22 @@ public class LocationBackgroundService extends Service {
}
}
private class ServiceLocationListener implements LocationListener {
private class ServiceLocationListener implements LocationListenerCompat {
@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.e(TAG, "onProviderDisabled: " + provider);
Log.w(TAG, "onProviderDisabled: " + provider);
}
@Override
public void onProviderEnabled(@NonNull String provider) {
Log.e(TAG, "onProviderEnabled: " + provider);
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
Log.e(TAG, "onStatusChanged: " + provider + " status: " + status);
Log.d(TAG, "onProviderEnabled: " + provider);
}
}
@@ -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.\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)
.withRationaleDialog("To share your live location with chat members, allow ArcaneChat to use your location data.", R.drawable.ic_location_on_white_24dp)
.withPermanentDenialDialog(activity.getString(R.string.perm_explain_access_to_location_denied))
.onAllGranted(() -> {
ShareLocationDialog.show(activity, durationInSeconds -> {
@@ -495,11 +495,7 @@ public class AttachmentManager {
}
});
});
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.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION);
permissionsBuilder.execute();
}
@@ -218,6 +218,7 @@ 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
@@ -243,6 +244,7 @@ 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,19 +1,15 @@
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 {
@@ -23,19 +19,11 @@ public abstract class CorrectedPreferenceFragment extends PreferenceFragmentComp
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
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);
}
View lv = getView().findViewById(android.R.id.list);
if (lv != null) lv.setPadding(0, 0, 0, 0);
}
@Override
@@ -39,4 +39,12 @@ 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,7 +41,6 @@ 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;
@@ -285,178 +284,6 @@ 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,19 +2,14 @@
<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,19 +2,14 @@
<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,19 +2,14 @@
<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>
+57 -14
View File
@@ -3,53 +3,49 @@
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"
@@ -58,13 +54,16 @@
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"
@@ -73,13 +72,16 @@
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"
@@ -91,12 +93,14 @@
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"
@@ -107,7 +111,9 @@
android:textSize="16sp"
android:text="@string/more_info_desktop"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/no_servers_hint"
android:layout_width="0dp"
@@ -117,6 +123,7 @@
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"
@@ -125,6 +132,7 @@
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"
@@ -137,6 +145,7 @@
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"
@@ -149,6 +158,7 @@
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"
@@ -159,6 +169,7 @@
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"
@@ -168,6 +179,7 @@
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"
@@ -175,13 +187,16 @@
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"
@@ -190,13 +205,16 @@
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"
@@ -205,13 +223,16 @@
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"
@@ -221,6 +242,7 @@
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"
@@ -229,11 +251,13 @@
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"
@@ -242,6 +266,7 @@
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"
@@ -249,13 +274,16 @@
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"
@@ -264,13 +292,16 @@
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"
@@ -279,13 +310,16 @@
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"
@@ -294,13 +328,16 @@
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"
@@ -310,6 +347,7 @@
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"
@@ -318,6 +356,7 @@
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"
@@ -327,6 +366,7 @@
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"
@@ -335,6 +375,7 @@
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"
@@ -349,7 +390,9 @@
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>
+8 -1
View File
@@ -3,22 +3,26 @@
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="wrap_content"
android:layout_height="?attr/actionBarSize"
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"
@@ -33,10 +37,13 @@
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,11 +2,14 @@
<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,21 +1,25 @@
<?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"
@@ -38,6 +42,7 @@
android:textColor="?attr/emoji_text_color"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -58,11 +63,14 @@
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"
@@ -70,15 +78,20 @@
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,47 +2,43 @@
<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:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<LinearLayout
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal">
<androidx.legacy.widget.Space
android:layout_weight="2"
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="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>
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>
</RelativeLayout>
@@ -2,19 +2,23 @@
<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"
@@ -26,6 +30,7 @@
android:minWidth="200dp"
android:text="@string/pref_background_btn_default"
android:textAllCaps="false" />
<Button
android:id="@+id/from_gallery_button"
style="@style/ButtonPrimary"
@@ -37,5 +42,7 @@
android:minWidth="200dp"
android:text="@string/pref_background_btn_gallery"
android:textAllCaps="false" />
</LinearLayout>
</FrameLayout>
+8 -1
View File
@@ -3,22 +3,26 @@
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="wrap_content"
android:layout_height="?attr/actionBarSize"
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"
@@ -33,10 +37,13 @@
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,11 +2,14 @@
<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,26 +2,32 @@
<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="wrap_content"
android:layout_height="?attr/actionBarSize"
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,18 +2,10 @@
<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,6 +5,7 @@
android:id="@id/container"
android:orientation="vertical"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -12,7 +13,7 @@
android:id="@+id/toolbar"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="0dp"
@@ -2,13 +2,16 @@
<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"
@@ -18,11 +21,13 @@
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"
@@ -36,6 +41,7 @@
<requestFocus />
</androidx.appcompat.widget.AppCompatEditText>
</LinearLayout>
<TextView
android:id="@+id/chat_hints"
android:layout_width="match_parent"
@@ -46,11 +52,14 @@
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,138 +2,147 @@
<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"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="?android:attr/windowBackground"
>
<LinearLayout
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">
<LinearLayout
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_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_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_marginLeft="10dp">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/name_text"
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>
</FrameLayout>
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>
</RelativeLayout>
+9 -19
View File
@@ -2,25 +2,15 @@
<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: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>
<LinearLayout
android:id="@+id/fragment_container"
android:orientation="vertical"
android:background="?android:attr/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
@@ -1,10 +1,14 @@
<?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>
+62 -67
View File
@@ -1,76 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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:background="?attr/colorPrimary">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
android:fitsSystemWindows="true"
android:background="?attr/colorPrimary"
android:fillViewport="true"
tools:context=".contacts.NewContactActivity">
<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context=".contacts.NewContactActivity">
<androidx.constraintlayout.widget.ConstraintLayout
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="wrap_content"
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: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: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: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"
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>
android:hint="@string/email_address"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
+2 -1
View File
@@ -3,6 +3,7 @@
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">
@@ -14,7 +15,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="14dp"
+80 -79
View File
@@ -1,88 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<FrameLayout
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">
<!-- 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: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"
<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: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_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: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>
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>
+22 -29
View File
@@ -3,37 +3,30 @@
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">
<!-- Status bar background - extends the toolbar color behind the status bar -->
<View
android:id="@+id/status_bar_background"
<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"
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_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="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>
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
@@ -6,5 +6,8 @@
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,7 +3,9 @@
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"
@@ -17,10 +19,13 @@
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>
+1 -2
View File
@@ -9,8 +9,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
android:background="?attr/search_toolbar_background"/>
<View android:layout_width="match_parent"
+9 -1
View File
@@ -2,25 +2,30 @@
<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="wrap_content"
android:layout_height="?attr/actionBarSize"
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"
@@ -30,8 +35,10 @@
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"
@@ -39,4 +46,5 @@
android:textSize="20sp"
android:text="@string/one_moment" />
</RelativeLayout>
</RelativeLayout>
+12 -22
View File
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<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>
<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>
+77 -77
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">
<!-- 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
<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="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: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="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: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: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="0dp"/>
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>
</FrameLayout>
<androidx.legacy.widget.Space
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
</RelativeLayout>
-7
View File
@@ -1,10 +1,3 @@
<?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,6 +358,8 @@
<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>