当前位置: 首页>>代码示例>>Java>>正文


Java MaterialDrawableBuilder.setColor方法代码示例

本文整理汇总了Java中net.steamcrafted.materialiconlib.MaterialDrawableBuilder.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDrawableBuilder.setColor方法的具体用法?Java MaterialDrawableBuilder.setColor怎么用?Java MaterialDrawableBuilder.setColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.steamcrafted.materialiconlib.MaterialDrawableBuilder的用法示例。


在下文中一共展示了MaterialDrawableBuilder.setColor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateShuffleState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
@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();
            }
        });
    }
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:23,代码来源:Timber6.java

示例2: updateRepeatState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
@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();
            }
        });
    }
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:23,代码来源:Timber6.java

示例3: updateShuffleState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
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();
            }
        });
    }
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:24,代码来源:BaseNowplayingFragment.java

示例4: updateRepeatState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
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();
            }
        });
    }
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:24,代码来源:BaseNowplayingFragment.java

示例5: updateRepeatState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
@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.BLACK);
        } else builder.setColor(accentColor);

        repeat.setImageDrawable(builder.build());
        repeat.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MusicPlayer.cycleRepeat();
                updateRepeatState();
                updateShuffleState();
            }
        });
    }
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:23,代码来源:Timber5.java

示例6: updateShuffleState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
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(Color.BLACK);
            } else builder.setColor(accentColor);
        }

        shuffle.setImageDrawable(builder.build());
        shuffle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MusicPlayer.cycleShuffle();
                updateShuffleState();
                updateRepeatState();
            }
        });
    }
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:24,代码来源:Timber5.java

示例7: updateShuffleState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
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(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();
            }
        });
    }
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:24,代码来源:BaseNowplayingFragment.java

示例8: updateRepeatState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
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(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();
            }
        });
    }
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:24,代码来源:BaseNowplayingFragment.java

示例9: updateShuffleState

import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入方法依赖的package包/类
@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);

            }
        });
    }
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:28,代码来源:Timber1.java


注:本文中的net.steamcrafted.materialiconlib.MaterialDrawableBuilder.setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。