$30 off During Our Annual Pro Sale. View Details »
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
660
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
MRAID広告の実装から見るWebViewとアプリ間のインタラクション実装
fusuma0325
0
70
Coroutinesを中心としたAndroidアプリでの並行数制限・排他制御
fusuma0325
0
160
Kotlin Multiplatform Projectで社内用APIクライアントを作る
fusuma0325
0
2.1k
Kotlin/Nativeで作ってみるCLI, iOSアプリ
fusuma0325
1
140
Redashアラートの最近 - カスタマイズ機能を作った話
fusuma0325
0
840
Other Decks in Programming
See All in Programming
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
3
1.4k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
180
無秩序からの脱却 / Emergence from chaos
nrslib
2
12k
Level up your Gemini CLI - D&D Style!
palladius
1
180
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
12
7k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
290
tparseでgo testの出力を見やすくする
utgwkk
1
160
チームをチームにするEM
hitode909
0
240
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
250
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
350
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
19k
[SF Ruby Conf 2025] Rails X
palkan
0
470
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
56
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
A Tale of Four Properties
chriscoyier
162
23k
Speed Design
sergeychernyshev
33
1.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
87
How to train your dragon (web standard)
notwaldorf
97
6.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Making Projects Easy
brettharned
120
6.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
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