Search in sources :

Example 6 with MaterialDrawableBuilder

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();
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) TimelyView(com.naman14.timber.timely.TimelyView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) MaterialIconView(net.steamcrafted.materialiconlib.MaterialIconView) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 7 with MaterialDrawableBuilder

use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.

the class Timber6 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();
            }
        });
    }
}
Also used : CircleImageView(com.naman14.timber.widgets.CircleImageView) TextView(android.widget.TextView) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 8 with MaterialDrawableBuilder

use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.

the class Timber6 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();
            }
        });
    }
}
Also used : CircleImageView(com.naman14.timber.widgets.CircleImageView) TextView(android.widget.TextView) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 9 with MaterialDrawableBuilder

use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.

the class BaseNowplayingFragment method updateShuffleState.

public void updateShuffleState() {
    if (shuffle != null && getActivity() != null) {
        MaterialDrawableBuilder builder = MaterialDrawableBuilder.with(getActivity()).setIcon(MaterialDrawableBuilder.IconValue.SHUFFLE).setSizeDp(30);
        if (getActivity() != null) {
            if (MusicPlayer.getShuffleMode() == 0) {
                builder.setColor(Config.textColorPrimary(getActivity(), ateKey));
            } else
                builder.setColor(Config.accentColor(getActivity(), ateKey));
        }
        shuffle.setImageDrawable(builder.build());
        shuffle.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                MusicPlayer.cycleShuffle();
                updateShuffleState();
                updateRepeatState();
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) TimelyView(com.naman14.timber.timely.TimelyView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) MaterialIconView(net.steamcrafted.materialiconlib.MaterialIconView) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 10 with MaterialDrawableBuilder

use of net.steamcrafted.materialiconlib.MaterialDrawableBuilder in project Timber by naman14.

the class Timber4 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();
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Aggregations

View (android.view.View)12 MaterialDrawableBuilder (net.steamcrafted.materialiconlib.MaterialDrawableBuilder)12 ImageView (android.widget.ImageView)9 RecyclerView (android.support.v7.widget.RecyclerView)7 TextView (android.widget.TextView)5 TimelyView (com.naman14.timber.timely.TimelyView)2 CircleImageView (com.naman14.timber.widgets.CircleImageView)2 MaterialIconView (net.steamcrafted.materialiconlib.MaterialIconView)2 Bitmap (android.graphics.Bitmap)1 Handler (android.os.Handler)1 Palette (android.support.v7.graphics.Palette)1 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)1 FailReason (com.nostra13.universalimageloader.core.assist.FailReason)1 ImageLoadingListener (com.nostra13.universalimageloader.core.listener.ImageLoadingListener)1