Slide 1

Slide 1 text

Kotlin 2.0͕༩͑ΔAndroid։ൃͷਐԽ 2024.09.12 Masayuki Suda © LINE Digital Frontier Corporation

Slide 2

Slide 2 text

໨࣍ 01. ΠϯτϩμΫγϣϯ 04. Stabilized Features 05. Test Experimence 02. Kotlin 2.0 migration 03. K2Compiler 06. Jetpack Compose 1.1 ࣗݾ঺հ 1.2 kotlin2.0 overview 4.1 Enum entries Stable 4.2 Auto Closeable 5.1 Power Assert 2.1 kotlin2.0΁ͷmigrationํ๏ 2.2 kapt͔Βksp΁ͷҠߦํ๏ 3.1 ֓ཁ 3.2 Smart Castͷվળ 3.3 BackingFieldsͷਐԽ 6.1 Strong Skip Mode

Slide 3

Slide 3 text

ΠϯτϩμΫγϣϯ 01. ࣗݾ঺հ kotlin2.0 Overview for mobile engineer

Slide 4

Slide 4 text

1.1 ࣗݾ঺հ LINE Digital Frontierגࣜձࣾ ɹɹMasayukiSuda ɹɹdaasuu

Slide 5

Slide 5 text

1.1 ࣗݾ঺հ LINE Digital Frontier גࣜձࣾͱ͸

Slide 6

Slide 6 text

Kotlin 2.0 OverView ɾK2 Compiler ɾCompose Multiplatform ɾKotlin Native ɾStabilized Features ɾTest Experience ɾJetpack Compose

Slide 7

Slide 7 text

Kotlin 2.0 OverView ɾK2 Compiler ɾCompose Multiplatform ɾKotlin Native ɾStabilized Features ɾTest Experience ɾJetpack Compose

Slide 8

Slide 8 text

Kotlin 2.0΁ͷmigration 02. ΑΓ௚ײతͳcodeʹ

Slide 9

Slide 9 text

Kotlin 2.0΁ͷmigration ɾBump up 2.0 ɾ.gitignore ͷߋ৽ ɾComposeͷߋ৽ ɾKotlin Optionͷߋ৽ ɾAndroid Studio K2 Compilerͷ༗ޮԽ ɾkapt͔Βksp΁ͷҠߦ Kotlin 2.0΁ͷmigration

Slide 10

Slide 10 text

Kotlin 2.0΁ͷmigration kotlin ͷversionΛ2.0.0΁

Slide 11

Slide 11 text

Kotlin 2.0΁ͷmigration ksp ͷversionΛ2.0.0΁

Slide 12

Slide 12 text

Kotlin 2.0΁ͷmigration Jetpack Composeͷ৽͍͠ґଘઌΛ௥Ճ Kotlinͱಉ࣌ʹversion up͕Մೳʹ

Slide 13

Slide 13 text

Kotlin 2.0΁ͷmigration ϓϩδΣΫτͷϧʔτ build.gradle.kts ʹґଘΛ௥Ճ

Slide 14

Slide 14 text

Kotlin 2.0΁ͷmigration Compose Λ࢖༻͢Δ֤ϞδϡʔϧͰɺϓϥάΠϯΛద༻

Slide 15

Slide 15 text

Kotlin 2.0΁ͷmigration kotlinCompilerExtensionVersionΛ࡟আ

Slide 16

Slide 16 text

Kotlin 2.0΁ͷmigration .kotlinΛ௥Ճ

Slide 17

Slide 17 text

Kotlin 2.0΁ͷmigration kotlinOptionsΛɺkotlinͷcompilerOptionsʹॻ͖׵͑

Slide 18

Slide 18 text

Kotlin 2.0΁ͷmigration Setting → Language & Frameworks → Kotlin → Enable K2 Kotlin Mode

Slide 19

Slide 19 text

Kotlin 2.0΁ͷmigration Enable K2 Kotlin Mode In IntelliJ IDEA 2024.1ͰରԠࡁΈɹྫ ɾCode highlighting & Code completion. ɾNavigation ɾBasic refactorings ɾDebugging

