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

キーボードの切替を いい感じにしたい

キーボードの切替を いい感じにしたい

90ec81078e4fd2b905f8ef0776887afa?s=128

Ryo Sakaguchi

April 19, 2018
Tweet

Transcript

  1. ©2018 Wantedly, Inc. 2018.4.19 - ΩʔϘʔυͷ੾ସΛ ͍͍ײ͡ʹ͍ͨ͠ QPUBUPUJQT 3ZP4BLBHVDIJ !XBLXBL

  2. ©2018 Wantedly, Inc. ͔Β୭͔ڭ͑ͯཉ͍͠ པΉ

  3. ©2018 Wantedly, Inc. w 3ZP4BLBHVDIJ!XBLXBL w 8BOUFEMZ *OD d 

    w 8BOUFEMZ1FPQMF About me
  4. ©2018 Wantedly, Inc. ͪΐͬͱߟ͑ͯΈͨ Ͳ͏΍ͬͯ·͔͢ʁ .FTTFOHFSͱ͔Ͱ͋Δ΍ͭ w ֆจࣈͱ͔ૹ৴͢Δࣸਅબ୒ͨ͠Γͱ͔͢Δͱ͜Ζ w Ϙλϯͱ͔Λλοϓͨ͠Β͍͍ײ͡ʹ੾ΓସΘͬͯ

    ͘ΕΔ΍ͭ w J04Ͱ͸Α͘ݟΔ͔΋ʁ
  5. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ద౰ʹ΍Δ৔߹ attachmentButton.setOnClickListener { if (!pickerContainer.isVisible()) {

    val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() ImeUtil.showImeKeyboard(this, editText) } } val attachmentButton = findViewById<ImageView>(R.id.button_plus)
  6. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ద౰ʹ΍Δ৔߹ val attachmentButton = findViewById<ImageView>(R.id.button_plus) attachmentButton.setOnClickListener

    { if (!pickerContainer.isVisible()) { val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() ImeUtil.showImeKeyboard(this, editText) } }
  7. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ద౰ʹ΍Δ৔߹ val attachmentButton = findViewById<ImageView>(R.id.button_plus) attachmentButton.setOnClickListener

    { if (!pickerContainer.isVisible()) { val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() ImeUtil.showImeKeyboard(this, editText) } } όίϯ/ΨίϯΈ͍ͨͳԻ͕ฉ͖͑ͯͦ͜͏
  8. ©2018 Wantedly, Inc. ͪΐͬͱߟ͑ͯΈ·ͨ͠

  9. ©2018 Wantedly, Inc. ͪΐͬͱߟ͑ͯΈͨ .FTTFOHFSΛࢀߟʹ͢Δ ΍ͬͨ͜ͱ w 7JFXߏ଄ͷEVNQͱͬͯΈΔ w BECTIFMMEVNQTZTBDUJWJUZUPQ

    w ͻͨ͢Β੾Γସ͑ͯΈͨ w ΩʔϘʔυͷߴ͞Λۃ୺ʹখ͘͞େ͖ͯ͘͠੾ସࣗମʹͲ͏੍͍ͬͨݶԽͰߦΘΕ͍ͯΔ͔͔֬Ίͨ w ҙ஍ѱʹͳͬͨؾ࣋ͪͰյ͠ʹ͔͔Δ
  10. ©2018 Wantedly, Inc. ͪΐͬͱߟ͑ͯΈͨ .FTTFOHFSΛࢀߟʹ͢Δ Θ͔ͬͨ͜ͱ w 7JFXͷߏ଄ w ಛผͳมΘͬͨ$VTUPN7JFXΛ࢖͍ͬͯΔ༷ࢠ͸ͳ͔ͬͨɻ

    w ͻͨ͢Β੾Γସ͑ͨ w ΩʔϘʔυͷཪʹ7JFX͕͋ΔงғؾΛ௫Μͩ w ͱ͍͏͜ͱ͸ΩʔϘʔυΛӅ͢ʢด͡Δʣࡍʹߴ͕͞มΘΒͳ͚Ε͹ྑ͍ͷͰ͸ʁ w ۃ୺ͳߴ͞ͷ৔߹͸NJONBY)FJHIUΛઃఆ͍ͯ͠Δͷ͔ͿͬյΕΔ͜ͱ͸ͳ͔ͬͨ
  11. ©2018 Wantedly, Inc. ΍ͬͯΈͨ ΩʔϘʔυΛด͡Δࡍʹߴ͞Λม͑ͳ͍Α͏ʹ͢ΔΞϓϩʔν

  12. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ద౰ʹ΍Δ৔߹ val attachmentButton = findViewById<ImageView>(R.id.button_plus) attachmentButton.setOnClickListener

    { if (!pickerContainer.isVisible()) { val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) toAdjustNothing() pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() toAdjustResize() ImeUtil.showImeKeyboard(this, editText) } }
  13. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ͪΐͬͱஸೡʹ΍Δ৔߹ val attachmentButton = findViewById<ImageView>(R.id.button_plus) attachmentButton.setOnClickListener

    { if (!pickerContainer.isVisible()) { val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) toAdjustNothing() pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() toAdjustResize() ImeUtil.showImeKeyboard(this, editText) } }
  14. ©2018 Wantedly, Inc. ΩʔϘʔυͷ੾ସ ͪΐͬͱஸೡʹ΍Δ৔߹ val attachmentButton = findViewById<ImageView>(R.id.button_plus) attachmentButton.setOnClickListener

    { if (!pickerContainer.isVisible()) { val params = window.attributes ImeUtil.hideImeKeyboard(this, editText) toAdjustNothing() pickerContainer.visible() window.attributes = params } else { pickerContainer.gone() toAdjustResize() ImeUtil.showImeKeyboard(this, editText) } } ΘΓ͔͠εϜʔζʂ
  15. ©2018 Wantedly, Inc. UP"EKVTU3FTJ[F 4PGU*OQVU.PEF ͦΕͧΕͲ͏͍͏ಈ͖Λ͢Δͷ͔ fun toAdjustResize() { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)

    } •LayoutManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE •͜Ε͸WindowʹΩʔϘʔυͷग़ݱͷࡍʹɺΩʔϘʔυ͕ද͍ࣔͯ͠Δcontentsʹ͔ͿΒͳ͍Α͏ʹ
 WindowͷResizeΛ͢Δ΋ͷ
  16. ©2018 Wantedly, Inc. UP"EKVTU/PUIJOH 4PGU*OQVU.PEF ͦΕͧΕͲ͏͍͏ಈ͖Λ͢Δͷ͔ fun toAdjustNothing() { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_Nothing)

    } •LayoutManager.LayoutParams.SOFT_INPUT_ADJUST_Nothing •ΩʔϘʔυͷग़ݱ࣌ʹɺWindowͷߴ͞ௐ੔ͳͲΛ·ͬͨ͘͠ͳ͘ͳΔϞʔυɻ
 ຊ౰ʹԿ΋͠ͳ͍ͷͰɺ௨ৗ࣌ʹ࢖͏ͱcontentsͱ͔Ϳͬͯ͠·͏
  17. ©2018 Wantedly, Inc. UP"EKVTU/PUIJOH %FNP"QQ fun toAdjustNothing() { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_Nothing) }

    •LayoutManager.LayoutParams.SOFT_INPUT_ADJUST_Nothing •ΩʔϘʔυͷग़ݱ࣌ʹɺWindowͷߴ͞ௐ੔ͳͲΛ·ͬͨ͘͠ͳ͘ͳΔϞʔυɻ
 ຊ౰ʹԿ΋͠ͳ͍ͷͰɺ௨ৗ࣌ʹ࢖͏ͱcontentsͱ͔Ϳͬͯ͠·͏
  18. ©2018 Wantedly, Inc. ͜ͷͭΛద੾ʹ੾Γସ͑Δ ͱɺ͏·͘ߦ͘

  19. ©2018 Wantedly, Inc. ແཧ໼ཧײ͋ΔͷͰεϚʔτͳ ํ๏ืू͍ͯ͠·͢

  20. ©2018 Wantedly, Inc. IUUQTHJUIVCDPNXBLXBL ,FZCPBSE4IPX)JEF4BNQMF ࠓ೔ͷαϯϓϧ͜͜ʹ͋Γ·͢

  21. ©2018 Wantedly, Inc. 5IBOLT