Added new dark icon

This commit is contained in:
hemanths@live.com 2019-01-14 17:47:22 +05:30
parent 0456914e2a
commit 9ea7735261
68 changed files with 306 additions and 249 deletions

View file

@ -82,7 +82,7 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
setUpViews()
artistDetailsPresenter = ArtistDetailsPresenter(this, intent.extras)
artistDetailsPresenter = ArtistDetailsPresenter(this, intent.extras!!)
artistDetailsPresenter!!.subscribe()
contentContainer.setOnScrollChangeListener { _: NestedScrollView?, _: Int, scrollY: Int, _: Int, oldScrollY: Int ->

View file

@ -195,7 +195,6 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
}
private fun setToolbarTitle(title: String) {
supportActionBar!!.title = title
}
@ -230,11 +229,6 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
super.onDestroy()
}
override fun onPlayingMetaChanged() {
super.onPlayingMetaChanged()
songsPresenter!!.subscribe()
}
override fun loading() {}
override fun showEmptyView() {
@ -249,7 +243,6 @@ class PlaylistDetailActivity : AbsSlidingMusicPanelActivity(), CabHolder, Playli
}
companion object {
var EXTRA_PLAYLIST = "extra_playlist"
}
}

View file

@ -13,6 +13,7 @@ import android.view.ViewGroup
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.LayoutRes
import androidx.annotation.UiThread
import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -63,6 +64,7 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH
setContentView(R.layout.activity_donation)
setStatusbarColorAuto()
setNavigationbarColorAuto()
setTaskDescriptionColorAuto()

View file

@ -26,7 +26,6 @@ import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import java.util.*

View file