Slide 20

Slide 20 text

Kotlin 2.0΁ͷmigration Enable K2 Kotlin Mode In IntelliJ IDEA 2024.1ͰະରԠɹྫ ɾAndroid Project ɾKotlin Multiplatform projects ɾJava-to-Kotlin conversion ɾCode analysis in .gradle.kts files

Slide 21

Slide 21 text

Kotlin 2.0΁ͷmigration IntelliJ IDEA 2024.3ͰશͯରԠ͢Δ༧ఆ🎉

Slide 22

Slide 22 text

Kotlin 2.0΁ͷmigration kapt͔Βksp΁ͷҠߦ ɾ࢖༻͍ͯ͠ΔϥΠϒϥϦ͕KSPʹରԠ͍ͯ͠Δ͔֬ೝ͢Δ ɾKSPϓϥάΠϯΛϓϩδΣΫτʹ௥Ճ͢Δ ɾΞϊςʔγϣϯϓϩηοαΛKSPʹஔ͖׵͑Δ ɾkaptϓϥάΠϯΛ࡟আ͢Δ

Slide 23

Slide 23 text

Kotlin 2.0΁ͷmigration kapt͔Βksp΁ͷҠߦ DataBindingͷҠߦํ๏ ɾJetpack Compose ɾView Binding

Slide 24

Slide 24 text

Kotlin 2.0΁ͷmigration kapt͔Βksp΁ͷҠߦ DataBindingͷҠߦํ๏ ɾJetpack Compose ɹɾҠߦίετ͸ඇৗʹߴ͍ ɹɾGoogle͕ެࣜʹਪ͍ͯ͠Δ ɹɾҠߦޙʹcodeྔ͕ݮΔՄೳੑ͕ߴ͍

Slide 25

Slide 25 text

Kotlin 2.0΁ͷmigration kapt͔Βksp΁ͷҠߦ DataBindingͷҠߦํ๏ ɾView Binding ɹɾAnnotation ProcessorΛ࢖༻͍ͯ͠ͳ͍ ɹɾҠߦίετ͸JetPack ComposeఔͰ͸ͳ͍

Slide 26

Slide 26 text

Kotlin 2.0΁ͷmigration kapt͔Βksp΁ͷҠߦ MigrateDataBindingToViewBindingPlugin

Slide 27

Slide 27 text

K2 Compiler 03. ਐԽͨ͠Kotlin Compiler

Slide 28

Slide 28 text

K2 Compiler Kotlin Compilerͱ͸ ɾKotlinίʔυΛ࣮ߦՄೳͳܗࣜʹม׵͠ɺܕνΣοΫ΍࠷దԽΛߦ͏ ɾେ͖͘෼͚ͯɺFrontendͱBackendͷΞʔΩςΫνϟ͔ΒͳΔ ɾFrontend ɾίʔυͷղੳɺߏจ෼ੳɺܕνΣοΫΛ୲౰͠·͢ ɾBackend ɾϓϥοτϑΥʔϜݻ༗ͷίʔυʢJVMόΠτίʔυɺJavaScriptɺωΠςΟ ϒόΠφϦͳͲʣΛੜ੒͠·͢

Slide 29

Slide 29 text

K2 Compiler K2 CompilerͷਐԽ ɾFrontendͷΞʔΩςΫνϟʹେ෯มߋ͋Γ ɾܕਪ࿦΍ݺͼग़͠ղܾ͕ਐԽ͠ɺSmart Cast͕վળ ɾߴ଎Խ ɾैདྷͱൺ΂ͯ࠷େ2ഒͷίϯύΠϧͷ଎౓վળ͕࣮ࢪ ※ୠ͠kaptͷ࢖༻͕࢒͍ͬͯͨΓJavaͳͲ͕࢒͍ͬͯͨ৔߹͸Ϗϧυϓϩ ηε͕ෳࡶʹͳΔͨΊɺߴ଎ԽͷԸܙΛड͚ΒΕ·ͤΜɻ ɾIDEͷύϑΥʔϚϯε΋޲্

Slide 30

Slide 30 text

