share recipe photo as provider

This commit is contained in:
vishnuraghavb 2021-04-18 21:38:58 +05:30
parent db35f99235
commit 6d5ac93200
4 changed files with 20 additions and 5 deletions

View file

@ -791,7 +791,7 @@ export default {
) )
.then(() => .then(() =>
pv.animate({ pv.animate({
height: sh, height: sh + 8,
translate: { x: -sw + 112, y: -((sh - sw) / 6) }, translate: { x: -sw + 112, y: -((sh - sw) / 6) },
duration: 250, duration: 250,
curve: CoreTypes.AnimationCurve.ease, curve: CoreTypes.AnimationCurve.ease,

View file

@ -10,7 +10,7 @@
<uses-permission android:name="android.permission.INTERNET" tools:node="remove" /> <uses-permission android:name="android.permission.INTERNET" tools:node="remove" />
<uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove" /> <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove" />
<application android:extractNativeLibs="true" <application android:extractNativeLibs="true"
android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:hardwareAccelerated="true" android:largeHeap="true" android:theme="@style/AppTheme" android:preserveLegacyExternalStorage="true"> android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:hardwareAccelerated="true" android:largeHeap="true" android:theme="@style/AppTheme">
<activity android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:screenOrientation="userPortrait" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode" android:theme="@style/LaunchScreenTheme" android:windowSoftInputMode="adjustResize"> <activity android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:screenOrientation="userPortrait" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode" android:theme="@style/LaunchScreenTheme" android:windowSoftInputMode="adjustResize">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" /> <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
<intent-filter> <intent-filter>
@ -19,5 +19,14 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.tns.ErrorReportActivity" /> <activity android:name="com.tns.ErrorReportActivity" />
<provider
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:authorities="${applicationId}.provider"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider"/>
</provider>
</application> </application>
</manifest> </manifest>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-cache-path name="external_cache_path" path="." />
</paths>

View file

@ -264,9 +264,11 @@ export const shareImage = (image, subject) => {
fos.write(baos.toByteArray()) fos.write(baos.toByteArray())
fos.flush() fos.flush()
fos.close() fos.close()
intent.putExtra( let shareUri = global.androidx.core.content.FileProvider.getUriForFile(
android.content.Intent.EXTRA_STREAM, ctx,
android.net.Uri.fromFile(tmpFile) Application.android.nativeApp.getPackageName() + '.provider',
tmpFile
) )
intent.putExtra(android.content.Intent.EXTRA_STREAM, shareUri)
share(intent, subject) share(intent, subject)
} }