本文整理汇总了Java中com.github.clans.fab.FloatingActionButton.setColorNormal方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setColorNormal方法的具体用法?Java FloatingActionButton.setColorNormal怎么用?Java FloatingActionButton.setColorNormal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.clans.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setColorNormal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.discountcard_detail, container, false);
txtDescription = (TextView)rootView.findViewById(R.id.discount_card_description);
txtName = (TextView)rootView.findViewById(R.id.discount_card_name);
txtExtraInfo = (TextView)rootView.findViewById(R.id.discount_card_extra_info);
txtDiscountPercentage = (TextView)rootView.findViewById(R.id.discount_card_discount_percentage);
imgBarcode = (ImageView)rootView.findViewById(R.id.barcode_image_view);
toolbar = (Toolbar)getActivity().findViewById(R.id.detail_toolbar);
fabEditMenu = (FloatingActionMenu)getActivity().findViewById(R.id.edit_discount_card_fab_menu);
fabDeleteCard = (FloatingActionButton)fabEditMenu.findViewById(R.id.fab_delete_discount_card);
fabEditCard = (FloatingActionButton)fabEditMenu.findViewById(R.id.fab_edit_discount_card_info);
fabEditBarcode = (FloatingActionButton)fabEditMenu.findViewById(R.id.fab_edit_discount_card_barcode);
if (discountCard != null) {
txtDescription.setText(discountCard.description);
txtName.setText(discountCard.name);
txtExtraInfo.setText(discountCard.barcode.extraInfo);
Double discountPercentage = discountCard.barcode.discountPercentage;
if (discountPercentage != null) {
txtDiscountPercentage.setText(discountCard.barcode.discountPercentage.toString() + "%");
}
}
Log.d("TOOL_BAR_COLOR", " ====> " + toolbarColorHex);
if (toolbarColorHex != null) {
int parsedColor = Color.parseColor(toolbarColorHex);
fabEditMenu.setMenuButtonColorNormal(parsedColor);
fabEditMenu.setMenuButtonColorPressed(parsedColor);
fabDeleteCard.setColorPressed(parsedColor);
fabDeleteCard.setColorNormal(parsedColor);
fabEditCard.setColorPressed(parsedColor);
fabEditCard.setColorNormal(parsedColor);
fabEditBarcode.setColorPressed(parsedColor);
fabEditBarcode.setColorNormal(parsedColor);
try {
toolbar.setBackgroundColor(parsedColor);
toolbar.setBackgroundTintList(ColorStateList.valueOf(parsedColor));
toolbarLayout.setBackgroundColor(parsedColor);
toolbarLayout.setContentScrimColor(parsedColor);
} catch (Exception e) {
e.printStackTrace();
}
Window window = getActivity().getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Colorize.darken(parsedColor, 0.5f));
}
initDiscountCardBarcodeBitmap();
return rootView;
}
示例2: setFabBtnColor
import com.github.clans.fab.FloatingActionButton; //导入方法依赖的package包/类
public static void setFabBtnColor(Activity activity, FloatingActionButton fab) {
// 更新FAB的颜色
fab.setColorNormal(getThemeColor(activity));
fab.setColorPressed(getThemeColor(activity));
fab.setColorRipple(getThemeColor(activity));
}