satoyos/Shuffle100

View on GitHub
app/layouts/volume_setting_layout.rb

Summary

Maintainability
A
0 mins
Test Coverage
class VolumeSettingLayout < MK::Layout
  include NormalButtonStyles

  VERTICAL_BLANK_SIZE = 40

  def layout
    background_color :white.uicolor

    add UISlider, :slider
    add UIButton, :play_button
  end

  def slider_style
    size ['80%', VERTICAL_BLANK_SIZE]
    center ['50%', '40%']
  end

  def play_button_style
    title 'テスト音声を再生する'
    font MDT::Font.body
    size ['80%', VERTICAL_BLANK_SIZE]
    frame below(:slider, down: VERTICAL_BLANK_SIZE)
    center x: '50%'
    set_button_title_color
  end

  def font_changed(notification)
    get(:play_button).titleLabel.font = MDT::Font.body
  end
end