本文整理汇总了Java中com.melnykov.fab.FloatingActionButton.setImageResource方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setImageResource方法的具体用法?Java FloatingActionButton.setImageResource怎么用?Java FloatingActionButton.setImageResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.melnykov.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setImageResource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.default_device_view, container, false);
list=(ExpandableListView)view.findViewById(R.id.list);
list.setAdapter(adapter);
list.setOnChildClickListener(this);
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
fab.attachToListView(list);
fab.setOnClickListener(this);
if(conn.isShowAll()){
fab.setImageResource(R.drawable.ic_visibility_black_24dp);
}else{
fab.setImageResource(R.drawable.ic_visibility_off_black_24dp);
}
return view;
}
示例2: setupMenuItem
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
private static FloatingActionButton setupMenuItem(FloatingActionButton menuBase, int id,
int drawable,
int style,
View.OnClickListener menuItemClickListener) {
int[] styleValues = new int[]{com.melnykov.fab.R.attr.fab_colorNormal,
com.melnykov.fab.R.attr.fab_colorPressed,
com.melnykov.fab.R.attr.fab_colorRipple,
com.melnykov.fab.R.attr.fab_shadow};
Context context = menuBase.getContext();
TypedArray array = context.obtainStyledAttributes(style, styleValues);
int color;
FloatingActionButton button = new FloatingActionButton(menuBase.getContext(), null, style);
button.setId(id);
button.setType(menuBase.getType());
if ((color = array.getColor(0, -1)) != -1)
button.setColorNormal(color);
if ((color = array.getColor(1, -1)) != -1)
button.setColorPressed(color);
if ((color = array.getColor(2, -1)) != -1)
button.setColorRipple(color);
if (array.getBoolean(3, false))
button.setShadow(true);
else
button.setShadow(false);
array.recycle();
button.setImageResource(drawable);
button.setLayoutParams(menuBase.getLayoutParams());
button.setVisibility(View.GONE);
button.setOnClickListener(menuItemClickListener);
((ViewGroup) menuBase.getParent()).addView(button);
return button;
}
示例3: setButtonSelectedStatus
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
private void setButtonSelectedStatus(FloatingActionButton fab, boolean selected) {
if (selected) {
fab.setImageResource(R.drawable.ic_beenhere_white_18dp);
} else {
fab.setImageResource(android.R.color.transparent);
}
}
示例4: onActivityCreated
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Init resources
// Resources res = getResources();
// // Init title
// setTitle(res.getString(R.string.title_activity_tag_suggestion));
// this.id3Tag = ((Id3TagParcelable) getArguments().getParcelable(TAG_KEY)).getId3Tag();
// localSuggestion = new SuggestionItem(id3Tag, MAX_SCORE_PLUS_ONE);
//
// // Init adapter
// adapter = new SuggestionItemAdapter(localSuggestion, res);
// Init footer
// waitingFooter = inflater.inflate(R.layout.suggestion_list_waiting_footer_view, listView, false);
// reloadFooter = inflater.inflate(R.layout.suggestion_list_retry_footer_view, listView, false);
// Init Floating Action Button
fab = (FloatingActionButton) getView().findViewById(R.id.fab_next);
fab.setOnClickListener(this);
if (isLastFragment) {
fab.setImageResource(R.drawable.ic_action_action_done_32dp);
}
// loadContent();
}
示例5: onClick
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
FloatingActionButton fab=(FloatingActionButton) v;
if(conn.isShowAll()){
conn.showAll(false);
fab.setImageResource(R.drawable.ic_visibility_off_black_24dp);
}else{
conn.showAll(true);
fab.setImageResource(R.drawable.ic_visibility_black_24dp);
}
}