Skip to content

Commit

Permalink
feat: add notice when drag more than 1 file to EnterView
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <[email protected]>
  • Loading branch information
NextAlone committed Sep 26, 2024
1 parent 6c5ae84 commit 240446b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -4910,6 +4911,9 @@ public boolean onDragEvent(DragEvent event) {
if (clipData.getItemCount() == 1 && (clipData.getDescription().hasMimeType("image/*") || clipData.getDescription().hasMimeType("video/mp4")) && !isEditingBusinessLink()) {
editPhoto(clipData.getItemAt(0).getUri(), clipData.getDescription().getMimeType(0));
return true;
} else if (clipData.getItemCount() > 1) {
Toast.makeText(getContext(), "Don't drag more than 1 file at a time", Toast.LENGTH_SHORT).show();
return true;
}
}
}
Expand Down

0 comments on commit 240446b

Please sign in to comment.