Smart CastͷਐԽ K2 Compiler

Slide 31

Slide 31 text

K2 Compiler Smart Castͷվળ ɾϩʔΧϧม਺ͱ͞ΒͳΔείʔϓ ɾ࿦ཧ࿨ԋࢉࢠΛ࢖༻ͨ͠ܕνΣοΫ ɾΠϯϥΠϯؔ਺ ɾؔ਺ܕͷϓϩύςΟ ɾΠϯΫϦϝϯτԋࢉࢠͱσΫϦϝϯτԋࢉࢠ

Slide 32

Slide 32 text

K2 Compiler Smart Castͷվળ̍ɹϩʔΧϧม਺ͱ͞ΒͳΔείʔϓ ৚݅จͷલʹએݴͨ͠ม਺͸Smart Cast͞ΕΔΑ͏ʹ Ver 1.9.24 Ver 2.0.0

Slide 33

Slide 33 text

K2 Compiler

Slide 34

Slide 34 text

K2 Compiler Smart Castͷվળ2ɹ࿦ཧ࿨ԋࢉࢠΛ࢖༻ͨ͠ܕνΣοΫ Ver 1.9.24 2.0ΑΓલ͸AnyܕʹSmart Cast

Slide 35

Slide 35 text

K2 Compiler Smart Castͷվળ2ɹ࿦ཧ࿨ԋࢉࢠΛ࢖༻ͨ͠ܕνΣοΫ Ver 2.0.0 Orԋࢉࢠʢ||ʣͰܕνΣοΫΛ૊Έ߹ΘͤΔͱɺڞ௨ͷsuper typeʹ Smart Cast

Slide 36

Slide 36 text

K2 Compiler

Slide 37

Slide 37 text

K2 Compiler Smart Castͷվળ3ɹΠϯϥΠϯؔ਺ ΠϯϥΠϯؔ਺Λͦͷ৔Ͱݺͼग़͢ͱݟͳ͠ɺม਺ΛSmart Cast Ver 1.9.24 Ver 2.0.0

Slide 38

Slide 38 text

K2 Compiler Smart Castͷվળ4ɹؔ਺ܕͷϓϩύςΟ ؔ਺ܕͷΫϥεϓϩύςΟ͕Smart Cast͞Εͳ͍ όά͕मਖ਼ Ver 1.9.24 Ver 2.0.0

Slide 39

Slide 39 text

K2 Compiler Smart Castͷվળ4ɹؔ਺ܕͷϓϩύςΟ

Slide 40

Slide 40 text

K2 Compiler Smart Castͷվળ5ɹΠϯΫϦϝϯτԋࢉࢠͱσΫϦϝϯτԋࢉࢠ Ver 1.9.24 Ver 2.0.0 ਺஋ܕͷૢ࡞͕؆୯ʹͳΓɺܕม׵ͷඞཁ͕ݮΓ·͢ɻ

Slide 41

Slide 41 text

K2 Compiler Smart Castͷվળ5ɹΠϯΫϦϝϯτԋࢉࢠͱσΫϦϝϯτԋࢉࢠ Ver 1.9.24 Ver 2.0.0 Nullableͷ৔߹΋গͳ͍هड़Ͱॻ͘͜ͱ͕Մೳʹ

Slide 42

Slide 42 text

K2 Compiler Smart Castͷվળ5ɹΠϯΫϦϝϯτԋࢉࢠͱσΫϦϝϯτԋࢉࢠ

Slide 43

Slide 43 text

BackingFieldsͷਐԽ K2 Compiler

Slide 44

Slide 44 text

Backing Fields Ҏલ·ͰͷStateFlowΛViewModelͰ࢖͏ࡍͷهड़

Slide 45

Slide 45 text

Backing Fields Privateͷม਺͕ෆཁʹ🎉

Slide 46

Slide 46 text

Backing Fields Ҏલ·ͰͷLiveDataΛViewModelͰ࢖͏ࡍͷهड़

Slide 47

Slide 47 text

Backing Fields Privateͷม਺͕ෆཁʹ🎉

Slide 48

Slide 48 text

