本文整理汇总了Java中net.steamcrafted.materialiconlib.MaterialDrawableBuilder类的典型用法代码示例。如果您正苦于以下问题:Java MaterialDrawableBuilder类的具体用法?Java MaterialDrawableBuilder怎么用?Java MaterialDrawableBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialDrawableBuilder类属于net.steamcrafted.materialiconlib包,在下文中一共展示了MaterialDrawableBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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()
);
}
开发者ID:SeriousBug,项目名称:Kutuk,代码行数:17,代码来源:NamedListActivity.java
示例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();
}
});
}
}
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:23,代码来源: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.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
示例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();
}
});
}
}
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:24,代码来源:BaseNowplayingFragment.java
示例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();
}
});
}
}
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:24,代码来源:BaseNowplayingFragment.java
示例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());
}
}
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:18,代码来源:MainActivity.java
示例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;
}
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:23,代码来源:MenuIntroFragment.java
示例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;
}
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:18,代码来源:PagerIntroFragment.java
示例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;
}
开发者ID:code-mc,项目名称:material-icon-lib,代码行数:20,代码来源:ImageAdapter.java
示例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;
}
开发者ID:gandulf,项目名称:DsaTab,代码行数:27,代码来源:DirectoryChooserDialog.java
示例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);
}
}
}
开发者ID:gandulf,项目名称:DsaTab,代码行数:25,代码来源:ItemsFragment.java
示例16: initDrawer
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
private void initDrawer() {
final ActionBar ab = getSupportActionBar();
ab.setHomeAsUpIndicator(ViewUtils.toolbarIcon(ab.getThemedContext(), MaterialDrawableBuilder.IconValue.MENU));
ab.setDisplayHomeAsUpEnabled(true);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerLayout.setClickable(true);
mDrawer = ((NavigationView) findViewById(R.id.drawer));
mDrawerLayout.setStatusBarBackgroundColor(Util.getThemeColors(this, R.attr.colorPrimaryDark));
mDrawer.setNavigationItemSelectedListener(this);
if (mDrawerHeaderItem != null) {
mDrawer.removeHeaderView(mDrawerHeaderItem);
}
mDrawerHeaderItem = mDrawer.inflateHeaderView(R.layout.drawer_header);
mDrawerLayout.closeDrawers();
}
开发者ID:gandulf,项目名称:DsaTab,代码行数:20,代码来源:DsaTabActivity.java
示例17: 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
示例18: setupFloatingButton
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
private void setupFloatingButton(@IdRes int id, IconValue value, View.OnClickListener listener) {
FloatingActionButton button = (FloatingActionButton) findViewById(id);
button.setImageDrawable(
MaterialDrawableBuilder.with(this)
.setIcon(value)
.setColorResource(R.color.text_light)
.build()
);
button.setOnClickListener(listener);
}
开发者ID:SeriousBug,项目名称:Kutuk,代码行数:11,代码来源:ObjectDetailActivity.java
示例19: setCurrentPage
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
void setCurrentPage(int i) {
if (i >= mAdapter.getCount()) {
i = mAdapter.getCount() - 1;
}
mNumber.setText(i + 1 + "/" + mAdapter.getCount());
if (mFav == null) {
return;
}
if (mAdapter.getCount() == 0) {
return;
}
if (mFavs.contains((int) mAdapter.getItemId(mPager.getCurrentItem()))) {
mFav.setIcon(MaterialDrawableBuilder.with(getActivity())
.setIcon(MaterialDrawableBuilder.IconValue.STAR)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
} else {
mFav.setIcon(MaterialDrawableBuilder.with(getActivity())
.setIcon(MaterialDrawableBuilder.IconValue.STAR_OUTLINE)
.setColor(Color.WHITE)
.setToActionbarSize()
.build());
}
if ((mRemFav != -1) && mFavs.contains(mRemFav)) {
mFavs.remove(mRemFav);
mAdapter.notifyDataSetChanged();
setCurrentPage(mPager.getCurrentItem());
mRemFav = -1;
}
}
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:37,代码来源:HadithFragment.java
示例20: onOptionsItemSelected
import net.steamcrafted.materialiconlib.MaterialDrawableBuilder; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.delete:
mDeleteMode = !mDeleteMode;
item.setIcon(MaterialDrawableBuilder.with(getActivity())
.setIcon(mDeleteMode ? MaterialDrawableBuilder.IconValue.DELETE_EMPTY : MaterialDrawableBuilder.IconValue.DELETE)
.setColor(Color.WHITE).setToActionbarSize().build());
mAdapter.notifyDataSetChanged();
}
return super.onOptionsItemSelected(item);
}
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:13,代码来源:SortFragment.java
注:本文中的net.steamcrafted.materialiconlib.MaterialDrawableBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论