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


Java FloatingActionButton.setImageResource方法代碼示例

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

示例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;
}
 
開發者ID:rahuliyer95,項目名稱:FABMenu,代碼行數:36,代碼來源:FABMenuUtil.java

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

示例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();
    }
 
開發者ID:pierre-binauld,項目名稱:music-tag,代碼行數:31,代碼來源:SuggestionFragment.java

示例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);
    }
}
 
開發者ID:torresj,項目名稱:indi-android-ui,代碼行數:12,代碼來源:DefaultDeviceView.java


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