mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
[android] Show a toast when an image could not be attached
This commit is contained in:
@@ -18,6 +18,7 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
@@ -44,6 +45,7 @@ import static android.support.v7.app.AppCompatDelegate.getDefaultNightMode;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.widget.Toast.LENGTH_LONG;
|
||||
import static com.bumptech.glide.load.engine.DiskCacheStrategy.NONE;
|
||||
import static com.bumptech.glide.load.resource.bitmap.DownsampleStrategy.FIT_CENTER;
|
||||
import static java.util.Collections.emptyList;
|
||||
@@ -153,6 +155,9 @@ class TextAttachmentController extends TextSendController {
|
||||
Object model, Target<Bitmap> target,
|
||||
boolean isFirstResource) {
|
||||
reset();
|
||||
Toast.makeText(imageView.getContext(),
|
||||
R.string.image_attach_error, LENGTH_LONG)
|
||||
.show();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
<string name="message_hint">Type message</string>
|
||||
<string name="image_caption_hint">Add a caption (optional)</string>
|
||||
<string name="image_attach">Attach image</string>
|
||||
<string name="image_attach_error">Could not attach image</string>
|
||||
<string name="set_contact_alias">Change contact name</string>
|
||||
<string name="set_contact_alias_hint">Contact name</string>
|
||||
<string name="set_alias_button">Change</string>
|
||||
|
||||
Reference in New Issue
Block a user