Skip to content

Commit

Permalink
Merge pull request #176 from ashutoshgngwr/fix/icons
Browse files Browse the repository at this point in the history
Migrates to using vector drawables
  • Loading branch information
ashutoshgngwr authored May 23, 2020
2 parents 6fa6198 + fc93b16 commit 17a691b
Show file tree
Hide file tree
Showing 129 changed files with 350 additions and 209 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class MediaPlayerService : Service() {
val notificationBuilder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setContentTitle(getString(R.string.app_name))
.setShowWhen(false)
.setSmallIcon(R.drawable.ic_stat_media_player)
.setSmallIcon(R.drawable.ic_launcher_24dp)
.setContentIntent(
PendingIntent.getActivity(
this, RC_MAIN_ACTIVITY,
Expand All @@ -113,20 +113,20 @@ class MediaPlayerService : Service() {
)
)
.addAction(
R.drawable.ic_stat_close,
R.drawable.ic_noti_close,
getString(R.string.stop),
createPlaybackControlPendingIntent(RC_STOP_PLAYBACK)
)

if (event.state == PlaybackManager.State.PAUSED) {
notificationBuilder.addAction(
R.drawable.ic_stat_play,
R.drawable.ic_noti_play,
getString(R.string.play),
createPlaybackControlPendingIntent(RC_START_PLAYBACK)
)
} else {
notificationBuilder.addAction(
R.drawable.ic_stat_pause,
R.drawable.ic_noti_pause,
getString(R.string.pause),
createPlaybackControlPendingIntent(RC_PAUSE_PLAYBACK)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,137 +17,137 @@ class AboutFragment : Fragment() {
private val ITEMS = arrayOf(
arrayOf(
R.string.credits__app_icon,
R.drawable.ic_stat_media_player,
R.drawable.ic_launcher_24dp,
R.string.credits__app_icon_url
),
arrayOf(
R.string.credits__sound_airplane_inflight,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_airplane_inflight_url
),
arrayOf(
R.string.credits__sound_airplane_seatbelt_beeps,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_airplane_seatbelt_beeps_url
),
arrayOf(
R.string.credits__sound_birds,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_birds_url
),
arrayOf(
R.string.credits__sound_bonfire,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_bonfire_url
),
arrayOf(
R.string.credits__sound_coffee_shop,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_coffee_shop_url
),
arrayOf(
R.string.credits__sound_distant_thunder,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_distant_thunder_url
),
arrayOf(
R.string.credits__sound_heavy_rain,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_heavy_rain_url
),
arrayOf(
R.string.credits__sound_light_rain,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_light_rain_url
),
arrayOf(
R.string.credits__sound_moderate_rain,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_moderate_rain_url
),
arrayOf(
R.string.credits__morning_in_a_village,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__morning_in_a_village_url
),
arrayOf(
R.string.credits__sound_moving_train,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_moving_train_url
),
arrayOf(
R.string.credits__sound_night,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_night_url
),
arrayOf(
R.string.credits__sound_office,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_office_url
),
arrayOf(
R.string.credits__sound_rolling_thunder,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_rolling_thunder_url
),
arrayOf(
R.string.credits__sound_seaside,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_seaside_url
),
arrayOf(
R.string.credits__sound_soft_wind,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_soft_wind_url
),
arrayOf(
R.string.credits__sound_thunder_crack,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_thunder_crack_url
),
arrayOf(
R.string.credits__sound_train_horn,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_train_horn_url
),
arrayOf(
R.string.credits__sound_water_stream,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_water_stream_url
),
arrayOf(
R.string.credits__sound_wind_chimes_of_shells,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_wind_chimes_of_shells_url
),
arrayOf(
R.string.credits__sound_wind_in_palm_trees,
R.drawable.ic_stat_sound,
R.drawable.ic_about_sound,
R.string.credits__sound_wind_in_palm_trees_url
),
arrayOf(
R.string.credits__translation_argentinian_spanish,
R.drawable.ic_stat_translation,
R.drawable.ic_about_translation,
R.string.credits__translation_argentinian_spanish_url
),
arrayOf(
R.string.credits__translation_russian,
R.drawable.ic_stat_translation,
R.drawable.ic_about_translation,
R.string.credits__translation_russian_url
),
arrayOf(
R.string.credits__translation_german,
R.drawable.ic_stat_translation,
R.drawable.ic_about_translation,
R.string.credits__translation_german_url
),
arrayOf(
R.string.credits__translation_italian,
R.drawable.ic_stat_translation,
R.drawable.ic_about_translation,
R.string.credits__translation_italian_url
),
arrayOf(
R.string.credits__translation_french,
R.drawable.ic_stat_translation,
R.drawable.ic_about_translation,
R.string.credits__translation_french_url
)
)
Expand All @@ -165,7 +165,7 @@ class AboutFragment : Fragment() {
addItem(
createElement(
R.string.app_copyright,
R.drawable.ic_stat_copyright,
R.drawable.ic_about_copyright,
R.string.app_license_url
)
)
Expand All @@ -188,7 +188,7 @@ class AboutFragment : Fragment() {
private fun getVersionElement(): Element {
val version =
requireContext().packageManager?.getPackageInfo(requireContext().packageName, 0)?.versionName
return Element("v$version", R.drawable.ic_stat_version)
return Element("v$version", R.drawable.ic_about_version)
}

private fun createElement(titleResId: Int, iconId: Int, urlResId: Int): Element {
Expand Down
14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_close.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_copyright.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_pause.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_play.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_sound.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_time_period.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_translation.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_version.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-anydpi-v24/ic_stat_volume.xml

This file was deleted.

10 changes: 0 additions & 10 deletions app/src/main/res/drawable-anydpi/ic_action_stop.xml

This file was deleted.

Binary file removed app/src/main/res/drawable-hdpi/ic_action_add.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_expand.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_info.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_library.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_play.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_report.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_save.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_stop.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_theme.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_action_timer.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_close.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_copyright.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_media_player.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_pause.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_play.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_sound.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_time_period.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_translation.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_version.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_stat_volume.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_warning.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_add.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_expand.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_info.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_library.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_report.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_save.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_stop.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_theme.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_action_timer.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_close.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_copyright.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_media_player.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_pause.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_sound.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_time_period.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_translation.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_version.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_volume.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-mdpi/ic_warning.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_add.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_expand.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_info.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_library.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_report.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_save.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_stop.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_theme.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_action_timer.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_close.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_copyright.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_media_player.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_pause.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_sound.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_time_period.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_translation.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_version.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_volume.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xhdpi/ic_warning.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_add.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_expand.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_info.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_library.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_report.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_save.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_stop.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_theme.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_action_timer.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_close.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_copyright.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_pause.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_sound.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_version.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_volume.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_warning.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxxhdpi/ic_action_play.png
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxxhdpi/ic_action_stop.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/main/res/drawable-xxxhdpi/ic_warning.png
Diff not rendered.
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_about_copyright.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:alpha="0.87"
android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10.08,10.86c0.05,-0.33 0.16,-0.62 0.3,-0.87s0.34,-0.46 0.59,-0.62c0.24,-0.15 0.54,-0.22 0.91,-0.23 0.23,0.01 0.44,0.05 0.63,0.13 0.2,0.09 0.38,0.21 0.52,0.36s0.25,0.33 0.34,0.53 0.13,0.42 0.14,0.64h1.79c-0.02,-0.47 -0.11,-0.9 -0.28,-1.29s-0.4,-0.73 -0.7,-1.01 -0.66,-0.5 -1.08,-0.66 -0.88,-0.23 -1.39,-0.23c-0.65,0 -1.22,0.11 -1.7,0.34s-0.88,0.53 -1.2,0.92 -0.56,0.84 -0.71,1.36S8,11.29 8,11.87v0.27c0,0.58 0.08,1.12 0.23,1.64s0.39,0.97 0.71,1.35 0.72,0.69 1.2,0.91 1.05,0.34 1.7,0.34c0.47,0 0.91,-0.08 1.32,-0.23s0.77,-0.36 1.08,-0.63 0.56,-0.58 0.74,-0.94 0.29,-0.74 0.3,-1.15h-1.79c-0.01,0.21 -0.06,0.4 -0.15,0.58s-0.21,0.33 -0.36,0.46 -0.32,0.23 -0.52,0.3c-0.19,0.07 -0.39,0.09 -0.6,0.1 -0.36,-0.01 -0.66,-0.08 -0.89,-0.23 -0.25,-0.16 -0.45,-0.37 -0.59,-0.62s-0.25,-0.55 -0.3,-0.88 -0.08,-0.67 -0.08,-1v-0.27c0,-0.35 0.03,-0.68 0.08,-1.01zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_about_sound.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:alpha="0.87"
android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z" />
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_about_translation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:alpha="0.87"
android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z" />
</vector>
Loading

0 comments on commit 17a691b

Please sign in to comment.