• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FloatingActionButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.rey.material.widget.FloatingActionButton的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton类的具体用法?Java FloatingActionButton怎么用?Java FloatingActionButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FloatingActionButton类属于com.rey.material.widget包,在下文中一共展示了FloatingActionButton类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateView

import com.rey.material.widget.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View root = inflater.inflate(R.layout.fragment_feed, container, false);

	mToolbar = getActivity().findViewById(R.id.toolbar);
	mAdapter = new FeedPagerAdapter(getChildFragmentManager());
	ViewPager pager = (ViewPager) root.findViewById(R.id.feed_pager);
	pager.setAdapter(mAdapter);
	pager.addOnPageChangeListener(this);
	pager.setOffscreenPageLimit(3);

	mTabStrip = (TabPageIndicator) root.findViewById(R.id.feed_tabs);
	mTabStrip.setOnPageChangeListener(this);
	mTabStrip.setViewPager(pager);

	mFab = (FloatingActionButton) root.findViewById(R.id.fab);
	mFab.setOnClickListener(this);

	return root;
}
 
开发者ID:tidbit-team,项目名称:tidbit-android,代码行数:21,代码来源:FeedFragment.java


示例2: onCreateView

import com.rey.material.widget.FloatingActionButton; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View root = inflater.inflate(R.layout.fragment_create_event, container, false);

	mFromDateButton = (Button) root.findViewById(R.id.from_date_button);
	mToDateButton = (Button) root.findViewById(R.id.to_date_button);
	mFromTimeButton = (Button) root.findViewById(R.id.from_time_button);
	mToTimeButton = (Button) root.findViewById(R.id.to_time_button);
	mFABUpload = (FloatingActionButton) root.findViewById(R.id.fab_upload);
	mCoverImage = (ImageView) root.findViewById(R.id.create_event_cover);

	mFABUpload.setOnClickListener(this);
	mCoverImage.setOnClickListener(this);

	setupButtonListener(mFromDateButton, true);
	setupButtonListener(mToDateButton, true);
	setupButtonListener(mFromTimeButton, false);
	setupButtonListener(mToTimeButton, false);

	return root;
}
 
开发者ID:tidbit-team,项目名称:tidbit-android,代码行数:22,代码来源:NewEventFragment.java


示例3: setIconColorOnClickListeners

import com.rey.material.widget.FloatingActionButton; //导入依赖的package包/类
private void setIconColorOnClickListeners(final MaterialDialog md) {
    String colors[] = getResources().getStringArray(R.array.icon_colors_array_pro);

    for (int i = 0; i < colors.length; i++) {
        int id = getResources().getIdentifier("icon_button_bt_float" + Integer.toString(i), "id", getPackageName());
        final FloatingActionButton fab = (FloatingActionButton) md.findViewById(id);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iconColor = v.getTag().toString();
                setImageButtonsBasedOffIconSelection();
                md.dismiss();
            }
        });
    }
}
 
开发者ID:jt19056,项目名称:Notey,代码行数:17,代码来源:MainActivity.java


示例4: onCreate

import com.rey.material.widget.FloatingActionButton; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_menu_edit);

    _menuDto = (MenuDto) getIntent().getSerializableExtra(MenuService.MenuIntent);

    _receiverController = new ReceiverController(this);

    final TextView dateTextView = findViewById(R.id.menuDateTextView);
    final AutoCompleteTextView menuTitleTypeTextView = findViewById(R.id.menu_edit_title_textview);
    final AutoCompleteTextView menuDescriptionTypeTextView = findViewById(R.id.menu_edit_description_textview);

    _saveButton = findViewById(R.id.save_menu_edit_button);

    menuTitleTypeTextView.setAdapter(new ArrayAdapter<>(MenuEditActivity.this, android.R.layout.simple_dropdown_item_1line, MenuService.getInstance().GetMenuTitleList()));
    menuTitleTypeTextView.addTextChangedListener(_textWatcher);

    menuDescriptionTypeTextView.setAdapter(new ArrayAdapter<>(MenuEditActivity.this, android.R.layout.simple_dropdown_item_1line, MenuService.getInstance().GetMenuDescriptionList()));
    menuDescriptionTypeTextView.addTextChangedListener(_textWatcher);

    if (_menuDto != null) {
        dateTextView.setText(_menuDto.GetDateString());
        menuTitleTypeTextView.setText(_menuDto.GetTitle());
        menuDescriptionTypeTextView.setText(_menuDto.GetDescription());
    } else {
        displayErrorSnackBar("Cannot work with data! Is corrupt! Please try again!");
    }

    FloatingActionButton randomMenuButton = findViewById(R.id.menuRandomEntry_Button);
    randomMenuButton.setOnClickListener(view -> {
        SerializableList<ListedMenu> listedMenuList = ListedMenuService.getInstance().GetDataList();

        Random randomMenuId = new Random();
        int menuId = randomMenuId.nextInt(listedMenuList.getSize());

        ListedMenu menu = listedMenuList.getValue(menuId);
        menuTitleTypeTextView.setText(menu.GetTitle());
        menuDescriptionTypeTextView.setText(menu.GetDescription());
    });

    _saveButton.setEnabled(false);
    _saveButton.setOnClickListener(view -> {
        menuTitleTypeTextView.setError(null);
        menuDescriptionTypeTextView.setError(null);
        boolean cancel = false;
        View focusView = null;

        if (!_propertyChanged) {
            menuTitleTypeTextView.setError(createErrorText(getString(R.string.error_nothing_changed)));
            focusView = menuTitleTypeTextView;
            cancel = true;
        }

        String title = menuTitleTypeTextView.getText().toString();

        if (TextUtils.isEmpty(title)) {
            menuTitleTypeTextView.setError(createErrorText(getString(R.string.error_field_required)));
            focusView = menuTitleTypeTextView;
            cancel = true;
        }

        String description = menuDescriptionTypeTextView.getText().toString();

        if (TextUtils.isEmpty(description)) {
            menuDescriptionTypeTextView.setError(createErrorText(getString(R.string.error_field_required)));
            focusView = menuDescriptionTypeTextView;
            cancel = true;
        }

        if (cancel) {
            focusView.requestFocus();
        } else {
            MenuService.getInstance().UpdateMenu(new LucaMenu(_menuDto.GetId(), title, description, _menuDto.GetWeekday(), _menuDto.GetDate(), false, ILucaClass.LucaServerDbAction.Update));
            _saveButton.setEnabled(false);
        }
    });
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-AndroidApplication,代码行数:79,代码来源:MenuEditActivity.java


