Search in sources :

Example 1 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 2 with MaterialDrawableBuilder

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);
            }
        });
    }
}
Also used : Handler(android.os.Handler) View(android.view.View) MaterialDrawableBuilder(net.steamcrafted.materialiconlib.MaterialDrawableBuilder)

Example 3 with MaterialDrawableBuilder

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

Example 4 with MaterialDrawableBuilder

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

Example 5 with MaterialDrawableBuilder

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();
            }
        });
    }
}
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