Backing Fields ࢖༻͢Δmoduleͷbuild.gradleʹهड़

Slide 49

Slide 49 text

Stabilized Features 04. ΑΓ҆શͳCode΁

Slide 50

Slide 50 text

Enum entries Stable

Slide 51

Slide 51 text

Enum emtries Stable entriesΑΓҎલͷؔ਺

Slide 52

Slide 52 text

Enum emtries Stable ɾvalues()Ͱ͸ɺؔ਺͕call͞ΕΔ౓ʹArrayList͕ੜ੒ ɾentriesͰ͸ಉ͡ListΛຖճฦ͢Α͏ʹ

Slide 53

Slide 53 text

AutoCloseable

Slide 54

Slide 54 text

AutoCloseable ϦιʔεΛࣗಈతʹղ์͢ΔͨΊͷ interface

Slide 55

Slide 55 text

AutoCloseable Closeableͱͷҧ͍ ɾCloseable: I/O ૢ࡞ʹಛԽͨ͠ΠϯλʔϑΣʔεͰɺ IOException ͷΈΛѻ͏ɻ ɾAutoCloseable: ൚༻తͳϦιʔε؅ཧΠϯλʔϑΣʔεͰɺྫ ֎ॲཧ΋ॊೈɻ

Slide 56

Slide 56 text

AutoCloseable AutoCloseable͕ͳ͔ͬͨ৔߹

Slide 57

Slide 57 text

AutoCloseable AutoCloseable͕ͳ͔ͬͨ৔߹

Slide 58

Slide 58 text

AutoCloseable AutoCloseableΛద༻͢Δ৔߹

Slide 59

Slide 59 text

AutoCloseable ɾ໌ࣔతʹϦιʔεΛด͡ͳͯ͘΋ྑ͍ ɾ֦ுؔ਺ͷuse͕࢖͑ΔΑ͏ʹͳΔ

Slide 60

Slide 60 text

AutoCloseable Javaͱͷޓ׵ੑ΋͋ΔͷͰɺSDK౳Λ࡞Δࡍʹ΋˕

Slide 61

Slide 61 text

Test Experimence 05. Power Assert

Slide 62

Slide 62 text

Power Assert Power Assertͷͳ͍ɺUnit Test͕མͪͨ࣌

Slide 63

Slide 63 text

Power Assert Power Assertͷͳ͍ɺUnit Test͕མͪͨ࣌ Failed message͸ඇৗʹγϯϓϧ

Slide 64

Slide 64 text

Power Assert Power Assertͷ͋ΔɺUnit Test͕མͪͨ࣌

Slide 65

Slide 65 text

Power Assert Power Assertͷ͋ΔɺUnit Test͕མͪͨ࣌ ৄࡉͳFailed message͕දࣔ

Slide 66

Slide 66 text

Power Assert Kotlin 2.0͔Βਖ਼ࣜʹ Kotlin͕αϙʔτ🎉🎉

Slide 67

Slide 67 text

Power Assert ࢖༻͢Δmoduleͷpluginsʹ௥Ճ

Slide 68

Slide 68 text

Power Assert JUnitͰ͸ͳ͘ɺKotlinͷtestΛ dependenciesʹ௥Ճ

Slide 69

Slide 69 text

Power Assert ࢖༻͢Δmoduleʹ௥Ճ

Slide 70

Slide 70 text

Power Assert

Slide 71

Slide 71 text

Power Assert

Slide 72

Slide 72 text

Power Assert test message

Slide 73

Slide 73 text

Power Assert test message

Slide 74

Slide 74 text

Power Assert test message

Slide 75

Slide 75 text

Power Assert test message

Slide 76

Slide 76 text

Power Assert test message

Slide 77

Slide 77 text

Power Assert test message

Slide 78

Slide 78 text

Power Assert test message

Slide 79

Slide 79 text

Power Assert ListΛ࢖͏ςετͷύλʔϯ

Slide 80

Slide 80 text

Power Assert Listͷத਎΋ग़ྗͯ͘͠ΕΔ🎉🎉

Slide 81

Slide 81 text

