Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android Studioプラグインを作ってみよう 〜Compose for Desktop...
Search
k-tomoyasu
October 26, 2023
Programming
1
620
Android Studioプラグインを作ってみよう 〜Compose for Desktopで始めるプラグイン開発〜
2023年10月26日(木)開催のpixiv App Nightで発表した資料です。
k-tomoyasu
October 26, 2023
Tweet
Share
More Decks by k-tomoyasu
See All by k-tomoyasu
Coroutinesを中心としたAndroidアプリでの並行数制限・排他制御
fusuma0325
0
110
Kotlin Multiplatform Projectで社内用APIクライアントを作る
fusuma0325
0
2.1k
Kotlin/Nativeで作ってみるCLI, iOSアプリ
fusuma0325
1
140
Redashアラートの最近 - カスタマイズ機能を作った話
fusuma0325
0
830
Other Decks in Programming
See All in Programming
コーディングエージェント時代のNeovim
key60228
1
100
Introduction to Git & GitHub
latte72
0
120
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
990
なぜ今、Terraformの本を書いたのか? - 著者陣に聞く!『Terraformではじめる実践IaC』登壇資料
fufuhu
4
650
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
150
Infer入門
riru
4
1.6k
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
260
AHC051解法紹介
eijirou
0
620
令和最新版手のひらコンピュータ
koba789
14
8k
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.6k
フロントエンドのmonorepo化と責務分離のリアーキテクト
kajitack
2
140
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
302
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Unsuck your backbone
ammeep
671
58k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Documentation Writing (for coders)
carmenintech
73
5k
Practical Orchestrator
shlominoach
190
11k
For a Future-Friendly Web
brad_frost
179
9.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
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