示例5: onCreate

import com.rey.material.widget.FloatingActionButton; //导入依赖的package包/类
@Override
public void onCreate() {
    FloatingActionButton floatingActionButtonMenu = ((Activity) _context).findViewById(R.id.floating_action_button_menu);
    FloatingActionButton floatingActionButtonShopping = ((Activity) _context).findViewById(R.id.floating_action_button_shopping);
    FloatingActionButton floatingActionButtonWirelessSocket = ((Activity) _context).findViewById(R.id.floating_action_button_socket);
    FloatingActionButton floatingActionButtonWirelessSwitch = ((Activity) _context).findViewById(R.id.floating_action_button_switch);
    FloatingActionButton floatingActionButtonReload = ((Activity) _context).findViewById(R.id.floating_action_button_reload);

    floatingActionButtonMenu.setOnClickListener(view -> {
        if (_menu != null) {
            ArrayList<String> menuTitleList = new ArrayList<>();
            for (int index = 0; index < _menu.getSize(); index++) {
                menuTitleList.add(_menu.getValue(index).GetSingleLineString());
            }

            _dialogController.DisplayListViewDialog("Menu", menuTitleList);
        } else {
            Logger.getInstance().Error(TAG, "_menu is null!");
            Toasty.warning(_context, "Menu is null!!", Toast.LENGTH_LONG).show();
        }
    });

    floatingActionButtonShopping.setOnClickListener(view -> {
        if (_shoppingList != null) {
            ArrayList<String> shoppingListTitleList = new ArrayList<>();
            for (int index = 0; index < _shoppingList.getSize(); index++) {
                shoppingListTitleList.add(String.format(Locale.getDefault(), "%dx %s", _shoppingList.getValue(index).GetQuantity(), _shoppingList.getValue(index).GetName()));
            }

            _dialogController.DisplayListViewDialog("Shopping List", shoppingListTitleList);
        } else {
            Logger.getInstance().Error(TAG, "_shoppingList is null!");
            Toasty.warning(_context, "ShoppingList is null!!", Toast.LENGTH_LONG).show();
        }
    });

    floatingActionButtonWirelessSocket.setOnClickListener(view -> {
        if (_wirelessSocketList != null) {
            _dialogController.DisplaySocketListViewDialog(_wirelessSocketList);
        } else {
            Logger.getInstance().Error(TAG, "_wirelessSocketList is null!");
            Toasty.warning(_context, "WirelessSocketList is null!!", Toast.LENGTH_LONG).show();
        }
    });

    floatingActionButtonWirelessSwitch.setOnClickListener(view -> {
        if (_wirelessSocketList != null) {
            _dialogController.DisplaySwitchListViewDialog(_wirelessSwitchList);
        } else {
            Logger.getInstance().Error(TAG, "_wirelessSwitchList is null!");
            Toasty.warning(_context, "WirelessSwitchList is null!!", Toast.LENGTH_LONG).show();
        }
    });

    floatingActionButtonReload.setOnClickListener(view -> _broadcastController.SendSimpleBroadcast(Broadcasts.RELOAD_ALL));
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-AndroidApplication,代码行数:57,代码来源:BottomButtonViewController.java



注:本文中的com.rey.material.widget.FloatingActionButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JournalResponseProto类代码示例发布时间:2022-05-22
下一篇:
Java StreamHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap