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
開発 4 年目のアプリへの Kotlin 導入
Search
Ryutaro Miyashita
January 26, 2018
Technology
0
400
開発 4 年目のアプリへの Kotlin 導入
DroidKaigi Prelude #dk_prelude
Ryutaro Miyashita
January 26, 2018
Tweet
Share
More Decks by Ryutaro Miyashita
See All by Ryutaro Miyashita
Java で書かれた Android アプリを Kotlin で書き直すまでの話 / Talk of rewrite Android app for Java to Kotlin
ryugoo
0
1.6k
チーム開発と Android アプリの構成
ryugoo
5
1.1k
開発 4 年目のアプリへの Kotlin 導入
ryugoo
1
2.5k
Either で想定内のエラーと想定外のエラーを別ものにしたい!
ryugoo
2
1.6k
全て S になる -RxJava と LWS を持ち込む楽しさ-
ryugoo
4
680
Transition at RxJava 1.x to 2.x
ryugoo
0
510
Kotlin さんと誕生日が近いだけの男の話
ryugoo
2
490
Android エンジニアになって 2 年の学び
ryugoo
1
2.6k
年末だしお掃除をしよう!
ryugoo
0
750
Other Decks in Technology
See All in Technology
株式会社M2X エンジニアチーム紹介資料
m2xsoftware
0
330
タイミーのBraze活用 ~PUSH通知を活用したレコメンド~
ozeshun
2
120
MySQLのあらたしいリリースモデル LTSとIR
sakaik
1
110
分野に潜むツールの紹介
pojiro
1
330
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
1
160
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
9
41k
エンジニア視点で見る、 組織で運用されるデザインシステムにするには
shunya078
1
200
なぜクラウドサービスで Web コンソールを提供するのか
shuta13
4
1.8k
AWS版GitHub?Amazon CodeCatalystの全体像をまとめてみた
oshanqq
1
3.2k
デジタル化・DX推進あるある
y150saya
0
220
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
0
3.2k
Dojo 20240830 COBOL to Java on Z
ichikawayasuhisa
0
240
Featured
See All Featured
A Tale of Four Properties
chriscoyier
155
22k
In The Pink: A Labor of Love
frogandcode
139
22k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
RailsConf 2023
tenderlove
26
790
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
Embracing the Ebb and Flow
colly
83
4.4k
What's in a price? How to price your products and services
michaelherold
241
11k
Designing the Hi-DPI Web
ddemaree
278
34k
Done Done
chrislema
180
16k
Optimizing for Happiness
mojombo
375
69k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
The Cult of Friendly URLs
andyhume
76
5.9k
Transcript
։ൃͷΞϓϦͷ,PUMJOಋೖ %SPJE,BJHJ1SFMVEF!%F/"
ٶԼཽେ $IBU8PSLגࣜձࣾ ΫϥΠΞϯτΞϓϦέʔγϣϯ։ൃ෦ !SZVHPP@
,PUMJO
։ൃͷΞϓϦͷ,PUMJOಋೖ ‣ ͷ(PPHMF*0Ͱެࣜ։ൃݴޠԽͨ͠ Ҏલ͔Βಋೖݕ౼͍ͯͨ͠ ެࣜαϙʔτ͕ಘΒΕͨ͜ͱͰ҆৺Λಘͨ ཌ͔ΒಋೖΛ։࢝ͨ͠ʜ͔͠͠ʜ ‣
طଘͷΞϓϦͷಋೖͲ͏ͨ͠Βྑ͍ͷ͔ʁ Ͳ͔͜Βʁ શͯॻ͖͑Δʁ ϋοΩϦ͍ͯ͠ͳ͍͕ɺͬͯΈΑ͏
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ ಋೖॳશͯΛ,PUMJOԽ͢Δ༧ఆແ͔ͬͨ ͡Ί৽ن%JBMPH'SBHNFOU͔Β։࢝ ࣍ʹطଘͷ"DUJWJUZΛ,PUMJOԽ ͦͷޙɺ৽نίʔυΛ,PUMJOͰՃ ‣
+BWBͱͷͭͳ͗ࠐΈ͕ωοΫʹͳ͍ͬͯ͘ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET SFUVSO6OJU*/45"/$& 1MBUGPSN5ZQFT
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET DPNQBOJPOPCKFDUதʹॻ͘ͱTUBUJDʹల։ class SomeFragment : Fragment() {
companion object { @JvmField val TAG: String = SomeFragment::class.java.simpleName } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET DPNQBOJPOPCKFDUதʹॻ͘ͱTUBUJDʹల։ class SomeFragment : Fragment() {
companion object { @JvmStatic fun newInstance() = SomeFragment() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET σϑΥϧτҾ͕͋Δ͚ͩΦʔόʔϩʔυ class SomeFragment : Fragment() {
companion object { @JvmStatic @JvmOverloads fun newInstance(id: Long, name: String = "") = SomeFragment() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ SFUVSO6OJU*/45"/$& ؔΛҾʹऔΔॲཧΛ+BWB͔Βݺͼग़͢ͱʁ class Model { fun async(callback:
() -> Unit) { // Some asynchronous processing callback() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ SFUVSO6OJU*/45"/$& lWPJEzͳ͍ͷͰɺl6OJUzΛฦ͢ඞཁ͕͋Δ Model model = new Model();
model.async(() -> { // Some callback processing return Unit.INSTANCE; });
IUUQTEJTDVTTLPUMJOMBOHPSHUKBWBJOUFSPQVOJUDMPTVSFTSFRVJSFEUPSFUVSOLPUMJOVOJU !+WN7PJEͷఏҊ ʹಉ͡ఏى
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ 1MBUGPSN5ZQFT /PO/VMM·ͨ/VMMBCMF͔͠Εͳ͍ܕ "OESPJE4%,جຊతʹ1MBUGPSN5ZQFT !/PO/VMM!/VMMBCMF͕͍͍ͯΕϋοϐʔ val
inflater = LayoutInflater.from(this) ˡฦΓʹlz͕͍͍ͯΔ
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ public static LayoutInflater from(Context context) { LayoutInflater
LayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (LayoutInflater == null) { throw new AssertionError("LayoutInflater not found."); } return LayoutInflater; } val inflater: LayoutInflater = LayoutInflater.from(this) ˡͲ͏ΒOVMMʹͳΒͳ͍Β͍͠ ˣ/PO/VMMܕͱͯ͠ѻ͏Α͏ʹ͢Δ
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ lTPVSDFTz͕͋ΔͳΒ"OESPJE4UVEJPͰ $ISPNFͷ"OESPJE4%,4FBSDIΦεεϝ ‣ IUUQCJUMZBOESPJETELTFBSDI
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ lTPVSDFTz͕͋ΔͳΒ"OESPJE4UVEJPͰ $ISPNFͷ"OESPJE4%,4FBSDIΦεεϝ ‣ IUUQCJUMZBOESPJETELTFBSDI ˡιʔεϑΝΠϧͷϦϯΫ͕͘
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ ࣗୡ͕ॻ͍ͨίʔυʁ !/PO/VMM!/VMMBCMFΛ͚͍ͯ͘ʁ ͍ͬͦͷ͜ͱ,PUMJOʹͯ͠͠·ͬͨํ͕ʁ ‣ ͭͣͭ,PUMJOԽ͍ͯ͘͠
ؔ࿈͢Δ+BWBʹΞ ϊςʔγϣϯΛ͚Δ যΒͣɺΏͬ͘ΓͱͰશͯΛ,PUMJOԽ͢Δ
ݱঢ়
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ ϑΝΠϧ ,PUMJO +BWB
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ νʔϜͷޮՌ /PO/VMM/VMMBCMFΛڧ͘ҙࣝ͢ΔΑ͏ʹͳͬͨ ‣ !/PO/VMM!/VMMBCMFΞ ϊςʔγϣϯͷ͚Ε͕ͳ͍
‣ ݴޠػೳʹ/VMMTBGFUZ͕͋Δํ͕Εͳ͍͠ҙࣝ͢Δ ‣ ͜Ε·Ͱ+BWBͰ0QUJPOBM"1*͍ͬͯͨ ‣ ͨͩɺ0QUJPOBMΛ͍ͬͯΔͱ,PUMJOଆͰ໘ʜʜ
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ νʔϜͷޮՌ ൣғͷWBSΛආ͚ΔΑ͏ʹͳͬͨ ‣ ΠϯελϯεϓϩύςΟͰ͖Δ͚ͩWBM ‣
ϝιουͳͲڱ͍ൣғͰWBS͍ͬͯΔ ‣ -JTU.VUBCMF-JTUͳͲҙࣝతʹ͍͚Λ͍ͯ͠Δ
͓͠·͍ %SPJE,BJHJ1SFMVEF!%F/"