當前位置: 首頁>>代碼示例>>Java>>正文


Java FloatingActionButton.setColorNormal方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Discounty,項目名稱:Discounty.android,代碼行數:65,代碼來源:DiscountCardDetailFragment.java

示例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));
}
 
開發者ID:gzsll,項目名稱:TLint,代碼行數:7,代碼來源:ResourceUtil.java


注:本文中的com.github.clans.fab.FloatingActionButton.setColorNormal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。