mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
sticker alerts: do not repeat text in title and message
moreover, the "Delete" button is shown as being destructive. this removes noise and is more consistent with other confirmations.
This commit is contained in:
@@ -1034,7 +1034,6 @@ public class ConversationFragment extends MessageSelectorFragment {
|
||||
@Override
|
||||
public void onStickerClicked(DcMsg messageRecord) {
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setTitle(R.string.add_to_sticker_collection)
|
||||
.setMessage(R.string.ask_add_sticker_to_collection)
|
||||
.setPositiveButton(
|
||||
R.string.ok,
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
@@ -18,6 +19,7 @@ import java.util.List;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
public class StickerPickerView extends RecyclerView {
|
||||
|
||||
@@ -130,25 +132,26 @@ public class StickerPickerView extends RecyclerView {
|
||||
|
||||
private void deleteSticker(File stickerFile) {
|
||||
if (stickerFile != null && stickerFile.exists()) {
|
||||
new androidx.appcompat.app.AlertDialog.Builder(context)
|
||||
.setTitle(R.string.delete)
|
||||
.setMessage(R.string.ask_delete_sticker)
|
||||
.setPositiveButton(
|
||||
R.string.delete,
|
||||
(dialog, which) -> {
|
||||
if (stickerFile.delete()) {
|
||||
int position = stickerFiles.indexOf(stickerFile);
|
||||
if (position >= 0) {
|
||||
stickerFiles.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onStickerDeleted(stickerFile);
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
AlertDialog dialog =
|
||||
new AlertDialog.Builder(context)
|
||||
.setMessage(R.string.ask_delete_sticker)
|
||||
.setPositiveButton(
|
||||
R.string.delete,
|
||||
(d, which) -> {
|
||||
if (stickerFile.delete()) {
|
||||
int position = stickerFiles.indexOf(stickerFile);
|
||||
if (position >= 0) {
|
||||
stickerFiles.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onStickerDeleted(stickerFile);
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
Util.redPositiveButton(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user