Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Activityの背景をぼかす
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Nobuhito Ibaraki
November 28, 2017
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Activityの背景をぼかす
Nobuhito Ibaraki
November 28, 2017
More Decks by Nobuhito Ibaraki
See All by Nobuhito Ibaraki
ノーコード編集と配信パフォーマンスを両立するコンテンツエディタの開発
niba1122
1
410
フロントエンドの動向 From Google I/O 2018
niba1122
0
3.2k
Rust+WebAssemblyでWebアプリは作れるのか
niba1122
0
650
potatotips_48茨木.pdf
niba1122
0
920
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.7k
First, design no harm
axbom
PRO
2
1.3k
Docker and Python
trallard
47
4.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
580
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Design in an AI World
tapps
1
310
Statistics for Hackers
jakevdp
799
230k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
How to Ace a Technical Interview
jacobian
281
24k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Google's AI Overviews - The New Search
badams
0
1.6k
Transcript
© 2017 VASILY,Inc. "DUJWJUZͷഎܠΛ΅͔͢ potatotips #45ʢiOS/Android։ൃTipsڞ༗ձʣ 2017/11/28
© 2017 VASILY,Inc. ࣗݾհ Ἒɹெਔ גࣜձࣾ7"4*-:ϑϩϯτΤϯυ։ൃ෦ @niba1122 ɺגࣜձࣾ7"4*-:ʹ৽ଔͰೖࣾɻ ϑϩϯτΤϯυΤϯδχΞͱͯ͠8FCJ04"OESPJEͷ ֤ϓϥοτϑΥʔϜΛ୲͍ͯ͠Δɻ
J04"OESPJEڞʹ։ൃྺϲ݄ɻ
© 2017 VASILY,Inc. Γ͍ͨ͜ͱ "DUJWJUZͷ্ʹ৽͍͠"DUJWJUZΛදࣔͯ͠എܠΛ΅͔͢
© 2017 VASILY,Inc. ࣮ͷํ എܠͷΩϟϓνϟΛऔΔ Ωϟϓνϟʹ#MVSॲཧΛֻ͚Δ #MVSΛֻ͚ͨΩϟϓνϟΛ"DUJWJUZͷഎܠʹઃఆ͢Δ
© 2017 VASILY,Inc. #MVSॲཧ IUUQXXXKBZSBNCIJBDPNCMPHBOESPJECBDLHSPVOECMVS Λࢀߟʹ࣮ͯ͠
© 2017 VASILY,Inc. Ωϟϓνϟͷऔಘ val view: View = window.findViewById(android.R.id.content) try
{ val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888) val c = Canvas(bitmap) view.draw(c) } catch (e: IllegalArgumentException) { e.printStackTrace() }
© 2017 VASILY,Inc. ۤ࿑ͨ͠ᶃ ϙοϓΞοϓͷ"DUJWJUZͰ എܠͷΩϟϓνϟΛࡱΕͳ͍ ϙοϓΞοϓͷ"DUJWJUZΛಁ໌ʹͯ͠ΩϟϓνϟΛࡱͬͯ എܠͷ"DUJWJUZΩϟϓνϟ͞Εͳ͍
© 2017 VASILY,Inc. ղܾࡦ ભҠલͷ"DUJWJUZͰΩϟϓνϟΛࡱͬͯ ϙοϓΞοϓͷ"DUJWJUZʹ͢
© 2017 VASILY,Inc. Ωϟϓνϟͷ#NQ͕େ͖͗ͯ͢*OUFOUͰͤͳ͍ͷͰ ϩʔΧϧετϨʔδʹอଘͯ͠63*Λ*OUFOUͰ͢Α͏ʹͨ͠ val cacheDir = cacheDir val
file = File(cacheDir, CACHE_FILE_NAME) return try { val outputStream = FileOutputStream(file) bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream) outputStream.flush() outputStream.close() Uri.fromFile(file) } catch (e: IOException) { e.printStackTrace() null }
© 2017 VASILY,Inc.
© 2017 VASILY,Inc. ۤ࿑ͨ͠ᶄ ը૾อଘɾ#MVSॲཧ͕ॏ͍ ʢػछʹΑΔ͕ඵఔ͔͔Δ߹͕͋Δʣ ͦͷͨΊϝΠϯεϨουΛѹഭ͢Δ
© 2017 VASILY,Inc. ղܾࡦ શͯ"TZOD5BTLͰΔ
© 2017 VASILY,Inc. ը૾ॲཧ$POUFYUΛ͏ॲཧ͕ଟ͍ͷͰ "TZOD5BTLʹ"DUJWJUZΛͯ͠8FBL3FGFSFODFͰ ࢀর͢ΔΑ͏ʹͨ͠ private class AsyncBlurredCaptureLoader(activity: BlurredModalActivity)
: AsyncTask<Uri, Unit, Drawable>() { private val activity = WeakReference(activity) override fun doInBackground(vararg params: Uri?): Drawable? { val uri = params[0] ?: return null val capture = loadCapture(uri) ?: return null val renderScript = activity.get()?.let { RenderScript.create(it) } ?: return null val blurredCapture = RSBlurProcessor(renderScript).blur(capture, 25f, 3) ?: return null val resources = activity.get()?.resources ?: return null return BitmapDrawable(resources, blurredCapture) } override fun onPostExecute(result: Drawable?) { super.onPostExecute(result) activity.get()?.onLoadBlurredCapture(result) }
© 2017 VASILY,Inc.
© 2017 VASILY,Inc. ·ͱΊ w ϙοϓΞοϓͷ"DUJWJUZ͔ΒഎܠͷΩϟϓνϟࡱΕͳ͍ͷͰ എܠͷ"DUJWJUZͰ༧ΊΩϟϓνϟΛऔΔΑ͏ʹͨ͠ w Ωϟϓνϟը૾͕େ͖͍ͨΊʹJOUFOUͰͤͳ͍ͷͰ ϩʔΧϧετϨʔδʹอଘ͢ΔΑ͏ʹͨ͠
w ը૾อଘ#MVSॲཧΛ"TZOD5BTLͰߦ͏ͱ͖ʹϝΠϯεϨου ͷDPOUFYU͕ඞཁͳͷͰɺ8FBL3FGFSFODFΛͬͨ
© 2017 VASILY,Inc. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