Commit 419f2d96 authored by Torsten Grote's avatar Torsten Grote

[android] Show a toast when an image could not be attached

parent d6c18db9
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment