Loading tests/SilkFX/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,11 @@ <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> </activity> </application> Loading tests/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt +18 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ package com.android.test.silkfx.app import android.content.Intent import android.graphics.ImageDecoder import android.net.Uri import android.os.Bundle import android.os.Parcelable import com.android.test.silkfx.R import com.android.test.silkfx.hdr.GainmapImage Loading @@ -29,14 +31,21 @@ class HdrImageViewer : BaseDemoActivity() { setContentView(R.layout.hdr_image_viewer) val intent = this.intent ?: return finish() if (Intent.ACTION_VIEW != intent.action) { finish() return } when (intent.action) { Intent.ACTION_VIEW -> { val data = intent.data ?: return finish() val source = ImageDecoder.createSource(contentResolver, data) findViewById<GainmapImage>(R.id.gainmap_image)!!.setImageSource(source) } Intent.ACTION_SEND -> { val uri = (intent.getParcelableExtra<Parcelable>(Intent.EXTRA_STREAM) as? Uri) ?: return finish() val source = ImageDecoder.createSource(contentResolver, uri) findViewById<GainmapImage>(R.id.gainmap_image)!!.setImageSource(source) } else -> { finish() } } } } Loading
tests/SilkFX/AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,11 @@ <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter> </activity> </application> Loading
tests/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt +18 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,9 @@ package com.android.test.silkfx.app import android.content.Intent import android.graphics.ImageDecoder import android.net.Uri import android.os.Bundle import android.os.Parcelable import com.android.test.silkfx.R import com.android.test.silkfx.hdr.GainmapImage Loading @@ -29,14 +31,21 @@ class HdrImageViewer : BaseDemoActivity() { setContentView(R.layout.hdr_image_viewer) val intent = this.intent ?: return finish() if (Intent.ACTION_VIEW != intent.action) { finish() return } when (intent.action) { Intent.ACTION_VIEW -> { val data = intent.data ?: return finish() val source = ImageDecoder.createSource(contentResolver, data) findViewById<GainmapImage>(R.id.gainmap_image)!!.setImageSource(source) } Intent.ACTION_SEND -> { val uri = (intent.getParcelableExtra<Parcelable>(Intent.EXTRA_STREAM) as? Uri) ?: return finish() val source = ImageDecoder.createSource(contentResolver, uri) findViewById<GainmapImage>(R.id.gainmap_image)!!.setImageSource(source) } else -> { finish() } } } }