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
Android Studioプラグインを作ってみよう 〜Compose for Desktop...
Search
k-tomoyasu
October 26, 2023
Programming
940
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android Studioプラグインを作ってみよう 〜Compose for Desktopで始めるプラグイン開発〜
2023年10月26日(木)開催のpixiv App Nightで発表した資料です。
k-tomoyasu
October 26, 2023
More Decks by k-tomoyasu
See All by k-tomoyasu
Kotlin Notebookを プラグイン開発に活用する
fusuma0325
0
88
MRAID広告の実装から見るWebViewとアプリ間のインタラクション実装
fusuma0325
0
120
Coroutinesを中心としたAndroidアプリでの並行数制限・排他制御
fusuma0325
0
270
Kotlin Multiplatform Projectで社内用APIクライアントを作る
fusuma0325
0
2.2k
Kotlin/Nativeで作ってみるCLI, iOSアプリ
fusuma0325
1
150
Redashアラートの最近 - カスタマイズ機能を作った話
fusuma0325
0
880
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
490
Workers Cache を知る
syumai
0
320
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
32
14k
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
5.7k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
420
速習iPhone Duo対応
yuukiw00w
2
920
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
740
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
160
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
520
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
850
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
750
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
750
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Ruling the World: When Life Gets Gamed
codingconduct
0
380
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
380
The Pragmatic Product Professional
lauravandoore
37
7.5k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Transcript
2023/10/26 fusuma Android StudioϓϥάΠϯΛ࡞ͬͯΈΑ͏ ʙCompose for DesktopͰ࢝ΊΔϓϥάΠϯ։ൃʙ
ࣗݾհ • fusuma(;͢·) • ϐΫγϒגࣜձࣾ • pixivίϛοΫͷAndroidΞϓϦ։ൃ
Android StudioϓϥάΠϯ • Android StudioͷػೳΛ֦ு͢Δ༷ʑͳϓϥάΠϯ͕ެ։͞Ε͍ͯΔ • ։ൃͷੜ࢈ੑΛ্ͤͯ͘͞ΕΔ X(چTwitter)MeetͷίϝϯτͰ օ͞Μ͕Α͘͏ϓϥάΠϯΛڭ͍͑ͯͩ͘͞
εΫγϣิॿͷϓϥάΠϯΛ࡞ͬͨ • Android UiTheme Screenshot • εΫϦʔϯγϣοτิॿ • ϓϧϦΫʹషΔ༻ͳͲΛఆ •
ςʔϚΓସ͑ɾεΫγϣɾϦαΠζ ΛϫϯϘλϯͰ
σϞ
ϓϥάΠϯ։ൃ͍ͯ͘͠ ※հͨ͠ϓϥάΠϯͷ࣮ͷৄࡉʹ৮Ε·ͤΜ (ίʔυGitHubʹஔ͍͍ͯ·͢) https://github.com/k-tomoyasu/Android-UiTheme-Screenshot
Android StudioϓϥάΠϯΛ࡞Γ͍ͨ • Android StudioIntelliJϕʔεͷIDE • جຊతʹIntelliJϓϥάΠϯ • ଟ͘ͷIntelliJϓϥάΠϯAndroid StudioͰͦͷ··͑Δ
• IntelliJϓϥάΠϯ։ൃͷυΩϡϝϯτΛΈͯਐΊΔ https://plugins.jetbrains.com/docs/intellij/developing-plugins.html • ͍͔ͭ͘Android Studio͚ͷઃఆ͕͋Δ • Android Studioʹґଘͨ͠ػೳ͕ͳ͚Εෆཁ
։ൃڥ • ݴޠ: Kotlin | 1.9.10 • ։ൃ: IntelliJ IDEA
(Community Edition) | IC-232.10072.27 • ಈ࡞֬ೝ: Android Studio Giraffe | 2022.3.1 Patch 2 • ϓϥάΠϯ͕Android Studioʹͳ͍ػೳʹґଘͯ͠͠·͍ͬͯͯ։ ൃதʹؾ͚Δ(σϑΥϧτͩͱಈ࡞֬ೝ࣌ʹ։ൃͰ͍ͬͯΔIDE ͕ىಈ͞ΕΔ)
ϓϩδΣΫτ࡞ • File > New > Project ͔ΒIDE PluginΛબ •
࡞ͨ͠εέϧτϯϓϩδΣΫτʹAndroid Studio͚ͷઃఆΛՃ͑Δ
resouces/META-INF/plugin.xml ϓϥάΠϯͷઃఆ
build.gradle.kts ϓϥάΠϯͷϏϧυઃఆ
version.setͱAndroid Studioͷޓੑ • ࢦఆ͢ΔIntelliJ IDEAͷόʔδϣϯλʔήοτͱͳΔAndroid Studioͱޓੑ͕͋Δͷʹ͢Δ • ઌ΄Ͳͷྫͷ version.set(“2022.3.3”) ͷ෦
• IntelliJ IDEAͱAndroid StudioͷόʔδϣϯͷରԠΛ·ͱΊͨϖʔδ͕͋Δ • ࢦఆͨ͠IDEAͷόʔδϣϯ͕Android StudioͷͲͷόʔδϣϯͱޓੑ͕͋Δ͔֬ೝͯ͠ɺόʔδϣ ϯΛ߹ΘͤΔ
ϓϥάΠϯͷಈ࡞֬ೝ • Run PluginͰϓϥάΠϯ͕Πϯετʔϧ͞ΕͨAndroid Studio͕ىಈ
None
ϓϥάΠϯΛݺͼग़͢: ActionΛྫʹ • Action: ϓϥάΠϯΛݺͼग़͢खஈͰɺ࠷Α͘ΘΕΔ • ϝχϡʔπʔϧόʔ͔Β࣮ߦ͞ΕΔΑ͏ʹઃఆͰ͖Δ • AnActionΫϥεΛܧঝͨ͠ΫϥεΛ࣮͠ɺݺͼग़͠ͷτϦΨʔΛ plugin.xmlʹఆٛ͢Δͱ͍͏ྲྀΕ
None
resouces/META-INF/plugin.xml
දࣔ͞Εͨ
ϓϥάΠϯͷUI࣮ • ϓϥάΠϯͷUI࣮ʹSwingΛ͏ • Swing: JavaͰఏڙ͞Ε͍ͯΔGUIϑϨʔϜϫʔΫ • μΠΞϩά࣮ͷྫ(࣍εϥΠυ)
None
None
SwingɺΘ͔Βͳ͍ ※ Swing͕ѱ͍Θ͚Ͱͳ͍Ͱ͢
಄Ͱհͨ͠ϓϥάΠϯͰ
͜͜ΛComposeͰ࣮ ಄Ͱհͨ͠ϓϥάΠϯͰ
ComposeͰUIΛ࣮Ͱ͖Δ
Compose for Desktop • Compose MultiplatformͷҰ෦ • Jetpack Compose ͷ
API Λ༷ʑͳϓϥοτϑΥʔϜʹద༻ • Swingͱ૬ޓӡ༻͢ΔͨΊͷAPI͕͋ΓɺΈ߹Θͤͯ͑Δ • ϓϥάΠϯͷUI࣮ʹར༻Ͱ͖Δ • SwingΛΘͳ͘ͳΔΘ͚Ͱͳ͍ • Composeͱͷ͗ͪΖΜɺSwingͷ࣮Λ͍͍ͨ໘͋Δ
None
None
None
Before: Swing
After: Compose
ϓϥάΠϯUIɺ͍͚ͦ͏ͳؾ͕͢Δ
Compose for DesktopΛ͏४උ • IntelliJͰCompose MultiplatformͷϓϥάΠϯΛΠϯετʔϧ • Preview͕͑Δ(ͨͩ͠Previewͷߋ৽खಈ)
ґଘؔͷهड़ build.gradle.kts
ComposeͰ։ൃ͢Δ४උ͕Ͱ͖ͨ
IDEͷ৭ͱ߹͍ͬͯͳ͍
ͳΒจࣈΛന͘
จࣈΛന͘……
IDEͷ৭ʹద߹ͤ͞Δ࣮
None
None
࣮ͨ͠ThemeΛద༻
ComposeͰ։ൃ͢Δ४උ͕Ͱ͖ͨ
ϓϥάΠϯؔ࿈APIΛௐΔ • UI͕Composeͩͱͯ͠ɺػೳͷ࣮͢ΔʹϓϥάΠϯؔ࿈ͷAPIʹ ͍ͭͯௐΔඞཁ͕͋Δ • υΩϡϝϯτ͔Β୳͢……͚ͩͩͱେม • ࢀߟʹͳΔίʔυΛ୳͢ • Γ͍ͨ͜ͱʹ͍ۙطଘͷϓϥάΠϯ͔Β୳͢
• Android Studioͷ࣮͔Β୳͢
• ϓϥάΠϯͷઃఆը໘ʹ͋ΔϦϯΫ͔ΒḷΔͷָ͕ طଘͷϓϥάΠϯ͔Β୳͢
ιʔείʔυ͕ެ։͞Ε͍ͯͨΒɺ͔͜͜ΒḷΓண͚Δ
Android Studioͷ࣮͔Β୳͢ • Android Studioʹόϯυϧ͞Ε͍ͯΔϓϥάΠϯ͔Β୳͢ • ιʔείʔυ͕ެ։͞Ε͍ͯΔ https://github.com/JetBrains/android •
AndroidϓϥάΠϯͷґଘΛઃఆ͍ͯ͠ΔͷͰɺAndroid Studioͷ࣮ Λར༻͢Δ͜ͱͰ͖Δ
Android Studioͷ࣮͔Β୳͢ • Android StudioͷWebP ConverterΛىಈ͢Δ
Android Studioͷ࣮͔Β୳͢
ެ։ • JetBrainsͷΞΧϯτ͕ඞཁ • ࡞ۀυΩϡϝϯτͷखॱ௨ΓͰOK https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html 1. GradleλεΫbuildPluginͰΞοϓϩʔυ͢ΔzipΛੜ 2.
JetBrains Marketplaceͷϖʔδ͔Β৹ࠪఏग़ 3. ೋӦۀͷʹ৹͕ࠪྃͯ͠ެ։։࢝
ɹϓϥάΠϯ։ൃͰ Compose for DesktopΛಋೖͨ͠ॴײ
Compose for DesktopͰͷϓϥάΠϯ։ൃͷॴײ • ؾʹͳͬͨ • ϓϥάΠϯͷϑΝΠϧαΠζ͕େ͖͘ͳΔ • SwingʹރΕٕͨज़ͷ҆৺ײ͕͋Δ •
Compose for DesktopͰෆ۩߹Β͖͠ͷΛ౿ΜͩΓɺະ࣮ͷͷ͕͋ͬͨΓ • Swingͱͷ૬ޓӡ༻͕ࠓޙൃల͍͔ͯ͘͠Ͳ͏͔ • ྑ͍ • ಈతʹมԽ͢Δཁૉ͕ଟ͍UIͷ࣮ʹڧ͍ • ComposeͷࣝΛ͑Δ • ϨΠΞτͷํ๏ඪ४తͳίϯϙʔωϯτͷ͍ํ͕͔ΔϝϦοτେ͖͍ • ָ͍͠
Compose for DesktopͰͷϓϥάΠϯ։ൃͷॴײ • ߴ͍҆ఆੑଟ͘ͷϢʔβʔʹΘΕΔͷΛٻΊΔͳΒؾ߹͕ඞཁͦ͏ • ಛʹUI͕؆ૉͰ͋ΕSwing͕ແ • ComposeΛ͍͍ͨؾ͕࣋ͪڧ͍/ͱΓ͕͋͑ͣࣗ͏༻ͷϓϥάΠϯ Λ࡞Γ͍ͨͳΒ👍
• ͱʹ͔͘AndroidΤϯδχΞʹͱͬͯऔ͖͍ͬ͢ͷັྗ
ࢀߟ • IntelliJ Platform SDK (ެࣜυΩϡϝϯτ) • Android Studio Plugin
• JetBrains/compose-multiplatofrm ϦϙδτϦ (pluginͷαϯϓϧ) • JetBrains/android (Android Studio࣮) • pbreqult/adb-idea • AndroidͰϥΠτ/μʔΫϞʔυͷεΫγϣΛshellΛୟ͚ҰׅͰࡱӨͰ͖ΔΑ͏ʹͯ͠Έͨ | Qiita • Compose for DeskopͰ࢝ΊΔAndroid։ൃޮԽπʔϧͷ࡞ | Speaker Deck