Jetpack Compose 06. Compose Strong Skip Mode

Slide 82

Slide 82 text

Jetpack Compose Strong Skip Mode enabled by default Kotlin 2.0.20Ͱͷมߋ఺

Slide 83

Slide 83 text

Strong Skip ModeͰมߋ͞ΕΔࣄ ɾComposableؔ਺ͷRecomposeͷ৚݅ ɾlambdaࣜͷ࠶ੜ੒ͷ৚݅ Jetpack Compose Strong Skip Mode

Slide 84

Slide 84 text

Jetpack Compose Strong Skip Mode Row item1 item2 item3 item1Λߋ৽ Row item1 item2 item3 Recompose Recompose Skip Skip Recomposeͱ͸ ɾUIͷҰ෦͕ঢ়ଶͷมԽʹԠͯ͡࠶ඳը͞ΕΔϓϩηε

Slide 85

Slide 85 text

Jetpack Compose Strong Skip Mode UnstableͳҾ਺Λitem2, 3͕࢖͍ͬͯΔͱ ঢ়ଶ͕มߋ͍ͯ͠ͳͯ͘΋࠶ඳը͕͞Εͯ͠·͏ Row item1 item2 item3 item1Λߋ৽ Row item1 item2 item3 Recompose Recompose Recompose Recompose

Slide 86

Slide 86 text

StableͱUnStable Kotlin 2.0.20Ͱͷมߋ఺

Slide 87

Slide 87 text

Jetpack Compose Strong Skip Mode Stableͳྫ ϓϦϛςΟϒ஋ จࣈྻ Stableͳ஋Ͱߏ੒͞Ε ͨImmurableͳclass

Slide 88

Slide 88 text

Jetpack Compose Strong Skip Mode Unstableͳྫᶃ List΍Set mutableͳclass Throwable΍Date

Slide 89

Slide 89 text

Jetpack Compose Strong Skip Mode Unstableͳྫᶄ Compose Λ࢖༻͍ͯ͠ͳ͍module΍֎෦libraryͷ classΛ࢖༻

Slide 90

Slide 90 text

Jetpack Compose Strong Skip Mode Strong Skip Mode͕trueͷ࣌ kotlin 2.0.20ͷҎ߱ͷRecompose

Slide 91

Slide 91 text

Jetpack Compose Strong Skip Mode ɾUnstableͳҾ਺࢖༻͍ͯͯ͠΋ɺinstance͕ಉ͡Ͱ͋Ε͹ Recompose͞Εͳ͍ ɾStableͳҾ਺Λ࢖༻͍ͯͨ͠৔߹͸ڍಈ͸มΘΒͳ͍ Row item1 item2 item3 item1Λߋ৽ Row item1 item2 item3 Recompose Recompose Skip Skip

Slide 92

Slide 92 text

Jetpack Compose Strong Skip Mode Strong Skip Mode͕true͔false͔Ͱڍಈ͕มΘΔྫ

Slide 93

Slide 93 text

Jetpack Compose Strong Skip Mode

Slide 94

Slide 94 text

Jetpack Compose Strong Skip Mode

Slide 95

Slide 95 text

Jetpack Compose Strong Skip Mode

Slide 96

Slide 96 text

Jetpack Compose Strong Skip Mode

Slide 97

Slide 97 text

Jetpack Compose Strong Skip Mode

Slide 98

Slide 98 text

Jetpack Compose Strong Skip Mode

Slide 99

Slide 99 text

Jetpack Compose Strong Skip Mode Strong Skip Mode OFF

Slide 100

Slide 100 text

Jetpack Compose Strong Skip Mode Strong Skip Mode ON

Slide 101

Slide 101 text

Jetpack Compose Strong Skip Mode

Slide 102

Slide 102 text

Jetpack Compose Strong Skip Mode UnstableͳҾ਺࢖༻͍ͯͯ͠΋ɺinstance͕ಉ͡Ͱ͋Ε͹ Recompose͞Εͳ͍ UnstableͳҾ਺࢖༻͍ͯͯ͠ΒɺRecompose͞ΕΔ

Slide 103

Slide 103 text

