当前位置: 首页>>代码示例>>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;未经允许,请勿转载。