Add revoke remote wipe conversation notification

This commit is contained in:
ameba23
2021-08-31 12:55:48 +02:00
parent d81964844f
commit 9a28203437
4 changed files with 57 additions and 5 deletions

View File

@@ -327,12 +327,18 @@ class ConversationVisitor implements
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_in, text, r);
}
default: // WIPE
case WIPE:
String text = ctx.getString(R.string.remote_wipe_wipe_sent,
contactName.getValue()) + " " + UiUtils
.formatDateAbsolute(ctx, r.getMessageExpiry());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
default: // REVOKE
String revokeText = ctx.getString(R.string.remote_wipe_revoke_sent,
contactName.getValue()) + " " + UiUtils
.formatDateAbsolute(ctx, r.getMessageExpiry());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, revokeText, r);
}
}

View File

@@ -40,7 +40,7 @@ public class RevokeRemoteWipeSuccessFragment extends BaseFragment {
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_activate_remote_wipe_success,
View view = inflater.inflate(R.layout.fragment_revoke_remote_wipe_success,
container, false);
Button button = view.findViewById(R.id.button);

View File

@@ -1,6 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_large"
android:paddingTop="@dimen/margin_medium"
android:paddingRight="@dimen/margin_large"
android:paddingBottom="@dimen/margin_medium">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="@string/button_confirm"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="@string/remote_wipe_revoke_success"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="32dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_baseline_done_outline_24" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -750,6 +750,7 @@
<string name="activity_name_remote_wipe">Remote Wipe</string>
<string name="assigned_wipers">Your assigned trusted wipers</string>
<string name="activate_remote_wipe">Activate remote wipe</string>
<string name="remote_wipe_revoke_sent">%1$s may no longer activate a remote wipe.</string>
<!-- activate -->
<string name="activity_name_activate_remote_wipe">Activate Remote Wipe</string>