Render GV1->GV2 migration event.
This commit is contained in:
parent
6bb9d27d4e
commit
5e536c3fa5
21 changed files with 447 additions and 26 deletions
|
@ -59,6 +59,7 @@ public interface BindableConversationItem extends Unbindable {
|
|||
void onVoiceNotePause(@NonNull Uri uri);
|
||||
void onVoiceNotePlay(@NonNull Uri uri, long messageId, double position);
|
||||
void onVoiceNoteSeekTo(@NonNull Uri uri, double position);
|
||||
void onGroupMigrationLearnMoreClicked(@NonNull List<RecipientId> pendingRecipients);
|
||||
|
||||
/** @return true if handled, false if you want to let the normal url handling continue */
|
||||
boolean onUrlClicked(@NonNull String url);
|
||||
|
|
|
@ -22,7 +22,6 @@ import android.app.Activity;
|
|||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
|
@ -90,6 +89,7 @@ import org.thoughtcrime.securesms.database.model.MessageRecord;
|
|||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.groups.ui.migration.GroupsV1MigrationBottomSheetDialogFragment;
|
||||
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceViewOnceOpenJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
@ -1417,6 +1417,11 @@ public class ConversationFragment extends LoggingFragment {
|
|||
public boolean onUrlClicked(@NonNull String url) {
|
||||
return CommunicationActions.handlePotentialGroupLinkUrl(requireActivity(), url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupMigrationLearnMoreClicked(@NonNull List<RecipientId> pendingRecipients) {
|
||||
GroupsV1MigrationBottomSheetDialogFragment.showForLearnMore(requireFragmentManager(), pendingRecipients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,12 +42,14 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
|
||||
private Set<ConversationMessage> batchSelected;
|
||||
|
||||
private TextView body;
|
||||
private LiveRecipient sender;
|
||||
private ConversationMessage conversationMessage;
|
||||
private MessageRecord messageRecord;
|
||||
private Locale locale;
|
||||
private LiveData<Spannable> displayBody;
|
||||
private TextView body;
|
||||
private TextView actionButton;
|
||||
private LiveRecipient sender;
|
||||
private ConversationMessage conversationMessage;
|
||||
private Optional<MessageRecord> nextMessageRecord;
|
||||
private MessageRecord messageRecord;
|
||||
private LiveData<Spannable> displayBody;
|
||||
private EventListener eventListener;
|
||||
|
||||
private final UpdateObserver updateObserver = new UpdateObserver();
|
||||
private final SenderObserver senderObserver = new SenderObserver();
|
||||
|
@ -63,7 +65,8 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
this.body = findViewById(R.id.conversation_update_body);
|
||||
this.body = findViewById(R.id.conversation_update_body);
|
||||
this.actionButton = findViewById(R.id.conversation_update_action);
|
||||
|
||||
this.setOnClickListener(new InternalClickListener(null));
|
||||
}
|
||||
|
@ -82,12 +85,12 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
{
|
||||
this.batchSelected = batchSelected;
|
||||
|
||||
bind(lifecycleOwner, conversationMessage, locale);
|
||||
bind(lifecycleOwner, conversationMessage, nextMessageRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEventListener(@Nullable EventListener listener) {
|
||||
// No events to report yet
|
||||
this.eventListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,10 +98,13 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
return conversationMessage;
|
||||
}
|
||||
|
||||
private void bind(@NonNull LifecycleOwner lifecycleOwner, @NonNull ConversationMessage conversationMessage, @NonNull Locale locale) {
|
||||
private void bind(@NonNull LifecycleOwner lifecycleOwner,
|
||||
@NonNull ConversationMessage conversationMessage,
|
||||
@NonNull Optional<MessageRecord> nextMessageRecord)
|
||||
{
|
||||
this.conversationMessage = conversationMessage;
|
||||
this.messageRecord = conversationMessage.getMessageRecord();
|
||||
this.locale = locale;
|
||||
this.nextMessageRecord = nextMessageRecord;
|
||||
|
||||
observeSender(lifecycleOwner, messageRecord.getIndividualRecipient());
|
||||
|
||||
|
@ -106,7 +112,7 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
LiveData<Spannable> liveUpdateMessage = LiveUpdateMessage.fromMessageDescription(getContext(), updateDescription);
|
||||
LiveData<Spannable> spannableMessage = loading(liveUpdateMessage);
|
||||
|
||||
present(conversationMessage);
|
||||
present(conversationMessage, nextMessageRecord);
|
||||
|
||||
observeDisplayBody(lifecycleOwner, spannableMessage);
|
||||
}
|
||||
|
@ -156,9 +162,24 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
}
|
||||
}
|
||||
|
||||
private void present(ConversationMessage conversationMessage) {
|
||||
private void present(ConversationMessage conversationMessage, @NonNull Optional<MessageRecord> nextMessageRecord) {
|
||||
if (batchSelected.contains(conversationMessage)) setSelected(true);
|
||||
else setSelected(false);
|
||||
|
||||
if (conversationMessage.getMessageRecord().isGroupV1MigrationEvent() &&
|
||||
(!nextMessageRecord.isPresent() || !nextMessageRecord.get().isGroupV1MigrationEvent()))
|
||||
{
|
||||
actionButton.setText(R.string.ConversationUpdateItem_learn_more);
|
||||
actionButton.setVisibility(VISIBLE);
|
||||
actionButton.setOnClickListener(v -> {
|
||||
if (batchSelected.isEmpty() && eventListener != null) {
|
||||
eventListener.onGroupMigrationLearnMoreClicked(conversationMessage.getMessageRecord().getGroupV1MigrationEventInvites());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
actionButton.setVisibility(GONE);
|
||||
actionButton.setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -170,7 +191,7 @@ public final class ConversationUpdateItem extends LinearLayout
|
|||
|
||||
@Override
|
||||
public void onChanged(Recipient recipient) {
|
||||
present(conversationMessage);
|
||||
present(conversationMessage, nextMessageRecord);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
|
|||
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
||||
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, int defaultReceiptStatus, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
||||
public abstract void insertProfileNameChangeMessages(@NonNull Recipient recipient, @NonNull String newProfileName, @NonNull String previousProfileName);
|
||||
public abstract void insertGroupV1MigrationEvent(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients);
|
||||
public abstract void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients);
|
||||
|
||||
public abstract boolean deleteMessage(long messageId);
|
||||
abstract void deleteThread(long threadId);
|
||||
|
|
|
@ -415,7 +415,7 @@ public class MmsDatabase extends MessageDatabase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void insertGroupV1MigrationEvent(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients) {
|
||||
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
|
@ -266,6 +266,10 @@ public interface MmsSmsColumns {
|
|||
return type == PROFILE_CHANGE_TYPE;
|
||||
}
|
||||
|
||||
public static boolean isGroupV1MigrationEvent(long type) {
|
||||
return type == GV1_MIGRATION_TYPE;
|
||||
}
|
||||
|
||||
public static long translateFromSystemBaseType(long theirType) {
|
||||
// public static final int NONE_TYPE = 0;
|
||||
// public static final int INBOX_TYPE = 1;
|
||||
|
|
|
@ -740,7 +740,22 @@ public class SmsDatabase extends MessageDatabase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void insertGroupV1MigrationEvent(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients) {
|
||||
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, @NonNull List<RecipientId> pendingRecipients) {
|
||||
insertGroupV1MigrationNotification(recipientId, threadId);
|
||||
|
||||
if (pendingRecipients.size() > 0) {
|
||||
insertGroupV1MigrationEvent(recipientId, threadId, pendingRecipients);
|
||||
}
|
||||
|
||||
notifyConversationListeners(threadId);
|
||||
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
|
||||
}
|
||||
|
||||
private void insertGroupV1MigrationNotification(@NonNull RecipientId recipientId, long threadId) {
|
||||
insertGroupV1MigrationEvent(recipientId, threadId, Collections.emptyList());
|
||||
}
|
||||
|
||||
private void insertGroupV1MigrationEvent(@NonNull RecipientId recipientId, long threadId, @NonNull List<RecipientId> pendingRecipients) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(RECIPIENT_ID, recipientId.serialize());
|
||||
values.put(ADDRESS_DEVICE_ID, 1);
|
||||
|
@ -749,12 +764,12 @@ public class SmsDatabase extends MessageDatabase {
|
|||
values.put(READ, 1);
|
||||
values.put(TYPE, Types.GV1_MIGRATION_TYPE);
|
||||
values.put(THREAD_ID, threadId);
|
||||
values.put(BODY, RecipientId.toSerializedList(pendingRecipients));
|
||||
|
||||
if (pendingRecipients.size() > 0) {
|
||||
values.put(BODY, RecipientId.toSerializedList(pendingRecipients));
|
||||
}
|
||||
|
||||
databaseHelper.getWritableDatabase().insert(TABLE_NAME, null, values);
|
||||
|
||||
notifyConversationListeners(threadId);
|
||||
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.thoughtcrime.securesms.database.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
|
@ -46,6 +45,7 @@ import org.thoughtcrime.securesms.util.DateUtils;
|
|||
import org.thoughtcrime.securesms.util.ExpirationUtil;
|
||||
import org.thoughtcrime.securesms.util.GroupUtil;
|
||||
import org.thoughtcrime.securesms.util.StringUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.libsignal.util.guava.Function;
|
||||
import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
|
@ -172,6 +172,13 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||
} else if (isEndSession()) {
|
||||
if (isOutgoing()) return staticUpdateDescription(context.getString(R.string.SmsMessageRecord_secure_session_reset), R.drawable.ic_update_info_light_16, R.drawable.ic_update_info_dark_16);
|
||||
else return fromRecipient(getIndividualRecipient(), r-> context.getString(R.string.SmsMessageRecord_secure_session_reset_s, r.getDisplayName(context)), R.drawable.ic_update_info_light_16, R.drawable.ic_update_info_dark_16);
|
||||
} else if (isGroupV1MigrationEvent()) {
|
||||
if (Util.isEmpty(getBody())) {
|
||||
return staticUpdateDescription(context.getString(R.string.MessageRecord_this_group_was_updated_to_a_new_group), R.drawable.ic_update_group_role_light_16, R.drawable.ic_update_group_role_dark_16);
|
||||
} else {
|
||||
int count = getGroupV1MigrationEventInvites().size();
|
||||
return staticUpdateDescription(context.getResources().getQuantityString(R.plurals.MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited, count, count), R.drawable.ic_update_group_add_light_16, R.drawable.ic_update_group_add_dark_16);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -347,9 +354,22 @@ public abstract class MessageRecord extends DisplayRecord {
|
|||
return SmsDatabase.Types.isInvalidVersionKeyExchange(type);
|
||||
}
|
||||
|
||||
public boolean isGroupV1MigrationEvent() {
|
||||
return SmsDatabase.Types.isGroupV1MigrationEvent(type);
|
||||
}
|
||||
|
||||
public @NonNull List<RecipientId> getGroupV1MigrationEventInvites() {
|
||||
if (isGroupV1MigrationEvent()) {
|
||||
return RecipientId.fromSerializedList(getBody());
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUpdate() {
|
||||
return isGroupAction() || isJoined() || isExpirationTimerUpdate() || isCallLog() ||
|
||||
isEndSession() || isIdentityUpdate() || isIdentityVerified() || isIdentityDefault() || isProfileChange();
|
||||
isEndSession() || isIdentityUpdate() || isIdentityVerified() || isIdentityDefault() ||
|
||||
isProfileChange() || isGroupV1MigrationEvent();
|
||||
}
|
||||
|
||||
public boolean isMediaPending() {
|
||||
|
|
|
@ -9,7 +9,10 @@ import androidx.annotation.Nullable;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -74,6 +77,10 @@ public final class GroupMemberListView extends RecyclerView {
|
|||
membersAdapter.updateData(recipients);
|
||||
}
|
||||
|
||||
public void setDisplayOnlyMembers(@NonNull List<Recipient> recipients) {
|
||||
membersAdapter.updateData(Stream.of(recipients).map(r -> new GroupMemberEntry.FullMember(r, false)).toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthSpec, int heightSpec) {
|
||||
if (maxHeight > 0) {
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
package org.thoughtcrime.securesms.groups.ui.migration;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.groups.ui.GroupMemberListView;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.BottomSheetUtil;
|
||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class GroupsV1MigrationBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||
|
||||
private static final String KEY_PENDING = "pending";
|
||||
|
||||
private GroupsV1MigrationViewModel viewModel;
|
||||
private GroupMemberListView pendingList;
|
||||
private TextView pendingTitle;
|
||||
|
||||
public static void showForLearnMore(@NonNull FragmentManager manager, @NonNull List<RecipientId> pendingRecipients) {
|
||||
Bundle args = new Bundle();
|
||||
args.putParcelableArrayList(KEY_PENDING, new ArrayList<>(pendingRecipients));
|
||||
|
||||
GroupsV1MigrationBottomSheetDialogFragment fragment = new GroupsV1MigrationBottomSheetDialogFragment();
|
||||
fragment.setArguments(args);
|
||||
|
||||
fragment.show(manager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
setStyle(DialogFragment.STYLE_NORMAL,
|
||||
ThemeUtil.isDarkTheme(requireContext()) ? R.style.Theme_Signal_RoundedBottomSheet
|
||||
: R.style.Theme_Signal_RoundedBottomSheet_Light);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.groupsv1_migration_learn_more_bottom_sheet, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
this.pendingTitle = view.findViewById(R.id.gv1_learn_more_pending_title);
|
||||
this.pendingList = view.findViewById(R.id.gv1_learn_more_pending_list);
|
||||
|
||||
List<RecipientId> pending = getArguments().containsKey(KEY_PENDING) ? getArguments().getParcelableArrayList(KEY_PENDING) : null;
|
||||
|
||||
this.viewModel = ViewModelProviders.of(this, new GroupsV1MigrationViewModel.Factory(pending)).get(GroupsV1MigrationViewModel.class);
|
||||
viewModel.getPendingMembers().observe(getViewLifecycleOwner(), this::onPendingMembersChanged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||
BottomSheetUtil.show(manager, tag, this);
|
||||
}
|
||||
|
||||
private void onPendingMembersChanged(@NonNull List<Recipient> pendingMembers) {
|
||||
pendingTitle.setText(getResources().getQuantityText(R.plurals.GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite, pendingMembers.size()));
|
||||
pendingList.setDisplayOnlyMembers(pendingMembers);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package org.thoughtcrime.securesms.groups.ui.migration;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class GroupsV1MigrationViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<List<Recipient>> pendingMembers;
|
||||
|
||||
private GroupsV1MigrationViewModel(@NonNull List<RecipientId> pendingMembers) {
|
||||
this.pendingMembers = new MutableLiveData<>();
|
||||
|
||||
SignalExecutors.BOUNDED.execute(() -> {
|
||||
this.pendingMembers.postValue(Recipient.resolvedList(pendingMembers));
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull LiveData<List<Recipient>> getPendingMembers() {
|
||||
return pendingMembers;
|
||||
}
|
||||
|
||||
static class Factory extends ViewModelProvider.NewInstanceFactory {
|
||||
|
||||
private final List<RecipientId> pendingMembers;
|
||||
|
||||
Factory(List<RecipientId> pendingMembers) {
|
||||
this.pendingMembers = pendingMembers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull<T extends ViewModel> T create(@NonNull Class<T> modelClass) {
|
||||
return modelClass.cast(new GroupsV1MigrationViewModel(pendingMembers));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -285,7 +285,7 @@ public class GroupV1MigrationJob extends BaseJob {
|
|||
|
||||
Log.i(TAG, "[Local] Migrating group over to the version we were added to: V" + decryptedGroup.getRevision());
|
||||
DatabaseFactory.getGroupDatabase(context).migrateToV2(gv1Id, decryptedGroup);
|
||||
DatabaseFactory.getSmsDatabase(context).insertGroupV1MigrationEvent(groupRecipient.getId(), threadId, pendingRecipients);
|
||||
DatabaseFactory.getSmsDatabase(context).insertGroupV1MigrationEvents(groupRecipient.getId(), threadId, pendingRecipients);
|
||||
|
||||
Log.i(TAG, "[Local] Applying all changes since V" + decryptedGroup.getRevision());
|
||||
try {
|
||||
|
|
13
app/src/main/res/drawable/paragraph_marker_dark.xml
Normal file
13
app/src/main/res/drawable/paragraph_marker_dark.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<size
|
||||
android:height="11dp"
|
||||
android:width="5dp" />
|
||||
|
||||
<solid
|
||||
android:color="@color/core_grey_65" />
|
||||
|
||||
</shape>
|
13
app/src/main/res/drawable/paragraph_marker_light.xml
Normal file
13
app/src/main/res/drawable/paragraph_marker_light.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<size
|
||||
android:height="11dp"
|
||||
android:width="5dp" />
|
||||
|
||||
<solid
|
||||
android:color="@color/core_grey_15" />
|
||||
|
||||
</shape>
|
|
@ -24,4 +24,12 @@
|
|||
android:textColor="?attr/conversation_item_update_text_color"
|
||||
tools:text="Gwen Stacy set the disappearing message timer to 1 hour" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/conversation_update_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
style="?attr/outlined_action_button"
|
||||
tools:text="Learn more"/>
|
||||
|
||||
</org.thoughtcrime.securesms.conversation.ConversationUpdateItem>
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
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:orientation="vertical"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp"
|
||||
tools:theme="@style/Theme.Signal.RoundedBottomSheet.Light">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gv1_learn_more_title"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="@string/GroupsV1MigrationLearnMore_what_are_new_groups"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Title1"
|
||||
android:textColor="?title_text_color_primary"
|
||||
android:gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="23dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="?paragraph_marker" />
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:text="@string/GroupsV1MigrationLearnMore_new_groups_have_features_like_mentions"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1"
|
||||
android:textColor="?title_text_color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="23dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="?paragraph_marker" />
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:text="@string/GroupsV1MigrationLearnMore_all_message_history_and_media_has_been_kept"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1"
|
||||
android:textColor="?title_text_color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gv1_learn_more_pending_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="23dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:src="?paragraph_marker" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gv1_learn_more_pending_title"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.Signal.Body1"
|
||||
android:textColor="?title_text_color_primary"
|
||||
tools:text="Plurized string for pending members." />
|
||||
|
||||
<org.thoughtcrime.securesms.groups.ui.GroupMemberListView
|
||||
android:id="@+id/gv1_learn_more_pending_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="-12dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
31
app/src/main/res/layout/item_member_view.xml
Normal file
31
app/src/main/res/layout/item_member_view.xml
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
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="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/member_item_avatar"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/member_item_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
style="@style/TextAppearance.Signal.Body2"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constraintStart_toEndOf="@id/member_item_avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/member_item_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/member_item_avatar"
|
||||
tools:text="Mary Jane Watson" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -297,6 +297,9 @@
|
|||
<attr name="media_overview_grid_view_icon" format="reference"/>
|
||||
<attr name="media_overview_list_view_icon" format="reference"/>
|
||||
|
||||
<attr name="outlined_action_button" format="reference" />
|
||||
<attr name="paragraph_marker" format="reference" />
|
||||
|
||||
<attr name="shared_contact_details_header_background" format="color"/>
|
||||
<attr name="shared_contact_details_titlebar" format="color"/>
|
||||
<attr name="shared_contact_item_button_color" format="color"/>
|
||||
|
|
|
@ -539,6 +539,19 @@
|
|||
<string name="GroupManagement_learn_more">Learn more</string>
|
||||
<string name="GroupManagement_invite_multiple_users">These users can’t be automatically added to this group by you.\n\nThey’ve been invited to join the group, and won’t see any group messages until they accept.</string>
|
||||
|
||||
<!-- GroupsV1MigrationLearnMoreBottomSheetDialogFragment -->
|
||||
<string name="GroupsV1MigrationLearnMore_what_are_new_groups">What are New Groups?</string>
|
||||
<string name="GroupsV1MigrationLearnMore_new_groups_have_features_like_mentions">New Groups have features like @mentions and group admins, and will support more features in the future.</string>
|
||||
<string name="GroupsV1MigrationLearnMore_all_message_history_and_media_has_been_kept">All message history and media has been kept from before the upgrade.</string>
|
||||
<plurals name="GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite">
|
||||
<item quantity="one">This member will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
||||
<item quantity="other">These members will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
||||
</plurals>
|
||||
<plurals name="GroupsV1MigrationLearnMore_these_members_are_not_capable_of_joining_new_groups">
|
||||
<item quantity="one">This member is not capable of joining New Groups, and has been removed from the group:</item>
|
||||
<item quantity="other">These members are not capable of joining New Groups, and have been removed from the group:</item>
|
||||
</plurals>
|
||||
|
||||
<!-- LeaveGroupDialog -->
|
||||
<string name="LeaveGroupDialog_leave_group">Leave group?</string>
|
||||
<string name="LeaveGroupDialog_you_will_no_longer_be_able_to_send_or_receive_messages_in_this_group">You will no longer be able to send or receive messages in this group.</string>
|
||||
|
@ -951,6 +964,11 @@
|
|||
<string name="MessageRecord_you_set_disappearing_message_time_to_s">You set the disappearing message timer to %1$s.</string>
|
||||
<string name="MessageRecord_s_set_disappearing_message_time_to_s">%1$s set the disappearing message timer to %2$s.</string>
|
||||
<string name="MessageRecord_disappearing_message_time_set_to_s">The disappearing message timer has been set to %1$s.</string>
|
||||
<string name="MessageRecord_this_group_was_updated_to_a_new_group">This group was updated to a New Group.</string>
|
||||
<plurals name="MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited">
|
||||
<item quantity="one">%1$s member couldn\'t be added to the New Group and has been invited to join.</item>
|
||||
<item quantity="other">%1$s members couldn\'t be added to the New Group and have been invited to join.</item>
|
||||
</plurals>
|
||||
|
||||
<!-- Profile change updates -->
|
||||
<string name="MessageRecord_changed_their_profile_name_to">%1$s changed their profile name to %2$s.</string>
|
||||
|
@ -1773,6 +1791,7 @@
|
|||
|
||||
<!-- ConversationUpdateItem -->
|
||||
<string name="ConversationUpdateItem_loading">Loading</string>
|
||||
<string name="ConversationUpdateItem_learn_more">Learn more</string>
|
||||
|
||||
<!-- audio_view -->
|
||||
<string name="audio_view__play_pause_accessibility_description">Play … Pause</string>
|
||||
|
|
|
@ -522,6 +522,30 @@
|
|||
<item name="colorControlNormal">@color/core_grey_50</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Signal.Button.OutlinedAction.Light" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="android:paddingTop">0dp</item>
|
||||
<item name="android:paddingBottom">0dp</item>
|
||||
<item name="android:paddingStart">16dp</item>
|
||||
<item name="android:paddingEnd">16dp</item>
|
||||
<item name="android:textColor">@color/core_ultramarine</item>
|
||||
<item name="android:textSize">13sp</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:letterSpacing" tools:ignore="NewApi">0.01</item>
|
||||
<item name="strokeColor">@color/core_grey_15</item>
|
||||
<item name="backgroundTint">@color/white</item>
|
||||
<item name="strokeWidth">2dp</item>
|
||||
<item name="cornerRadius">18dp</item>
|
||||
<item name="rippleColor">@color/core_grey_05</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Signal.Button.OutlinedAction.Dark" parent="Widget.Signal.Button.OutlinedAction.Light">
|
||||
<item name="android:textColor">@color/core_ultramarine_light</item>
|
||||
<item name="strokeColor">@color/core_grey_85</item>
|
||||
<item name="backgroundTint">@color/core_grey_95</item>
|
||||
<item name="rippleColor">@color/core_grey_85</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Signal.Button.Rounded" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">50%</item>
|
||||
|
|
|
@ -424,6 +424,9 @@
|
|||
<item name="message_request_text_color_primary">@color/core_grey_90</item>
|
||||
<item name="message_request_text_color_secondary">@color/core_grey_60</item>
|
||||
|
||||
<item name="outlined_action_button">@style/Widget.Signal.Button.OutlinedAction.Light</item>
|
||||
<item name="paragraph_marker">@drawable/paragraph_marker_light</item>
|
||||
|
||||
<item name="avatar_selection_take_photo">@drawable/ic_camera_outline_24</item>
|
||||
<item name="avatar_selection_pick_photo">@drawable/ic_photo_outline_24</item>
|
||||
<item name="avatar_selection_remove_photo">@drawable/ic_trash_outline_24</item>
|
||||
|
@ -448,7 +451,6 @@
|
|||
<item name="tooltip_default_color">@color/core_white</item>
|
||||
|
||||
<item name="dangerous_button_color">@color/core_red_highlight</item>
|
||||
|
||||
<item name="pref_icon_tint">?attr/icon_tint</item>
|
||||
|
||||
<item name="pref_divider">@drawable/preference_divider_light</item>
|
||||
|
@ -617,6 +619,8 @@
|
|||
<item name="conversation_item_reveal_viewed_background_color">?conversation_background</item>
|
||||
<item name="conversation_item_delete_for_everyone_text_color">@color/core_grey_15</item>
|
||||
<item name="conversation_item_mention_pulse_color">@color/transparent</item>
|
||||
<item name="outlined_action_button">@style/Widget.Signal.Button.OutlinedAction.Dark</item>
|
||||
<item name="paragraph_marker">@drawable/paragraph_marker_dark</item>
|
||||
|
||||
<item name="safety_number_change_dialog_button_background">@color/core_grey_75</item>
|
||||
<item name="safety_number_change_dialog_button_text_color">@color/core_grey_05</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue