2014-06-24 01:35:43 +02:00
|
|
|
#!/bin/env ruby
|
2014-10-15 15:19:32 +02:00
|
|
|
resolutions={
|
|
|
|
'mdpi'=> 1,
|
|
|
|
'hdpi' => 1.5,
|
|
|
|
'xhdpi' => 2,
|
|
|
|
'xxhdpi' => 3,
|
2015-01-22 05:00:35 +01:00
|
|
|
'xxxhdpi' => 4,
|
2014-10-15 15:19:32 +02:00
|
|
|
}
|
|
|
|
images = {
|
2014-11-17 17:23:58 +01:00
|
|
|
'conversations_baloon.svg' => ['ic_launcher', 48],
|
2014-10-15 15:19:32 +02:00
|
|
|
'conversations_mono.svg' => ['ic_notification', 24],
|
|
|
|
'ic_received_indicator.svg' => ['ic_received_indicator', 12],
|
2015-05-02 11:38:56 +02:00
|
|
|
'ic_send_text_offline.svg' => ['ic_send_text_offline', 36],
|
|
|
|
'ic_send_text_online.svg' => ['ic_send_text_online', 36],
|
|
|
|
'ic_send_text_away.svg' => ['ic_send_text_away', 36],
|
|
|
|
'ic_send_text_dnd.svg' => ['ic_send_text_dnd', 36],
|
|
|
|
'ic_send_photo_online.svg' => ['ic_send_photo_online', 36],
|
|
|
|
'ic_send_photo_offline.svg' => ['ic_send_photo_offline', 36],
|
|
|
|
'ic_send_photo_away.svg' => ['ic_send_photo_away', 36],
|
|
|
|
'ic_send_photo_dnd.svg' => ['ic_send_photo_dnd', 36],
|
|
|
|
'ic_send_location_online.svg' => ['ic_send_location_online', 36],
|
|
|
|
'ic_send_location_offline.svg' => ['ic_send_location_offline', 36],
|
|
|
|
'ic_send_location_away.svg' => ['ic_send_location_away', 36],
|
|
|
|
'ic_send_location_dnd.svg' => ['ic_send_location_dnd', 36],
|
|
|
|
'ic_send_voice_online.svg' => ['ic_send_voice_online', 36],
|
|
|
|
'ic_send_voice_offline.svg' => ['ic_send_voice_offline', 36],
|
|
|
|
'ic_send_voice_away.svg' => ['ic_send_voice_away', 36],
|
|
|
|
'ic_send_voice_dnd.svg' => ['ic_send_voice_dnd', 36],
|
2015-05-03 09:30:30 +02:00
|
|
|
'ic_send_cancel_online.svg' => ['ic_send_cancel_online', 36],
|
|
|
|
'ic_send_cancel_offline.svg' => ['ic_send_cancel_offline', 36],
|
|
|
|
'ic_send_cancel_away.svg' => ['ic_send_cancel_away', 36],
|
|
|
|
'ic_send_cancel_dnd.svg' => ['ic_send_cancel_dnd', 36],
|
2015-05-26 05:34:58 +02:00
|
|
|
'ic_send_picture_online.svg' => ['ic_send_picture_online', 36],
|
|
|
|
'ic_send_picture_offline.svg' => ['ic_send_picture_offline', 36],
|
|
|
|
'ic_send_picture_away.svg' => ['ic_send_picture_away', 36],
|
2015-07-18 19:38:52 +02:00
|
|
|
'ic_send_picture_dnd.svg' => ['ic_send_picture_dnd', 36],
|
|
|
|
'md_switch_thumb_disable.svg' => ['switch_thumb_disable', 48],
|
|
|
|
'md_switch_thumb_off_normal.svg' => ['switch_thumb_off_normal', 48],
|
|
|
|
'md_switch_thumb_off_pressed.svg' => ['switch_thumb_off_pressed', 48],
|
|
|
|
'md_switch_thumb_on_normal.svg' => ['switch_thumb_on_normal', 48],
|
|
|
|
'md_switch_thumb_on_pressed.svg' => ['switch_thumb_on_pressed', 48],
|
2014-10-15 15:19:32 +02:00
|
|
|
}
|
2014-06-24 01:35:43 +02:00
|
|
|
images.each do |source, result|
|
|
|
|
resolutions.each do |name, factor|
|
|
|
|
size = factor * result[1]
|
2014-11-01 22:27:11 +01:00
|
|
|
path = "../src/main/res/drawable-#{name}/#{result[0]}.png"
|
2014-06-24 01:35:43 +02:00
|
|
|
cmd = "inkscape -e #{path} -C -h #{size} -w #{size} #{source}"
|
|
|
|
puts cmd
|
|
|
|
system cmd
|
|
|
|
end
|
|
|
|
end
|