本文整理汇总了Java中net.steamcrafted.materialiconlib.MaterialDrawableBuilder类的典型用法代码示例。如果您正苦于以下问题:Java MaterialDrawableBuilder类的具体用法?Java MaterialDrawableBuilder怎么用?Java MaterialDrawableBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialDrawableBuilder类属于net.steamcrafted.materialiconlib包,在下文中一共展示了MaterialDrawableBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
});
}
}
示例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();
}
});
}
}
示例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();
}
});
}
}
示例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();
}
});
}
}
示例5: onCreate
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.named_list);
realm = Realm.getDefaultInstance();
RecyclerView namedView = (RecyclerView) findViewById(R.id.named_list_view);
namedView.setLayoutManager(new LinearLayoutManager(this));
namedView.setAdapter(getViewAdapter());
FloatingActionButton addButton = (FloatingActionButton) findViewById(R.id.add_button);
addButton.setImageDrawable(MaterialDrawableBuilder.with(this)
.setIcon(MaterialDrawableBuilder.IconValue.PLUS)
.setColorResource(R.color.text_light)
.build()
);
}
示例6: 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();
}
});
}
}
示例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.BLACK);
} else builder.setColor(accentColor);
}
shuffle.setImageDrawable(builder.build());
shuffle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.cycleShuffle();
updateShuffleState();
updateRepeatState();
}
});
}
}
示例8: 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();
}
});
}
}
示例9: 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();
}
});
}
}
示例10: onBackStackChanged
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
public void onBackStackChanged() {
FragmentManager fm = getSupportFragmentManager();
if (fm.getBackStackEntryCount() > 0) {
mToolbar.setNavigationIcon(MaterialDrawableBuilder.with(this)
.setIcon(MaterialDrawableBuilder.IconValue.ARROW_LEFT)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
} else {
mToolbar.setNavigationIcon(MaterialDrawableBuilder.with(this)
.setIcon(MaterialDrawableBuilder.IconValue.MENU)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
}
}
示例11: onCreateView
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.intro_menu, container, false);
Toolbar toolbar = v.findViewById(R.id.toolbar);
toolbar.setTitle(R.string.appName);
toolbar.setNavigationIcon(MaterialDrawableBuilder.with(getActivity())
.setIcon(MaterialDrawableBuilder.IconValue.MENU)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
mDrawerLayout = v.findViewById(R.id.drawer);
mDrawerLayout.setBackgroundColor(Color.WHITE);
ListView lv = v.findViewById(R.id.base_nav);
lv.setAdapter(buildNavAdapter(getActivity()));
return v;
}
示例12: onCreateView
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.intro_pager, container, false);
Toolbar toolbar = mView.findViewById(R.id.toolbar);
toolbar.setTitle(R.string.appName);
toolbar.setNavigationIcon(MaterialDrawableBuilder.with(getActivity())
.setIcon(MaterialDrawableBuilder.IconValue.MENU)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
return mView;
}
示例13: getView
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if(view == null){
view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.image_list_item, null, false);
view.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.WRAP_CONTENT, AbsListView.LayoutParams.WRAP_CONTENT));
}
FrameLayout host = (FrameLayout) view;
ImageView v = (ImageView) host.getChildAt(0);
TextView tv = (TextView) host.getChildAt(1);
v.setImageDrawable(
MaterialDrawableBuilder.with(viewGroup.getContext())
.setIcon(icons.get(i))
.setColor(Color.BLACK)
.setSizePx(viewGroup.getWidth() / 5)
.build()
);
tv.setText(icons.get(i).name());
return view;
}
示例14: getView
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textview = (TextView) super.getView(position, convertView, parent);
File item = getItem(position);
if (currentDir!=null && item.equals(currentDir)) {
textview.setText(item.getPath());
textview.setCompoundDrawablesWithIntrinsicBounds(
ViewUtils.icon(getContext(), MaterialDrawableBuilder.IconValue.FILE)
,
null, null, null);
} else if (currentDir!=null && item.equals(currentDir.getParentFile())) {
textview.setText("..");
textview.setCompoundDrawablesWithIntrinsicBounds(
ViewUtils.icon(getContext(), MaterialDrawableBuilder.IconValue.CHEVRON_UP),
null, null, null);
} else {
textview.setText(item.getName());
textview.setCompoundDrawablesWithIntrinsicBounds(
ViewUtils.icon(getContext(), MaterialDrawableBuilder.IconValue.FILE),
null, null, null);
}
return textview;
}
示例15: onPrepareOptionsMenu
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
if (menu.findItem(R.id.option_filter) != null) {
SubMenu filterSet = menu.findItem(R.id.option_filter).getSubMenu();
ItemType[] itemType = ItemType.values();
for (int i = 0; i < filterSet.size(); i++) {
MenuItem item = filterSet.getItem(i);
item.setChecked(categoriesSelected.contains(itemType[item.getItemId()]));
}
}
if (menu.findItem(R.id.option_itemgrid_type) != null) {
if (TYPE_GRID.equals(mScreenType)) {
ViewUtils.menuIcon(getToolbarThemedContext(), menu, R.id.option_itemgrid_type, MaterialDrawableBuilder.IconValue.VIEW_GRID);
menu.findItem(R.id.option_itemgrid_type_grid).setChecked(true);
} else {
ViewUtils.menuIcon(getToolbarThemedContext(), menu, R.id.option_itemgrid_type, MaterialDrawableBuilder.IconValue.VIEW_LIST);
menu.findItem(R.id.option_itemgrid_type_list).setChecked(true);
}
}
}