use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.
the class BaseNowplayingFragment method updateRepeatState.
public void updateRepeatState() {
if (repeat != null && getActivity() != null) {
MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.REPEAT).setSizeDp(30);
if (getActivity() != null) {
if (MusicPlayer.getRepeatMode() == 0) {
builder.setColor(Config.textColorPrimary(getActivity(), ateKey));
} else
builder.setColor(Config.accentColor(getActivity(), ateKey));
}
repeat.setImageDrawable(builder.build());
repeat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.cycleRepeat();
updateRepeatState();
updateShuffleState();
}
});
}
}
use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.
the class Timber1 method updateShuffleState.
@Override
public void updateShuffleState() {
if (shuffle != null && getActivity() != null) {
MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.SHUFFLE).setSizeDp(30);
builder.setColor(TimberUtils.getBlackWhiteColor(accentColor));
shuffle.setImageDrawable(builder.build());
shuffle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.setShuffleMode(MusicService.SHUFFLE_NORMAL);
MusicPlayer.next();
recyclerView.scrollToPosition(MusicPlayer.getQueuePosition());
}
}, 150);
}
});
}
}
use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.
the class Timber2 method updateShuffleState.
@Override
public void updateShuffleState() {
if (shuffle != null && getActivity() != null) {
MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.SHUFFLE).setSizeDp(30);
if (MusicPlayer.getShuffleMode() == 0) {
builder.setColor(Color.WHITE);
} else
builder.setColor(accentColor);
shuffle.setImageDrawable(builder.build());
shuffle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.cycleShuffle();
updateShuffleState();
updateRepeatState();
}
});
}
}
use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.
the class Timber2 method updateRepeatState.
@Override
public void updateRepeatState() {
if (repeat != null && getActivity() != null) {
MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.REPEAT).setSizeDp(30);
if (MusicPlayer.getRepeatMode() == 0) {
builder.setColor(Color.WHITE);
} else
builder.setColor(accentColor);
repeat.setImageDrawable(builder.build());
repeat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.cycleRepeat();
updateRepeatState();
updateShuffleState();
}
});
}
}
use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.
the class Timber4 method updateRepeatState.
@Override
public void updateRepeatState() {
if (repeat != null && getActivity() != null) {
MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.REPEAT).setSizeDp(30);
if (MusicPlayer.getRepeatMode() == 0) {
builder.setColor(Color.WHITE);
} else
builder.setColor(accentColor);
repeat.setImageDrawable(builder.build());
repeat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.cycleRepeat();
updateRepeatState();
updateShuffleState();
}
});
}
}
Aggregations