设为首页 加入收藏

TOP

FloatingActionButton增强版,一个按钮跳出多个按钮--第三方开源--FloatingActionButton(五)
2017-10-11 17:08:39 】 浏览:4325
Tags:FloatingActionButton 增强 一个 按钮 跳出 多个 第三方 开源 --FloatingActionButton
removeAction.setOnClickListener(new OnClickListener() { 50 @Override 51 public void onClick(View v) { 52 ((FloatingActionsMenu) findViewById(R.id.multiple_actions_down)).removeButton(removeAction); 53 } 54 }); 55 56 ShapeDrawable drawable = new ShapeDrawable(new OvalShape()); 57 drawable.getPaint().setColor(getResources().getColor(R.color.white)); 58 ((FloatingActionButton) findViewById(R.id.setter_drawable)).setIconDrawable(drawable); 59 60 final FloatingActionButton actionA = (FloatingActionButton) findViewById(R.id.action_a); 61 actionA.setOnClickListener(new OnClickListener() { 62 @Override 63 public void onClick(View view) { 64 actionA.setTitle("Action A clicked"); 65 } 66 }); 67 68 // Test that FAMs containing FABs with visibility GONE do not cause crashes 69 findViewById(R.id.button_gone).setVisibility(View.GONE); 70 71 final FloatingActionButton actionEnable = (FloatingActionButton) findViewById(R.id.action_enable); 72 actionEnable.setOnClickListener(new OnClickListener() { 73 @Override 74 public void onClick(View view) { 75 menuMultipleActions.setEnabled(!menuMultipleActions.isEnabled()); 76 } 77 }); 78 79 FloatingActionsMenu rightLabels = (FloatingActionsMenu) findViewById(R.id.right_labels); 80 FloatingActionButton addedOnce = new FloatingActionButton(this); 81 addedOnce.setTitle("Added once"); 82 rightLabels.addButton(addedOnce); 83 84 FloatingActionButton addedTwice = new FloatingActionButton(this); 85 addedTwice.setTitle("Added twice"); 86 rightLabels.addButton(addedTwice); 87 rightLabels.removeButton(addedTwice); 88 rightLabels.addButton(addedTwice); 89 } 90 }
复制代码

 

colors:

复制代码
 1 <?xml version="1.0" encoding="utf-8"?>  2 <resources>  3 <color name="black_semi_transparent">#B2000000</color>  4 <color name="background">#e5e5e5</color>  5 <color name="half_black">#808080</color>  6 <color name="white">#fafafa</color>  7 <color name="white_pressed">#f1f1f1</color>  8 <color name="pink">#e91e63</color>  9 <color name="pink_pressed">#ec407a</color> 10 <color name="blue_semi_transparent">#805677fc</color> 11 <color name="blue_semi_transparent_pressed">#80738ffe</color> 12 </resources>
复制代码
首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇单击事件的处理方式及注册窗体的.. 下一篇Android-隐式Intent

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目