Jetpack Compose Strong Skip Mode ˏImmutableͱ@Stable Unstableͳ΋ͷΛɺStableͱcompilerʹೝࣝͤ͞Δ

Slide 104

Slide 104 text

Jetpack Compose Strong Skip Mode ˏImmutableͱ@Stable Strong Skip ModeͰ΋ڍಈ͸ಉ͡ ͚ͭͨ৔߹ʹҧ͏ͷ͸ɺInstance equals == false͔ɺ Object equals == falseͰRecomposeͤ͞Δ͔ͷҧ͍

Slide 105

Slide 105 text

Jetpack Compose Strong Skip Mode ˏImmutableͱ@Stable Strong Skip ModeͰ΋ڍಈ͸ಉ͡ API͔Βऔಘͨ͠ࡍ΍DB͔Βऔಘͨ͠ࡍͳͲɺಉ͡஋Ͱ΋औ ಘ࣌ʹຖճinstance͕มΘΔ৔߹͸ @ImmutableΛ࢖༻ͨ͠ํ ͕ྑ͍৔߹͕͋Δ͔΋͠Εͳ͍

Slide 106

Slide 106 text

Jetpack Compose Strong Skip Mode config fileͰstableΛҰׅࢦఆ

Slide 107

Slide 107 text

Jetpack Compose Strong Skip Mode config fileͰstableΛҰׅࢦఆ

Slide 108

Slide 108 text

Jetpack Compose Strong Skip Mode config fileͰstableΛҰׅࢦఆ

Slide 109

Slide 109 text

Jetpack Compose Strong Skip Mode config fileͰstableΛҰׅࢦఆ

Slide 110

Slide 110 text

Strong Skip ModeͰมߋ͞ΕΔࣄ ɾComposableؔ਺ͷRecomposeͷ৚݅ ɾlambdaࣜͷ࠶ੜ੒ͷ৚݅ Jetpack Compose Strong Skip Mode

Slide 111

Slide 111 text

Jetpack Compose Strong Skip Mode Strong Skip Mode͕false ैདྷͷlambdaࣜͷ࠶ੜ੒৚݅

Slide 112

Slide 112 text

Jetpack Compose Strong Skip Mode LambdaࣜͷதͰunstableͳclassΛࢀর͍ͯ͠Δͱ Recompose࣌ʹ࠶ੜ੒͞ΕΔ

Slide 113

Slide 113 text

Jetpack Compose Strong Skip Mode LambdaࣜͷதͰunstableͳclassΛࢀর͍ͯ͠Δͱ Recompose࣌ʹ࠶ੜ੒͞ΕΔ

Slide 114

Slide 114 text

Jetpack Compose Strong Skip Mode ҆ఆͨ͠ClassͩͱRecompose࣌ʹ࠶ੜ੒͞Εͳ͍

Slide 115

Slide 115 text

Jetpack Compose Strong Skip Mode Strong Skip Mode͕trueͷ࣌ lambdaࣜͷ࠶ੜ੒͢Δʁ

Slide 116

Slide 116 text

Jetpack Compose Strong Skip Mode LambdaࣜͷதͰunstableͳclassΛࢀর͍ͯͯ͠΋ Recompose࣌ʹ࠶ੜ੒͞Εͳ͘ͳΔ

Slide 117

Slide 117 text

Jetpack Compose Strong Skip Mode Compiler͕rememberͰmemo͢ΔΑ͏ʹॻ͖׵͑ͯ͘ΕΔͨΊ Recompose࣌ʹ࠶ੜ੒͞Εͳ͘ͳΔ

Slide 118

Slide 118 text

Jetpack Compose Strong Skip Mode AnnotationͷDontMemoizeΛ෇༩͢Δ͜ͱͰɺҎલͱ ಉ͡Α͏ʹ࠶ੜ੒ͤ͞Δ͜ͱ΋Մೳ

Slide 119

Slide 119 text

Jetpack Compose Strong Skip Mode Strong Skip ModeͰ΋සൟʹRecompose͍ͤͨ͞

Slide 120

Slide 120 text

Jetpack Compose Strong Skip Mode

