Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Support Library 28.0.0 Alpha 1に触れてみる

Support Library 28.0.0 Alpha 1に触れてみる

Support Library 28.0.0 Alpha 1に触れてみる

文字起こし
https://github.com/operando/Notes/tree/master/Mercari_Meetup_for_Mobile_App_Engineer_in_Fukuoka

Mercari Meetup for Mobile App Engineer in Fukuoka
https://mercari.connpass.com/event/83957/

operandoOS

April 25, 2018
Tweet

More Decks by operandoOS

Other Decks in Technology

Transcript

  1. About Me • AndroidΤϯδχΞ • ϝϧΧϦ → ι΢κ΢ → ϝϧΧϦ

    • ϓϩήʔϚʔ໨ࢦͯ͠·͢ʂ • Discord : operandoOS • Steam : operandoOS
  2. androidx: Hello World! • package name͕androidxʹͳΔ • Android KTX͔Β࠾༻͞Ε࢝Ίͨ΍ͭ •

    ৽͍͠Support Library͔ΒͳΔ • heifwriter,recyclerview-selection
  3. HeifWriter • High Efficiency Image File Format • iOS͸iOS11͔Β࠾༻ͯ͠Δ •

    Android PͰ΋ެࣜαϙʔτ • HeifWriter͸HEIF-formatͰॻ͖ࠐΈ͕Ͱ͖Δ • Read΋Support LibraryͰग़Δ͜ͱظ଴͍ͨ͠ʂ
  4. New components • ঺հ͠ͳ͔ͬͨComponentͷ࢖͍ํ͸ҎԼΛಡΉ ͱॻ͍ͯ͋Γ·͢ʂ • Exploring the v28 Android

    Design Support Library Additions • https://medium.com/google-developer- experts/exploring-the-v28-android-design- support-library-2c96c6031ae8
  5. What are Slices? “Slices provides a framework for apps to

    embed templated content from other apps.”
  6. What are Slices? • ·ͩṖʹแ·ΕͯΔAPI • ͍ͨͩ͢͝ڵຯਂ͍ • Android P

    Preview 2ʹظ଴ʂ • ·ͩPreview 1ͳͷͰAPI͸όΪʔ
  7. Slices Support Library • com.android.support:slices-builders • Slice Provide AppͷͨΊͷAPI •

    com.android.support:slices-view • Slice Host AppͷͨΊͷAPI • com.android.support:slices-core • Slices APIͷίΞ
  8. SliceProviderͷ࣮૷ class SampleSliceProvider : SliceProvider() { private var counter =

    0 override fun onCreateSliceProvider(): Boolean { return true } override fun onBindSlice(sliceUri: Uri): Slice { return when (sliceUri.path) { "/time" -> createTimeSlice(sliceUri) else -> createTimeSlice(sliceUri) } } }
  9. SliceProviderͷ࣮૷ private fun createTimeSlice(uri: Uri): Slice = ListBuilder(context, uri) .apply

    { counter++ setHeader( ListBuilder.HeaderBuilder(this) .setTitle("What's the time now?") ) addRow( ListBuilder.RowBuilder(this) .setTitle("It is ${SimpleDateFormat(“HH:mm") .format(Calendar.getInstance().time)}”) ) addRow( ListBuilder.RowBuilder(this) .setTitle("Slice has called $counter times") ) } .build()
  10. SliceProviderΛAndroidManifestʹఆٛ <?xml version="1.0" encoding="utf-8"?> <manifest> <application ... > <provider android:name=".SampleSliceProvider"

    android:authorities="com.os.operando.slice_provider" android:exported="true" /> </application> </manifest>
  11. SliceΛ͞Βʹਂ͘஌Δ • Android P Slices: the missing documentation — part

    1 and 2 • https://blog.novoda.com/android-p-slices- missing-documentation-part-1/ • https://blog.novoda.com/android-p-slices- missing-documentation-part-2/
  12. Support Library 28.0.0 Alpha 1·ͱΊ • ண࣮ʹ͍͍API͸૿͑ͯΔ • Android P

    Preview 2͕ग़ͨΒ·ͨΨϥοͱ มΘΓͦ͏ • ਂ͘ௐ΂Δͱ৽͍͠Կ͔͕ݟ͑ͯ͘Δʂ͔΋...