Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cust_remove_call_…
Browse files Browse the repository at this point in the history
…confirm
  • Loading branch information
simonsso committed Jan 30, 2021
2 parents 89d5856 + 01778f7 commit 8fdfabd
Show file tree
Hide file tree
Showing 60 changed files with 299 additions and 112 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ protobuf {
}
}

def canonicalVersionCode = 781
def canonicalVersionName = "5.3.8"
def canonicalVersionCode = 782
def canonicalVersionName = "5.3.9"

def postFixSize = 100
def abiPostFix = ['universal' : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onLoadCleared(@Nullable Drawable placeholder) {
toolbar.setTitle(recipient.getDisplayName(context));
});

FullscreenHelper fullscreenHelper = new FullscreenHelper(this);
FullscreenHelper fullscreenHelper = FullscreenHelper.createWithShortEdgesCutoutMode(this);

findViewById(android.R.id.content).setOnClickListener(v -> fullscreenHelper.toggleUiVisibility());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected void onCreate(Bundle bundle, boolean ready) {

viewModel = ViewModelProviders.of(this).get(MediaPreviewViewModel.class);

fullscreenHelper = new FullscreenHelper(this);
fullscreenHelper = FullscreenHelper.createWithShortEdgesCutoutMode(this);

getSupportActionBar().setDisplayHomeAsUpEnabled(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.webrtc_call_activity);

fullscreenHelper = new FullscreenHelper(this);
fullscreenHelper = FullscreenHelper.createWithShortEdgesCutoutMode(this);

setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public InsetAwareConstraintLayout(@NonNull Context context, @Nullable AttributeS
protected boolean fitSystemWindows(Rect insets) {
Guideline statusBarGuideline = findViewById(R.id.status_bar_guideline);
Guideline navigationBarGuideline = findViewById(R.id.navigation_bar_guideline);
Guideline parentStartGuideline = findViewById(R.id.parent_start_guideline);
Guideline parentEndGuideline = findViewById(R.id.parent_end_guideline);

if (statusBarGuideline != null) {
statusBarGuideline.setGuidelineBegin(insets.top);
Expand All @@ -44,14 +42,6 @@ protected boolean fitSystemWindows(Rect insets) {
navigationBarGuideline.setGuidelineEnd(insets.bottom);
}

if (parentStartGuideline != null) {
parentStartGuideline.setGuidelineBegin(insets.left);
}

if (parentEndGuideline != null) {
parentEndGuideline.setGuidelineEnd(insets.right);
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ protected void onCreate(Bundle state, boolean ready) {
return;
}

new FullscreenHelper(this).showSystemUI();
FullscreenHelper.createWithDefaultCutoutMode(this).showSystemUI();

ConversationIntents.Args args = ConversationIntents.Args.from(getIntent());

Expand Down Expand Up @@ -998,7 +998,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.menu_expiring_messages_off:
case R.id.menu_expiring_messages: handleSelectMessageExpiration(); return true;
case R.id.menu_create_bubble: handleCreateBubble(); return true;
case android.R.id.home: onNavigateUp(); return true;
case android.R.id.home: super.onBackPressed(); return true;
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import androidx.recyclerview.widget.ListAdapter;
import androidx.recyclerview.widget.RecyclerView;

import org.signal.core.util.logging.Log;
import org.signal.paging.PagingController;
import org.thoughtcrime.securesms.BindableConversationListItem;
import org.thoughtcrime.securesms.R;
Expand Down Expand Up @@ -58,6 +57,8 @@ protected ConversationListAdapter(@NonNull GlideRequests glideRequests,

this.glideRequests = glideRequests;
this.onConversationClickListener = onConversationClickListener;

this.setHasStableIds(true);
}

@Override
Expand Down Expand Up @@ -170,6 +171,19 @@ protected Conversation getItem(int position) {
return super.getItem(position);
}

@Override
public long getItemId(int position) {
Conversation item = getItem(position);

switch (item.getType()) {
case THREAD: return item.getThreadRecord().getThreadId();
case PINNED_HEADER: return -1;
case UNPINNED_HEADER: return -2;
case ARCHIVED_FOOTER: return -3;
default: throw new AssertionError();
}
}

public void setPagingController(@Nullable PagingController pagingController) {
this.pagingController = pagingController;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class FcmReceiveService extends FirebaseMessagingService {

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.i(TAG, "FCM message... Delay: " + (System.currentTimeMillis() - remoteMessage.getSentTime()));
Log.i(TAG, "onMessageReceived() ID: " + remoteMessage.getMessageId() + ", Delay: " + (System.currentTimeMillis() - remoteMessage.getSentTime()));

String challenge = remoteMessage.getData().get("challenge");
if (challenge != null) {
Expand All @@ -30,6 +30,12 @@ public void onMessageReceived(RemoteMessage remoteMessage) {
}
}

@Override
public void onDeletedMessages() {
Log.w(TAG, "onDeleteMessages() -- Messages may have been dropped. Doing a normal message fetch.");
handleReceivedNotification(ApplicationDependencies.getApplication());
}

@Override
public void onNewToken(String token) {
Log.i(TAG, "onNewToken()");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.thoughtcrime.securesms.sharing;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.provider.OpenableColumns;
Expand All @@ -9,6 +11,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import androidx.core.content.ContextCompat;

import com.annimon.stream.Collectors;
import com.annimon.stream.Stream;
Expand All @@ -22,9 +25,9 @@
import org.thoughtcrime.securesms.mediasend.MediaSendConstants;
import org.thoughtcrime.securesms.mms.MediaConstraints;
import org.thoughtcrime.securesms.mms.PartAuthority;
import org.thoughtcrime.securesms.mms.PushMediaConstraints;
import org.thoughtcrime.securesms.providers.BlobProvider;
import org.thoughtcrime.securesms.util.MediaUtil;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;
import org.whispersystems.libsignal.util.guava.Optional;

Expand Down Expand Up @@ -109,7 +112,8 @@ void getResolved(@NonNull List<Uri> uris, @NonNull Callback<Optional<ShareData>>
}

private boolean isMmsSupported(@NonNull Context context, @NonNull String mimeType, long size) {
if (!Util.isMmsCapable(context)) {
boolean canReadPhoneState = ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED;
if (!TextSecurePreferences.isSmsEnabled(context) || !canReadPhoneState || !Util.isMmsCapable(context)) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,28 @@ public final class FullscreenHelper {

@NonNull private final Activity activity;

public FullscreenHelper(@NonNull Activity activity) {
this.activity = activity;
public static @NonNull FullscreenHelper createWithDefaultCutoutMode(@NonNull Activity activity) {
FullscreenHelper helper = new FullscreenHelper(activity);

helper.showSystemUI();

return helper;
}

public static @NonNull FullscreenHelper createWithShortEdgesCutoutMode(@NonNull Activity activity) {
FullscreenHelper helper = new FullscreenHelper(activity);

if (Build.VERSION.SDK_INT >= 28) {
activity.getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}

showSystemUI();
helper.showSystemUI();

return helper;
}

private FullscreenHelper(@NonNull Activity activity) {
this.activity = activity;
}

public void configureToolbarSpacer(@NonNull View spacer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void onCreate(Bundle savedInstanceState, boolean ready) {
bubble2.setText(getString(R.string.ChatWallpaperPreviewActivity__set_wallpaper_for_s, recipient.getDisplayName(this)));
}

new FullscreenHelper(this).showSystemUI();
FullscreenHelper.createWithDefaultCutoutMode(this).showSystemUI();
WindowUtil.setLightStatusBarFromTheme(this);
WindowUtil.setLightNavigationBarFromTheme(this);
}
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/conversation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/parent_start_guideline"
app:layout_constraintEnd_toEndOf="@id/parent_end_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/status_bar_guideline">

<androidx.appcompat.widget.Toolbar
Expand Down Expand Up @@ -79,10 +79,10 @@
android:id="@+id/layout_container"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@id/status_bar_guideline"
app:layout_constraintBottom_toBottomOf="@id/navigation_bar_guideline"
app:layout_constraintStart_toStartOf="@id/parent_start_guideline"
app:layout_constraintEnd_toEndOf="@id/parent_end_guideline">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/status_bar_guideline">

<LinearLayout
android:id="@+id/conversation_container"
Expand Down Expand Up @@ -227,8 +227,8 @@
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@+id/status_bar_guideline"
app:layout_constraintBottom_toBottomOf="@+id/navigation_bar_guideline"
app:layout_constraintStart_toStartOf="@+id/parent_start_guideline"
app:layout_constraintEnd_toEndOf="@+id/parent_end_guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:inflatedId="@+id/conversation_reaction_scrubber"
android:layout="@layout/conversation_reaction_scrubber" />

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/conversation_reaction_scrubber.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
android:id="@+id/conversation_reaction_scrubber"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@+id/status_bar_guideline"
app:layout_constraintBottom_toBottomOf="@+id/navigation_bar_guideline"
app:layout_constraintStart_toStartOf="@+id/parent_start_guideline"
app:layout_constraintEnd_toEndOf="@+id/parent_end_guideline"
android:elevation="1000dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/navigation_bar_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/status_bar_guideline"
tools:visibility="visible">

<org.thoughtcrime.securesms.components.MaskView
Expand Down
14 changes: 0 additions & 14 deletions app/src/main/res/layout/system_ui_guidelines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,4 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:layout_constraintGuide_end="48dp" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/parent_start_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:layout_constraintGuide_begin="5dp" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/parent_end_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:layout_constraintGuide_end="5dp" />
</merge>
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">حول</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">اكتب عدة كلمات عن نفسك….</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">ما عليك إلا التحدث بكل حرية</string>
<string name="EditAboutFragment_encrypted">مُعمَّى</string>
<string name="EditAboutFragment_be_kind">كن لطيفا</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,6 @@
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Относно</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Напиши нещо за себе си…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_speak_freely">Говори свободно</string>
<string name="EditAboutFragment_encrypted">Криптирано</string>
<string name="EditAboutFragment_be_kind">Бъде добър</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-bs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">O kontaktu</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Napišite nekoliko riječi o sebi…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Govorite slobodno</string>
<string name="EditAboutFragment_encrypted">Šifrirano</string>
<string name="EditAboutFragment_be_kind">Budite ljubazni</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ S\'ha rebut un missatge d\'intercanvi de claus per a una versió del protocol no
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Quant a</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Escriviu alguna cosa sobre vosaltres…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Parleu lliurement</string>
<string name="EditAboutFragment_encrypted">Encriptat</string>
<string name="EditAboutFragment_be_kind">Sigueu amables</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ Obdržen požadavek na výměnu klíčů pro neplatnou verzi protokolu.
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">O mně</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Napište pár slov o sobě…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Vyjadřujte se svobodně</string>
<string name="EditAboutFragment_encrypted">Šifrováno</string>
<string name="EditAboutFragment_be_kind">Buďte milí</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cy/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ Send neges heb ei ddiogelu?</string>
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Ynghylch</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Ysgrifennwch ychydig o eiriau amdanoch…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Siarad yn rhydd</string>
<string name="EditAboutFragment_encrypted">Amgryptiedig</string>
<string name="EditAboutFragment_be_kind">Byddwch yn garedig</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ Modtog en nøgle besked, for en ugyldig protokol-version
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Om</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Skriv et par ord om dig selv…</string>
<string name="EditAboutFragment_count">%d%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Tal frit</string>
<string name="EditAboutFragment_encrypted">Krypteret</string>
<string name="EditAboutFragment_be_kind">Vær venlig</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ Schlüsselaustausch-Nachricht für eine ungültige Protokollversion empfangen</s
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Über</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Schreib einige Worte über dich …</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Sprich offen</string>
<string name="EditAboutFragment_encrypted">Verschlüsselt</string>
<string name="EditAboutFragment_be_kind">Sei freundlich</string>
Expand Down Expand Up @@ -2379,7 +2379,7 @@ Schlüsselaustausch-Nachricht für eine ungültige Protokollversion empfangen</s
<string name="ShareActivity__s_comma">%1$s,</string>
<string name="ShareActivity__sharing_to_multiple_chats_is">Das Weiterleiten an mehrere Unterhaltungen wird nur für Signal-Nachrichten unterstützt.</string>
<!--MultiShareDialogs-->
<string name="MultiShareDialogs__failed_to_send_to_some_users">Senden an einige Benutzer fehlgeschlagen</string>
<string name="MultiShareDialogs__failed_to_send_to_some_users">Die Nachricht konnte an einige Nutzer nicht gesendet werden</string>
<string name="MultiShareDialogs__you_can_only_share_with_up_to">Du kannst mit maximal %1$d Unterhaltungen teilen</string>
<!--ShareInterstitialActivity-->
<string name="ShareInterstitialActivity__forward_message">Nachricht weiterleiten</string>
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@
<string name="ImageEditorHud_draw_anywhere_to_blur">Ζωγράφισε οπουδήποτε για να θολώσεις</string>
<string name="ImageEditorHud_draw_to_blur_additional_faces_or_areas">Ζωγράφισε για να θολώσεις επιπλέον πρόσωπα ή περιοχές</string>
<!--InputPanel-->
<string name="InputPanel_tap_and_hold_to_record_a_voice_message_release_to_send">Πάτα και κράτα πατημένο για να ηχογραφήσεις ένα φωνητικό μήνυμα, άφησε το κουμπί για αποστολή</string>
<string name="InputPanel_tap_and_hold_to_record_a_voice_message_release_to_send">Πάτα και κράτα πατημένο για να ηχογραφήσεις ένα μήνυμα φωνής, άφησε το κουμπί για αποστολή</string>
<!--InviteActivity-->
<string name="InviteActivity_share">Μοιράσου</string>
<string name="InviteActivity_share_with_contacts">Μοιράσου με επαφές</string>
Expand Down Expand Up @@ -1696,11 +1696,11 @@
<!--EditAboutFragment-->
<string name="EditAboutFragment_about">Πληροφορίες</string>
<string name="EditAboutFragment_write_a_few_words_about_yourself">Γράψε δυο πράγματα για σένα…</string>
<string name="EditAboutFragment_count">%d/%d</string>
<string name="EditAboutFragment_count">%1$d/%2$d</string>
<string name="EditAboutFragment_speak_freely">Μίλα ελεύθερα</string>
<string name="EditAboutFragment_encrypted">Με κρυπτογράφηση</string>
<string name="EditAboutFragment_encrypted">Έχει κρυπτογραφηθεί</string>
<string name="EditAboutFragment_be_kind">Κάνε το καλό και ρίξτο στο γιαλό</string>
<string name="EditAboutFragment_coffee_lover">Πίνω καφεδάκι</string>
<string name="EditAboutFragment_coffee_lover">Λάτρης του καφέ</string>
<string name="EditAboutFragment_free_to_chat">Ελάτε να συζητήσουμε</string>
<string name="EditAboutFragment_taking_a_break">Κάνω διάλειμμα</string>
<string name="EditAboutFragment_working_on_something_new">Ετοιμάζω κάτι καινούργιο</string>
Expand Down
Loading

0 comments on commit 8fdfabd

Please sign in to comment.