Slide 121

Slide 121 text

Jetpack Compose Strong Skip Mode

Slide 122

Slide 122 text

Jetpack Compose Strong Skip Mode Strong Skip Mode ON @NonSkippableComposable

Slide 123

Slide 123 text

Jetpack Compose Strong Skip Mode

Slide 124

Slide 124 text

Jetpack Compose Strong Skip Mode @DontMemoizeΛLazyColumnʹ෇༩

Slide 125

Slide 125 text

Jetpack Compose Strong Skip Mode Strong Skip Mode ON @NonSkippableComposable ˏDontMemoize

Slide 126

Slide 126 text

Jetpack Compose Strong Skip Mode @NonSkippableComposable ɾසൟʹRecompose͍ͤͨ͞ࡍʹศར ɾؔ਺಺Ͱఆٛ͞Ε͍ͯΔlambdaΛ࠶ੜ੒ͯ͘͠Εͳ ͍৔߹͸@DontMemoizeͰղܾ

Slide 127

Slide 127 text

Jetpack Compose Strong Skip Mode Strong Skip ModeΛOffʹ͍ͨ͠

Slide 128

Slide 128 text

Jetpack Compose Strong Skip Mode Strong Skip ModeΛOffʹ͍ͨ͠

Slide 129

Slide 129 text

Jetpack Compose Strong Skip Mode ͳͥStrong Skip Mode͕ಋೖ͞Ε͔ͨʁ ɾ౰ॳͷ૝ఆͰ͸ɺෆ҆ఆͳύϥϝʔλʔ౳͕͋ͬͨΒ ࣮֬ʹrecompose͢Δ͜ͱͰɺbugͷগͳ͍application ͕࡞੒͠΍͘͢ͳΔͱ͞Ε͍ͯͨ

Slide 130

Slide 130 text

Jetpack Compose Strong Skip Mode ͳͥStrong Skip Mode͕ಋೖ͞Ε͔ͨʁ ɾReleaseΛͨ͠ΒɺͳͥRecompose͞Εͯ͠·͏ͷ͔ ͱ͍͏೰ΈΛ๊͑Δ։ൃऀ͕ଟ͍͘Δͱ͍͏ࣄଶʹͳͬ ͨɻ

Slide 131

Slide 131 text

Jetpack Compose Strong Skip Mode Object equalsͱinstance equals ɾStrong Skip Mode͕ಋೖ͞ΕΔͱύϑΥʔϚϯεͰ೰ Ή͜ͱࣗମ͕ݮΔՄೳੑ͕ߴ͍ ɾObject equalsͱinstance equals͔Ͱ೰Ή͜ͱ͕૿͑Δ ͔΋ʁ

Slide 132

Slide 132 text

Jetpack Compose Strong Skip Mode Object equalsͱinstance equals ɾObject equals͸O(n)ʹରͯ͠instance equals͸O(1) ɾ݅਺ͷଟ͍͍ෳࡶͳlist౳Λ๊͍͑ͯΔ৔߹͸ instance equalsͷํ͕ѹ౗తʹ଎͍

Slide 133

Slide 133 text

Jetpack Compose Strong Skip Mode Object equalsͱinstance equals ɾࠓ·Ͱ͚͍ͭͯͨ@ImmutableͳͲͷAnnotationΛݟ ௚ͨ͠ํ͕ૣ͘ͳΔ͜ͱ΋͋Γͦ͏

Slide 134

Slide 134 text

Special Thanks KotlinެࣜϦϑΝϨϯε https://kotlinlang.org/docs/collections-overview.html Jetpack Compose: Strong Skipping Mode Explained https://medium.com/androiddevelopers/jetpack-compose-strong-skipping-mode-explained-cbdb2aa4b900 Jetpack Compose Stability Explained https://medium.com/androiddevelopers/jetpack-compose-stability-explained-79c10db270c8 New ways of optimizing stability in Jetpack Compose https://medium.com/androiddevelopers/new-ways-of-optimizing-stability-in-jetpack-compose-038106c283cc

Slide 135

Slide 135 text

End Of doc.