@ -61,7 +61,7 @@ abstract class AbsOffsetSongAdapter : SongAdapter {
override// could also return null, just to be safe return empty song
val song: Song
get() = if (itemViewType == OFFSET_ITEM) Song.emptySong else dataSet[adapterPosition - 1]
get() = if (itemViewType == OFFSET_ITEM) Song.EMPTY_SONG else dataSet[adapterPosition - 1]
override fun onClick(v: View?) {
if (isInQuickSelectMode && itemViewType != OFFSET_ITEM) {

View file

@ -24,7 +24,7 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
private val onMoveItemListener: OnMoveItemListener?) : PlaylistSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder), DraggableItemAdapter<OrderablePlaylistSongAdapter.ViewHolder> {
init {
setMultiSelectMenuRes(R.menu.menu_playlists_songs_selection)
setMultiSelectMenuRes(code.name.monkey.retromusic.R.menu.menu_playlists_songs_selection)
}
override fun createViewHolder(view: View): SongAdapter.ViewHolder {
@ -49,9 +49,7 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
override fun onMultipleItemAction(menuItem: MenuItem, selection: ArrayList<Song>) {
when (menuItem.itemId) {
R.id.action_remove_from_playlist -> {
val songs = ArrayList<PlaylistSong>()
songs.addAll(songs)
RemoveFromPlaylistDialog.create(songs).show(activity.supportFragmentManager, "ADD_PLAYLIST")
RemoveFromPlaylistDialog.create(selection as ArrayList<PlaylistSong>).show(activity.supportFragmentManager, "ADD_PLAYLIST")
return
}
}
@ -94,8 +92,8 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
private var mDragStateFlags: Int = 0
override var songMenuRes: Int
get() = R.menu.menu_item_playlist_song
set(value: Int) {
get() = code.name.monkey.retromusic.R.menu.menu_item_playlist_song
set(value) {
super.songMenuRes = value
}
@ -111,7 +109,7 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
override fun onSongMenuItemClick(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_remove_from_playlist -> {
code.name.monkey.retromusic.R.id.action_remove_from_playlist -> {
RemoveFromPlaylistDialog.create(song as PlaylistSong).show(activity.supportFragmentManager, "REMOVE_FROM_PLAYLIST")
return true
}
@ -130,7 +128,6 @@ class OrderablePlaylistSongAdapter(activity: AppCompatActivity,
}
companion object {
val TAG = OrderablePlaylistSongAdapter::class.java.simpleName
val TAG: String = OrderablePlaylistSongAdapter::class.java.simpleName
}
}

View file

@ -2,14 +2,12 @@ package code.name.monkey.retromusic.ui.adapter.song
import android.view.MenuItem
import android.view.View
import android.widget.ImageView
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.core.util.Pair
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.model.PlaylistSong
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.NavigationUtil

View file

@ -12,7 +12,6 @@ import android.view.ViewGroup
import android.widget.SeekBar
import androidx.fragment.app.Fragment
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.PreferenceUtil
@ -95,17 +94,14 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
}
fun tintWhiteColor() {
setProgressBarColor(Color.WHITE)
setTintable(Color.WHITE)
}
private fun setProgressBarColor(newColor: Int) {
val text = ColorStateList(arrayOf(intArrayOf(-android.R.attr.state_checked), intArrayOf(android.R.attr.state_checked)), intArrayOf(ThemeStore.textColorSecondary(context!!), ThemeStore.textColorPrimary(context!!)))
volumeSeekBar.progressTintList = text
volumeSeekBar.progressBackgroundTintList = text
//TintHelper.setTint(volumeSeekBar, newColor, false)
volumeSeekBar.thumbTintList = ColorStateList.valueOf(newColor)
volumeSeekBar.progressTintList = ColorStateList.valueOf(newColor)
volumeSeekBar.progressBackgroundTintList = ColorStateList.valueOf(newColor)
volumeDown.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
volumeUp.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
}

View file

@ -364,7 +364,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
File file1 = (File) extra;
int startIndex = -1;
for (int i = 0; i < songs.size(); i++) {
if (file1.getPath().equals(songs.get(i).getData())) { // path is already canonical here
if (file1.getPath().equals(songs.get(i).data)) { // path is already canonical here
startIndex = i;
break;
}

View file

@ -14,6 +14,7 @@ import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator
import android.widget.SeekBar
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
@ -129,8 +130,12 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
private fun setProgressBarColor(newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(context!!, ColorUtil.isColorLight(ThemeStore.primaryColor(context!!))), PorterDuff.Mode.SRC_IN)
}
private fun setUpPlayPauseFab() {

View file

@ -1,8 +1,11 @@
package code.name.monkey.retromusic.ui.fragments.player.color
import android.animation.ObjectAnimator
import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@ -21,7 +24,7 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil
import kotlinx.android.synthetic.main.fragment_color_player_playback_controls.*
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
@ -38,7 +41,6 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_color_player_playback_controls, container, false)
}
@ -103,7 +105,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
title!!.setTextColor(lastPlaybackControlsColor)
text!!.setTextColor(lastDisabledPlaybackControlsColor)
TintHelper.setTintAuto(progressSlider!!, lastPlaybackControlsColor, false)
setProgressBarColor(lastPlaybackControlsColor, lastDisabledPlaybackControlsColor)
volumeFragment.setTintable(lastPlaybackControlsColor)
@ -115,6 +117,16 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
updatePrevNextColor()
}
private fun setProgressBarColor(c1: Int, c2: Int) {
progressSlider.thumbTintList = ColorStateList.valueOf(c1)
val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawableProgress.setColorFilter(c1, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(c2, PorterDuff.Mode.SRC_IN)
}
private fun setUpPlayPauseFab() {
TintHelper.setTintAuto(playPauseButton, Color.WHITE, true)

View file

@ -56,7 +56,7 @@ class FlatPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
valueAnimator!!.addUpdateListener { animation ->
val drawable = DrawableGradient(GradientDrawable.Orientation.TOP_BOTTOM,
intArrayOf(animation.animatedValue as Int, android.R.color.transparent), 0)
colorGradientBackground.background = drawable
colorGradientBackground!!.background = drawable
}
valueAnimator!!.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()).start()

View file

@ -1,6 +1,7 @@
package code.name.monkey.retromusic.ui.fragments.player.material
import android.animation.ObjectAnimator
import android.content.res.ColorStateList
import android.graphics.PorterDuff
import android.os.Bundle
import android.view.LayoutInflater
@ -21,6 +22,7 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_material_playback_controls.*
import kotlinx.android.synthetic.main.fragment_volume.*
import kotlinx.android.synthetic.main.player_time.*
/**
@ -105,6 +107,10 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
if (PreferenceUtil.getInstance().adaptiveColor) {
lastPlaybackControlsColor = color
text.setTextColor(color)
progressSlider.thumbTintList = ColorStateList.valueOf(color)
progressSlider.progressTintList = ColorStateList.valueOf(color)
progressSlider.progressBackgroundTintList = ColorStateList.valueOf(color)
}
updatePlayPauseColor()

View file

@ -1,20 +1,14 @@
package code.name.monkey.retromusic.ui.fragments.player.normal
import android.animation.Animator
import android.animation.AnimatorSet
import android.animation.ArgbEvaluator
import android.animation.ValueAnimator
import android.graphics.drawable.GradientDrawable
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewAnimationUtils
import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.model.Song
@ -24,8 +18,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import code.name.monkey.retromusic.views.DrawableGradient
import kotlinx.android.synthetic.main.fragment_player.*
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
@ -45,9 +37,8 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
valueAnimator = ValueAnimator.ofObject(ArgbEvaluator(), android.R.color.transparent, i)
valueAnimator!!.addUpdateListener { animation ->
val drawable = DrawableGradient(GradientDrawable.Orientation.TOP_BOTTOM,
intArrayOf(animation.animatedValue as Int, android.R.color.transparent), 0)
colorGradientBackground.background = drawable
val drawable = DrawableGradient(GradientDrawable.Orientation.TOP_BOTTOM, intArrayOf(animation.animatedValue as Int, android.R.color.transparent), 0)
colorGradientBackground!!.background = drawable
}
valueAnimator!!.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()).start()
}

View file

@ -28,7 +28,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
import kotlinx.android.synthetic.main.volume_controls.*
class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -130,8 +129,12 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
private fun setProgressBarColor(newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(context!!, ColorUtil.isColorLight(ThemeStore.primaryColor(context!!))), PorterDuff.Mode.SRC_IN)
}
private fun setUpPlayPauseFab() {

View file

@ -1,6 +1,7 @@
package code.name.monkey.retromusic.ui.fragments.player.plain
import android.animation.ObjectAnimator
import android.content.res.ColorStateList
import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
@ -28,7 +29,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_plain_controls_fragment.*
import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
import kotlinx.android.synthetic.main.volume_controls.*
/**
* @author Hemanth S (h4h13).
@ -130,15 +130,16 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
if (PreferenceUtil.getInstance().adaptiveColor) {
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(color)), false)
TintHelper.setTintAuto(playPauseButton, color, true)
setProgressBarColor(progressSlider, color)
setProgressBarColor(color)
}
updateRepeatState()
updateShuffleState()
updatePrevNextColor()
}
private fun setProgressBarColor(progressBar: SeekBar?, newColor: Int) {
val ld = progressBar!!.progressDrawable as LayerDrawable
private fun setProgressBarColor(newColor: Int) {
progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawable = ld.findDrawableByLayerId(android.R.id.progress) as ClipDrawable
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
}