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

This commit is contained in:
Torsten Grote
2018-12-03 15:32:03 -02:00
parent d6c18db9e9
commit 419f2d966a
2 changed files with 6 additions and 0 deletions

View File

@@ -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;
}