diff --git a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java index e5f02d1..9b55adc 100644 --- a/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java +++ b/app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java @@ -122,7 +122,23 @@ public void openWhatsApp() { } } + public static void shareImage(Context context, Uri imageUri) { + try { + + StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); + StrictMode.setVmPolicy(builder.build()); + + Intent intent = new Intent(Intent.ACTION_SEND); + intent.setType("image/*"); + intent.putExtra(Intent.EXTRA_STREAM, imageUri); + context.startActivity(Intent.createChooser(intent, context.getString(R.string.share))); + } catch (Exception e) + { + Log.e("shareImage", "shareImage: "+e.getMessage() ); + Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } public void shareApp() { diff --git a/app/src/main/res/raw/error3.mp3 b/app/src/main/res/raw/error3.mp3 new file mode 100644 index 0000000..a1f8586 Binary files /dev/null and b/app/src/main/res/raw/error3.mp3 differ diff --git a/app/src/main/res/raw/valid2.mp3 b/app/src/main/res/raw/valid2.mp3 new file mode 100644 index 0000000..08d70de Binary files /dev/null and b/app/src/main/res/raw/valid2.mp3 differ